Re: Not valid dump [8.2.9, 8.3.1]

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Gaetano Mendola <mendola(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Patrizia Grasso - Eutelsat <pgrasso(at)mbigroup(dot)it>
Subject: Re: Not valid dump [8.2.9, 8.3.1]
Date: 2008-06-21 16:05:55
Message-ID: 485D26E3.80505@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> "Gaetano Mendola" <mendola(at)gmail(dot)com> writes:
>
>> On Fri, Jun 20, 2008 at 4:37 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> (Of course you realize that referencing any table at all in an
>>
>>> "immutable" function is probably a mortal sin...)
>>>
>
>
>> Yes Tom I know, in our case that table is a lookup table, noone update,
>> delete, insert data in it, so from my point of view it is like I have
>> declared a static array inside the function declaration.
>>
>
> No, you'd like to imagine that it is a static array, but that technique
> is just a foot-gun waiting to bite you. As an example, since pg_dump
> has no idea that that function has any dependency on the lookup table,
> there is nothing to stop it from trying to create the index before it's
> populated the lookup table.
>
> (I think it probably works for you at the moment because pg_dump tends
> to fill all the tables before creating any indexes, but the planned
> changes to support multi-threaded restores will certainly break your
> case.)
>
>
>

Purely static lookup tables can also often be replaced by enum types,
often with significant efficiency gains.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2008-06-21 22:34:47 Re: Hash index build patch has *worse* performance at small table sizes
Previous Message Tom Lane 2008-06-21 15:31:07 Re: Not valid dump [8.2.9, 8.3.1]