Guest User

Untitled

a guest
Jan 23rd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. CREATE OR REPLACE FUNCTION A()
  2. RETURNS VOID AS
  3. $BODY$
  4. how do i print 'hello world' here?
  5. $BODY$
  6. LANGUAGE sql VOLATILE
  7.  
  8. CREATE OR REPLACE FUNCTION A()
  9. RETURNS VOID AS
  10. $BODY$
  11. Raise Notice 'hello world'
  12. $BODY$
  13. LANGUAGE plpgsql VOLATILE
  14.  
  15. ! echo "HERE YOUR DEBUG MSG!"
  16. select * from your_table;
  17.  
  18. create function print(text) returns void as
  19. $$ begin raise notice '%', $1; end
  20. $$ language plpgsql;
  21.  
  22. create function whatever(int) returns int as $$
  23. select print('foobar');
  24. select $1;
  25. $$ language sql;
  26.  
  27. select whatever(3);
  28. NOTICE: foobar
  29. CONTEXT: SQL function "whatever" statement 1
  30. whatever
  31. ----------
  32. 3
  33. (1 row)
  34.  
  35. select 'Straight';
  36. echo BETWEEN
  37. select 'the lines.';
  38.  
  39. ?column?
  40. ----------
  41. Straight
  42. (1 row)
  43.  
  44. BETWEEN
  45. ?column?
  46. ------------
  47. the lines.
  48. (1 row)
Add Comment
Please, Sign In to add comment