Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE OR REPLACE FUNCTION importrate.check_ticker_suid_spaces()
  2.   RETURNS trigger AS
  3. $BODY$
  4. BEGIN
  5.    
  6.     IF new.suid!=trim(new.suid) THEN
  7.     RAISE EXCEPTION 'Unable to set ticker suid with spaces';
  8.     END if;
  9.     RETURN new;
  10. END;
  11. $BODY$
  12.   LANGUAGE plpgsql VOLATILE
  13.   COST 100;
  14.  
  15.  
  16. CREATE TRIGGER check_ticker_suid_spaces_trigger
  17.   BEFORE UPDATE OR INSERT
  18.   ON importrate.tickers
  19.   FOR EACH ROW
  20.   EXECUTE PROCEDURE importrate.check_ticker_suid_spaces();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement