pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pg_dump - 8.3 - schemas
6+ messages / 2 participants
[nested] [flat]

* pg_dump - 8.3 - schemas
@ 2012-02-16 18:59 Edward W. Rouse <erouse@comsquared.com>
  2012-02-16 19:21 ` Re: pg_dump - 8.3 - schemas Adrian Klaver <adrian.klaver@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Edward W. Rouse @ 2012-02-16 18:59 UTC (permalink / raw)
  To: pgsql-sql

I am working with a database set up by someone else. They set it up so that
most tables are in the public schema, but they also have a reports schema;
database.public.tables and database.reports.tables.

If I do a pg_dump of the database, I only get the public schema. If I do a
dump with --schema=reports, I only get the reports schema. Is there a way to
get all the schemas from a single pg_dump or am I forced to use separate
ones? This is also for future issues where there may be more than 2.

Thanks

Edward W. Rouse




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pg_dump - 8.3 - schemas
  2012-02-16 18:59 pg_dump - 8.3 - schemas Edward W. Rouse <erouse@comsquared.com>
@ 2012-02-16 19:21 ` Adrian Klaver <adrian.klaver@gmail.com>
  2012-02-16 19:31   ` Re: pg_dump - 8.3 - schemas Edward W. Rouse <erouse@comsquared.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Adrian Klaver @ 2012-02-16 19:21 UTC (permalink / raw)
  To: Edward W. Rouse <erouse@comsquared.com>; +Cc: pgsql-sql

On 02/16/2012 10:59 AM, Edward W. Rouse wrote:
> I am working with a database set up by someone else. They set it up so that
> most tables are in the public schema, but they also have a reports schema;
> database.public.tables and database.reports.tables.
>
> If I do a pg_dump of the database, I only get the public schema. If I do a
> dump with --schema=reports, I only get the reports schema. Is there a way to
> get all the schemas from a single pg_dump or am I forced to use separate
> ones? This is also for future issues where there may be more than 2.

The pg_dump should work.
What is the exact command line statement you are using?
Are doing both dumps as the same user?

>
> Thanks
>
> Edward W. Rouse
>
>


-- 
Adrian Klaver
adrian.klaver@gmail.com



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pg_dump - 8.3 - schemas
  2012-02-16 18:59 pg_dump - 8.3 - schemas Edward W. Rouse <erouse@comsquared.com>
  2012-02-16 19:21 ` Re: pg_dump - 8.3 - schemas Adrian Klaver <adrian.klaver@gmail.com>
@ 2012-02-16 19:31   ` Edward W. Rouse <erouse@comsquared.com>
  2012-02-16 19:38     ` Re: pg_dump - 8.3 - schemas Adrian Klaver <adrian.klaver@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Edward W. Rouse @ 2012-02-16 19:31 UTC (permalink / raw)
  To: 'Adrian Klaver' <adrian.klaver@gmail.com>; +Cc: pgsql-sql

To answer the second question first, yes; both as the same user.

pg_dump -v -f $bkfile -F c -U $USER $DATABASE



> -----Original Message-----
> From: Adrian Klaver [mailto:adrian.klaver@gmail.com]
> Sent: Thursday, February 16, 2012 2:22 PM
> To: Edward W. Rouse
> Cc: pgsql-sql@postgresql.org
> Subject: Re: [SQL] pg_dump - 8.3 - schemas
> 
> On 02/16/2012 10:59 AM, Edward W. Rouse wrote:
> > I am working with a database set up by someone else. They set it up
> so that
> > most tables are in the public schema, but they also have a reports
> schema;
> > database.public.tables and database.reports.tables.
> >
> > If I do a pg_dump of the database, I only get the public schema. If I
> do a
> > dump with --schema=reports, I only get the reports schema. Is there a
> way to
> > get all the schemas from a single pg_dump or am I forced to use
> separate
> > ones? This is also for future issues where there may be more than 2.
> 
> The pg_dump should work.
> What is the exact command line statement you are using?
> Are doing both dumps as the same user?
> 
> >
> > Thanks
> >
> > Edward W. Rouse
> >
> >
> 
> 
> --
> Adrian Klaver
> adrian.klaver@gmail.com




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pg_dump - 8.3 - schemas
  2012-02-16 18:59 pg_dump - 8.3 - schemas Edward W. Rouse <erouse@comsquared.com>
  2012-02-16 19:21 ` Re: pg_dump - 8.3 - schemas Adrian Klaver <adrian.klaver@gmail.com>
  2012-02-16 19:31   ` Re: pg_dump - 8.3 - schemas Edward W. Rouse <erouse@comsquared.com>
@ 2012-02-16 19:38     ` Adrian Klaver <adrian.klaver@gmail.com>
  2012-02-16 20:17       ` Re: pg_dump - 8.3 - schemas Edward W. Rouse <erouse@comsquared.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Adrian Klaver @ 2012-02-16 19:38 UTC (permalink / raw)
  To: Edward W. Rouse <erouse@comsquared.com>; +Cc: pgsql-sql

