Re: [PATCHES] too many variants of relation_open

2007-09-28 Thread Heikki Linnakangas
Jaime Casanova wrote:
 I can understand why we have relation_openrv and try_relation_open,
 but relation_open_nowait can be merged with relation_open.

Well, yes it could, but why? Keeping them separate looks slightly more
readable to me, and the change could break a lot of external modules for
no good reason.

-- 
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate


Re: [PATCHES] too many variants of relation_open

2007-09-28 Thread Neil Conway
On Fri, 2007-09-28 at 10:02 +0100, Heikki Linnakangas wrote:
 Well, yes it could, but why? Keeping them separate looks slightly more
 readable to me, and the change could break a lot of external modules for
 no good reason.

I agree: it also complicates the common case (calling relation_open()
and waiting to acquire for a lock).

If anything, you could perhaps refactor relation_open_nowait() to be
implemented in terms of relation_open() (first try to get the lock, then
do a relation_open(rel, NoLock)), but since you'd only be saving a
handful of duplicated lines, it hardly seems worth it.

-Neil



---(end of broadcast)---
TIP 6: explain analyze is your friend