pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Problem with compiling extensions with Postgres Version 13
2+ messages / 2 participants
[nested] [flat]

* Problem with compiling extensions with Postgres Version 13
@ 2020-11-18 13:46 Eric Svenson <esvenson74@googlemail.com>
  2020-11-18 17:01 ` Re: Problem with compiling extensions with Postgres Version 13 Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 1 reply; 2+ messages in thread

From: Eric Svenson @ 2020-11-18 13:46 UTC (permalink / raw)
  To: pgsql-general

Hello,

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?

Best regards,
Eric

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Problem with compiling extensions with Postgres Version 13
  2020-11-18 13:46 Problem with compiling extensions with Postgres Version 13 Eric Svenson <esvenson74@googlemail.com>
@ 2020-11-18 17:01 ` Laurenz Albe <laurenz.albe@cybertec.at>
  0 siblings, 0 replies; 2+ messages in thread

From: Laurenz Albe @ 2020-11-18 17:01 UTC (permalink / raw)
  To: Eric Svenson <esvenson74@googlemail.com>; 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






^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2020-11-18 17:01 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-11-18 13:46 Problem with compiling extensions with Postgres Version 13 Eric Svenson <esvenson74@googlemail.com>
2020-11-18 17:01 ` Laurenz Albe <laurenz.albe@cybertec.at>

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