Re: BUG #6205: ERROR: temporary tables cannot specify a schema name - Mailing list pgsql-bugs

From Robert Haas
Subject Re: BUG #6205: ERROR: temporary tables cannot specify a schema name
Date
Msg-id CA+TgmobM6Ke69nUK9JTWqSUo-GG7BA+z8vcvnOXutpaSNtw2=w@mail.gmail.com
Whole thread Raw
In response to Re: BUG #6205: ERROR: temporary tables cannot specify a schema name  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: BUG #6205: ERROR: temporary tables cannot specify a schema name  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On Sun, Sep 18, 2011 at 5:10 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Thu, Sep 15, 2011 at 12:05 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Alvaro Herrera <alvherre@commandprompt.com> writes:
>>> Excerpts from Abel Abraham Camarillo Ojeda's message of mi=E9 sep 14 18=
:33:33 -0300 2011:
>>>> _n_srv=3D# create table pg_temp.c (x int);
>>>> CREATE TABLE
>>>> _n_srv=3D# drop table pg_temp.c;
>>>> DROP TABLE
>>>> _n_srv=3D# create table pg_temp.c (x int unique);
>>>> ERROR: =A0temporary 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. =A0Will 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.

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

pgsql-bugs by date:

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