Skip site navigation (1) Skip section navigation (2)

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-22 06:13:59
Message-ID: 3621.1098425639@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
Neil Conway <neilc(at)samurai(dot)com> writes:
> I'm not really sure whether this is the correct fix, but it certainly
> seems wrong to be doing the check in some places and not in others.
> Another approach would be to elog(ERROR) when an error occurs in
> hash_create(), which would be fine except there might be some
> circumstances in which hash_create() is invoked but elog(ERROR) is not
> setup yet.

There are no places where hash_create is called before elog() is
functional.  I'd go for putting the error into hash_create, I think,
because I can't imagine any caller not wanting to error out.  (If
there is any such caller, it can always catch it with PG_TRY.)

			regards, tom lane

In response to

Responses

pgsql-patches by date

Next:From: Neil ConwayDate: 2004-10-22 06:55:27
Subject: Re: hash_create(): check return code
Previous:From: Neil ConwayDate: 2004-10-22 06:02:31
Subject: code cleanup in dynahash.c

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group