pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Glyn Astill <glynastill@yahoo.co.uk>
To: Geo P.C. <pcgeopc@gmail.com>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: How to take backup of a table on a different schema in PostgreSQL
Date: Thu, 6 Aug 2015 10:52:59 +0000 (UTC)
Message-ID: <530671698.62863.1438858379459.JavaMail.yahoo@mail.yahoo.com> (raw)
In-Reply-To: <CAKtc8vU+9Aj_EXDRtYeytvEUht9Zk+yPowmcr2=EvVSUBKqjZg@mail.gmail.com>
References: <CAKtc8vU+9Aj_EXDRtYeytvEUht9Zk+yPowmcr2=EvVSUBKqjZg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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



view thread (3+ messages)  latest in thread

Message-ID: <530671698.62863.1438858379459.JavaMail.yahoo@mail.yahoo.com>
Permalink:  ../530671698.62863.1438858379459.JavaMail.yahoo@mail.yahoo.com/
Also on:    postgresql.org/message-id/530671698.62863.1438858379459.JavaMail.yahoo@mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: glynastill@yahoo.co.uk, pcgeopc@gmail.com
  Subject: Re: How to take backup of a table on a different schema in PostgreSQL
  In-Reply-To: <530671698.62863.1438858379459.JavaMail.yahoo@mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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