Re: PL/pgSQL support to define multi variables once

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Quan Zongliang <quanzongliang(at)gmail(dot)com>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PL/pgSQL support to define multi variables once
Date: 2014-06-13 07:41:09
Message-ID: CAB7nPqS9Dzz85h+vunuYNfmy=bdyeXf0N3wp+V2Vs0k41b+-OA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jun 13, 2014 at 4:20 PM, Quan Zongliang <quanzongliang(at)gmail(dot)com> wrote:
> By my friend asking, for convenience,
> support to define multi variables in single PL/pgSQL line.
>
> Like this:
>
> CREATE OR REPLACE FUNCTION try_mutlivardef() RETURNS text AS $$
> DECLARE
> local_a, local_b, local_c text := 'a1----';
> BEGIN
> return local_a || local_b || local_c;
> end;
> $$ LANGUAGE plpgsql;
I don't recall that this is possible. Have a look at the docs as well:
http://www.postgresql.org/docs/current/static/plpgsql-declarations.html
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro HORIGUCHI 2014-06-13 07:41:33 Use unique index for longer pathkeys.
Previous Message Pavel Stehule 2014-06-13 07:39:30 Re: PL/pgSQL support to define multi variables once