pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedHow to take backup of a table on a different schema in PostgreSQL
3+ messages / 2 participants
[nested] [flat]
* How to take backup of a table on a different schema in PostgreSQL
@ 2015-08-06 10:20 Geo P.C. <pcgeopc@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Geo P.C. @ 2015-08-06 10:20 UTC (permalink / raw)
To: pgsql-admin
Please let us know in PostgreSQL how we can take backup of a table on a
different schema. We have db named "geopostgrest" and under Schema named
"1" (Not inside Public Schema) we need to take backup of table "activity"
Please see the following:
postgres=# \c geopostgrest
You are now connected to database "geopostgrest" as user "postgres".
geopostgrest=# \dt
No relations found.
geopostgrest=# \dt 1.
List of relations
Schema | Name | Type | Owner
--------+---------------------------------+-------+----------
1 | activity | table | postgres
We tried the following command but its not working.
pg_dump -U postgres -n1 -d geopostgrest -t activity -f activity_05-08-2015.sql
pg_dump: No matching tables were found
We are using PostgreSQL 9.4.4 and Ubuntu 14.04.2 LTS
Can any one please help us on it
Thanks
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: How to take backup of a table on a different schema in PostgreSQL
@ 2015-08-06 10:52 Glyn Astill <glynastill@yahoo.co.uk>
parent: Geo P.C. <pcgeopc@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Glyn Astill @ 2015-08-06 10:52 UTC (permalink / raw)
To: Geo P.C. <pcgeopc@gmail.com>; pgsql-admin
> From: Geo P.C. <pcgeopc@gmail.com>
>To: pgsql-admin@postgresql.org
>Sent: Thursday, 6 August 2015, 11:20
>Subject: [ADMIN] How to take backup of a table on a different schema in PostgreSQL
>
>
>
>Please let us know in PostgreSQL how we can take backup of a table on a different schema. We have db named "geopostgrest" and under Schema named "1" (Not inside Public Schema) we need to take backup of table "activity"
>Please see the following:
>postgres=# \c geopostgrest
You are now connected to database "geopostgrest" as user "postgres".
geopostgrest=# \dt
No relations found.
geopostgrest=# \dt 1. List of relations Schema | Name | Type | Owner
--------+---------------------------------+-------+---------- 1 | activity | table | postgres
>We tried the following command but its not working.
>pg_dump -U postgres -n1 -d geopostgrest -t activity -f activity_05-08-2015.sql pg_dump: No matching tables were found
>We are using PostgreSQL 9.4.4 and Ubuntu 14.04.2 LTS
>Can any one please help us on it
>Thanks
>
>
If you take a peek at the man pages you'll see some thing like:
"The -n and -N switches have no effect when -t is used, because tables selected by -t will be dumped regardless of those switches, and non-table objects will not be dumped."
Try something like:
pg_dump -U postgres -t 1.activity -d geopostgrest -f activity_05-08-2015.sql
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: How to take backup of a table on a different schema in PostgreSQL
@ 2015-08-06 11:32 Geo P.C. <pcgeopc@gmail.com>
parent: Glyn Astill <glynastill@yahoo.co.uk>
0 siblings, 0 replies; 3+ messages in thread
From: Geo P.C. @ 2015-08-06 11:32 UTC (permalink / raw)
To: Glyn Astill <glynastill@yahoo.co.uk>; +Cc: pgsql-admin
Thanks a lot. This works "pg_dump -U postgres -t 1.activity -d
geopostgrest -f activity_05-08-2015.sql" perfectly fine.
* <http://pcgeo.blogspot.in/>*
On Thu, Aug 6, 2015 at 4:22 PM, Glyn Astill <glynastill@yahoo.co.uk> wrote:
> > From: Geo P.C. <pcgeopc@gmail.com>
> >To: pgsql-admin@postgresql.org
> >Sent: Thursday, 6 August 2015, 11:20
> >Subject: [ADMIN] How to take backup of a table on a different schema in
> PostgreSQL
> >
> >
> >
> >Please let us know in PostgreSQL how we can take backup of a table on a
> different schema. We have db named "geopostgrest" and under Schema named
> "1" (Not inside Public Schema) we need to take backup of table "activity"
> >Please see the following:
> >postgres=# \c geopostgrest
> You are now connected to database "geopostgrest" as user "postgres".
> geopostgrest=# \dt
> No relations found.
> geopostgrest=# \dt 1. List of relations Schema | Name |
> Type | Owner
> --------+---------------------------------+-------+---------- 1 |
> activity | table | postgres
> >We tried the following command but its not working.
> >pg_dump -U postgres -n1 -d geopostgrest -t activity -f
> activity_05-08-2015.sql pg_dump: No matching tables were found
> >We are using PostgreSQL 9.4.4 and Ubuntu 14.04.2 LTS
> >Can any one please help us on it
> >Thanks
> >
>
> >
>
> If you take a peek at the man pages you'll see some thing like:
>
> "The -n and -N switches have no effect when -t is used, because tables
> selected by -t will be dumped regardless of those switches, and non-table
> objects will not be dumped."
>
> Try something like:
>
> pg_dump -U postgres -t 1.activity -d geopostgrest -f
> activity_05-08-2015.sql
>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2015-08-06 11:32 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-08-06 10:20 How to take backup of a table on a different schema in PostgreSQL Geo P.C. <pcgeopc@gmail.com>
2015-08-06 10:52 ` Glyn Astill <glynastill@yahoo.co.uk>
2015-08-06 11:32 ` Geo P.C. <pcgeopc@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