Re: Problem with compiling extensions with Postgres Version 13 - Mailing list pgsql-general

From Laurenz Albe
Subject Re: Problem with compiling extensions with Postgres Version 13
Date
Msg-id d69a30f15c5f23e3e154b52cf25224aa00bdcf85.camel@cybertec.at
Whole thread Raw
In response to Problem with compiling extensions with Postgres Version 13  (Eric Svenson <esvenson74@googlemail.com>)
List pgsql-general
On Wed, 2020-11-18 at 14:46 +0100, Eric Svenson wrote:
> I am not really sure if I am in the right mailing list, but I try it here first.
> 
> I have written a postgres C extension as DLL which was used with Postgres 9.2 successfully.
> 
> Now I am trying to upgrade to Postgres 13 but I ran into a compile problem.
> 
> The function
> 
> PG_GETARG_BYTEA_P 
> 
> causes the compile error
> 
> error LNK2019: unresolved external symbol _pg_detoast_datum referenced in function _compressBytea
> 
> The Compiler is
> Microsoft Visual Studio 2010 
> Windows 10
> 
> Any idea what to do? Is PG_GETARG_BYTEA_P obsolete?

In PostgreSQL v13, "PG_GETARG_BYTEA_P(n)" is a macro that resolves to
"((bytea *) pg_detoast_datum((struct varlena *) DatumGetPointer(fcinfo->args[n].value)))".

This has not changed since 9.2, as far as I can tell.

The underscore in front of the function name is relevant: perhaps you compile your function
using a different "calling convention" than was used to build PostgreSQL?

Sorry, but I am not a Windows expert.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com




pgsql-general by date:

Previous
From: Snjezana Frketic
Date:
Subject: Re: How to select values in a JSON type of column?
Next
From: Ron
Date:
Subject: Re: psql backward compatibility