Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kfQqF-0000cG-I4 for pgsql-general@arkaria.postgresql.org; Wed, 18 Nov 2020 17:01:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kfQqE-0005rP-FE for pgsql-general@arkaria.postgresql.org; Wed, 18 Nov 2020 17:01:58 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kfQqE-0005rH-5d for pgsql-general@lists.postgresql.org; Wed, 18 Nov 2020 17:01:58 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kfQq9-0002rg-36 for pgsql-general@postgresql.org; Wed, 18 Nov 2020 17:01:56 +0000 Received: by mail-wr1-x436.google.com with SMTP id d12so2847219wrr.13 for ; Wed, 18 Nov 2020 09:01:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=f/UbxZ0dIC0ScLJjtPdqufXGNFQqD8X4OOhh1SSOQOI=; b=eDF66DJU62G7frZVOnyhmIC16XWSCoIvGgJXhVKLJOcN4M7/E+khdoMFlNbm1900dg lHaX1LpdqF9PvhPpQ6vdHPGMlyey0JQYk3k2OXe7kwsN4G8S7EisURBbO7F3xoQ5Hgs2 qgbTZQ4lL7zLBxsXISznB191EQGTNu5PP0R/zZiV2EUm3Mpjlznzj7LE/SPGe5GFlv5V jgohAYy2g/d4Eayms42bWxGE+XPI029peW9SrPr/A4gBvEVmj2PdkhTB+9bU3voMDsqm yOjxJNkr2/yp9SmwY8bkyRdVhjF2uekym8/zeTOHW2yHVjMe2hLWSCuxnS2e1q87ky8S NHRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=f/UbxZ0dIC0ScLJjtPdqufXGNFQqD8X4OOhh1SSOQOI=; b=dwlhTWt81hjqInZlBPghPcNciOAOMYkqsuvL7w9jeOXzuJ9lemZLToVzcUbhWCGvtg B+CvubL/EIjSEFHaZ0+Kw+a8yk8dIQR1TA5RtQ3x3a0KGb7rqfSUNCNs43ELaKs6jDEo k5rLTCQL7pTLq9eueU6MMOfuVYlJtsO0zxoGRgiPfqhbAvCNPgZsipEWDhULJ6rKoy+l PzT4ZA7GoTpyAqQ+IjWaDCvY+cs2yVPNC3lQp2mK0xFYCo9OevqWYpwail8cIuSzM9aE xwy+UKum7Lp/IhDWgv+LBiLsq1Y8iVaa1qvVGZfBPOLnfZNj9KtTXNCmWhqPQ61aX8HD 8YCQ== X-Gm-Message-State: AOAM531hM6ahgouOdkyLJEerMNt90aaktBvMLoQkPh0Pk3RUra2bnI+r xxUX/Rab+DZVE1SCRM8i7h8yGg== X-Google-Smtp-Source: ABdhPJxqchDe7x7OTU6X35LBiVAjHhdpFJP5zba2l60si8BOoVQVqu2GVA2jR3hLlNEZJUb5/BspCg== X-Received: by 2002:adf:c803:: with SMTP id d3mr5758310wrh.108.1605718910813; Wed, 18 Nov 2020 09:01:50 -0800 (PST) Received: from localhost.localdomain (217-149-169-56.nat.highway.telekom.at. [217.149.169.56]) by smtp.gmail.com with ESMTPSA id y203sm5579542wmg.9.2020.11.18.09.01.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Nov 2020 09:01:50 -0800 (PST) Message-ID: Subject: Re: Problem with compiling extensions with Postgres Version 13 From: Laurenz Albe To: Eric Svenson , pgsql-general@postgresql.org Date: Wed, 18 Nov 2020 18:01:49 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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