Re: dblink un-named connection doesn't get re-used

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: "Decibel!" <decibel(at)decibel(dot)org>
Cc: PostgreSQL-development list <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: dblink un-named connection doesn't get re-used
Date: 2007-11-05 17:13:14
Message-ID: 200711051713.lA5HDEk25137@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


This has been saved for the 8.4 release:

http://momjian.postgresql.org/cgi-bin/pgpatches_hold

---------------------------------------------------------------------------

Decibel! wrote:
> Is it intentional that dblink's unnamed connections don't get re-used?
>
> stats=# select datname, usename from pg_stat_activity;
> datname | usename
> ---------+---------
> stats | decibel
> (1 row)
>
> stats=# select dblink_connect('dbname=stats');
> dblink_connect
> ----------------
> OK
> (1 row)
>
> stats=# select dblink_connect('dbname=postgres');
> dblink_connect
> ----------------
> OK
> (1 row)
>
> stats=# select datname, usename from pg_stat_activity;
> datname | usename
> ----------+----------
> stats | decibel
> stats | postgres
> postgres | postgres
> (3 rows)
>
> AFAIK there's no way I could possibly use or refer to the connection
> to stats at this point; so why doesn't dblink close it when I issue
> the second connect?
> --
> Decibel!, aka Jim C. Nasby, Database Architect decibel(at)decibel(dot)org
> Give your computer some brain candy! www.distributed.net Team #1828
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2007-11-05 17:31:37 Re: A small rant about coding style for backend functions
Previous Message Tom Lane 2007-11-05 17:08:48 Re: pg_ctl configurable timeout