Re: Strange problem with create table as select * from table; - Mailing list pgsql-general

From Tom Lane
Subject Re: Strange problem with create table as select * from table;
Date
Msg-id 16649.1320357724@sss.pgh.pa.us
Whole thread Raw
In response to Re: Strange problem with create table as select * from table;  (hubert depesz lubaczewski <depesz@depesz.com>)
Responses Re: Strange problem with create table as select * from table;  (hubert depesz lubaczewski <depesz@depesz.com>)
List pgsql-general
hubert depesz lubaczewski <depesz@depesz.com> writes:
> i tried:
> create table qqq as select cmax as o_cmax, xmax as o_xmax, cmin as
> o_cmin, xmin as o_xmin, ctid as o_ctid, * from sssssss.xobjects;

> but the resulting table didn't have -1 values:

Oh, that's pretty interesting ... suggests that the targetlist has to be
exactly "select *".  We have some minor optimizations for that case,
though nothing that could result in extra rows AFAICS.

Are there any dropped columns in the original table?  Try

select * from pg_attribute where attrelid = 'sssssss.xobjects'::regclass
and attisdropped;

            regards, tom lane

pgsql-general by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: Strange problem with create table as select * from table;
Next
From: hubert depesz lubaczewski
Date:
Subject: Re: Strange problem with create table as select * from table;