Re: [GENERAL] SELECT INTO and ON COMMIT

2015-05-13 Thread Alvaro Herrera
Melvin Davidson wrote: > So perhaps replace the SQL SELECT INTO with SQL ADD INTO ? No, the alternative spelling is CREATE TABLE AS; we already have it. (To simply insert a query result into an existing table, the spelling is INSERT INTO .. SELECT). -- Álvaro Herrerahttp://www.2

Re: [GENERAL] SELECT INTO and ON COMMIT

2015-05-13 Thread Melvin Davidson
So perhaps replace the SQL SELECT INTO with SQL ADD INTO ? On Wed, May 13, 2015 at 8:54 PM, Tom Lane wrote: > Bruce Momjian writes: > > On Wed, May 13, 2015 at 06:05:43PM -0600, Yves Dorfsman wrote: > >> Will `SELECT INTO` be deprecated? It is very convenient when writing > pgplsql > >> functio

Re: [GENERAL] SELECT INTO and ON COMMIT

2015-05-13 Thread Tom Lane
Bruce Momjian writes: > On Wed, May 13, 2015 at 06:05:43PM -0600, Yves Dorfsman wrote: >> Will `SELECT INTO` be deprecated? It is very convenient when writing pgplsql >> functions, to select into a record. > The pl/psql `SELECT INTO` is not related to the SQL SELECT INTO command > --- yeah, confu

Re: [GENERAL] SELECT INTO and ON COMMIT

2015-05-13 Thread Bruce Momjian
On Wed, May 13, 2015 at 06:05:43PM -0600, Yves Dorfsman wrote: > > On Wed, May 13, 2015 at 05:29:36PM -0600, Yves Dorfsman wrote: > > Is there any way to add an ON COMMIT clause to a SELECT INTO TEMP TABLE? > > On 2015-05-13 17:56, David G. Johnston wrote: > > ​From the documentation of SELECT IN

Re: [GENERAL] SELECT INTO and ON COMMIT

2015-05-13 Thread Yves Dorfsman
On Wed, May 13, 2015 at 05:29:36PM -0600, Yves Dorfsman wrote: > Is there any way to add an ON COMMIT clause to a SELECT INTO TEMP TABLE? On 2015-05-13 17:56, David G. Johnston wrote: > ​From the documentation of SELECT INTO > > "​ > The PostgreSQL usage of SELECT INTO to represent table creatio

Re: [GENERAL] SELECT INTO and ON COMMIT

2015-05-13 Thread David G. Johnston
On Wed, May 13, 2015 at 4:38 PM, Bruce Momjian wrote: > On Wed, May 13, 2015 at 05:29:36PM -0600, Yves Dorfsman wrote: > > > > Is there any way to add an ON COMMIT clause to a SELECT INTO TEMP TABLE? > > Well CREATE TABLE has a ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } > clause, but I don'

Re: [GENERAL] SELECT INTO and ON COMMIT

2015-05-13 Thread Bruce Momjian
On Wed, May 13, 2015 at 05:29:36PM -0600, Yves Dorfsman wrote: > > Is there any way to add an ON COMMIT clause to a SELECT INTO TEMP TABLE? Well CREATE TABLE has a ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } clause, but I don't see it in SELECT INTO, so it seems you have to create the temp t