Search Postgresql Archives

Preserving ORDER of TEMP Tables during transaction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux