Re: Misleading CREATE TABLE error

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Thom Brown <thom(at)linux(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Misleading CREATE TABLE error
Date: 2011-11-29 04:33:10
Message-ID: 1322541190.4595.0.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On ons, 2011-11-09 at 12:00 -0500, Robert Haas wrote:
> On Tue, Nov 8, 2011 at 4:49 PM, Thom Brown <thom(at)linux(dot)com> wrote:
> > I found the following error message misleading:
> >
> > test=# create table cows2 (LIKE cows);
> > ERROR: inherited relation "cows" is not a table
> > STATEMENT: create table cows2 (LIKE cows);
> >
> > I'm not trying to inherit a relation, I'm trying to base a table on
> > it. As it happens, "cows" is a foreign table, which *is* a table,
> > just not a regular table. It might be useful to add support to clone
> > foreign tables into regular tables, the use-case being that you may
> > wish to import all the data locally into a table of the same
> > structure. But the gripe here is the suggestion that the relation
> > would have been inherited, which would actually be achieved using
> > INHERITS.
>
> Interesting. I agree that there's no obvious reason why that
> shouldn't be allowed to work. Could be useful with views, too.

I recently came across a situation where LIKE with a composite type
might have been useful.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2011-11-29 04:46:02 psql editor temp file extension
Previous Message Etsuro Fujita 2011-11-29 04:16:01 Re: pgsql_fdw, FDW for PostgreSQL server