move stuff to plpgsql
This commit is contained in:
12
sql/website_exists.sql
Normal file
12
sql/website_exists.sql
Normal file
@ -0,0 +1,12 @@
|
||||
CREATE OR REPLACE FUNCTION website_exists(in_website_name text) RETURNS boolean AS $$
|
||||
BEGIN
|
||||
PERFORM * FROM website w
|
||||
WHERE w.name = in_website_name;
|
||||
|
||||
IF FOUND THEN
|
||||
RETURN 1;
|
||||
ELSE
|
||||
RETURN 0;
|
||||
END IF;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql STRICT;
|
Reference in New Issue
Block a user