Re: Partitioning option for COPY - Mailing list pgsql-hackers

From Emmanuel Cecchet
Subject Re: Partitioning option for COPY
Date
Msg-id 4B02CD17.1000907@asterdata.com
Whole thread Raw
In response to Re: Partitioning option for COPY  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Partitioning option for COPY  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Emmanuel Cecchet <manu@asterdata.com> writes:
>   
>> Actually the list is supposed to stay around between statement 
>> executions. You don't want to restart with a cold cache at every 
>> statement so I really want this structure to stay in memory at a more 
>> global level.
>>     
>
> Cache?  Why do you need a cache for COPY?  Repeated bulk loads into the
> same table within a single session doesn't seem to me to be a case that
> is common enough to justify a cache.
>   
Actually the cache is only activated if you use the partitioning option. 
It is just a list of oids of child tables where tuples were inserted.
It is common to have multiple COPY operations in the same session when 
you are doing bulk loading in a warehouse.
> (BTW, the quoted code seems to be busily reinventing OID Lists.  Don't
> do that.)
>   
Yes, I understood that I should use an OidList instead. But I was trying 
to understand what I did wrong here (besides reinventing the oid list ;-)).
Why do I get this segfault if I use memory from CacheMemoryContext?

Emmanuel

-- 
Emmanuel Cecchet
Aster Data
Web: http://www.asterdata.com



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Timezones (in 8.5?)
Next
From: Sergey Konoplev
Date:
Subject: Re: Unpredictable shark slowdown after migrating to 8.4