public inbox for [email protected]  
help / color / mirror / Atom feed
Re: To take backup of Postgresql Database without large objects
6+ messages / 3 participants
[nested] [flat]

* Re: To take backup of Postgresql Database without large objects
@ 2025-04-11 15:01 Adrian Klaver <[email protected]>
  2025-04-12 05:06 ` Re: To take backup of Postgresql Database without large objects [email protected] <[email protected]>
  0 siblings, 1 reply; 6+ messages in thread

From: Adrian Klaver @ 2025-04-11 15:01 UTC (permalink / raw)
  To: [email protected] <[email protected]>; pgsql-general

On 4/11/25 05:55, [email protected] wrote:
> Hello,
> 
> Using PostgreSQL 15.1, compiled by Visual C++ build 1914, 64-bit in 
> Windows 10.
> 
> Trying to take backup of a database, using pg_dump, where one table 
> contains bytea datatype, which I don't want to include in the backup.
> 
> My command was:
> "E:\DBBackup\bin\pg_dump.exe"  -h 192.168.1.1 -p 5432 -U <username> 
> --no-blobs -F c -v -f "E:\DBBackup\demo6_110420251637.bak" demo6
> 
> the backup includes the bytea field also.
> 
> I tried with
> "E:\DBBackup\bin\pg_dump.exe"  -h 192.168.1.1 -p 5432 -U <username> -B 
> -F c -v -f "E:\DBBackup\demo6_110420251637.bak" demo6
> 
> also, which also included the bytea field.

1) Short version

Short version bytea fields != large objects.

2) Long version

 From here:

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

-B
--no-large-objects
--no-blobs (deprecated)

     Exclude large objects in the dump.

     When both -b and -B are given, the behavior is to output large 
objects, when data is being dumped, see the -b documentation.

Where large objects are defined here:

https://www.postgresql.org/docs/current/largeobjects.html




> 
> What wrong I'm doing?  Couldn't figure it out.   Any help is appreciated.
> 
> Happiness Always
> BKR Sivaprakash
> 

-- 
Adrian Klaver
[email protected]







^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: To take backup of Postgresql Database without large objects
  2025-04-11 15:01 Re: To take backup of Postgresql Database without large objects Adrian Klaver <[email protected]>
@ 2025-04-12 05:06 ` [email protected] <[email protected]>
  2025-04-12 06:00   ` Re: To take backup of Postgresql Database without large objects Adrian Klaver <[email protected]>
  0 siblings, 1 reply; 6+ messages in thread

From: [email protected] @ 2025-04-12 05:06 UTC (permalink / raw)
  To: pgsql-general; Adrian Klaver <[email protected]>

 I tried all the combinations, as mentioned in the documenthttps://www.postgresql.org/docs/current/app-pgdump.html

"E:\DBBackup\bin\pg_dump.exe" -h 192.168.1.1 -p 5432 -U <username> --no-blobs -F c -v -f "E:\DBBackup\demo6_110420251637.bak" demo6 

"E:\DBBackup\bin\pg_dump.exe" -h 192.168.1.1 -p 5432 -U <username> -B -F c -v -f "E:\DBBackup\demo6_110420251637.bak" demo6 

"E:\DBBackup\bin\pg_dump.exe" -h 192.168.1.1 -p 5432 -U <username> -B --no-blobs -F c -v -f "E:\DBBackup\demo6_110420251637.bak" demo6 

With version 15--no-large-objects  is not working.I tried with all the other combinations.  NO LUCK.
bytea field also included in the backup.   
I tried taking backup using pg_dump of version 17 also, with no luck.   [ Database version is 15 and the pg_dump version is 17 ]. 
Confirming this after restoring the backup file in a new database.   The new database contains contents from bytea field also.  
Either my command should be wrong or I'm missing something.  
Happiness Always
BKR Sivaprakash
    On Friday 11 April, 2025 at 08:31:31 pm IST, Adrian Klaver <[email protected]> wrote:  
 
 On 4/11/25 05:55, [email protected] wrote:
> Hello,
> 
> Using PostgreSQL 15.1, compiled by Visual C++ build 1914, 64-bit in 
> Windows 10.
> 
> Trying to take backup of a database, using pg_dump, where one table 
> contains bytea datatype, which I don't want to include in the backup.
> 
> My command was:
> "E:\DBBackup\bin\pg_dump.exe"  -h 192.168.1.1 -p 5432 -U <username> 
> --no-blobs -F c -v -f "E:\DBBackup\demo6_110420251637.bak" demo6
> 
> the backup includes the bytea field also.
> 
> I tried with
> "E:\DBBackup\bin\pg_dump.exe"  -h 192.168.1.1 -p 5432 -U <username> -B 
> -F c -v -f "E:\DBBackup\demo6_110420251637.bak" demo6
> 
> also, which also included the bytea field.

1) Short version

Short version bytea fields != large objects.

2) Long version

 From here:

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

-B
--no-large-objects
--no-blobs (deprecated)

    Exclude large objects in the dump.

    When both -b and -B are given, the behavior is to output large 
objects, when data is being dumped, see the -b documentation.

Where large objects are defined here:

https://www.postgresql.org/docs/current/largeobjects.html




> 
> What wrong I'm doing?  Couldn't figure it out.   Any help is appreciated.
> 
> Happiness Always
> BKR Sivaprakash
> 

-- 
Adrian Klaver
[email protected]



  

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: To take backup of Postgresql Database without large objects
  2025-04-11 15:01 Re: To take backup of Postgresql Database without large objects Adrian Klaver <[email protected]>
  2025-04-12 05:06 ` Re: To take backup of Postgresql Database without large objects [email protected] <[email protected]>
