Re: plpgsql select into

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Roger Mason <rmason(at)mun(dot)ca>
Cc: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: plpgsql select into
Date: 2021-08-20 16:12:03
Message-ID: CAKFQuwZPhqn1zF-zcOFXBrch2fqqAfFr5LVAhhiSR_xqXyMcCQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Fri, Aug 20, 2021 at 8:51 AM Roger Mason <rmason(at)mun(dot)ca> wrote:

> select into info_table from (select get_info('1043_1')) as info_split;
>

I suggest you should pretend that SQL's "SELECT INTO" doesn't exist. If
you want to create a table from a result write: "CREATE TABLE AS" and then
a normal select query. In particular the entire "action" command is kept
whole instead of needing to put a bunch of column names in between the
"SELECT" and the "INTO" - and you also are less likely to confuse the
plpgsql feature of the same form.

David J.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Roger Mason 2021-08-21 10:52:28 Re: plpgsql select into
Previous Message Tom Lane 2021-08-20 16:07:40 Re: plpgsql select into