BUG #7684: pg_dumpall doesn't sort "CREATE SERVER"s options correctly

Started by Timur Luchkinover 13 years ago2 messagesbugs
Jump to latest
#1Timur Luchkin
timur.luchkin@gmail.com

The following bug has been logged on the website:

Bug reference: 7684
Logged by: Timur Luchkin
Email address: timur.luchkin@gmail.com
PostgreSQL version: 9.2.1
Operating system: OpenSolaris
Description:

Looks like pg_dumpall sorts 'create server FOREIGN DATA WRAPPER' options
(keys) as varchar and not as integer.
Example from dumped sql (see "pX" option key):

CREATE SERVER can_master_cluster FOREIGN DATA WRAPPER plproxy OPTIONS (
connection_lifetime '1800',
p0 'dbname=database11 host=xxx-11 port=9811',
p1 'dbname=database12 host=xxx-12 port=9812',
p10 'dbname=database21 host=xxx-21 port=9821',
p11 'dbname=database22 host=xxx-22 port=9822',
p12 'dbname=database23 host=xxx-23 port=9823',
p13 'dbname=database24 host=xxx-24 port=9824',
p14 'dbname=database25 host=xxx-25 port=9825',
p15 'dbname=database26 host=xxx-26 port=9826',
p2 'dbname=database13 host=xxx-13 port=9813',
p3 'dbname=database14 host=xxx-14 port=9814',
p4 'dbname=database15 host=xxx-15 port=9815',
p5 'dbname=database16 host=xxx-16 port=9816',
p6 'dbname=database17 host=xxx-17 port=9817',
p7 'dbname=database18 host=xxx-18 port=9818',
p8 'dbname=database19 host=xxx-19 port=9819',
p9 'dbname=database20 host=xxx-20 port=9820'
);

which causes next error during the load:
ERROR: Pl/Proxy: partitions must be numbered consecutively
HINT: next valid partition number is 2
STATEMENT: CREATE SERVER can_master_cluster ...

Old 9.0 'pg_dumpall' doing job correct.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Timur Luchkin (#1)
Re: BUG #7684: pg_dumpall doesn't sort "CREATE SERVER"s options correctly

timur.luchkin@gmail.com writes:

Looks like pg_dumpall sorts 'create server FOREIGN DATA WRAPPER' options
(keys) as varchar and not as integer.

AFAIK there's no particular guarantee that they're dumped in any
specific order.

which causes next error during the load:
ERROR: Pl/Proxy: partitions must be numbered consecutively
HINT: next valid partition number is 2

I'd say this is either a bug or a misdesign of pl/proxy. It should not
be expecting that FDW options are stored in any specific physical order.
Suggest reporting it at plproxy-users@pgfoundry.org.

regards, tom lane