Pavel Stehule <pavel.steh...@gmail.com> writes: > attached updated \sf implementation. It is little bit simplyfied with > support a pager and output forwarding. Formating was updated per Tom's > request.
Applied with corrections --- mostly, fixing it to not trash the query buffer, which would certainly not be expected behavior for such a command. Also, as previously mentioned, I took out the line number argument, which seemed to me to have little if any use-case while substantially complicating the code. (It's not so much that it cost a lot in the patch as submitted, it's that it *would* cost a lot if you were honoring it in the pager calculation...) One other thing: I took a look at the pg_get_functiondef() code and realized that in fact it does NOT guarantee that the function body will start with "AS $function...". In languages with a nonnull probin field, that's not what the line will look like. I think though that looking for just "AS " at the start of the line is sufficient for our purposes here. I will go change the \ef and \sf code for that. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers