Skip site navigation (1) Skip section navigation (2)

[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 (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-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.

Responses

pgsql-hackers by date

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

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group