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

Поиск
Список
Период
Сортировка
От Decibel!
Тема Re: dblink un-named connection doesn't get re-used
Дата
Msg-id 2F3E1077-A583-4C3A-899C-1E40C2951EA3@decibel.org
обсуждение исходный текст
Ответ на Re: dblink un-named connection doesn't get re-used  (Joe Conway <mail@joeconway.com>)
Ответы Re: dblink un-named connection doesn't get re-used  (Joe Conway <mail@joeconway.com>)
Список pgsql-hackers
On Oct 18, 2007, at 11:17 PM, Joe Conway wrote:
> Decibel! wrote:
>> Is it intentional that dblink's unnamed connections don't get re- 
>> used?
>
> yes
>
>> stats=# select dblink_connect('dbname=stats');
>> dblink_connect
>> ----------------
>> OK
>> (1 row)
>> stats=# select dblink_connect('dbname=postgres');
>> dblink_connect
>> ----------------
>> OK
>> (1 row)
>
>> 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?
>
> Why doesn't C free allocated memory automatically if you reassign a  
> pointer?
>
> No one has ever complained before, so I can't imagine that the  
> resource leak is much of an issue in real world cases. But if you  
> don't like the behavior, patches are gratefully accepted ;-).
>
> Seriously though, I can change it for 8.3, but is it really worth  
> back-patching?

I think it'd be worth changing for 8.3. While C forces you to worry  
about memory, SQL does not, so I bet this is a surprise to most folks.

It might be worth backpatching the docs, because they're wrong.
-- 
Decibel!, aka Jim C. Nasby, Database Architect  decibel@decibel.org
Give your computer some brain candy! www.distributed.net Team #1828




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: ts_rewrite aggregate API seems mighty ugly
Следующее
От: Joe Conway
Дата:
Сообщение: Re: dblink un-named connection doesn't get re-used