Re: [PATCHES] trivial fix in fd.c

2006-05-30 Thread Bruce Momjian

Patch applied.  Thanks.

---


Qingqing Zhou wrote:
> Fix a format warning in fd.c when FDDEBUG is on.
> 
> By the way (to save a thread): What's the rationale of designing resowner
> APIs like this:
> 
> ResourceOwnerEnlargeABC();
> ResourceOwnerRememberABC();
> 
> Is that because sometimes we don't allow any elog in
> ResourceOwnerRememberABC()?
> 
> Regards,
> Qingqing
> 
> 
> Index: fd.c
> ===
> RCS file: /projects/cvsroot/pgsql/src/backend/storage/file/fd.c,v
> retrieving revision 1.127
> diff -c -r1.127 fd.c
> *** fd.c5 Mar 2006 15:58:37 -   1.127
> --- fd.c22 May 2006 08:00:42 -
> ***
> *** 649,655 
> Index   i;
> Filefile;
> 
> !   DO_DB(elog(LOG, "AllocateVfd. Size %d", SizeVfdCache));
> 
> Assert(SizeVfdCache > 0);   /* InitFileAccess not called? */
> 
> --- 649,655 
> Index   i;
> Filefile;
> 
> !   DO_DB(elog(LOG, "AllocateVfd. Size %lu", SizeVfdCache));
> 
> Assert(SizeVfdCache > 0);   /* InitFileAccess not called? */
> 
> 
> 
> 
> ---(end of broadcast)---
> TIP 4: Have you searched our list archives?
> 
>http://archives.postgresql.org
> 

-- 
  Bruce Momjian   http://candle.pha.pa.us
  EnterpriseDBhttp://www.enterprisedb.com

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

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [PATCHES] trivial fix in fd.c

2006-05-22 Thread Tom Lane
"Qingqing Zhou" <[EMAIL PROTECTED]> writes:
> What's the rationale of designing resowner
> APIs like this:

> ResourceOwnerEnlargeABC();
> ResourceOwnerRememberABC();

> Is that because sometimes we don't allow any elog in
> ResourceOwnerRememberABC()?

Yeah.  In a number of cases, ResourceOwnerRememberABC is done after
inserting the resource into some data structure, and an elog there
would leave the data structure in an inconsistent state.  Conversely,
we might fail to insert the resource into the other data structure,
so just inserting it into the resowner first isn't better.

regards, tom lane

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


[PATCHES] trivial fix in fd.c

2006-05-22 Thread Qingqing Zhou
Fix a format warning in fd.c when FDDEBUG is on.

By the way (to save a thread): What's the rationale of designing resowner
APIs like this:

ResourceOwnerEnlargeABC();
ResourceOwnerRememberABC();

Is that because sometimes we don't allow any elog in
ResourceOwnerRememberABC()?

Regards,
Qingqing


Index: fd.c
===
RCS file: /projects/cvsroot/pgsql/src/backend/storage/file/fd.c,v
retrieving revision 1.127
diff -c -r1.127 fd.c
*** fd.c5 Mar 2006 15:58:37 -   1.127
--- fd.c22 May 2006 08:00:42 -
***
*** 649,655 
Index   i;
Filefile;

!   DO_DB(elog(LOG, "AllocateVfd. Size %d", SizeVfdCache));

Assert(SizeVfdCache > 0);   /* InitFileAccess not called? */

--- 649,655 
Index   i;
Filefile;

!   DO_DB(elog(LOG, "AllocateVfd. Size %lu", SizeVfdCache));

Assert(SizeVfdCache > 0);   /* InitFileAccess not called? */




---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org