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

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: SELECT col INTO TEMP TABLE tab2 ON COMMIT DROP FROM tab1
Date: 2016-08-12 11:08:12
Message-ID: CAMsr+YGhwo_RFOZvaMOgPoWc2oF-1qUo-No=jYA7O8n23iLzeg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 12 August 2016 at 18:43, Alexander Farber <alexander(dot)farber(at)gmail(dot)com>
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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Travers 2016-08-12 11:28:45 Re: Postgres Pain Points 2 ruby / node language drivers
Previous Message Alexander Farber 2016-08-12 10:43:59 Re: SELECT col INTO TEMP TABLE tab2 ON COMMIT DROP FROM tab1