Re: Documentation clarification request: pg_dumpall and Large Objects

2025-12-04 Thread Laurenz Albe
On Thu, 2025-12-04 at 13:12 +0100, Radoulov, Dimitre wrote:
> I would like to request a clarification in the pg_dumpall
> documentation regarding Large Objects (LOBs). The current
> documentation does not explicitly state whether pg_dumpall includes
> Large Objects in its output.
> 
> This behavior is clear from the implementation, but not from the
> documentation.
> 
> I propose adding an explicit note such as:
> 
>   "pg_dumpall does not include Large Objects (BLOBs). To back up
>    Large Objects, use pg_dump -b per database."

At the beginning of the "pg_dumpall" page we see:

  pg_dumpall is a utility for writing out (“dumping”) all PostgreSQL databases
  of a cluster into one script file. [...].
  It does this by calling pg_dump for each database in the cluster.

And the pg_dump documentation says:

  -b
  --large-objects
  --blobs (deprecated)

Include large objects in the dump. This is the default behavior except when
--schema, --table, --schema-only, --statistics-only, or --no-data is 
specified.

Since pg_dumpall dumps the databases (and not parts of the databases), it will
automatically dump large objects too.

But I admit that you have to go by circumstantial evidence here.  But rather
than explicitly naming large objects, perhaps it would be useful to add 
something
like

  pg_dumpall is primarily intended as a tool to upgrade database clusters.
  As such, it by default exports all data of the entire cluster.
  The only part of the state of a database cluster that is *not* included
  in the output of pg_dumpall are the configuration files and database 
parameters
  changed with ALTER SYSTEM.

Yours,
Laurenz Albe




Documentation clarification request: pg_dumpall and Large Objects

2025-12-04 Thread Radoulov, Dimitre
Hello,

I would like to request a clarification in the pg_dumpall
documentation regarding Large Objects (LOBs). The current
documentation does not explicitly state whether pg_dumpall includes
Large Objects in its output.

In the source code (pg_dumpall.c), there is a comment indicating
that pg_dumpall forces all pg_dump output to plain text. Since Large
Objects are only included by pg_dump when using -b or non-text
archive formats (custom/tar), pg_dumpall cannot include LOBs in its
output.

This behavior is clear from the implementation, but not from the
documentation.

I propose adding an explicit note such as:

  "pg_dumpall does not include Large Objects (BLOBs). To back up
   Large Objects, use pg_dump -b per database."

This clarification would help prevent user confusion during
cluster-wide backup procedures.

Thank you.

Best regards,
Dimitre Radoulov


Re: Documentation clarification request: pg_dumpall and Large Objects

2025-12-04 Thread Radoulov, Dimitre
Il Gio 4 Dic 2025, 16:50 Laurenz Albe  ha scritto:

> On Thu, 2025-12-04 at 13:12 +0100, Radoulov, Dimitre wrote:
> > I would like to request a clarification in the pg_dumpall
> > documentation regarding Large Objects (LOBs). The current
> > documentation does not explicitly state whether pg_dumpall includes
> > Large Objects in its output.
> >
> > This behavior is clear from the implementation, but not from the
> > documentation.
> >
> > I propose adding an explicit note such as:
> >
> >   "pg_dumpall does not include Large Objects (BLOBs). To back up
> >Large Objects, use pg_dump -b per database."
>
> At the beginning of the "pg_dumpall" page we see:
>
>   pg_dumpall is a utility for writing out (“dumping”) all PostgreSQL
> databases
>   of a cluster into one script file. [...].
>   It does this by calling pg_dump for each database in the cluster.
>
> And the pg_dump documentation says:
>
>   -b
>   --large-objects
>   --blobs (deprecated)
>
> Include large objects in the dump. This is the default behavior except
> when
> --schema, --table, --schema-only, --statistics-only, or --no-data is
> specified.
>
> Since pg_dumpall dumps the databases (and not parts of the databases), it
> will
> automatically dump large objects too.
>
> But I admit that you have to go by circumstantial evidence here.  But
> rather
> than explicitly naming large objects, perhaps it would be useful to add
> something
> like
>
>   pg_dumpall is primarily intended as a tool to upgrade database clusters.
>   As such, it by default exports all data of the entire cluster.
>   The only part of the state of a database cluster that is *not* included
>   in the output of pg_dumpall are the configuration files and database
> parameters
>   changed with ALTER SYSTEM.
>


