Re: SQL WHERE: many sql or large IN()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: SQL WHERE: many sql or large IN()
Дата
Msg-id 16762.1175888028@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: SQL WHERE: many sql or large IN()  (tom <tom@tacocat.net>)
Список pgsql-general
tom <tom@tacocat.net> writes:
> I've never seen this before.
> Is this PG specific or generic SQL that I've never been exposed to?

It's in the SQL standard.  SQL92 saith

         <table value constructor> ::=
              VALUES <table value constructor list>

         <table value constructor list> ::=
              <row value constructor> [ { <comma> <row value constructor> }... ]

and lists this as an alternative to <query specification> (ie, a SELECT)
in the query grammar.  So you can write VALUES anywhere you could write
SELECT.  However, the spec also allows "entry level SQL" implementations
to dumb it down pretty far:

         1) The following restrictions apply for Intermediate SQL:

            a) A <table value constructor> shall contain exactly one <row
              value constructor> that shall be of the form "(<row value
              constructor list>)".

            b) A <table value constructor> shall be the <query expression>
              of an <insert statement>.

         2) The following restrictions apply for Entry SQL in addition to
            any Intermediate SQL restrictions:

              None.

What we had up to 8.2 was the entry-level definition.  I couldn't tell
you which other DBMSes support the full definition...

            regards, tom lane

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

Предыдущее
От: Listmail
Дата:
Сообщение: Re: SQL WHERE: many sql or large IN()
Следующее
От: "Harpreet Dhaliwal"
Дата:
Сообщение: reindexing keys in postgres