Re: review: psql: edit function, show function commands patch - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: review: psql: edit function, show function commands patch
Date
Msg-id m2r5iwv965.fsf@hi-media.com
Whole thread Raw
In response to Re: review: psql: edit function, show function commands patch  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.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

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: documentation for committing with git
Next
From: Dimitri Fontaine
Date:
Subject: Re: managing git disk space usage