Re: erroneous restore into pg_catalog schema
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dimitri Fontaine <dimitri@2ndQuadrant.fr>
Cc: Robert Haas <robertmhaas@gmail.com>, Alvaro Herrera <alvherre@2ndquadrant.com>, Erik Rijkers <er@xs4all.nl>, "pgsql-hackers\@postgresql.org" <pgsql-hackers@postgresql.org>, Kohei KaiGai <kaigai@kaigai.gr.jp>
Date: 2013-05-06T14:37:33Z
Lists: pgsql-hackers
Dimitri Fontaine <dimitri@2ndQuadrant.fr> writes:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
>> it seems like the extensions code should test for and reject an attempt
>> to set a relocatable extension's schema to pg_catalog. Otherwise you'd
>> be likely to get not-too-intelligible errors from the extension script.
> Reading the code now, it seems to me that we lack a more general test
> and error situation to match with the comments.
> else if (control->schema != NULL)
> {
> /*
> * The extension is not relocatable and the author gave us a schema
> * for it. We create the schema here if it does not already exist.
> */
> We should probably error out when entering in that block of code if the
> extension is relocatable at all, right? That would fix the pg_catalog
> case as well as the general one.
Huh? According to the comment, at least, we don't get here for a
relocatable extension. I don't see anything wrong with auto-creating
the target schema for a non-relocatable extension.
regards, tom lane
Commits
-
Extend and improve use of EXTRA_REGRESS_OPTS.
- 4ae5ee6c9b4d 9.3.0 cited
-
Remove misplaced sanity check from heap_create().
- a475c6036752 9.3.0 cited
-
Silently ignore any nonexistent schemas that are listed in search_path.
- 880bfc3287dd 9.2.0 cited