Re: Problem reloading regression database - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Problem reloading regression database
Date
Msg-id 200201250114.g0P1End23598@candle.pha.pa.us
Whole thread Raw
In response to Re: Problem reloading regression database  (Brent Verner <brent@rcfile.org>)
List pgsql-hackers
This has been saved for the 7.3 release:
http://candle.pha.pa.us/cgi-bin/pgpatches2

---------------------------------------------------------------------------

Brent Verner wrote:
> [2002-01-14 21:52] Tom Lane said:
> | Brent Verner <brent@rcfile.org> writes:
> | > gotcha.  No, I don't think anything inside that loop expects to 
> | > persist across iterations.  The attribute_buf is static to the
> | > file, and initialized in DoCopy.
> | 
> | There is more to attribute_buf than meets the eye ;-)
> | 
> | > What I ended up doing is switching to per-tuple-context prior to 
> | > the input loop, then switching back to the (saved) query-context
> | > after exiting the loop.  I followed ResetTupleExprContext back, and
> | > it doesn't seem to do anything that would require a switch per loop.
> | > Are there any problems this might cause that I'm not seeing  with 
> | > my test case?
> | 
> | I really don't feel comfortable with running heap_insert or the
> | subsequent operations in a per-tuple context.  Have you tried any
> | test cases that involve triggers or indexes?
> 
> Yes.  The attached patch appears to do the right thing with all 
> indexes and triggers (RI) that I've tested.  I'm still doing the
> MemoryContextSwitchTo() outside the main loop, and have added some 
> more sanity checking for column name input.
> 
> If anyone could test this (with non-critical data ;-) or otherwise 
> give feedback, I'd appreciate it; especially if someone could test
> with a BEFORE INSERT trigger.
> 
> cheers.
>   brent
> 
> -- 
> "Develop your talent, man, and leave the world something. Records are 
> really gifts from people. To think that an artist would love you enough
> to share his music with anyone is a beautiful thing."  -- Duane Allman

[ Attachment, skipping... ]

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: PostgreSQL crashes with Qmail-SQL
Next
From: Tom Lane
Date:
Subject: Re: PostgreSQL crashes with Qmail-SQL