Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,29 @@
|
||||
-- # $Id$
|
||||
-- # $HeadURL$
|
||||
-- # $Author$
|
||||
|
||||
CREATE OR REPLACE FUNCTION exists_sequence(sequenceName text, dbSchema text) RETURNS bool AS
|
||||
$$
|
||||
DECLARE
|
||||
exist_sequence "char";
|
||||
BEGIN
|
||||
|
||||
EXECUTE 'SELECT c.relkind
|
||||
FROM pg_class c
|
||||
JOIN pg_namespace n ON n.oid = c.relnamespace
|
||||
WHERE c.relname = $1
|
||||
AND n.nspname = $2
|
||||
AND c.relkind = ''S'''
|
||||
INTO exist_sequence
|
||||
USING sequenceName, dbSchema;
|
||||
|
||||
IF exist_sequence IS NOT NULL THEN
|
||||
RETURN TRUE;
|
||||
ELSE
|
||||
RETURN FALSE;
|
||||
END IF;
|
||||
|
||||
END;
|
||||
$$
|
||||
LANGUAGE plpgsql;
|
||||
|
||||
Reference in new issue
Block a user