pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Eric Svenson <esvenson74@googlemail.com>
To: pgsql-general@postgresql.org
Subject: Re: Problem with compiling extensions with Postgres Version 13
Date: Wed, 18 Nov 2020 18:01:49 +0100
Message-ID: <d69a30f15c5f23e3e154b52cf25224aa00bdcf85.camel@cybertec.at> (raw)
In-Reply-To: <CABhsftjkg_qG_cW+Ebav3CExojCCgaiq0AwEK+qgBkeYAUsW2g@mail.gmail.com>
References: <CABhsftjkg_qG_cW+Ebav3CExojCCgaiq0AwEK+qgBkeYAUsW2g@mail.gmail.com>

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






view thread (2+ messages)

Message-ID: <d69a30f15c5f23e3e154b52cf25224aa00bdcf85.camel@cybertec.at>
Permalink:  ../d69a30f15c5f23e3e154b52cf25224aa00bdcf85.camel@cybertec.at/
Also on:    postgresql.org/message-id/d69a30f15c5f23e3e154b52cf25224aa00bdcf85.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, esvenson74@googlemail.com
  Subject: Re: Problem with compiling extensions with Postgres Version 13
  In-Reply-To: <d69a30f15c5f23e3e154b52cf25224aa00bdcf85.camel@cybertec.at>
  References: <CABhsftjkg_qG_cW+Ebav3CExojCCgaiq0AwEK+qgBkeYAUsW2g@mail.gmail.com> <d69a30f15c5f23e3e154b52cf25224aa00bdcf85.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox