Skip site navigation (1) Skip section navigation (2)

extra syntax on INSERT

From: Limin Liu <limin(at)pumpkinnet(dot)com>
To: pgsql-hackers(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Cc: limin(at)pumpkinnet(dot)com
Subject: extra syntax on INSERT
Date: 2001-05-31 20:24:12
Message-ID: 3B16A86C.EC14A048@pumpkinnet.com (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
I just realized that INSERT allows us to have more syntax than the
manual said.  I wonder if we want to elimiate it or keep it with more
documentation on the INSERT statment?

Here is the INSERT synopsis we have in 7.2 documentation.
==========
INSERT INTO table [ ( column [, ...] ) ]
    { DEFAULT VALUES | VALUES ( expression [, ...] ) | SELECT query }

Assume we have,
CREATE TABLE t1 (a1 int, a2 int);
CREATE TABLE t2 (a3 int, a4 int);

INSERT INTO t2 VALUES(2, 0);
INSERT INTO t2 VALUES(2,1);

====  postgres allows to have something like ====

INSERT INTO t1 VALUES(1, 0 AS "Oops");
INSRET INTO t1 VALUES(t2.*);

===================

For the first one, I believe that is due to reusing the definition of
target_list/target_el.  I didn't dig in to see how PostgreSQL handle the
second case.  At least the INSRET synopsis does not cover this case.


--
Regards,
LM Liu



Responses

pgsql-hackers by date

Next:From: Peter EisentrautDate: 2001-05-31 21:05:24
Subject: Re: Access statistics
Previous:From: Karel ZakDate: 2001-05-31 20:23:26
Subject: Re: Cache for query plans

pgsql-general by date

Next:From: Lamar OwenDate: 2001-05-31 20:26:36
Subject: Re: Compiling to RPM setup/filesystem layout
Previous:From: Steve WolfeDate: 2001-05-31 20:22:47
Subject: Re: Compiling to RPM setup/filesystem layout

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group