Bug #603: time() problems with PostgreSQL 7.2

Started by PostgreSQL Bugs Listabout 24 years ago2 messagesbugs
Jump to latest
#1PostgreSQL Bugs List
pgsql-bugs@postgresql.org

Ricardo Ryoiti Sugawara Junior (suga@netbsd.com.br) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
time() problems with PostgreSQL 7.2

Long Description
time('now') used to work but it doesn't work anymore in PostgreSQL 7.2.

Sample Code
carteirinhas=# \d registros
Table "registros"
Column | Type | Modifiers
-----------+------------------------+-----------
matricula | integer |
resp | character varying(50) |
tipo | character(1) |
nome | character varying(50) |
data | date |
hora | time without time zone |
baixa | boolean |

carteirinhas=# select time('now');
ERROR: parser: parse error at or near "'";

No file was uploaded with this report

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: PostgreSQL Bugs List (#1)
Re: Bug #603: time() problems with PostgreSQL 7.2

pgsql-bugs@postgresql.org writes:

time('now') used to work but it doesn't work anymore in PostgreSQL 7.2.

TIME is a reserved word now, or at least more reserved than it used to
be, because we've added some SQL92 syntax that wasn't supported before.

Try
"time"('now')
or
'now'::time
or
CAST('now' AS time)

In the INSERT command you showed originally, I don't actually believe
that you need any cast at all.

regards, tom lane