Re: Re: [COMMITTERS] pgsql: Update autovacuum to use reloptions instead of a system catalog, - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Re: [COMMITTERS] pgsql: Update autovacuum to use reloptions instead of a system catalog,
Date
Msg-id 13851.1234383456@sss.pgh.pa.us
Whole thread Raw
In response to Re: Re: [COMMITTERS] pgsql: Update autovacuum to use reloptions instead of a system catalog,  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: Re: [COMMITTERS] pgsql: Update autovacuum to use reloptions instead of a system catalog,
List pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Tom Lane wrote:
>> I tend to think this isn't a very good idea.  It's difficult for
>> applications to know whether a toast table will be created or not.
>> They should be able to just set the toast options and not worry.

> The problem is where do we store the options?

We don't.  If there's no toast table, we don't need them after all.

Now the alternative position you could take is that if someone is
setting toast reloptions, they should darn well know the implementation
well enough to know whether the table will have a toast table or not.
In which case you should argue that this case ought to be an ERROR,
not a notice or warning.  But I think that's probably unsustainably
anal.  For example consider the following scenario:
create table foo (f1 int, f2 text);set some toast reloptions on fooalter table foo drop column f2;
pg_dump

At this point foo still has a toast table and presumably pg_dump will
dump its options.  At reload, however, no toast table will be created,
and so throwing an error would be pretty embarrassing.

It's not hard to scale this up to find situations where the creation
of a toast table would be platform- or version-dependent (if the max
tuple width is just under a page).

If we are not able to teach pg_dump to predict whether the target
DB will create a toast table, we certainly can't expect applications
to know it.  So I think setting toast reloptions on a table that has
no toast table should just be a silent no-op.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: 64 bit PostgreSQL 8.3.6 build on AIX 5300-09-02-0849 with IBM XL C/C++ 10.1.0.1 - initdb fails (could not dump unrecognized node type: 650)
Next
From: Alvaro Herrera
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Update autovacuum to use reloptions instead of a system catalog,