@ 2025-04-12 06:00   ` Adrian Klaver <[email protected]>
  2025-04-12 06:05     ` Re: To take backup of Postgresql Database without large objects David G. Johnston <[email protected]>
  0 siblings, 1 reply; 6+ messages in thread

From: Adrian Klaver @ 2025-04-12 06:00 UTC (permalink / raw)
  To: [email protected] <[email protected]>; pgsql-general

On 4/11/25 22:06, [email protected] wrote:

> Either my command should be wrong or I'm missing something.

This was explained in my post as  quoted below.

> 
> Happiness Always
> BKR Sivaprakash
> 
> On Friday 11 April, 2025 at 08:31:31 pm IST, Adrian Klaver 
> <[email protected]> wrote:
> 
> 
> On 4/11/25 05:55, [email protected] <mailto:[email protected]> 
> wrote:
>  > Hello,
>  >
>  > Using PostgreSQL 15.1, compiled by Visual C++ build 1914, 64-bit in
>  > Windows 10.
>  >
>  > Trying to take backup of a database, using pg_dump, where one table
>  > contains bytea datatype, which I don't want to include in the backup.
>  >
>  > My command was:
>  > "E:\DBBackup\bin\pg_dump.exe"  -h 192.168.1.1 -p 5432 -U <username>
>  > --no-blobs -F c -v -f "E:\DBBackup\demo6_110420251637.bak" demo6
>  >
>  > the backup includes the bytea field also.
>  >
>  > I tried with
>  > "E:\DBBackup\bin\pg_dump.exe"  -h 192.168.1.1 -p 5432 -U <username> -B
>  > -F c -v -f "E:\DBBackup\demo6_110420251637.bak" demo6
>  >
>  > also, which also included the bytea field.
> 
> 1) Short version
> 
> Short version bytea fields != large objects.
> 
> 2) Long version
> 
>  From here:
> 
> https://www.postgresql.org/docs/current/app-pgdump.html 
> <https://www.postgresql.org/docs/current/app-pgdump.html;
> 
> -B
> --no-large-objects
> --no-blobs (deprecated)
> 
>      Exclude large objects in the dump.
> 
>      When both -b and -B are given, the behavior is to output large
> objects, when data is being dumped, see the -b documentation.
> 
> Where large objects are defined here:
> 
> https://www.postgresql.org/docs/current/largeobjects.html 
> <https://www.postgresql.org/docs/current/largeobjects.html;
> 
> 
> 
> 
> 
>  >
>  > What wrong I'm doing?  Couldn't figure it out.   Any help is appreciated.
>  >
>  > Happiness Always
>  > BKR Sivaprakash
> 
>  >
> 
> -- 
> Adrian Klaver
> [email protected] <mailto:[email protected]>
> 
> 
> 
> 

-- 
Adrian Klaver
[email protected]







^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: To take backup of Postgresql Database without large objects
  2025-04-11 15:01 Re: To take backup of Postgresql Database without large objects Adrian Klaver <[email protected]>
  2025-04-12 05:06 ` Re: To take backup of Postgresql Database without large objects [email protected] <[email protected]>
  2025-04-12 06:00   ` Re: To take backup of Postgresql Database without large objects Adrian Klaver <[email protected]>
