[PATCH] Magic block for modules

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: pgsql-patches(at)postgresql(dot)org
Subject: [PATCH] Magic block for modules
Date: 2006-05-07 21:17:05
Message-ID: 20060507211705.GB3808@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

This implements a proposal made last november:

http://archives.postgresql.org/pgsql-hackers/2005-11/msg00578.php

Basically, it tries to catch people loading modules which belong to the
wrong version or have had certain constants changed, or architechture
mismatches. It's a bit more fine grained though, it currently catches
changes in any of the following:

PG_VERSION_NUM
CATALOG_VERSION_NO
the size of 8 basic C types
BLCKSZ
NAMEDATALEN
HAVE_INT64_TIMESTAMP
INDEX_MAX_KEYS
FUNC_MAX_ARGS
VARHDRSZ
MAXDIM
The compiler used (only brand, not version)

It may be overkill, but better safe than sorry. The only one I'm
ambivalent about is the first one. We don't require a recompile between
minor version changes, or do we?

All it requires is to include the header "pgmagic.h" and to put
somewhere in their source:

PG_MODULE_MAGIC

Currently, modules without a magic block are merely logged at LOG
level. This needs some discussion though.

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 10.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-05-08 00:21:43 Re: [PATCH] Magic block for modules
Previous Message Thomas Hallgren 2006-05-07 20:48:22 Re: Fwd: [pgsql-hackers-win32] Build with Visual Studio & MSVC

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2006-05-08 00:11:17 Re: Page at a time index scan
Previous Message Sven Suursoho 2006-05-07 17:44:41 Re: plpython improvements