PostgreSQL order of evaluation

Поиск
Список
Период
Сортировка
От Petter Reinholdtsen
Тема PostgreSQL order of evaluation
Дата
Msg-id 199908192325.BAA06123@minerva.cc.uit.no
обсуждение исходный текст
Ответы Re: [GENERAL] PostgreSQL order of evaluation  (Bruce Momjian <maillist@candle.pha.pa.us>)
Список pgsql-general
I've been trying to find where the order of evaluation for SQL is
defined.  In short, I wounder if the following always gives the same
result:

        CREATE SEQUENCE counter
                start 1 increment 1 cache 1
                        minvalue 1
                        maxvalue 2147483647;
        SELECT NEXTVAL('counter'), NEXTVAL('counter');

        CREATE TABLE counts (
               value1 integer,
               value2 integer
        );
        INSERT INTO counts VALUES (NEXTVAL('counter'), NEXTVAL('counter'));

Will the first always return (1, 2) or are the SQL implementations
free to return (2,1).  Will every SQL implementation insert (3,4) in
the table, or will some insert (4,3).

Will PostgreSQL always be evaluating left-to-right?  Where in the
PostgreSQL manuals are this described?

BTW: I've implemented Oracles 'comment on' as functions.  Where should
  I send these functions and the perl tool to extract the comments?
--
##>  Petter Reinholdtsen  <##  |  pere@td.org.uit.no


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

Предыдущее
От: Petter Reinholdtsen
Дата:
Сообщение: PostgreSQL order of evaluation
Следующее
От: Dirk Lutzebaeck
Дата:
Сообщение: backend crashing with INTERSECT / ORDER BY