Warning: is_dir(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/data/web/virtuals/98151/virtual) in /data/web/virtuals/98151/virtual/www/subdom/postgresql/wp-content/plugins/wp-simple-firewall/src/lib/vendor/fernleafsystems/wordpress-services/src/Core/Fs.php on line 465

Warning: Cannot modify header information - headers already sent by (output started at /data/web/virtuals/98151/virtual/www/subdom/postgresql/wp-content/plugins/wp-simple-firewall/src/lib/vendor/fernleafsystems/wordpress-services/src/Core/Fs.php:465) in /data/web/virtuals/98151/virtual/www/subdom/postgresql/wp-content/plugins/disable-xml-rpc-pingback/disable-xml-rpc-pingback.php on line 51
Constraints Archives - PostgreSQL Candies

Domain – very useful constraint standardization

Do you need to ensure that the same constraints across application are really the same? Use so called “domain”. It is public definition of constraint you can use repeatedly in whole application. Example is of for simplicity taken from PG documentation...

Hierarchy of tables based on foreign keys

with recursive getall as ( select distinct ac.*, ac.table_name||'; ' as hierarchy, 1 as _level from allconst ac where dep_table_name is null --and table_schema='...your_schema_in_db...' --optional if you need to narrow select --and table_name='...your_table_name...'...