pg_restore -L reordering of the statements does not work

From: Aditya D <dsaditya91(at)gmail(dot)com>
To: pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: pg_restore -L reordering of the statements does not work
Date: 2023-10-27 18:02:42
Message-ID: CAEATte6vgZr6d2abZo9_wxTarwQP3TC_NLpCKTDzWW4E4OB9cw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi Team,

Does the reorder of the statements in the list file works? Please find the
below example -

pg_restore -h <<hostname>> -v -U epguser *-L
"C:\Users\Desktop\dumpfiles\single.list"* -d ownersdb
"C:\Users\Desktop\dumpfiles\single_list.dump"

The contents of the list file
;
; Archive created at 2023-10-27 22:37:57
; dbname: role_owners
; TOC Entries: 10
; Compression: -1
; Dump Version: 1.14-0
; Format: CUSTOM
; Integer: 4 bytes
; Offset: 8 bytes
; Dumped from database version: 11.18
; Dumped by pg_dump version: 15.2
;
;
; Selected TOC Entries:
10; 2615 57086 SCHEMA - schema_roles user1
4232; 0 0 ACL - SCHEMA schema_roles user1
201; 1259 57087 TABLE schema_roles test_user1 user1
202; 1259 57090 TABLE schema_roles test_user2 user2

Problem Statement - The ACL command i.e. The grant statement gets called
out at the end while performing pg_restore and the use case is to call it
at the beginning. I believe even though the re-ordering is done the
statements are executed using the "Internal Archive Id" while referring
to the dump file.

Is there any way we can reorder the statements instead of commenting or
deleting these statements?

Thanks & Regards,
Aditya D

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Dave Page 2023-10-27 18:03:06 Re: pgadmin for ubuntu 23.10 (mantic)
Previous Message Sanjay Minni 2023-10-27 18:01:23 Fwd: pgadmin for ubuntu 23.10 (mantic)