Re: pg_dump

From: Holger Jakobs <holger(at)jakobs(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: pg_dump
Date: 2024-08-12 19:18:41
Message-ID: 7b149653-4992-9285-d9af-53929497f4e8@jakobs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Am 12.08.24 um 21:09 schrieb Wasim Devale:
> Hi All
>
> Please let me know if the below option persists while using pg_dump
> command:
>
> -t table_name --exclude-column column_name
>
> I have a table with a column having bytea data type (BLOBS). I just
> want to exclude this in the dump file as it is of 99GB but I want the
> other data in the same table which is of only 22MB.
>
> Please let me know any work around this.
>
> I used this option in pg_dump but that didn't work:
>
> --exclude-table-data = table_name
>
> PG version 12.19
>
> Thanks,
> Wasim
No, pg_dump can only dump complete tables.

An alternative would be exporting the result of a select command via
COPY or \copy to a file, which can easily be read again with COPY or \copy

COPY is an SQL command and has to be used by a superuser because it
writes to (or reads from) a file on the server.
\copy is a psql command and thus can only be executed in psql (not any
other client) and by any user, because it writes to (or reads from) a
file on the client computer.

Kind Regards,

Holger

--

Holger Jakobs, Bergisch Gladbach

In response to

  • pg_dump at 2024-08-12 19:09:50 from Wasim Devale

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Sbob 2024-08-12 22:05:38 pgAdmin question
Previous Message David G. Johnston 2024-08-12 19:16:17 Re: pg_dump