Skip to content

Instantly share code, notes, and snippets.

--partitioning like http://www.postgresql.org/docs/9.3/static/ddl-partitioning.html
--create master table
CREATE TABLE master_table
(
id serial,
key character varying NOT NULL,
value character varying NOT NULL,
CONSTRAINT master_table_pkey PRIMARY KEY (id)
);
--create slave tables with constraint
@Lurunchik
Lurunchik / gist:11256656
Last active August 29, 2015 14:00
PostgreSQL: Partition with returning <column> solved "0 rows problem"
--partitioning like http://www.postgresql.org/docs/9.3/static/ddl-partitioning.html
--create master table
CREATE TABLE master_table
(
id serial,
key character varying NOT NULL,
value character varying NOT NULL,
CONSTRAINT master_table_pkey PRIMARY KEY (id)
);
--create slave tables with constraint