This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DO | |
$$ | |
DECLARE this record; | |
BEGIN | |
IF(CURRENT_USER = 'db_user') THEN | |
RETURN; | |
END IF; | |
FOR this IN | |
SELECT * FROM pg_tables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DO | |
$$ | |
DECLARE _sql text; | |
BEGIN | |
WITH all_sequences | |
AS | |
( | |
SELECT | |
pg_namespace.nspname AS schema_name, | |
pg_class.relname AS table_name, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE forums.banned_users | |
( | |
banned_user_id integer PRIMARY KEY REFERENCES account.users, | |
banned_by integer REFERENCES account.users, | |
reason text, | |
browser text, | |
ip_address text, | |
user_agent text, | |
audit_ts TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT(NOW()) | |
); |