Thread: Exporting float_to_shortest_decimal_buf(n) with Postgres 17 on Windows

Exporting float_to_shortest_decimal_buf(n) with Postgres 17 on Windows

From
Andrew Kane
Date:
Hi,

With Postgres 17 RC1 on Windows, `float_to_shortest_decimal_buf` and `float_to_shortest_decimal_bufn` are not longer exported. This causes `unresolved external symbol` linking errors for extensions that rely on these functions (like pgvector). Can these functions be exported like previous versions of Postgres?

Thanks,
Andrew
Andrew Kane <andrew@ankane.org> writes:
> With Postgres 17 RC1 on Windows, `float_to_shortest_decimal_buf` and
> `float_to_shortest_decimal_bufn` are not longer exported. This causes
> `unresolved external symbol` linking errors for extensions that rely on
> these functions (like pgvector). Can these functions be exported like
> previous versions of Postgres?

AFAICS it's in the exact same place it was in earlier versions.
You might need to review your linking commands.

            regards, tom lane



Re: Exporting float_to_shortest_decimal_buf(n) with Postgres 17 on Windows

From
Florents Tselai
Date:

> On 13 Sep 2024, at 11:07 PM, Andrew Kane <andrew@ankane.org> wrote:
>
> Hi,
>
> With Postgres 17 RC1 on Windows, `float_to_shortest_decimal_buf` and `float_to_shortest_decimal_bufn` are not longer
exported.This causes `unresolved external symbol` linking errors for extensions that rely on these functions (like
pgvector).Can these functions be exported like previous versions of Postgres? 

Probably a Windows thing?
Just tried on Darwin with 17_RC1, and pgvector 0.7.4 build installcheck’s OK.


>
> Thanks,
> Andrew




Re: Exporting float_to_shortest_decimal_buf(n) with Postgres 17 on Windows

From
Nathan Bossart
Date:
On Fri, Sep 13, 2024 at 04:58:20PM -0400, Tom Lane wrote:
> Andrew Kane <andrew@ankane.org> writes:
>> With Postgres 17 RC1 on Windows, `float_to_shortest_decimal_buf` and
>> `float_to_shortest_decimal_bufn` are not longer exported. This causes
>> `unresolved external symbol` linking errors for extensions that rely on
>> these functions (like pgvector). Can these functions be exported like
>> previous versions of Postgres?
> 
> AFAICS it's in the exact same place it was in earlier versions.
> You might need to review your linking commands.

I do see a fair amount of special handling for f2s.c in the build files.  I
wonder if something got broken for Windows in the switch from the MSVC
scripts to meson.

-- 
nathan



> Probably a Windows thing?

Correct, it's only on Windows.

> I do see a fair amount of special handling for f2s.c in the build files.  I
wonder if something got broken for Windows in the switch from the MSVC
scripts to meson.

This was my hunch as well since none of the source files changed. Also, neither function is present with `dumpbin /EXPORTS /SYMBOLS lib\postgres.lib`, which led me to believe it may need to be addressed upstream.

- Andrew

On Fri, Sep 13, 2024 at 2:41 PM Nathan Bossart <nathandbossart@gmail.com> wrote:
On Fri, Sep 13, 2024 at 04:58:20PM -0400, Tom Lane wrote:
> Andrew Kane <andrew@ankane.org> writes:
>> With Postgres 17 RC1 on Windows, `float_to_shortest_decimal_buf` and
>> `float_to_shortest_decimal_bufn` are not longer exported. This causes
>> `unresolved external symbol` linking errors for extensions that rely on
>> these functions (like pgvector). Can these functions be exported like
>> previous versions of Postgres?
>
> AFAICS it's in the exact same place it was in earlier versions.
> You might need to review your linking commands.

I do see a fair amount of special handling for f2s.c in the build files.  I
wonder if something got broken for Windows in the switch from the MSVC
scripts to meson.

--
nathan