Andrew McMillan ([EMAIL PROTECTED]) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
timestamp(timestamp('a timestamp)) no longer works

Long Description
In version 7.2 it seems that I can't reduntantly cast  value to timestamp if it is 
already a timestamp.

I do this reasonably often in my code by way of being paranoid that I might have a 
date, or a time, where I for sure _really_ want it to be a timestamp...

It's cleaning up some bugs in my code, I suppose, but I kind of like making it 
explicit to people who might come along after me :-)


Sample Code
Here's the broken query:

pcnz=# select timestamp('2002-03-01'::timestamp);
ERROR:  parser: parse error at or near "'"
pcnz=# select version();
                           version                           
-------------------------------------------------------------
 PostgreSQL 7.2 on i686-pc-linux-gnu, compiled by GCC 2.95.4
(1 row)

I notice that int4(int4())  still works:

pcnz=# select int4( '777'::int4 );
 int4 
------
  777
(1 row)

A couple of older versions where this worked:

pcnz=# select timestamp('2002-03-01'::timestamp);
       timestamp        
------------------------
 2002-03-01 00:00:00+13
(1 row)

pcnz=# select version();
                            version                            
---------------------------------------------------------------
 PostgreSQL 7.0.3 on i686-pc-linux-gnu, compiled by gcc 2.95.2
(1 row)

stimulus=#  select timestamp('2002-03-01'::timestamp);
       timestamp        
------------------------
 2002-03-01 00:00:00+13
(1 row)

stimulus=# select version();
                            version                            
---------------------------------------------------------------
 PostgreSQL 7.1.3 on i686-pc-linux-gnu, compiled by GCC 2.95.4
(1 row)



No file was uploaded with this report


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

Reply via email to