Displaying 2 results from an estimated 2 matches for "valid_ending_at".
2005 Mar 03
12
bug in postgresql ''now'' time handling??
line 212 of postgresql_adapter.rb is
return Time.now.to_s if value =~ /^\(''now''::text\)::(date|timestamp)/
i don''t think this will work. in postgresql the field ''now'' is pinned to the
SAME TIME for the duration of a transaction. eg. if you do
begin transaction;
insert into t values(42, ''now'');
# sleep one minute
2005 Mar 04
3
Boolean values
...making rails database agnostic.
>
> and how do you approximate this schema in rails?
>
> [ahoward@localhost ~]$ cat a.sql
> create table prices(
> id int,
> price float,
> valid_starting_at timestamp not null default ''now'',
> valid_ending_at timestamp not null default ''infinity''
> );
> insert into prices values (0, 42.0);
> select * from prices where valid_ending_at >= ''2005-03-03'';
>
> [ahoward@localhost ~]$ psql -f a.sql
> id | price | valid_starting_at | va...