pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: jindrich@vavruska.cz
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: Section 4.1.2.7 contains false information
Date: Tue, 09 Apr 2019 11:57:10 -0400
Message-ID: <18318.1554825430@sss.pgh.pa.us> (raw)
In-Reply-To: <155482249597.1372.1459692771442036097@wrigleys.postgresql.org>
References: <155482249597.1372.1459692771442036097@wrigleys.postgresql.org>

PG Doc comments form <noreply@postgresql.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





view thread (4+ messages)  latest in thread

Message-ID: <18318.1554825430@sss.pgh.pa.us>
Permalink:  ../18318.1554825430@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/18318.1554825430@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jindrich@vavruska.cz, pgsql-docs@lists.postgresql.org
  Subject: Re: Section 4.1.2.7 contains false information
  In-Reply-To: <18318.1554825430@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox