diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2022-12-05 08:52:11 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2022-12-05 08:52:55 +0100 |
commit | 35ce24c333cf6dee3c92bc5f67553c7720bd9988 (patch) | |
tree | 8b4a14e6d9382bc778f24562a40d7a3cd8206e5d /src/bin/pg_dump/pg_backup_null.c | |
parent | 8a476fda5e45f16d8c608c73d9e871bd4023d79a (diff) |
pg_dump: Remove "blob" terminology
For historical reasons, pg_dump refers to large objects as "BLOBs".
This term is not used anywhere else in PostgreSQL, and it also means
something different in the SQL standard and other SQL systems.
This patch renames internal functions, code comments, documentation,
etc. to use the "large object" or "LO" terminology instead. There is
no functionality change, so the archive format still uses the name
"BLOB" for the archive entry. Additional long command-line options
are added with the new naming.
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://www.postgresql.org/message-id/flat/868a381f-4650-9460-1726-1ffd39a270b4%40enterprisedb.com
Diffstat (limited to 'src/bin/pg_dump/pg_backup_null.c')
-rw-r--r-- | src/bin/pg_dump/pg_backup_null.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/bin/pg_dump/pg_backup_null.c b/src/bin/pg_dump/pg_backup_null.c index 541306d9915..08f096251b6 100644 --- a/src/bin/pg_dump/pg_backup_null.c +++ b/src/bin/pg_dump/pg_backup_null.c @@ -29,16 +29,16 @@ #include "pg_backup_utils.h" static void _WriteData(ArchiveHandle *AH, const void *data, size_t dLen); -static void _WriteBlobData(ArchiveHandle *AH, const void *data, size_t dLen); +static void _WriteLOData(ArchiveHandle *AH, const void *data, size_t dLen); static void _EndData(ArchiveHandle *AH, TocEntry *te); static int _WriteByte(ArchiveHandle *AH, const int i); static void _WriteBuf(ArchiveHandle *AH, const void *buf, size_t len); static void _CloseArchive(ArchiveHandle *AH); static void _PrintTocData(ArchiveHandle *AH, TocEntry *te); -static void _StartBlobs(ArchiveHandle *AH, TocEntry *te); -static void _StartBlob(ArchiveHandle *AH, TocEntry *te, Oid oid); -static void _EndBlob(ArchiveHandle *AH, TocEntry *te, Oid oid); -static void _EndBlobs(ArchiveHandle *AH, TocEntry *te); +static void _StartLOs(ArchiveHandle *AH, TocEntry *te); +static void _StartLO(ArchiveHandle *AH, TocEntry *te, Oid oid); +static void _EndLO(ArchiveHandle *AH, TocEntry *te, Oid oid); +static void _EndLOs(ArchiveHandle *AH, TocEntry *te); /* @@ -56,10 +56,10 @@ InitArchiveFmt_Null(ArchiveHandle *AH) AH->ReopenPtr = NULL; AH->PrintTocDataPtr = _PrintTocData; - AH->StartBlobsPtr = _StartBlobs; - AH->StartBlobPtr = _StartBlob; - AH->EndBlobPtr = _EndBlob; - AH->EndBlobsPtr = _EndBlobs; + AH->StartLOsPtr = _StartLOs; + AH->StartLOPtr = _StartLO; + AH->EndLOPtr = _EndLO; + AH->EndLOsPtr = _EndLOs; AH->ClonePtr = NULL; AH->DeClonePtr = NULL; @@ -90,10 +90,10 @@ _WriteData(ArchiveHandle *AH, const void *data, size_t dLen) /* * Called by dumper via archiver from within a data dump routine - * We substitute this for _WriteData while emitting a BLOB + * We substitute this for _WriteData while emitting a LO */ static void -_WriteBlobData(ArchiveHandle *AH, const void *data, size_t dLen) +_WriteLOData(ArchiveHandle *AH, const void *data, size_t dLen) { if (dLen > 0) { @@ -119,54 +119,54 @@ _EndData(ArchiveHandle *AH, TocEntry *te) /* * Called by the archiver when starting to save all BLOB DATA (not schema). * This routine should save whatever format-specific information is needed - * to read the BLOBs back into memory. + * to read the LOs back into memory. * * It is called just prior to the dumper's DataDumper routine. * * Optional, but strongly recommended. */ static void -_StartBlobs(ArchiveHandle *AH, TocEntry *te) +_StartLOs(ArchiveHandle *AH, TocEntry *te) { ahprintf(AH, "BEGIN;\n\n"); } /* - * Called by the archiver when the dumper calls StartBlob. + * Called by the archiver when the dumper calls StartLO. * * Mandatory. * * Must save the passed OID for retrieval at restore-time. */ static void -_StartBlob(ArchiveHandle *AH, TocEntry *te, Oid oid) +_StartLO(ArchiveHandle *AH, TocEntry *te, Oid oid) { - bool old_blob_style = (AH->version < K_VERS_1_12); + bool old_lo_style = (AH->version < K_VERS_1_12); if (oid == 0) pg_fatal("invalid OID for large object"); /* With an old archive we must do drop and create logic here */ - if (old_blob_style && AH->public.ropt->dropSchema) - DropBlobIfExists(AH, oid); + if (old_lo_style && AH->public.ropt->dropSchema) + DropLOIfExists(AH, oid); - if (old_blob_style) + if (old_lo_style) ahprintf(AH, "SELECT pg_catalog.lo_open(pg_catalog.lo_create('%u'), %d);\n", oid, INV_WRITE); else ahprintf(AH, "SELECT pg_catalog.lo_open('%u', %d);\n", oid, INV_WRITE); - AH->WriteDataPtr = _WriteBlobData; + AH->WriteDataPtr = _WriteLOData; } /* - * Called by the archiver when the dumper calls EndBlob. + * Called by the archiver when the dumper calls EndLO. * * Optional. */ static void -_EndBlob(ArchiveHandle *AH, TocEntry *te, Oid oid) +_EndLO(ArchiveHandle *AH, TocEntry *te, Oid oid) { AH->WriteDataPtr = _WriteData; @@ -179,7 +179,7 @@ _EndBlob(ArchiveHandle *AH, TocEntry *te, Oid oid) * Optional. */ static void -_EndBlobs(ArchiveHandle *AH, TocEntry *te) +_EndLOs(ArchiveHandle *AH, TocEntry *te) { ahprintf(AH, "COMMIT;\n\n"); } @@ -197,12 +197,12 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te) AH->currToc = te; if (strcmp(te->desc, "BLOBS") == 0) - _StartBlobs(AH, te); + _StartLOs(AH, te); te->dataDumper((Archive *) AH, te->dataDumperArg); if (strcmp(te->desc, "BLOBS") == 0) - _EndBlobs(AH, te); + _EndLOs(AH, te); AH->currToc = NULL; } |