Re: [HACKERS] pg_dump and schema names

2013-08-13 Thread Bruce Momjian
On Fri, Aug 9, 2013 at 02:15:31PM -0400, Bruce Momjian wrote: Well, it's certainly not immediately obvious why we shouldn't merge them. But I would have expected the function's header comment to now explain that the output is intentionally not schema-qualified and assumes that the search

Re: [HACKERS] pg_dump and schema names

2013-08-12 Thread Peter Eisentraut
On 8/9/13 12:04 AM, Bruce Momjian wrote: generates this output: SET search_path = xx, pg_catalog; CREATE TABLE test ( x integer ); If you dump a schema and want to reload it into another schema, you should only need to update that one search_path line. Is

Re: [HACKERS] pg_dump and schema names

2013-08-12 Thread Bruce Momjian
On Mon, Aug 12, 2013 at 12:28:26PM -0400, Peter Eisentraut wrote: On 8/9/13 12:04 AM, Bruce Momjian wrote: generates this output: SET search_path = xx, pg_catalog; CREATE TABLE test ( x integer ); If you dump a schema and want to reload it into another

Re: [HACKERS] pg_dump and schema names

2013-08-09 Thread Bruce Momjian
On Fri, Aug 9, 2013 at 01:48:43AM -0400, Tom Lane wrote: Bruce Momjian br...@momjian.us writes: pg_dump goes to great lengths not to hard-code the schema name into commands like CREATE TABLE, instead setting the search_path before creating the table; these commands: CREATE SCHEMA

Re: [HACKERS] pg_dump and schema names

2013-08-09 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: On Fri, Aug 9, 2013 at 01:48:43AM -0400, Tom Lane wrote: The practical difficulties involved can be seen by reading the comments and code for _getObjectDescription(). Yes, I looked at that.Seems _getObjectDescription() is only called from

Re: [HACKERS] pg_dump and schema names

2013-08-09 Thread Bruce Momjian
On Fri, Aug 9, 2013 at 12:53:20PM -0400, Tom Lane wrote: Bruce Momjian br...@momjian.us writes: On Fri, Aug 9, 2013 at 01:48:43AM -0400, Tom Lane wrote: The practical difficulties involved can be seen by reading the comments and code for _getObjectDescription(). Yes, I looked at that.

Re: [HACKERS] pg_dump and schema names

2013-08-09 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: On Fri, Aug 9, 2013 at 12:53:20PM -0400, Tom Lane wrote: This really requires more than no attention to the comments, especially since you just removed the only apparent reason for _getObjectDescription to make a distinction between objects whose name

Re: [HACKERS] pg_dump and schema names

2013-08-09 Thread Bruce Momjian
On Fri, Aug 9, 2013 at 01:39:35PM -0400, Tom Lane wrote: Bruce Momjian br...@momjian.us writes: On Fri, Aug 9, 2013 at 12:53:20PM -0400, Tom Lane wrote: This really requires more than no attention to the comments, especially since you just removed the only apparent reason for

Re: [HACKERS] pg_dump and schema names

2013-08-09 Thread Bruce Momjian
On Fri, Aug 9, 2013 at 02:15:31PM -0400, Bruce Momjian wrote: On Fri, Aug 9, 2013 at 01:39:35PM -0400, Tom Lane wrote: Bruce Momjian br...@momjian.us writes: On Fri, Aug 9, 2013 at 12:53:20PM -0400, Tom Lane wrote: This really requires more than no attention to the comments, especially

[HACKERS] pg_dump and schema names

2013-08-08 Thread Bruce Momjian
pg_dump goes to great lengths not to hard-code the schema name into commands like CREATE TABLE, instead setting the search_path before creating the table; these commands: CREATE SCHEMA xx; CREATE TABLE xx.test(x int); generates this output: SET search_path = xx,

Re: [HACKERS] pg_dump and schema names

2013-08-08 Thread James Sewell
I was under the impression that every command that references a relation makes use of the search path, regardless of what it is *doing*. Maybe this is different in older versions though? I actually ran into this recently and had to remove all the xx. schema components using vi before I could run

Re: [HACKERS] pg_dump and schema names

2013-08-08 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: pg_dump goes to great lengths not to hard-code the schema name into commands like CREATE TABLE, instead setting the search_path before creating the table; these commands: CREATE SCHEMA xx; CREATE TABLE xx.test(x int); generates this