extra syntax on INSERT

Поиск
Список
Период
Сортировка
От Limin Liu
Тема extra syntax on INSERT
Дата
Msg-id 3B16A86C.EC14A048@pumpkinnet.com
обсуждение исходный текст
Ответы Re: extra syntax on INSERT  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Karel Zak
Дата:
Сообщение: Re: Cache for query plans
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Access statistics