7 Commits

Author SHA1 Message Date
Matvey Arye
f38a578578 Fix handling of long constraint names 2017-12-09 12:05:34 -05:00
Erik Nordström
500563ffe5 Add support for PostgreSQL 10
The extension now works with PostgreSQL 10, while
retaining compatibility with version 9.6.

PostgreSQL 10 has numerous internal changes to functions and
APIs, which necessitates various glue code and compatibility
wrappers to seamlessly retain backwards compatiblity with older
versions.

Test output might also differ between versions. In particular,
the psql client generates version-specific output with `\d` and
EXPLAINs might differ due to new query optimizations. The test
suite has been modified as follows to handle these issues. First,
tests now use version-independent functions to query system
catalogs instead of using `\d`. Second, changes have been made to
the test suite to be able to verify some test outputs against
version-dependent reference files.
2017-11-10 09:44:20 +01:00
Matvey Arye
543a75f865 Refactor regression tests
This commit moves a lot of test setup logic to runner.sh. Also
passes the right commands to the regression infrastructure to create
appropriate users and run tests as a regular user.
2017-10-05 15:56:33 -04:00
Erik Nordström
04d01ce6ca Split DDL processing into start and end hooks
The ProcessUtility hook doesn't give any information on applied DDL
commands, which makes it hard to implement DDL processing that
requires the result of a DDL command on a hypertable (for instance,
adding a constraint or index without an explicit name).

This change splits the DDL processing over start and end hooks,
handling DDL commands before and after regular PostgreSQL processing,
respectively.

The start DDL hook is still based on the ProcessUtility hook, while
the end DDL hook is based on an event trigger that allows getting
information on the created/dropped/altered objects.
2017-09-22 12:54:22 +02:00
Erik Nordström
aa904fa5d0 Block adding constraints without a constraint name
The current approach of handling alter table commands does not allow
getting the result of the command; for instance, the object address of
a created constraint on a hypertable. Thus there is no way to get the
auto-generated name of a constraint, which is needed when the
corresponding constraints are created on the hypertable's chunks.

Therefore, this change blocks the ability to create constraints
without an explicit name. When a better approach to handling alter
table is deviced, it is possible to remove this restriction.
2017-09-19 09:09:16 +02:00
Erik Nordström
27675488f6 Block adding constraints using an existing index
Adding a constraint using an existing index changes the existing
index's name as a side effect (PostgreSQL wants the index name to
match the constraint name). This creates a mismatch between the
index's name and our metadata in the chunk_index table. Further, since
the name change happens as a result of an internal command (and not
via DDL command that we can capture) there is currently no way to sync
up this information.
2017-09-15 21:42:07 +02:00
Matvey Arye
4dcbe6114d Add support for hypertable constraints
This PR add support for primary-key, foreign-key, unique, and exclusion constraints.
Previously supported are CHECK and NOT NULL constraints. Now, foreign key
constraints where a hypertable references a plain table is support
(while vice versa, with a plain table references a hypertable, is still not).
2017-09-07 11:31:48 -04:00