Search Postgresql Archives

Re: SELECT col INTO TEMP TABLE tab2 ON COMMIT DROP FROM tab1

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

 



On 12 August 2016 at 18:43, Alexander Farber <alexander.farber@xxxxxxxxx> wrote:
Thank you,  I have rewritten it into:

BEGIN
        PERFORM check_positions(in_uid, in_gid, in_tiles);

        CREATE TEMP TABLE _words(word varchar, score integer) ON COMMIT DROP;

        INSERT INTO _words
        SELECT
                out_word AS word,
                max(out_score) AS score
        FROM check_words(in_uid, in_gid, in_tiles)
        GROUP BY word, gid;


Or use CREATE TABLE ... AS SELECT ... 

That's the SQL-standard spelling anyway. 


--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

[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