Re: Lock partitions - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Lock partitions
Date
Msg-id 2141.1158261828@sss.pgh.pa.us
Whole thread Raw
In response to Re: Lock partitions  (Mark Wong <markw@osdl.org>)
Responses Re: Lock partitions  (Mark Wong <markw@osdl.org>)
List pgsql-hackers
Mark Wong <markw@osdl.org> writes:
> Oops!  'autoreconf --install' is what I run to generate all that stuff. 

Ah, better.  I see at least part of the problem:

CREATE OR REPLACE FUNCTION stock_level (INTEGER, INTEGER, INTEGER) RETURNS INTEGER AS
'/home/tgl/dbt2/storedproc/pgsql/c/../../../storedproc/pgsql/c/funcs'LANGUAGE C STRICT;
 
psql:/home/tgl/dbt2/scripts/pgsql/../../storedproc/pgsql/c/stock_level.sql:7: ERROR:  incompatible library
"/home/tgl/dbt2/storedproc/pgsql/c/../../../storedproc/pgsql/c/funcs.so":missing magic block
 
HINT:  Extension libraries are now required to use the PG_MODULE_MAGIC macro.

You need to add something like this to funcs.c:
 #include <executor/spi.h> /* this should include most necessary APIs */ #include <executor/executor.h>  /* for
GetAttributeByName()*/ #include <funcapi.h> /* for returning set of rows in order_status */
 
+ 
+ #ifdef PG_MODULE_MAGIC
+ PG_MODULE_MAGIC;
+ #endif  /* #define DEBUG

With that change, I didn't see run_workload report any errors, but maybe
I don't know where to look.  I'm not sure how this bug could have led to
a "type not registered" error ... the query should've just failed outright.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: New version of money type
Next
From: Bruce Momjian
Date:
Subject: Re: XML support wiki page