Re: SELECT INTO without columns or star

2023-03-31 Thread Kirk Wolak
On Fri, Mar 31, 2023 at 11:26 AM Tom Lane wrote: > "David G. Johnston" writes: > > On Fri, Mar 31, 2023 at 8:10 AM Zhang Mingli > wrote: > >> When I exec a sql SELECT INTO without columns or * by mistake, it > succeeds: > > > Yes, a table may have zero columns by design. > > Yup, we've allowed

Re: SELECT INTO without columns or star

2023-03-31 Thread Tom Lane
"David G. Johnston" writes: > On Fri, Mar 31, 2023 at 8:10 AM Zhang Mingli wrote: >> When I exec a sql SELECT INTO without columns or * by mistake, it succeeds: > Yes, a table may have zero columns by design. Yup, we've allowed that for some time now; see the compatibility comments at the botto

Re: SELECT INTO without columns or star

2023-03-31 Thread David G. Johnston
On Fri, Mar 31, 2023 at 8:10 AM Zhang Mingli wrote: > When I exec a sql SELECT INTO without columns or * by mistake, it succeeds: > > Yes, a table may have zero columns by design. David J.

SELECT INTO without columns or star

2023-03-31 Thread Zhang Mingli
Hi, hackers When I exec a sql SELECT INTO without columns or * by mistake, it succeeds: select * from t1;  a | b ---+---  1 | 2  2 | 3  3 | 4 (3 rows) select into t2 from t1; SELECT 3  \pset null '(null)' Null display is "(null)". select * from t2; -- (3 rows) It seems that t2 has empty rows