Re: Misleading CREATE TABLE error

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Thom Brown <thom(at)linux(dot)com>
Subject: Re: Misleading CREATE TABLE error
Date: 2012-02-27 00:10:03
Message-ID: CA+TgmoYxdc=LkHCbGgEjmVe6vJra7Qyrgsk_pNRGZ-cS+q+smg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 24, 2012 at 4:03 AM, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> On tis, 2011-11-29 at 06:33 +0200, Peter Eisentraut wrote:
>> > > 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.
>>
> This was the last piece of the puzzle that was missing in this area, for
> which I have now developed a fix.  The problem was that
> parserOpenTable() rejected composite types.  But the only thing that was
> really adding over using relation_open() directly was nicer error
> pointers.  So I removed a few levels of indirection there, and
> integrated the error pointer support directly into
> transformTableLikeClause().  This also has the advantage that the "...
> is not a table, view, or ..." message now has error pointer support.

Looks reasonable. The only thing you didn't copy from
parserOpenTable() is the special error-handling for CTEs, but AFAICS
that's irrelevant here.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-02-27 00:34:39 Re: leakproof
Previous Message A.M. 2012-02-26 23:44:12 Re: leakproof