Re: review: psql: edit function, show function commands patch

From: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Jan Urbański <wulczer(at)wulczer(dot)org>, Postgres - Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: review: psql: edit function, show function commands patch
Date: 2010-07-21 21:04:18
Message-ID: m2r5iwv965.fsf@hi-media.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> **** CREATE OR REPLACE FUNCTION public.foo()
> **** RETURNS integer
> **** LANGUAGE plpgsql
> 1 AS $function$ begin
> 2 return 10/0;
> 3 end;
> **** $function$
>
> This is very trivial example - for more complex functions, the correct
> line numbering is more useful.

I completely agree with this, in-functions line numbering is a
must-have. I'd like psql to handle that better.

That said, I usually edit functions in Emacs on my workstation. I did
implement a linum-mode extension to show PL/pgSQL line numbers in
addition to the buffer line numbers in emacs, but it failed to work with
this "AS $function$ begin" on the same line example. It's fixed in the
attached, should there be any users of it.

Regards,
--
dim

Attachment Content-Type Size
dim-pgsql.el application/emacs-lisp 2.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2010-07-21 21:06:01 Re: git config user.email
Previous Message Robert Haas 2010-07-21 21:03:09 Re: documentation for committing with git