pastebin - collaborative debugging

pastebin is a collaborative debugging tool allowing you to share and modify code snippets while chatting on IRC, IM or a message board.

This site is developed to XHTML and CSS2 W3C standards. If you see this paragraph, your browser does not support those standards and you need to upgrade. Visit WaSP for a variety of options.

yancho private pastebin - collaborative debugging tool What's a private pastebin?


Posted by Yancho on Sat 15 Mar 10:55
report abuse | download | new post

  1. CREATE OR REPLACE FUNCTION give_source(text, integer, integer)
  2.   RETURNS integer AS
  3. $BODY$
  4.  
  5. DECLARE
  6.         pojnt ALIAS FOR $1;
  7.         box ALIAS FOR $2;
  8.         dist ALIAS FOR $3;
  9.  
  10.         r_source INTEGER;
  11.  
  12. BEGIN
  13.         SELECT source INTO r_source
  14.         FROM streets s
  15.         WHERE
  16.                 (
  17.                 the_geom && expand (pointfromtext(pojnt),box) AND
  18.                 distance (s.the_geom , pointfromtext(pojnt)) < dist
  19.                 )
  20.         ORDER BY distance (s.the_geom , pointfromtext(pojnt)) ASC
  21.         LIMIT 1;
  22.  
  23.         RETURN r_source;
  24. END;
  25. $BODY$
  26.   LANGUAGE 'plpgsql' VOLATILE;
  27. ALTER FUNCTION give_source(text, integer, integer) OWNER TO yancho;

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with @@


Remember me so that I can delete my post