Re: Strange problem with create table as select * from table;

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: depesz(at)depesz(dot)com
Cc: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Strange problem with create table as select * from table;
Date: 2011-11-03 22:02:04
Message-ID: 16649.1320357724@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

hubert depesz lubaczewski <depesz(at)depesz(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message hubert depesz lubaczewski 2011-11-03 22:03:45 Re: Strange problem with create table as select * from table;
Previous Message hubert depesz lubaczewski 2011-11-03 21:31:33 Re: Strange problem with create table as select * from table;

Browse pgsql-hackers by date

  From Date Subject
Next Message hubert depesz lubaczewski 2011-11-03 22:03:45 Re: Strange problem with create table as select * from table;
Previous Message hubert depesz lubaczewski 2011-11-03 21:31:33 Re: Strange problem with create table as select * from table;