Initial commit

This commit is contained in:
torsten committed 2026-08-13 18:33:10 +02:00
commit b7d90b9afe
16245 files changed
+3396666

No files matched your search

@@ -0,0 +1,30 @@
-- # $Id$
-- # $HeadURL$
-- # $Author$
CREATE OR REPLACE FUNCTION exists_constraint(constraintName text, dbSchema text, constraintType char) RETURNS bool AS
$$
DECLARE
exist_constraint "bool";
BEGIN
EXECUTE 'SELECT COUNT(*)
FROM pg_class c
JOIN pg_namespace n ON n.oid = c.relnamespace
WHERE c.relname = $1
AND n.nspname = $2
AND c.relkind = $3'
INTO exist_constraint
USING constraintName, dbSchema, constraintType;
IF exist_constraint THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
END;
$$
LANGUAGE plpgsql;