Re: Error when defining a set returning function - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Error when defining a set returning function
Date
Msg-id 4094099.1618583375@sss.pgh.pa.us
Whole thread Raw
In response to Error when defining a set returning function  (Esteban Zimanyi <ezimanyi@ulb.ac.be>)
Responses Re: Error when defining a set returning function  (Esteban Zimanyi <ezimanyi@ulb.ac.be>)
List pgsql-hackers
Esteban Zimanyi <ezimanyi@ulb.ac.be> writes:
> Since I was receiving an error when defining a set returning function, I
> borrowed a function from PostgreSQL as follows
> ...
> When I execute this function I obtain

> select testSRF(1,10, 2);
> ERROR:  unrecognized table-function returnMode: 257

Hmm, I compiled this function up and it works for me:

regression=# select testSRF(1,10, 2);
 testsrf 
----------
        1
        3
        5
        7
(4 rows)

I think your "quick opt-out" code is a bit broken, because it fails to
restore the current memory context; but there's nothing wrong with the
main code path.

Hence, the problem is somewhere else.  The first theory that comes
to mind is that you're compiling against Postgres headers that
don't match the server version you're actually loading the code
into.  In theory the PG_MODULE_MAGIC infrastructure ought to catch
that, but maybe you've found some creative way to fool that :-(.
One way maybe would be if the headers were from some pre-release
v13 version that wasn't ABI-compatible with 13.0.

Or it could be something else, but I'd counsel looking for build
process mistakes, cause this C code isn't the problem.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: fix old confusing JSON example
Next
From: Justin Pryzby
Date:
Subject: default_tablespace doc and partitioned rels