Re: hash_create(): check return code

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: hash_create(): check return code
Date: 2004-10-24 14:25:59
Message-ID: 8344.1098627959@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Neil Conway <neilc(at)samurai(dot)com> writes:
> There was one case in pgstat.c where I had to wrap the hash_create()
> call in a PG_TRY() block to ensure a file handle is closed (this code
> might be invoked by a regular backend it appears, so elog(ERROR) won't
> necessarily close the file handle).

A better solution is to use AllocateFile/FreeFile; I'm not 100%
certain that that works in the pgstat context, but I think it should.

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Magnus Hagander 2004-10-24 14:51:20 initdb conf-files linebreaks
Previous Message Neil Conway 2004-10-24 08:27:20 Re: hash_create(): check return code