Re: Arrays versus 'type constant' syntax

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Arrays versus 'type constant' syntax
Date: 1999-07-14 17:17:59
Message-ID: 378CC647.40B0FBAC@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> >> 2. Remove "AexprConst ::= Typename Sconst" from the grammar. I do
> >> not believe this rule is in SQL92.
> > Sorry, this *is* SQL92 syntax.
> I've just grepped the SQL92 spec in some detail, and I see noplace
> that allows "typename stringconstant". "::" is indeed not standard,
> but the only type conversion syntax I see in the spec is
> CAST (value AS type)
> If I'm missing something, please cite chapter and verse.

Well, ahem, er...

It isn't an explicit general construct in SQL92, since there are only
a few data types defined in the language, and since type extensibility
is not supported.

However, the language does define syntax for specifying date/time
literals (the only string-like literal which is not a string type) and
that would seem to suggest the general solution.

Allowed in SQL92 (according to my 2 reference books, and I may have
missed more info):

'Bastille Day' -- string literal
DATE '7/14/1999' -- date literal
TIMESTAMP '7/14/1999 09:47' -- date/time literal
TIME '09:47' -- time literal

SQL3 should have more to say on the subject, and does, but I've got
old versions of draft docs and have (so far) only found brief mention
of ADTs etc. Perhaps they intend the CAST construct to cover this, but
istm that it isn't a natural extension of the older forms mentioned
above.

- Thomas

--
Thomas Lockhart lockhart(at)alumni(dot)caltech(dot)edu
South Pasadena, California

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 1999-07-14 17:28:51 Re: [HACKERS] Interesting behaviour !
Previous Message Tom Lane 1999-07-14 16:39:28 Re: [HACKERS] Interesting behaviour !