Preserving ORDER of TEMP Tables during transaction

Поиск
Список
Период
Сортировка
От Ludo Smissaert
Тема Preserving ORDER of TEMP Tables during transaction
Дата
Msg-id 4EBFECB9.5080108@ludikidee.com
обсуждение исходный текст
Ответы Re: Preserving ORDER of TEMP Tables during transaction  (David Johnston <polobo@yahoo.com>)
Список pgsql-general
Greetings,

Within a PL/PgSQL function I do a

CREATE TEMPORARY TABLE v_temp ON COMMIT DROP
AS
SELECT ctime FROM source ORDER BY ctime
WITH DATA;

Then I use the v_temp in the same transaction block:

FOR v_ctime IN
     SELECT ctime FROM v_temp
LOOP
         ....
END LOOP;

Now I am curious, will the loop return values for ctime in the *same order*
as the query that created the temporary table, or is this undefined?

With other words: can I rely on the ORDER BY of the query that defined
the temporary table? Is there a way to do that?

Regards,
Ludo Smissaert


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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: [SPAM?]: Re: CLONE DATABASE (with copy on write?)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: CLONE DATABASE (with copy on write?)