From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: vasilgiann@gmail.com
Subject: BUG #18115: pg_restore of extensions does not respect dependencies
Date: Mon, 18 Sep 2023 10:14:35 +0000
Message-ID: <18115-e1bb51d5c161484e@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 18115
Logged by: Vasileios Giannakidis
Email address: vasilgiann@gmail.com
PostgreSQL version: 14.7
Operating system: Red Hat 7.3.1-6 64-bit
Description:
I have an issue that takes place during restore of a 14.4 database. During
this process creation of extension aws_s3 fails because it depends on
plpgsql extension which it seems to be created later on. These are the
commands we use for dump / restore:
pg_dump -d \$DATABASE_URL -j 8 -Z 0 -Fd -f ${backupDir}
pg_restore --verbose --clean --no-owner -d \$DATABASE_URL -j 8 --format=d
${backupDir}
This is the output of the pg_restore:
[2023-09-15T14:31:48.653Z] pg_restore: processing item 2 EXTENSION aws_s3
[2023-09-15T14:31:48.653Z] pg_restore: creating EXTENSION "aws_s3"
[2023-09-15T14:31:48.653Z] pg_restore: from TOC entry 2; 3079 57504364
EXTENSION aws_s3 (no owner)
[2023-09-15T14:31:48.653Z] pg_restore: error: could not execute query:
ERROR: language "plpgsql" does not exist
[2023-09-15T14:31:48.653Z] HINT: Use CREATE EXTENSION to load the language
into the database.
[2023-09-15T14:31:48.653Z] Command was: CREATE EXTENSION IF NOT EXISTS
aws_s3 WITH SCHEMA extensions;
[2023-09-15T14:31:48.653Z]
[2023-09-15T14:31:48.653Z]
[2023-09-15T14:31:48.653Z] pg_restore: processing item 8536 COMMENT
EXTENSION aws_s3
[2023-09-15T14:31:48.653Z] pg_restore: creating COMMENT "EXTENSION aws_s3"
[2023-09-15T14:31:48.653Z] pg_restore: from TOC entry 8536; 0 0 COMMENT
EXTENSION aws_s3
[2023-09-15T14:31:48.653Z] pg_restore: error: could not execute query:
ERROR: extension "aws_s3" does not exist
[2023-09-15T14:31:48.653Z] Command was: COMMENT ON EXTENSION aws_s3 IS 'AWS
S3 extension for importing data from S3';
[2023-09-15T14:31:48.653Z]
[2023-09-15T14:31:48.653Z]
[2023-09-15T14:31:48.653Z] pg_restore: processing item 194 SCHEMA
extensions
[2023-09-15T14:31:48.653Z] pg_restore: creating SCHEMA "extensions"
[2023-09-15T14:31:48.653Z] pg_restore: processing item 1 EXTENSION plpgsql
[2023-09-15T14:31:48.653Z] pg_restore: creating EXTENSION "plpgsql"
[2023-09-15T14:31:48.653Z] pg_restore: processing item 8539 COMMENT
EXTENSION plpgsql
[2023-09-15T14:31:48.653Z] pg_restore: creating COMMENT "EXTENSION
plpgsql"
It seems that dependencies between extensions are not considered by pg_dump.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, vasilgiann@gmail.com
Subject: Re: BUG #18115: pg_restore of extensions does not respect dependencies
In-Reply-To: <18115-e1bb51d5c161484e@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox