smart or dumb partition?

From: Bob Gobeille <bob(dot)gobeille(at)hp(dot)com>
To: PgSQL-general <pgsql-general(at)postgresql(dot)org>
Subject: smart or dumb partition?
Date: 2009-08-07 23:27:42
Message-ID: F5CEDC4A-6B50-4AFD-8705-FD09828A0B66@hp.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I gather from rtfm that it is typical to set up partitions so that the
"master" table has no records. But from my understanding of
partitions and doing some tests, I don't see any reason that has to
be. So I'm wondering if I'm missing some subtle (or not so subtle)
point about partitions? I'd like to have the master table contain all
my records except those that have very specific (and unique) criteria:

CREATE TABLE master (
master_pk serial NOT NULL,
myint integer);

CREATE TABLE master_1 (
CHECK (myint =1)
) INHERITS (master);

INSERT INTO master (myint) VALUES (2);
INSERT INTO master (myint) VALUES (3);
INSERT INTO master_1 (myint) VALUES (1);

Is there anything wrong with this? It seems to work well but I am
concerned that I may be missing something since the docs say "<the
master> will contain no data".

Thanks,
Bob Gobeille
bobg(at)fossology(dot)org

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Stark 2009-08-07 23:44:36 Re: smart or dumb partition?
Previous Message Tom Lane 2009-08-07 23:26:52 Re: Make check fails on 8.3.7