Re: Arrays versus 'type constant' syntax

Поиск
Список
Период
Сортировка
От Thomas Lockhart
Тема Re: Arrays versus 'type constant' syntax
Дата
Msg-id 378CC647.40B0FBAC@alumni.caltech.edu
обсуждение исходный текст
Ответ на Re: Arrays versus 'type constant' syntax  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [HACKERS] Re: Arrays versus 'type constant' syntax  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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@alumni.caltech.edu
South Pasadena, California


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Interesting behaviour !
Следующее
От: Thomas Lockhart
Дата:
Сообщение: Re: [HACKERS] Interesting behaviour !