title: Partitioning in PostgreSQL when partitioned table is referenced
body: <p>My PostgreSQL database has table with entities which can be active and inactive - it's determined by isActive column value. Inactive entities are accessed very rarely, and, as database grows, "inactive to active" rate becomes very high for the database. So I expect partitioning based on simple isActive check to bring huge performance outcome.</p>
  
  <p>The problem is, the table is referenced by foreign key constraint from many other tables. As specified in the last bullet of Caveats section of <a href="http://www.postgresql.org/docs/9.2/interactive/ddl-inherit.html" rel="nofollow">PostgreSQL Inheritance doc</a>, there is no good workaround for this case.</p>
  
  <p>So, is it true that currently partitioning in PostgreSQL is only suitable for the simple cases when the table partitioned is not referenced from anywhere?
  Are there any other ways to go and optimize performance of queries to the table I described above? I'm pretty sure my use case is common and there should be good solution for that.</p>
  
  <p>Example of queries to create the tables:</p>
  
  <pre><code>CREATE TABLE resources
  (
    id uuid NOT NULL,
    isActive integer NOT NULL, -- 0 means false, anything else is true, I intentionally do not use boolean type
    PRIMARY KEY (id)
  );
  
  CREATE TABLE resource_attributes
  (
    id uuid NOT NULL,
    resourceId uuid NOT NULL,
    name character varying(128) NOT NULL,
    value character varying(1024) DEFAULT NULL,
    PRIMARY KEY (id),
    CONSTRAINT fk_resource_attributes_resourceid_resources_id FOREIGN KEY (resourceId) REFERENCES resources (id)
  );
  </code></pre>
  
  <p>In this case, I'd like to partition <code>resources</code> table.</p>