@ 2025-04-12 06:05     ` David G. Johnston <[email protected]>
  2025-04-12 07:11       ` Re: To take backup of Postgresql Database without large objects [email protected] <[email protected]>
  2025-04-12 15:22       ` Re: To take backup of Postgresql Database without large objects Adrian Klaver <[email protected]>
  0 siblings, 2 replies; 6+ messages in thread

From: David G. Johnston @ 2025-04-12 06:05 UTC (permalink / raw)
  To: Adrian Klaver <[email protected]>; +Cc: [email protected] <[email protected]>; pgsql-general

On Friday, April 11, 2025, Adrian Klaver <[email protected]> wrote:

> On 4/11/25 22:06, [email protected] wrote:
>
> Either my command should be wrong or I'm missing something.
>>
>
> This was explained in my post as  quoted below.


Yeah, the short version.  Then you added a long version that just confused
the issue.  Why point out exclude blobs if you know they are using bytea?

David J.


^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: To take backup of Postgresql Database without large objects
  2025-04-11 15:01 Re: To take backup of Postgresql Database without large objects Adrian Klaver <[email protected]>
  2025-04-12 05:06 ` Re: To take backup of Postgresql Database without large objects [email protected] <[email protected]>
  2025-04-12 06:00   ` Re: To take backup of Postgresql Database without large objects Adrian Klaver <[email protected]>
  2025-04-12 06:05     ` Re: To take backup of Postgresql Database without large objects David G. Johnston <[email protected]>
@ 2025-04-12 07:11       ` [email protected] <[email protected]>
  1 sibling, 0 replies; 6+ messages in thread

From: [email protected] @ 2025-04-12 07:11 UTC (permalink / raw)
  To: Adrian Klaver <[email protected]>; David G. Johnston <[email protected]>; +Cc: pgsql-general

 Thanks for the clarification.
bytea != large object
Happiness Always
BKR Sivaprakash
    On Saturday 12 April, 2025 at 11:36:11 am IST, David G. Johnston <[email protected]> wrote:  
 
 On Friday, April 11, 2025, Adrian Klaver <[email protected]> wrote:

On 4/11/25 22:06, [email protected] wrote:


Either my command should be wrong or I'm missing something.


This was explained in my post as  quoted below.

Yeah, the short version.  Then you added a long version that just confused the issue.  Why point out exclude blobs if you know they are using bytea?
David J.
  

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: To take backup of Postgresql Database without large objects
  2025-04-11 15:01 Re: To take backup of Postgresql Database without large objects Adrian Klaver <[email protected]>
  2025-04-12 05:06 ` Re: To take backup of Postgresql Database without large objects [email protected] <[email protected]>
  2025-04-12 06:00   ` Re: To take backup of Postgresql Database without large objects Adrian Klaver <[email protected]>
  2025-04-12 06:05     ` Re: To take backup of Postgresql Database without large objects David G. Johnston <[email protected]>
@ 2025-04-12 15:22       ` Adrian Klaver <[email protected]>
  1 sibling, 0 replies; 6+ messages in thread

From: Adrian Klaver @ 2025-04-12 15:22 UTC (permalink / raw)
  To: David G. Johnston <[email protected]>; +Cc: [email protected] <[email protected]>; pgsql-general

On 4/11/25 23:05, David G. Johnston wrote:
> On Friday, April 11, 2025, Adrian Klaver <[email protected] 
> <mailto:[email protected]>> wrote:
> 
>     On 4/11/25 22:06, [email protected]
>     <mailto:[email protected]> wrote:
> 
>         Either my command should be wrong or I'm missing something.
> 
> 
>     This was explained in my post as  quoted below.
> 
> 
> Yeah, the short version.  Then you added a long version that just 
> confused the issue.  Why point out exclude blobs if you know they are 
> using bytea?

To show what --no-blobs is actually doing versus what the OP thought it 
was doing, along with link to large object docs to show they are not bytea.

> 
> David J.
> 

-- 
Adrian Klaver
[email protected]







^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2025-04-12 15:22 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-04-11 15:01 Re: To take backup of Postgresql Database without large objects Adrian Klaver <[email protected]>
2025-04-12 05:06 ` [email protected] <[email protected]>
2025-04-12 06:00   ` Adrian Klaver <[email protected]>
2025-04-12 06:05     ` David G. Johnston <[email protected]>
2025-04-12 07:11       ` [email protected] <[email protected]>
2025-04-12 15:22       ` Adrian Klaver <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox