Advertisement
Guest User

Untitled

a guest
May 6th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. CREATE OR REPLACE FUNCTION spgetmatchingusers(IN email text)
  2. RETURNS TABLE(email character, password character, userid smallint, teamname character, reset_password character, reset_password_expiry timestamp with time zone) AS
  3. $BODY$
  4. select "email", "password", "userid", "teamname", "reset_password", "reset_password_expiry"
  5. from "RegisteredUsers"
  6. where LOWER("RegisteredUsers"."email") = LOWER(email)
  7. $BODY$
  8. LANGUAGE sql VOLATILE
  9. COST 100
  10. ROWS 1000;
  11. ALTER FUNCTION spgetmatchingusers(text)
  12. OWNER TO bjlizgykrnyffr;
  13.  
  14. select * from spgetmatchingusers('user@email.com')
  15.  
  16. select * from spgetmatchingusers('randomtext')
  17.  
  18. CREATE TABLE "RegisteredUsers"
  19. (
  20. userid smallint NOT NULL DEFAULT nextval('user_id_seq'::regclass),
  21. teamname character(50) NOT NULL,
  22. first_name character(50),
  23. surname character(50),
  24. email character(50),
  25. company_name character(50),
  26. password character(50),
  27. reset_password character(50),
  28. reset_password_expiry timestamp with time zone,
  29. CONSTRAINT "RegisteredUsers_pkey" PRIMARY KEY (userid)
  30. )
  31. WITH (
  32. OIDS=FALSE
  33. );
  34. ALTER TABLE "RegisteredUsers"
  35. OWNER TO bjlizgykrnyffr;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement