Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sdkvZ-000eAu-0n for pgsql-admin@arkaria.postgresql.org; Tue, 13 Aug 2024 06:22:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sdkvX-001vyC-JE for pgsql-admin@arkaria.postgresql.org; Tue, 13 Aug 2024 06:22:39 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sdkvX-001vxA-7K for pgsql-admin@lists.postgresql.org; Tue, 13 Aug 2024 06:22:39 +0000 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sdkvQ-004UjT-L9 for pgsql-admin@lists.postgresql.org; Tue, 13 Aug 2024 06:22:37 +0000 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-52f04b3cb33so10226047e87.0 for ; Mon, 12 Aug 2024 23:22:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723530151; x=1724134951; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=W6woNMu38OSS+5UMPX/zw2YkFqBqYv4p5xttnA67ND8=; b=nP5P2bm9KRrNq/KE4fgkSi3jMBEp+q3ZMlv6qTCA9sA2HdcY/hROBd4KVY+in4mu9J vKjWktoRugcve+KcldVDioDK+6m0KMICefCXp24tPX1vJ3E/T5CGDRIts6OsNmnsWPXW m9XEW1Wxx6l3nLzArCugfaQG6fvgN2Y7zWnmNV2V7Gqv3Y/osQnH1kP1u5xg1jz+EQy8 X6QZUBMTXkLSub9Qrsg7hB1P/lhLgTq0UC25NII8/mpGxOajY4lbjFoXMZng12LMuCxt V9lHcB3EdO/4a29H0INsYCVyh8Xdvk3a27STDrbKcLw+Cq088sKrBeDy1VATKNAumSv8 QOjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723530151; x=1724134951; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=W6woNMu38OSS+5UMPX/zw2YkFqBqYv4p5xttnA67ND8=; b=HYoFwbQYAOQ5UtBiUBpJ/CvUC4MqZTG/gpRpoHQWnqvsFTZTG0ztCaRtj9LbYH+c+V XmH2SBtfyGFzbN033Y8etuhZyUKQUw4NoJBr8X4+4nCVdtREoOR+dj5PiXksLKWMazOb 01orNpzFXNIiqz0j4RBY8eXyADRvaUDhFLYI8dR1h41pwlDxI9VrFJ1r/7LnoUs+QqAg ZgvZeOg3seifYL7aQSVoC1Oe49TNDRmg7F08plQ37nHywHASoo9d76kQmk8/PBi8DEkQ mrzz2FheqQtPcWGHB6h6uZ3G0C0xnWjE7WOfiuqfxN8gyOfIuJcgN6UjJM9aqKZTknFd plAA== X-Gm-Message-State: AOJu0YyhJcdFZJcjqnUr/ycvmkTeHbtrPPCyIT+mp2Xp0TogJoIuM8jB xac+nKov1OVmg+LGSxG/HU8y+0zay/UVMFUPipUhPsbDEf0xWLVH2U8A0mYU563DgCLncX+meYE ACEl6ez2X2hdksS9+/83qV0jiG+rZ1yZP X-Google-Smtp-Source: AGHT+IE7PBtB+b/GUnCZXN9SPcUAGTPiKI/HWV6v8eyvB15tX+vTMb/OOTRpPFgR29czD7zcRr/C28q7UMSiwas8ouU= X-Received: by 2002:a05:6512:158b:b0:52c:cd77:fe03 with SMTP id 2adb3069b0e04-53213653292mr1802172e87.14.1723530150133; Mon, 12 Aug 2024 23:22:30 -0700 (PDT) MIME-Version: 1.0 References: <7b149653-4992-9285-d9af-53929497f4e8@jakobs.com> In-Reply-To: <7b149653-4992-9285-d9af-53929497f4e8@jakobs.com> From: Wasim Devale Date: Tue, 13 Aug 2024 11:52:17 +0530 Message-ID: Subject: Re: pg_dump To: Holger Jakobs Cc: pgsql-admin@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000005bcf37061f8aa20d" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000005bcf37061f8aa20d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I did one thing, we can exclude the toast table in the pg_dump command that has the BLOBS data for a particular table. --exclude-table-data=3Dpg_toast.pg_toast_10176226 Thanks, Wasim On Tue, 13 Aug, 2024, 12:48=E2=80=AFam Holger Jakobs, w= rote: > 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 =3D 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 \cop= y > > 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 > > --0000000000005bcf37061f8aa20d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

I did one thing, we can exclude the toast table in the pg_du= mp command that has the BLOBS data for a particular table.

--exclude-table-data=3Dpg_toast.pg_toast_10176226

Thanks,
Wasim


On Tue= , 13 Aug, 2024, 12:48=E2=80=AFam Holger Jakobs, <holger@jakobs.com> wrote:
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=C2=A0this.
>
> I used this option in pg_dump but that didn't work:
>
> --exclude-table-data =3D 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<= br>
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

--0000000000005bcf37061f8aa20d--