From: Tomas Vondra Date: Tue, 10 Jan 2017 19:06:32 +0000 (+0100) Subject: make pg_dump work on 9.6 by adding columns to getTables() X-Git-Tag: XL_10_R1BETA1~485 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=815809486c46601609f254453a1bc03dc942e8eb;p=postgres-xl.git make pg_dump work on 9.6 by adding columns to getTables() The 9.6 if-branch in getTables() was missing XL-specific columns, namely pgxclocatortype, pgxcattnum and pgxc_node_names, resulting in strange errors like this: pg_dump: column number -1 is out of range 0..33 pg_dump: column number -1 is out of range 0..33 cannot duplicate null pointer (internal error) After adding the columns, everything seems to be working fine. --- diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 06695f8934..83c2523408 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -5293,6 +5293,11 @@ getTables(Archive *fout, int *numTables) "d.refobjid AS owning_tab, " "d.refobjsubid AS owning_col, " "(SELECT spcname FROM pg_tablespace t WHERE t.oid = c.reltablespace) AS reltablespace, " +#ifdef PGXC + "(SELECT pclocatortype from pgxc_class v where v.pcrelid = c.oid) AS pgxclocatortype," + "(SELECT pcattnum from pgxc_class v where v.pcrelid = c.oid) AS pgxcattnum," + "(SELECT string_agg(node_name,',') AS pgxc_node_names from pgxc_node n where n.oid in (select unnest(nodeoids) from pgxc_class v where v.pcrelid=c.oid) ) , " +#endif "array_remove(array_remove(c.reloptions,'check_option=local'),'check_option=cascaded') AS reloptions, " "CASE WHEN 'check_option=local' = ANY (c.reloptions) THEN 'LOCAL'::text " "WHEN 'check_option=cascaded' = ANY (c.reloptions) THEN 'CASCADED'::text ELSE NULL END AS checkoption, "