[PATCH] Round 2: Magic block for modules

Lists: pgsql-patches
From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: pgsql-patches(at)postgresql(dot)org
Subject: [PATCH] Round 2: Magic block for modules
Date: 2006-05-08 18:03:12
Message-ID: 20060508180312.GA20672@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Per feedback, here is an updated version. As was pointed out, the prior
version was checking stuff that either changed too often to be useful
or was never going to change at all. The error reporting is cleaned up
too, it now releases the module before throwing the error. It now only
checks four things:

Major version number (7.4 or 8.1 for example)
NAMEDATALEN
FUNC_MAX_ARGS
INDEX_MAX_KEYS

The three constants were chosen because:

1. We document them in the config page in the docs
2. We mark them as changable in pg_config_manual.h
3. Changing any of these will break some of the more popular modules:

FUNC_MAX_ARGS changes fmgr interface, every module uses this
NAMEDATALEN changes syscache interface, every PL as well as tsearch uses this
INDEX_MAX_KEYS breaks tsearch and anything using GiST.

I considered others but ultimatly rejected them. For example,
HAVE_INT64_TIMESTAMP, while changing the way timestamps are stored and
being configurable by a configure option, doesn't actually break
anything important (only the btree_gist example in contrib).

Any more comments?

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment Content-Type Size
magic2.diff text/plain 8.6 KB

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: [PATCH] Round 2: Magic block for modules
Date: 2006-05-30 14:09:31
Message-ID: 200605301409.k4UE9Vw17939@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


Patch applied. Thanks.

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

Martijn van Oosterhout wrote:
-- Start of PGP signed section.
> Per feedback, here is an updated version. As was pointed out, the prior
> version was checking stuff that either changed too often to be useful
> or was never going to change at all. The error reporting is cleaned up
> too, it now releases the module before throwing the error. It now only
> checks four things:
>
> Major version number (7.4 or 8.1 for example)
> NAMEDATALEN
> FUNC_MAX_ARGS
> INDEX_MAX_KEYS
>
> The three constants were chosen because:
>
> 1. We document them in the config page in the docs
> 2. We mark them as changable in pg_config_manual.h
> 3. Changing any of these will break some of the more popular modules:
>
> FUNC_MAX_ARGS changes fmgr interface, every module uses this
> NAMEDATALEN changes syscache interface, every PL as well as tsearch uses this
> INDEX_MAX_KEYS breaks tsearch and anything using GiST.
>
> I considered others but ultimatly rejected them. For example,
> HAVE_INT64_TIMESTAMP, while changing the way timestamps are stored and
> being configurable by a configure option, doesn't actually break
> anything important (only the btree_gist example in contrib).
>
> Any more comments?
>
> Have a nice day,
> --
> Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> > From each according to his ability. To each according to his ability to litigate.

[ Attachment, skipping... ]
-- End of PGP section, PGP failed!

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

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


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-patches(at)postgresql(dot)org
Subject: Re: [PATCH] Round 2: Magic block for modules
Date: 2006-05-30 20:14:09
Message-ID: 17221.1149020049@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> Patch applied. Thanks.

I hadn't gotten around to reviewing the revised version. Just to let
you know, I'm going to remove the separate header file pgmagic.h and
put the macro into fmgr.h as I'd suggested originally. The reason is
that the separate file turns the problem of making backward-compatible
modules from a simple "#ifdef PG_MAGIC_BLOCK" into a big does-that-
header-exist autoconf pushup. It's not worth that.

regards, tom lane


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-patches(at)postgresql(dot)org
Subject: Re: [PATCH] Round 2: Magic block for modules
Date: 2006-05-30 20:19:59
Message-ID: 447CA8EF.4030608@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
>
>> Patch applied. Thanks.
>>
>
> I hadn't gotten around to reviewing the revised version.

Is it just me or is this happening a lot lately?

cheers

andrew


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-patches(at)postgresql(dot)org
Subject: Re: [PATCH] Round 2: Magic block for modules
Date: 2006-05-30 20:22:24
Message-ID: 17319.1149020544@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> Tom Lane wrote:
>> I hadn't gotten around to reviewing the revised version.

> Is it just me or is this happening a lot lately?

That security stuff took up a *lot* of time behind the scenes :-(

Normality is returning, slowly.

regards, tom lane