"Kevin Grittner" <kevin.gritt...@wicourts.gov> writes: > Tom Lane <t...@sss.pgh.pa.us> wrote: >> The usual procedure is to put the whole CREATE FUNCTION statement >> into a file, which you can then send with \i. I'm not quite >> seeing the point of having just the body in a file? It's not like >> the body is typically useful to run as standalone code. > The OP mentioned text highlighting, which has bothered me at times
Ah, that's a fair point, particular with smarter editors. Seems like what you want here is a variant of \i that pulls in the file, escapes it as a string literal, and appends that to the query buffer. Then you write something like create function ... as \istring myfunction.pl ; A backslash command defined that way might have other applications than CREATE FUNCTION, too. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs