Обсуждение: Bug #603: time() problems with PostgreSQL 7.2

Поиск
Список
Период
Сортировка

Bug #603: time() problems with PostgreSQL 7.2

От
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

Re: Bug #603: time() problems with PostgreSQL 7.2

От
Tom Lane
Дата:
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