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

2010-10-03 Thread Hitoshi Harada
2010/10/3 Tom Lane t...@sss.pgh.pa.us: Hitoshi Harada umi.tan...@gmail.com writes: 2010/10/2 Jeff Davis pg...@j-davis.com: 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

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

2010-10-03 Thread Tom Lane
Hitoshi Harada umi.tan...@gmail.com 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

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

2010-10-03 Thread Hitoshi Harada
2010/10/4 Tom Lane t...@sss.pgh.pa.us: Hitoshi Harada umi.tan...@gmail.com 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

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

2010-10-03 Thread Robert Haas
On Oct 3, 2010, at 11:10 AM, Tom Lane t...@sss.pgh.pa.us wrote: Hitoshi Harada umi.tan...@gmail.com 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;

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

2010-10-02 Thread Hitoshi Harada
2010/10/2 Jeff Davis pg...@j-davis.com: 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

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

2010-10-02 Thread Tom Lane
Hitoshi Harada umi.tan...@gmail.com writes: 2010/10/2 Jeff Davis pg...@j-davis.com: 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

[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;

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 looks