SELECT col INTO TEMP TABLE tab2 ON COMMIT DROP FROM tab1 - Mailing list pgsql-general

From Alexander Farber
Subject SELECT col INTO TEMP TABLE tab2 ON COMMIT DROP FROM tab1
Date
Msg-id CAADeyWiFBXbeOEA9HNMCrouqJ6FEw5Aph8=o3HWRYSw41WMqJw@mail.gmail.com
Whole thread Raw
Responses Re: SELECT col INTO TEMP TABLE tab2 ON COMMIT DROP FROM tab1  (Francisco Olarte <folarte@peoplecall.com>)
List pgsql-general
Good morning,

why does this syntax fail in 9.5.3 please?

I am trying to call 2 custom functions from a third one with:

CREATE OR REPLACE FUNCTION play_game(
        IN in_uid integer,
        IN in_gid integer,
        IN in_tiles jsonb,
        OUT out_gid integer)
        RETURNS integer AS
$func$
DECLARE
        ....
BEGIN
        PERFORM check_positions(in_uid, in_gid, in_tiles);

        SELECT
                out_word AS word,
                max(out_score) AS score
        INTO TEMP TABLE _words ON COMMIT DROP
        FROM check_words(in_uid, in_gid, in_tiles)
        GROUP BY word, gid;
...
END
$func$ LANGUAGE plpgsql;

But get the errors (I tried TEMP, TEMPORARY, with and without TABLE):

words=> \i play_game.sql
psql:play_game.sql:166: ERROR:  "temp" is not a known variable
LINE 29:         INTO TEMP TABLE _words ON COMMIT DROP
                      ^

words=> \i play_game.sql
psql:play_game.sql:166: ERROR:  "temporary" is not a known variable
LINE 29:         INTO TEMPORARY TABLE _words ON COMMIT DROP
                      ^


Thank you
Alex

pgsql-general by date:

Previous
From: Chris Travers
Date:
Subject: Re: Postgres Pain Points 2 ruby / node language drivers
Next
From: Francisco Olarte
Date:
Subject: Re: SELECT col INTO TEMP TABLE tab2 ON COMMIT DROP FROM tab1