Re: [HACKERS] INSERT ... VALUES... with ORDER BY / LIMIT

2010-10-03 Thread Robert Haas
On Oct 3, 2010, at 11:10 AM, Tom Lane wrote: > Hitoshi Harada writes: >> DEFAULT is disallowed now in such VALUES list, but we can explain it >> is allowed in a "simple" VALUES of INSERT case. > > I don't think we really need to explain anything. This is per spec; > if you trace the way that a

Re: [HACKERS] INSERT ... VALUES... with ORDER BY / LIMIT

2010-10-03 Thread Hitoshi Harada
2010/10/4 Tom Lane : > Hitoshi Harada writes: >> DEFAULT is disallowed now in such VALUES list, but we can explain it >> is allowed in a "simple" VALUES of INSERT case. > > I don't think we really need to explain anything.  This is per spec; > if you trace the way that a DEFAULT expression can app

Re: [HACKERS] INSERT ... VALUES... with ORDER BY / LIMIT

2010-10-03 Thread Tom Lane
Hitoshi Harada writes: > DEFAULT is disallowed now in such VALUES list, but we can explain it > is allowed in a "simple" VALUES of INSERT case. I don't think we really need to explain anything. This is per spec; if you trace the way that a DEFAULT expression can appear in INSERT, it's treated as

Re: [HACKERS] INSERT ... VALUES... with ORDER BY / LIMIT

2010-10-03 Thread Hitoshi Harada
2010/10/3 Tom Lane : > Hitoshi Harada writes: >> 2010/10/2 Jeff Davis : >>> On Fri, 2010-10-01 at 18:52 +0900, Hitoshi Harada wrote: >> While tackling the top-level CTEs patch, I found that INSERT ... >> VALUES isn't aware of ORDER BY / LIMIT. > >> From my reading the source around transformInsert

Re: [HACKERS] INSERT ... VALUES... with ORDER BY / LIMIT

2010-10-02 Thread Tom Lane
Hitoshi Harada writes: > 2010/10/2 Jeff Davis : >> On Fri, 2010-10-01 at 18:52 +0900, Hitoshi Harada wrote: > While tackling the top-level CTEs patch, I found that INSERT ... > VALUES isn't aware of ORDER BY / LIMIT. > From my reading the source around transformInsertStmt(), VALUES in > INSERT is

Re: [HACKERS] INSERT ... VALUES... with ORDER BY / LIMIT

2010-10-02 Thread Hitoshi Harada
2010/10/2 Jeff Davis : > On Fri, 2010-10-01 at 18:52 +0900, Hitoshi Harada wrote: >> While tackling the top-level CTEs patch, I found that INSERT ... >> VALUES isn't aware of ORDER BY / LIMIT. >> >> regression=# CREATE TABLE t1(x int); >> CREATE TABLE >> regression=# INSERT INTO t1 VALUES (1),(2),(

Re: [HACKERS] INSERT ... VALUES... with ORDER BY / LIMIT

2010-10-01 Thread Jeff Davis
On Fri, 2010-10-01 at 18:52 +0900, Hitoshi Harada wrote: > While tackling the top-level CTEs patch, I found that INSERT ... > VALUES isn't aware of ORDER BY / LIMIT. > > regression=# CREATE TABLE t1(x int); > CREATE TABLE > regression=# INSERT INTO t1 VALUES (1),(2),(3) LIMIT 1; > INSERT 0 3 That

[HACKERS] INSERT ... VALUES... with ORDER BY / LIMIT

2010-10-01 Thread Hitoshi Harada
While tackling the top-level CTEs patch, I found that INSERT ... VALUES isn't aware of ORDER BY / LIMIT. regression=# CREATE TABLE t1(x int); CREATE TABLE regression=# INSERT INTO t1 VALUES (1),(2),(3) LIMIT 1; INSERT 0 3 regression=# TABLE t1; x --- 1 2 3 (3 rows) regression=# TRUNCATE t1; T