Absolutely loving pgschema, thank you!
I'm using typeid to provide type safe ID's all the way down to the database. Unfortunately pgschema doesn't seem to correctly order statements when a function is referenced in a CREATE DOMAIN CHECK constraint. To use typeid you create a new domain like so:
CREATE DOMAIN user_id AS typeid CHECK (typeid_check(value, 'user'));
CREATE TABLE example (
id user_id NOT NULL PRIMARY KEY
);
However, as can be seen in this example run, both the CREATE DOMAIN and CREATE TABLE are reordered before the required function is defined, as can be seen in the ordering of the original SQL.