Re: [GENERAL] pg_dump vs schemas

2007-07-16 Thread Jeff Davis
On Mon, 2007-07-16 at 14:58 -0400, Francisco Reyes wrote: > One possible way may be: > Dump the source schema. > Remove references to the schema name in the pg_dump file. > Change search_path and restore schema. That's what I currently do. It seems a little flimsy though: there are too many object

Re: [GENERAL] pg_dump vs schemas

2007-07-16 Thread Francisco Reyes
Jeff Davis writes: Let's say I have a development database, and I want to copy the entire schema myapp_dev1 to schema myapp_dev2 on the same database. Currently, it's fairly awkward to do that. One possible way may be: Dump the source schema. Remove references to the schema name in the pg_dump

Re: [GENERAL] pg_dump vs schemas

2007-07-16 Thread Jeff Davis
On Fri, 2007-07-13 at 20:06 -0500, Michael Glaesemann wrote: > On Jul 13, 2007, at 19:10 , Francisco Reyes wrote: > > > Alternatively is there any easy way to take all data in one schema > > and load it into a target DB and a different schema? > > You might try using the -n flag with pg_dump, r

Re: [GENERAL] pg_dump vs schemas

2007-07-16 Thread Francisco Reyes
Tom Lane writes: Shouldn't the "public." be left out? I'm hesitant to remove the schema spec for fear we'd end up with underspecified output in some corner case or other. Totally understand. How about making it an option? Just like the --no-owner option. There are options that one may rar

Re: [GENERAL] pg_dump vs schemas

2007-07-13 Thread Tom Lane
Francisco Reyes <[EMAIL PROTECTED]> writes: > I however noticed that pg_dump also does this: > ALTER TABLE public.mytable OWNER TO pgsql; > Shouldn't the "public." be left out? Probably in an ideal world, but that code is far from ideal --- it's dealing with a bunch of considerations including co

Re: [GENERAL] pg_dump vs schemas

2007-07-13 Thread Michael Glaesemann
On Jul 13, 2007, at 19:10 , Francisco Reyes wrote: Alternatively is there any easy way to take all data in one schema and load it into a target DB and a different schema? You might try using the -n flag with pg_dump, replace schema1 with schema2 in the dump file, and loading the altered du