From: | Andres Freund <andres(at)anarazel(dot)de> |
---|---|
To: | Robert Haas <robertmhaas(at)gmail(dot)com> |
Cc: | Peter Eisentraut <peter(at)eisentraut(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Daniel Gustafsson <daniel(at)yesql(dot)se>, Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>, Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>, Rahila Syed <rahilasyed90(at)gmail(dot)com> |
Subject: | Re: Add missing PGDLLIMPORT markings |
Date: | 2025-04-09 17:10:09 |
Message-ID: | 968FFBF1-3CF4-4DE7-9D07-AE5CBB8FFE43@anarazel.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi,
On April 9, 2025 12:58:23 PM EDT, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>On Wed, Apr 9, 2025 at 11:28 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
>> FWIW, the AIO ones really don't make sense to make public - the only reason
>> for those variables to exists is so they can be put into an array of
>> callbacks. There's no way an extension could ever benefit from them. But I
>> guess we don't really have a way to tell mark_pgdllimport.pl that.
>
>I'm not here to say that you're wrong, but this kind of argument is
>exactly why we didn't use to mark a bunch of things PGDLLIMPORT that,
>as it turned out, extension developers actually wanted to use.
>
>I don't think we should go back to the bad old days where we litigated
>every case of marking something PGDLLIMPORT or not unless we have an
>extremely good reason for so doing.
Yeah, that's why I guessed that we will have to just mark these.
Fwiw, just marking everything is far from free. We prevent optimizations the compiler could make otherwise. Except of course that we have implicitly always done so in the main binary on ELF platforms, so "PGDLLIMPORT everything" kind of just removed the portability hazard.
I think eventually we ought to change the default visibility in the main binary to hidden, just like we do for extensions. Then the windows/everything else behavior difference vanishes and we actually get the benefit of being more restrictive on common platforms. I think we still ought to default to exporting symbols in such a world, just not always do so. We probably should just require all externs are either marked "server only" or "visible to extensions", never just a plain extern.
Greetings,
Andres
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
From | Date | Subject | |
---|---|---|---|
Next Message | Nathan Bossart | 2025-04-09 17:16:44 | Re: Horribly slow pg_upgrade performance with many Large Objects |
Previous Message | Tomas Vondra | 2025-04-09 17:07:15 | Re: Draft for basic NUMA observability |