Re: [HACKERS] Adding support for Default partition in partitioning - Mailing list pgsql-hackers

From Rajkumar Raghuwanshi
Subject Re: [HACKERS] Adding support for Default partition in partitioning
Date
Msg-id CAKcux6n2zGnM5D7EccfFsLC_x=FnG2ie624c4NpqurGCDtcpyw@mail.gmail.com
Whole thread Raw
In response to [HACKERS] Adding support for Default partition in partitioning  (Rahila Syed <rahilasyed90@gmail.com>)
Responses Re: [HACKERS] Adding support for Default partition in partitioning  (Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>)
List pgsql-hackers
Hi Rahila,

pg_restore is failing for default partition, dump file still storing old syntax of default partition.

create table lpd (a int, b int, c varchar) partition by list(a);
create table lpd_d partition of lpd DEFAULT;

create database bkp owner 'edb';
grant all on DATABASE bkp to edb;

--take plain dump of existing database
\! ./pg_dump -f lpd_test.sql -Fp -d postgres

--restore plain backup to new database bkp
\! ./psql -f lpd_test.sql -d bkp

psql:lpd_test.sql:63: ERROR:  syntax error at or near "DEFAULT"
LINE 2: FOR VALUES IN (DEFAULT);
                       ^


vi lpd_test.sql

--
-- Name: lpd; Type: TABLE; Schema: public; Owner: edb
--

CREATE TABLE lpd (
    a integer,
    b integer,
    c character varying
)
PARTITION BY LIST (a);


ALTER TABLE lpd OWNER TO edb;

--
-- Name: lpd_d; Type: TABLE; Schema: public; Owner: edb
--

CREATE TABLE lpd_d PARTITION OF lpd
FOR VALUES IN (DEFAULT);


ALTER TABLE lpd_d OWNER TO edb;


Thanks,
Rajkumar

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: [HACKERS] Change GetLastImportantRecPtr's definition? (wasSkipcheckpoints, archiving on idle systems.)
Next
From: Andres Freund
Date:
Subject: Re: [HACKERS] Change GetLastImportantRecPtr's definition? (wasSkipcheckpoints, archiving on idle systems.)