[CDBI] Using scalar functions with AbstractSearch

Bill Moseley moseley at hank.org
Thu Feb 2 05:29:00 GMT 2006


On Wed, Feb 01, 2006 at 09:23:14PM -0800, Bill Moseley wrote:
> On Thu, Feb 02, 2006 at 05:54:24AM +0100, Rhesa Rozendaal wrote:
> > I suppose it's my lack of experience with postgresql, but I find it a bit 
> > unsettling that placeholder values would be executed instead of used as 
> > plain strings. I would not have expected
> 
> Does seem odd.
> 
> 
> test=> select * from times where time < now();
>  id | name  |          time          
> ----+-------+------------------------
>   1 | hello | 2006-02-01 20:10:53-08
> (1 row)
> 
> test=> select * from times where time < 'now()';
>  id | name  |          time          
> ----+-------+------------------------
>   1 | hello | 2006-02-01 20:10:53-08
> (1 row)

I left this out:

test=> select now();
              now              
-------------------------------
 2006-02-01 21:26:58.379497-08
(1 row)

test=> select 'now()';
 ?column? 
----------
 now()
(1 row)


test=> select * from times where time < 'now()';
 id | name  |          time          
----+-------+------------------------
  1 | hello | 2006-02-01 20:10:53-08
(1 row)

test=> select * from times where time > 'now()';
 id | name | time 
----+------+------
(0 rows)

Interesting, no?


-- 
Bill Moseley
moseley at hank.org





More information about the ClassDBI mailing list