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 ^