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

2016-08-12 Thread Alexander Farber
Thank you Craig, this has worked in my custom function too: BEGIN PERFORM check_positions(in_uid, in_gid, in_tiles); CREATE TEMP TABLE _words ON COMMIT DROP AS SELECT out_word AS word, max(out_score) AS score FROM

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

2016-08-12 Thread Craig Ringer
On 12 August 2016 at 18:43, Alexander Farber 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

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

2016-08-12 Thread Alexander Farber
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

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

2016-08-12 Thread Guillaume Lelarge
2016-08-12 11:00 GMT+02:00 Alexander Farber : > Francisco, thanks, but - > > On Fri, Aug 12, 2016 at 10:47 AM, Francisco Olarte > wrote: > >> >> https://www.postgresql.org/docs/9.5/static/plpgsql-statement >>

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

2016-08-12 Thread Francisco Olarte
Alexander: On Fri, Aug 12, 2016 at 11:00 AM, Alexander Farber wrote: > but the custom function I am trying to call (from another function) does not > return one row, but several rows, which I'd like to store into a temp table: This I know, I wasn't trying to solve

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

2016-08-12 Thread Alexander Farber
Francisco, thanks, but - On Fri, Aug 12, 2016 at 10:47 AM, Francisco Olarte wrote: > > https://www.postgresql.org/docs/9.5/static/plpgsql- > statements.html#PLPGSQL-STATEMENTS-SQL-ONEROW > > but the custom function I am trying to call (from another function) does not

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

2016-08-12 Thread Francisco Olarte
On Fri, Aug 12, 2016 at 10:41 AM, Alexander Farber wrote: > why does this syntax fail in 9.5.3 please? Maybe because... > $func$ LANGUAGE plpgsql; ... you are writing pspgsql. > The doc https://www.postgresql.org/docs/9.5/static/sql-selectinto.html just

[GENERAL] SELECT col INTO TEMP TABLE tab2 ON COMMIT DROP FROM tab1

2016-08-12 Thread Alexander Farber
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