Re: query has no destination for result data

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: Rob Sargent <robjsargent(at)gmail(dot)com>, Ron <ronljohnsonjr(at)gmail(dot)com>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: query has no destination for result data
Date: 2019-03-06 15:37:37
Message-ID: CAFj8pRBY5DOfE1O_+ZbK4B6TP7VxccQy73kF_+u-1dCo+VhcyQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I believe language plpgsql is not considered part of the function body
> so it is not included in the line count:
>
> https://www.postgresql.org/docs/10/plpgsql-structure.html
>
> When tracking a line number down I usually do:
>
> \ef some_function line_number
>
> which counts the line in the function body not the file. So for example:
>
> Using set nu in Vi:
>
> 1 CREATE OR REPLACE FUNCTION public.ts_update()
> 2 RETURNS trigger
> 3 LANGUAGE plpgsql
> 4 AS $function$
> 5 BEGIN
> 6 NEW.ts_update := timeofday();
> 7 RETURN NEW;
> 8 END;
> 9 $function$
>
> \ef ts_update 4
>
> CREATE OR REPLACE FUNCTION public.ts_update()
> RETURNS trigger
> LANGUAGE plpgsql
> AS $function$
> BEGIN
> NEW.ts_update := timeofday();
> RETURN NEW; <--- This row is marked
> END;
> $function$
>
>
or

\sf+ functioname

Regards

Pavel

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2019-03-06 15:41:22 Re: query has no destination for result data
Previous Message Adrian Klaver 2019-03-06 15:27:14 Re: query has no destination for result data