Inheritance in PostgreSQL
PostgreSQL can do inheritance:
https://www.postgresql.org/docs/current/tutorial-inheritance.html
PostgreSQL can do inheritance:
https://www.postgresql.org/docs/current/tutorial-inheritance.html
create table only_numbers (
my_column text not null check (my_column ~ '^[0-9]+$')
);
You can disable DDL transactions during a migration with tern by adding the magic comment to the top of the migration file:
---- tern: disable-tx ----
create index concurrently on my_table (id);
pg_get_constraintdef can be used to get the SQL definition of a constraint.
select pg_get_constraintdef(oid) from pg_constraint where conname='users_tenant_id_fkey';
-- => FOREIGN KEY (tenant_id) REFERENCES tenants(id) ON DELETE CASCADE