pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Backup schema without data
4+ messages / 4 participants
[nested] [flat]

* Backup schema without data
@ 2023-04-07 00:40  Atul Kumar <akumar14871@gmail.com>
  0 siblings, 3 replies; 4+ messages in thread

From: Atul Kumar @ 2023-04-07 00:40 UTC (permalink / raw)
  To: pgsql-general <pgsql-general@lists.postgresql.org>

Hi,

Please help me in telling that how I can take the backup of one single
schema without its data using pg_dump utility ?


So far, I could not find anything suitable for doing so.

Regards,
Atul

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

* Re: Backup schema without data
@ 2023-04-07 00:53  Michael Loftis <mloftis@wgops.com>
  parent: Atul Kumar <akumar14871@gmail.com>
  2 siblings, 0 replies; 4+ messages in thread

From: Michael Loftis @ 2023-04-07 00:53 UTC (permalink / raw)
  To: Atul Kumar <akumar14871@gmail.com>; +Cc: pgsql-general <pgsql-general@lists.postgresql.org>



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

* Re: Backup schema without data
@ 2023-04-07 00:54  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Atul Kumar <akumar14871@gmail.com>
  2 siblings, 0 replies; 4+ messages in thread

From: Tom Lane @ 2023-04-07 00:54 UTC (permalink / raw)
  To: Atul Kumar <akumar14871@gmail.com>; +Cc: pgsql-general <pgsql-general@lists.postgresql.org>

Atul Kumar <akumar14871@gmail.com> writes:
> Please help me in telling that how I can take the backup of one single
> schema without its data using pg_dump utility ?

Doesn't "pg_dump -s -n <schema> ..." do what you want?

			regards, tom lane





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

* Re: Backup schema without data
@ 2023-04-07 00:59  Brent Wood <pcreso@yahoo.com>
  parent: Atul Kumar <akumar14871@gmail.com>
  2 siblings, 0 replies; 4+ messages in thread

From: Brent Wood @ 2023-04-07 00:59 UTC (permalink / raw)
  To: pgsql-general <pgsql-general@lists.postgresql.org>; Atul Kumar <akumar14871@gmail.com>

 Looking at the result of:

pg_dump --help
Usage:
  pg_dump [OPTION]... [DBNAME]
...  -n, --schema=PATTERN         dump the specified schema(s) only...
 -s, --schema-only            dump only the schema, no data...  


So: pg_dump -s -n <schema> <db>

It works for me...

Cheers
Brent Wood


    On Friday, April 7, 2023 at 12:40:58 PM GMT+12, Atul Kumar <akumar14871@gmail.com> wrote:  
 
 Hi,
Please help me in telling that how I can take the backup of one single schema without its data using pg_dump utility ?

So far, I could not find anything suitable for doing so.
Regards,Atul
  

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


end of thread, other threads:[~2023-04-07 00:59 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-04-07 00:40 Backup schema without data Atul Kumar <akumar14871@gmail.com>
2023-04-07 00:53 ` Michael Loftis <mloftis@wgops.com>
2023-04-07 00:54 ` Tom Lane <tgl@sss.pgh.pa.us>
2023-04-07 00:59 ` Brent Wood <pcreso@yahoo.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