Re: BUG #6205: ERROR: temporary tables cannot specify a schema name

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Abel Abraham Camarillo Ojeda <acamari(at)verlet(dot)org>, Pg Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #6205: ERROR: temporary tables cannot specify a schema name
Date: 2011-09-21 14:55:19
Message-ID: CA+TgmobM6Ke69nUK9JTWqSUo-GG7BA+z8vcvnOXutpaSNtw2=w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sun, Sep 18, 2011 at 5:10 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Thu, Sep 15, 2011 at 12:05 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
>>> Excerpts from Abel Abraham Camarillo Ojeda's message of mié sep 14 18:33:33 -0300 2011:
>>>> _n_srv=# create table pg_temp.c (x int);
>>>> CREATE TABLE
>>>> _n_srv=# drop table pg_temp.c;
>>>> DROP TABLE
>>>> _n_srv=# create table pg_temp.c (x int unique);
>>>> ERROR:  temporary tables cannot specify a schema name
>>
>>> FWIW this does work in 9.0.
>>
>> In that case I'm betting Robert broke it somewhere in the unlogged-table
>> changes.
>
> Yeah, looks like it.  Will investigate.

I committed a localized fix for this. Basically, it now double-checks
that the schema name isn't the one that would have been forced by the
temp-ness, and doesn't throw an error if they match.

However, I'm wondering if it would be better to instead (a) jigger
things so that RangeVarAdjustRelationPersistence sets the schema name
to NULL if it changes the relpersistence, or (b) just remove the
cross-check in RangeVarGetRelid() altogether (or demote it to an elog
or assert). It's not clear to me under what circumstances this check
can actually be hit any more, and if there are any they probably need
to be fixed further upstream. However, I didn't feel safe doing
either of those things without discussion, especially in a back-branch
the day before we wrap 9.1.1.

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message YAMAMOTO Takashi 2011-09-21 15:22:40 BUG #6218: TRAP: FailedAssertion("!(owner->nsnapshots == 0)", File: "resowner.c", Line: 365)
Previous Message Lionel Elie Mamane 2011-09-21 08:25:17 Re: BUG #6216: Calling PQconnectdbParams from C++ with a char**