Postgres 10 partitioned tables

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Postgres 10 partitioned tables
Date: 2017-05-13 11:09:24
Message-ID: of6pgu$7kb$1@blaine.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

The current JDBC driver returns no information about the new partitioned tables in the upcoming Postgres 10.
This is caused by the fact that partitioned tables have a new pg_class.relkind value: 'p'

I have attached a simple patch that fixes the obvious problem that partitioned tables are not returned by getTables() and no column information is returned from getColumns().

The patch essentially treats relkind 'r' and 'p' the same because I think the driver should not make a distinction between regular tables and partitioned tables.

But I think the bigger is: what do do with the partitions themselves?

Technically they are tables, but I think it would make sense to hide them and let frontend tools deal with displaying partitions belonging to a table (this is e.g. how Oracle does it).

However, psql displays them as regular tables just like with the "old" inheritance partitions, so that would probably cause some confusion if getTables() did not return those tables.

Thomas

Attachment Content-Type Size
partioned_tables.diff text/plain 4.9 KB

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2017-05-14 11:39:00 Re: Postgres 10 partitioned tables
Previous Message Erko Hansar 2017-05-11 12:42:50 Re: ArrayIndexOutOfBoundsException from ByteConverter.int8 when resolving generated keys