Bug #656: timestamp function generates parsing errors when used as specified in the documentation

Lists: pgsql-bugs
From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #656: timestamp function generates parsing errors when used as specified in the documentation
Date: 2002-05-03 05:24:26
Message-ID: 20020503052426.B1EAD475A72@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Bron Gondwana (brong(at)h-r-s(dot)com) reports a bug with a severity of 1
The lower the number the more severe it is.

Short Description
timestamp function generates parsing errors when used as specified in the documentation

Long Description
See the following session examples using the form given in the documentation. 'select timestamp(now());' fails similarly.

All systems are running Debian GNU/Linux 3.0.

... I have a pile of scripts that use the timestamp function to convert incoming date-times for comparison. This breaking without
the change being documented is causing major headaches here!

I will be reverting to 7.1.3 in the short term.

Sample Code
... Three different machines.
a) luet running 7.1.3 on i386
b) grendel running 7.2.1 on i386
c) golgotha running 7.2.1 on sparc

a)
brong(at)luet~>echo "select timestamp(date '2000-12-25');" | psql template1
timestamp
------------------------
2000-12-25 00:00:00+11
(1 row)

b)
brong(at)grendel~>echo "select timestamp(date '2000-12-25');" | psql template1
ERROR: parser: parse error at or near "date"

c)
brong(at)golgotha~>echo "select timestamp(date '2000-12-25');" | psql template1
ERROR: parser: parse error at or near "date"

No file was uploaded with this report


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: brong(at)h-r-s(dot)com, Thomas Lockhart <lockhart(at)fourpalms(dot)org>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Bug #656: timestamp function generates parsing errors when used as specified in the documentation
Date: 2002-05-03 05:38:52
Message-ID: 4491.1020404332@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

pgsql-bugs(at)postgresql(dot)org writes:
> See the following session examples using the form given in the documentation. 'select timestamp(now());' fails similarly.

I'm afraid you've got bit by our continuing pursuit of SQL standard
compliance. The 7.2 release notes do point out:

Observe the following incompatibilities:
* The timestamp() function is no longer available. Use timestamp 'string' instead, or CAST.

but I notice that the last two examples in Table 4-17 "Date/Time Functions"
didn't get fixed. (AFAICT there are no other places in current
documentation that claim you can do that.)

regards, tom lane


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: brong(at)h-r-s(dot)com, Thomas Lockhart <lockhart(at)fourpalms(dot)org>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Bug #656: timestamp function generates parsing errors when
Date: 2002-06-02 21:55:43
Message-ID: 200206022155.g52LthI09013@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Tom Lane wrote:
> pgsql-bugs(at)postgresql(dot)org writes:
> > See the following session examples using the form given in the documentation. 'select timestamp(now());' fails similarly.
>
> I'm afraid you've got bit by our continuing pursuit of SQL standard
> compliance. The 7.2 release notes do point out:
>
> Observe the following incompatibilities:
> * The timestamp() function is no longer available. Use timestamp 'string' instead, or CAST.
>
> but I notice that the last two examples in Table 4-17 "Date/Time Functions"
> didn't get fixed. (AFAICT there are no other places in current
> documentation that claim you can do that.)

I have removed those two timestamp() entries from the SGML table; patch
attached. I don't see any need to mention casting in that table. In
fact, timestamp() was the only conversion function mentioned in that
table.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

Attachment Content-Type Size
unknown_filename text/plain 1.2 KB