Re: PL/SQL & unset custom variable

From: Gordon Ross <gr306(at)ucs(dot)cam(dot)ac(dot)uk>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: PL/SQL & unset custom variable
Date: 2009-09-02 14:56:59
Message-ID: C6C4464B.9E9C%gr306@staff-ad.csi.cam.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 02/09/2009 15:39, "Andreas Kretschmer" <akretschmer(at)spamfence(dot)net> wrote:
> Gordon Ross <gr306(at)ucs(dot)cam(dot)ac(dot)uk> wrote:
>> Is there a way to either test if the custom variable is set, or to specify a
>> global default for the custom variable ?
>
> I think, you can use COALESCE(your_variable, default_value) to solve
> that problem. Try it, it is untested.

Sorry, no joy :-(

grails=> SELECT current_setting('phone.id');
ERROR: unrecognized configuration parameter "phone.id"

grails=> SELECT coalesce(current_setting('phone.id'),'SYSTEM');
ERROR: unrecognized configuration parameter "phone.id"

GTG

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sam Mason 2009-09-02 15:01:21 Re: Join efficiency
Previous Message Himanshu Gupta 2009-09-02 14:52:07 Re: how to use multiple schema's