Re: Add dblink function to check if a named connection exists

From: Tommy Gildseth <tommy(dot)gildseth(at)usit(dot)uio(dot)no>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Add dblink function to check if a named connection exists
Date: 2008-06-02 17:44:12
Message-ID: 4844316C.8050401@usit.uio.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Joe Conway wrote:

>
> If you really want the notational simplicity, you could use an SQL
> function to wrap it:
>
> CREATE OR REPLACE FUNCTION dblink_exists(text)
> RETURNS bool AS $$
> SELECT $1 = ANY (dblink_get_connections())
> $$ LANGUAGE sql;

Thanks, that seems like a reasonable way to solve this.

--
Tommy Gildseth

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2008-06-02 17:55:16 Re: Case-Insensitve Text Comparison
Previous Message Hannu Krosing 2008-06-02 17:37:59 Re: Core team statement on replication in PostgreSQL