Re: Shouldn't CREATE TABLE LIKE copy the relhasoids property?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Shouldn't CREATE TABLE LIKE copy the relhasoids property?
Date: 2015-01-15 00:49:29
Message-ID: 19025.1421282969@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> On 01/14/2015 07:29 PM, Tom Lane wrote:
>> If you don't find that problematic, how about this case?
>>
>> regression=# create table src2 (f1 int, primary key(oid)) with oids;
>> CREATE TABLE
>> regression=# create table dst2 (like src2 including indexes);
>> ERROR: column "oid" named in key does not exist

> I agree it's odd, and probably wrong, although it's been like that for a
> very long time, hasn't it?

Sure, LIKE has always behaved this way. It still seems wrong though.
As a reference point, creating a table that inherits from src1 or src2
will result in it having oids (even if you say WITHOUT OIDS).

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2015-01-15 00:50:14 Re: hung backends stuck in spinlock heavy endless loop
Previous Message Andrew Dunstan 2015-01-15 00:39:27 Re: Shouldn't CREATE TABLE LIKE copy the relhasoids property?