On 02/16/2012 11:31 AM, Edward W. Rouse wrote:
> To answer the second question first, yes; both as the same user.
>
> pg_dump -v -f $bkfile -F c -U $USER $DATABASE


So how are you determining that only the public schema is being dumped?
One thing to check is the search_path setting in postgresql.conf. This 
can create the illusion that only one schema is available in a database. 
One way to check is to use the fully qualified name for a table you know 
to be in the reports schema. Ex:

select * from reports.some_table;

>
>
>
>
-- 
Adrian Klaver
adrian.klaver@gmail.com



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pg_dump - 8.3 - schemas
  2012-02-16 18:59 pg_dump - 8.3 - schemas Edward W. Rouse <erouse@comsquared.com>
  2012-02-16 19:21 ` Re: pg_dump - 8.3 - schemas Adrian Klaver <adrian.klaver@gmail.com>
  2012-02-16 19:31   ` Re: pg_dump - 8.3 - schemas Edward W. Rouse <erouse@comsquared.com>
  2012-02-16 19:38     ` Re: pg_dump - 8.3 - schemas Adrian Klaver <adrian.klaver@gmail.com>
@ 2012-02-16 20:17       ` Edward W. Rouse <erouse@comsquared.com>
  2012-02-16 20:22         ` Re: pg_dump - 8.3 - schemas Adrian Klaver <adrian.klaver@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Edward W. Rouse @ 2012-02-16 20:17 UTC (permalink / raw)
  To: 'Adrian Klaver' <adrian.klaver@gmail.com>; +Cc: pgsql-sql

Well, when I do a restore using the created file, reports isn't there. i.e.
the select from reports.table gives an error and, from psql, \l doesn't list
it and \dn doesn't show it. But that all does work on the original database.

> -----Original Message-----
> From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-
> owner@postgresql.org] On Behalf Of Adrian Klaver
> Sent: Thursday, February 16, 2012 2:39 PM
> To: Edward W. Rouse
> Cc: pgsql-sql@postgresql.org
> Subject: Re: [SQL] pg_dump - 8.3 - schemas
> 
> On 02/16/2012 11:31 AM, Edward W. Rouse wrote:
> > To answer the second question first, yes; both as the same user.
> >
> > pg_dump -v -f $bkfile -F c -U $USER $DATABASE
> 
> 
> So how are you determining that only the public schema is being dumped?
> One thing to check is the search_path setting in postgresql.conf. This
> can create the illusion that only one schema is available in a
> database.
> One way to check is to use the fully qualified name for a table you
> know
> to be in the reports schema. Ex:
> 
> select * from reports.some_table;
> 
> >
> >
> >
> >
> --
> Adrian Klaver
> adrian.klaver@gmail.com
> 
> --
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: pg_dump - 8.3 - schemas
  2012-02-16 18:59 pg_dump - 8.3 - schemas Edward W. Rouse <erouse@comsquared.com>
  2012-02-16 19:21 ` Re: pg_dump - 8.3 - schemas Adrian Klaver <adrian.klaver@gmail.com>
  2012-02-16 19:31   ` Re: pg_dump - 8.3 - schemas Edward W. Rouse <erouse@comsquared.com>
  2012-02-16 19:38     ` Re: pg_dump - 8.3 - schemas Adrian Klaver <adrian.klaver@gmail.com>
  2012-02-16 20:17       ` Re: pg_dump - 8.3 - schemas Edward W. Rouse <erouse@comsquared.com>
@ 2012-02-16 20:22         ` Adrian Klaver <adrian.klaver@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Adrian Klaver @ 2012-02-16 20:22 UTC (permalink / raw)
  To: Edward W. Rouse <erouse@comsquared.com>; +Cc: pgsql-sql

On 02/16/2012 12:17 PM, Edward W. Rouse wrote:
> Well, when I do a restore using the created file, reports isn't there. i.e.
> the select from reports.table gives an error and, from psql, \l doesn't list
> it and \dn doesn't show it. But that all does work on the original database.

What is the error reported?
What do the Postgres logs show when you restore the data?
Do a pg_restore -l against the dump file. This will list the contents of 
the dump. See if the schema and contents are there.


>

>


-- 
Adrian Klaver
adrian.klaver@gmail.com



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2012-02-16 20:22 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-02-16 18:59 pg_dump - 8.3 - schemas Edward W. Rouse <erouse@comsquared.com>
2012-02-16 19:21 ` Adrian Klaver <adrian.klaver@gmail.com>
2012-02-16 19:31   ` Edward W. Rouse <erouse@comsquared.com>
2012-02-16 19:38     ` Adrian Klaver <adrian.klaver@gmail.com>
2012-02-16 20:17       ` Edward W. Rouse <erouse@comsquared.com>
2012-02-16 20:22         ` Adrian Klaver <adrian.klaver@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox