Re: Where clause in pg_dump: need help

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Where clause in pg_dump: need help
Дата
Msg-id CAKFQuwZ6uaGFMD7rROihYAzgicdVW452PAO==bsvavwa7d80ow@mail.gmail.com
обсуждение исходный текст
Ответ на Where clause in pg_dump: need help  (Prashanth Adiyodi <Prashantha@celltick.com>)
Список pgsql-bugs
On Thu, Jul 7, 2016 at 10:06 AM, Prashanth Adiyodi <Prashantha@celltick.com=
>
wrote:

> Dear Team,
>
>
>
> I am working on a script where I need to take backup of certain tables (o=
r
> a database) using the =E2=80=9C*date_trunc('day', NOW() - interval '1 mon=
th');*=E2=80=9D
> as a where clause. I have read online that this is achievable with the =
=E2=80=9Ct=E2=80=9D
> option and I have tried the below command
>
>
>
> pg_dump --table=3Dre_userstatus --data-only --column-inserts -t
> "date_trunc('day', NOW() - interval '1 month')" comp_db > data1.sql
>
>
>
> but this does not work, could you please help with the correct syntax or
> redirect me to any documentation which implements this, I am a newbee to
> Postgres SQL and I need this help from you, my pg_dump version is
>
>
>
> *pg_dump (PostgreSQL) 9.3.4*
>
>
>
=E2=80=8BThere is no provision in pg_dump to add custom where clauses in th=
e manner
you describe.  If you need a partial dump of a table you will need to write
a psql script and tell it to do exactly what you want.

=E2=80=8BThe options available to you are documented.

https://www.postgresql.org/docs/9.5/static/app-pgdump.html

You will note that your "--table" and your "-t" are the same...all they do
is select (entire) tables.=E2=80=8B

David J.

В списке pgsql-bugs по дате отправления:

Предыдущее
От: ssatyasrinivas@gmail.com
Дата:
Сообщение: BUG #14233: getting the size if the database failing with permission denied error
Следующее
От: Francisco Olarte
Дата:
Сообщение: Re: Where clause in pg_dump: need help