Thank you for the clarification.

I believe the confusion comes from the historical behavior of pg_dump in
older PostgreSQL versions.

Since pg_dumpall delegates to pg_dump, and pg_dump’s default behavior has
included LOBs since 7.1, the current behavior is consistent with your
explanation.


Thank you again for your time and for considering the suggestion.

Best regards
Dimitre

>


Re: Documentation clarification request: pg_dumpall and Large Objects

2025-12-04 Thread Laurenz Albe
On Thu, 2025-12-04 at 18:12 +0100, Radoulov, Dimitre wrote:
> Il Gio 4 Dic 2025, 16:50 Laurenz Albe  ha scritto:
> > On Thu, 2025-12-04 at 13:12 +0100, Radoulov, Dimitre wrote:
> > > I would like to request a clarification in the pg_dumpall
> > > documentation regarding Large Objects (LOBs). The current
> > > documentation does not explicitly state whether pg_dumpall includes
> > > Large Objects in its output.
> > 
> > I admit that you have to go by circumstantial evidence here.  But rather
> > than explicitly naming large objects, perhaps it would be useful to add 
> > something
> > like
> > 
> >   pg_dumpall is primarily intended as a tool to upgrade database clusters.
> >   As such, it by default exports all data of the entire cluster.
> >   The only part of the state of a database cluster that is *not* included
> >   in the output of pg_dumpall are the configuration files and database 
> > parameters
> >   changed with ALTER SYSTEM.
> 
> Thank you again for your time and for considering the suggestion.

Attached is a patch for such a change.

I'll add it to the next commitfest.

Yours,
Laurenz Albe
From 8867a64f4d0c6c530bc001b8db73802f25284d15 Mon Sep 17 00:00:00 2001
From: Laurenz Albe 
Date: Thu, 4 Dec 2025 19:09:17 +0100
Subject: [PATCH v1] pg_dumpall doc: clarify scope and suggested use

Add a paragraph that clarifies that pg_dumpall is mostly an upgrade
tool and describes the parts of a cluster's state that are *not*
included in the dump.

In the spirit of added clarity, swap two sentences in the introductory
paragraph.  Without that, it is not clear what the "it" at the beginning
of the second sentence is referring to.

Author: Laurenz Albe 
Discussion: https://postgr.es/m/CAGJBphSX2oMPPu%3DVM4U8NP4%2BqffFH_483tFQCJ_s-mOcN3DLDw%40mail.gmail.com
---
 doc/src/sgml/ref/pg_dumpall.sgml | 17 +
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/doc/src/sgml/ref/pg_dumpall.sgml b/doc/src/sgml/ref/pg_dumpall.sgml
index 8834b7ec141..f46f2e70b7f 100644
--- a/doc/src/sgml/ref/pg_dumpall.sgml
+++ b/doc/src/sgml/ref/pg_dumpall.sgml
@@ -33,16 +33,25 @@ PostgreSQL documentation
   
pg_dumpall is a utility for writing out
(dumping) all PostgreSQL databases
-   of a cluster into one script file.  The script file contains
-   SQL commands that can be used as input to  to restore the databases.  It does this by
-   calling  for each database in the cluster.
+   of a cluster into one script file.  It does this by calling
+for each database in the cluster.
+   The resulting script file contains SQL commands that
+   can be used as input to  to restore the databases.
pg_dumpall also dumps global objects
that are common to all databases, namely database roles, tablespaces,
and privilege grants for configuration parameters.
(pg_dump does not save these objects.)
   
 
+  
+   pg_dumpall is primarily intended as a tool
+   for upgrading database clusters (see ).
+   As such, it by default exports all data of the entire cluster.  The only
+   part of a database cluster's state that is not included
+   in the output of pg_dumpall are the configuration
+   files and database parameters changed with .
+  
+
   
Since pg_dumpall reads tables from all
databases you will most likely have to connect as a database
-- 
2.52.0