pg_basebackup failure after setting default_table_access_method option

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_basebackup failure after setting default_table_access_method option
Date: 2019-06-05 15:46:23
Message-ID: CALDaNm1KXK9gbZfY-p_peRFm_XrBh1OwQO1Kk6Gig0c0fVZ2uw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

*I noticed pg_basebackup failure when default_table_access_method option is
set.*

*Test steps:*

Step 1: Init database
./initdb -D data

Step 2: Start Server
./postgres -D data &

Step 3: Set Guc option
export PGOPTIONS='-c default_table_access_method=zheap'

Step 4: Peform backup
/pg_basebackup -D backup -p 5432 --no-sync
2019-06-05 20:35:04.088 IST [11601] FATAL: cannot read pg_class without
having selected a database
pg_basebackup: error: could not connect to server: FATAL: cannot read
pg_class without having selected a database

*Reason why it is failing:*
pg_basebackup does not use any database to connect to server as it backs up
the whole data instance.
As the option default_table_access_method is set.
It tries to validate this option, but while validating the option in
ScanPgRelation function:
if (!OidIsValid(MyDatabaseId))
elog(FATAL, "cannot read pg_class without having selected a database");

Here as pg_basebackup uses no database the command fails.

Fix:
The patch has the fix for the above issue:

Let me know your opinion on this.

--
Regards,
vignesh
EnterpriseDB: http://www.enterprisedb.com

Attachment Content-Type Size
0001-pg-backup-guc-option-validation-failure.patch application/octet-stream 735 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Cramer 2019-06-05 15:51:10 Re: Binary support for pgoutput plugin
Previous Message Antonin Houska 2019-06-05 12:32:03 Re: "WIP: Data at rest encryption" patch and, PostgreSQL 11-beta3