Re: Section 4.1.2.7 contains false information

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jindrich(at)vavruska(dot)cz
Cc: pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Section 4.1.2.7 contains false information
Date: 2019-04-09 15:57:10
Message-ID: 18318.1554825430@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

PG Doc comments form <noreply(at)postgresql(dot)org> writes:
> QUOTE:
> The CAST() syntax conforms to SQL. The type 'string' syntax is a
> generalization of the standard: SQL specifies this syntax only for a few
> data types, but PostgreSQL allows it for all types. The syntax with :: is
> historical PostgreSQL usage, as is the function-call syntax.
> UNQUOTE

> In fact, this is not 100% true. TIMESTAMP 'string' does not work this way.

Looks like it works to me:

regression=# select timestamp '2019-04-09 11:49';
timestamp
---------------------
2019-04-09 11:49:00
(1 row)

If you feel that the documentation is unclear, you need to be clearer
about how it's unclear ;-)

(Reading between the lines of this complaint and your adjacent one,
I kind of suspect that you were trying to use "TIMESTAMP something"
where the something wasn't a literal string constant. But surely
4.1.2.7 makes it plain that the discussed syntax is for constants.
You might need to read 4.2.9 "Type Casts" instead.)

regards, tom lane

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Fujii Masao 2019-04-09 18:54:01 Mark a reloption as indexterm
Previous Message PG Doc comments form 2019-04-09 15:08:15 Section 4.1.2.7 contains false information