Re: [HACKERS] PGDLLEXPORTing all GUCs?

2014-05-08 Thread Robert Haas
On Thu, May 8, 2014 at 12:19 AM, Craig Ringer cr...@2ndquadrant.com wrote: In terms of ugliness, would you be happier using a pg_extern instead of extern, where we: #ifdef WIN32 #define pg_extern extern PGDLLIMPORT #else #define pg_extern extern #endif ? I personally would not be

Re: [HACKERS] PGDLLEXPORTing all GUCs?

2014-05-08 Thread Andres Freund
On 2014-05-08 07:56:46 -0400, Robert Haas wrote: On Thu, May 8, 2014 at 12:19 AM, Craig Ringer cr...@2ndquadrant.com wrote: In terms of ugliness, would you be happier using a pg_extern instead of extern, where we: #ifdef WIN32 #define pg_extern extern PGDLLIMPORT #else #define

[HACKERS] PGDLLEXPORTing all GUCs?

2014-05-07 Thread Craig Ringer
Hi all As part of development on BDR the issue of GUC globals not being PGDLLEXPORT'ed has been run into a few times. Is there any reason _not_ to PGDLLEXPORT all GUCs, other than cosmetic concerns? Barring objections I'll post a patch to do this tomorrow. -- Craig Ringer

Re: [HACKERS] PGDLLEXPORTing all GUCs?

2014-05-07 Thread Tom Lane
Craig Ringer cr...@2ndquadrant.com writes: Is there any reason _not_ to PGDLLEXPORT all GUCs, other than cosmetic concerns? That seems morally equivalent to is there a reason not to make every static variable global?. IOW, no, I don't accept this proposition. Every time we DLLEXPORT some

Re: [HACKERS] PGDLLEXPORTing all GUCs?

2014-05-07 Thread Andres Freund
On 2014-05-07 09:35:06 -0400, Tom Lane wrote: Craig Ringer cr...@2ndquadrant.com writes: Is there any reason _not_ to PGDLLEXPORT all GUCs, other than cosmetic concerns? That seems morally equivalent to is there a reason not to make every static variable global?. IOW, no, I don't

Re: [HACKERS] PGDLLEXPORTing all GUCs?

2014-05-07 Thread Craig Ringer
On 05/07/2014 09:45 PM, Andres Freund wrote: I think what Craig actually tries to propose is to mark all GUCs currently exported in headers PGDLLIMPORT. Currently it's easy to have extensions that work on sane systems but not windows. If they're already exposed in headers I don't think changes

Re: [HACKERS] PGDLLEXPORTing all GUCs?

2014-05-07 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On 2014-05-07 09:35:06 -0400, Tom Lane wrote: Craig Ringer cr...@2ndquadrant.com writes: Is there any reason _not_ to PGDLLEXPORT all GUCs, other than cosmetic concerns? That seems morally equivalent to is there a reason not to make every static

Re: [HACKERS] PGDLLEXPORTing all GUCs?

2014-05-07 Thread David G Johnston
Tom Lane-2 wrote Andres Freund lt; andres@ gt; writes: On 2014-05-07 09:35:06 -0400, Tom Lane wrote: Craig Ringer lt; craig@ gt; writes: Is there any reason _not_ to PGDLLEXPORT all GUCs, other than cosmetic concerns? That seems morally equivalent to is there a reason not to make

Re: [HACKERS] PGDLLEXPORTing all GUCs?

2014-05-07 Thread Andres Freund
On 2014-05-07 10:29:36 -0400, Tom Lane wrote: Andres Freund and...@2ndquadrant.com writes: On 2014-05-07 09:35:06 -0400, Tom Lane wrote: Craig Ringer cr...@2ndquadrant.com writes: Is there any reason _not_ to PGDLLEXPORT all GUCs, other than cosmetic concerns? That seems morally

Re: [HACKERS] PGDLLEXPORTing all GUCs?

2014-05-07 Thread Tom Lane
Andres Freund and...@2ndquadrant.com writes: On 2014-05-07 10:29:36 -0400, Tom Lane wrote: To my mind, we PGDLLEXPORT some variable only after deciding that yeah, we're okay with having third-party modules touching that. Craig's proposal is to remove human judgement from that process. It's

Re: [HACKERS] PGDLLEXPORTing all GUCs?

2014-05-07 Thread Robert Haas
On Wed, May 7, 2014 at 11:19 AM, Tom Lane t...@sss.pgh.pa.us wrote: Andres Freund and...@2ndquadrant.com writes: On 2014-05-07 10:29:36 -0400, Tom Lane wrote: To my mind, we PGDLLEXPORT some variable only after deciding that yeah, we're okay with having third-party modules touching that.

Re: [HACKERS] PGDLLEXPORTing all GUCs?

2014-05-07 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: I don't accept this argument. In EnterpriseDB's Advanced Server fork of PostgreSQL, we've marked a bunch of extra things PGDLLEXPORT precisely because we have external modules that need access to them. Well, that's an argument for marking every darn

Re: [HACKERS] PGDLLEXPORTing all GUCs?

2014-05-07 Thread Andres Freund
On 2014-05-07 12:21:55 -0400, Tom Lane wrote: Robert Haas robertmh...@gmail.com writes: I don't accept this argument. In EnterpriseDB's Advanced Server fork of PostgreSQL, we've marked a bunch of extra things PGDLLEXPORT precisely because we have external modules that need access to them.

Re: [HACKERS] PGDLLEXPORTing all GUCs?

2014-05-07 Thread Robert Haas
On Wed, May 7, 2014 at 12:21 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: I don't accept this argument. In EnterpriseDB's Advanced Server fork of PostgreSQL, we've marked a bunch of extra things PGDLLEXPORT precisely because we have external modules that

Re: [HACKERS] PGDLLEXPORTing all GUCs?

2014-05-07 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Wed, May 7, 2014 at 12:21 PM, Tom Lane t...@sss.pgh.pa.us wrote: If Craig has a concrete argument why all GUCs should be accessible to external modules, then let's see it (after which we'd better debate exposing the few that are in fact static in

Re: [HACKERS] PGDLLEXPORTing all GUCs?

2014-05-07 Thread Andres Freund
On 2014-05-07 13:08:52 -0400, Tom Lane wrote: Robert Haas robertmh...@gmail.com writes: On Wed, May 7, 2014 at 12:21 PM, Tom Lane t...@sss.pgh.pa.us wrote: If Craig has a concrete argument why all GUCs should be accessible to external modules, then let's see it (after which we'd better

Re: [HACKERS] PGDLLEXPORTing all GUCs?

2014-05-07 Thread Robert Haas
On Wed, May 7, 2014 at 1:08 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Wed, May 7, 2014 at 12:21 PM, Tom Lane t...@sss.pgh.pa.us wrote: If Craig has a concrete argument why all GUCs should be accessible to external modules, then let's see it (after

Re: [HACKERS] PGDLLEXPORTing all GUCs?

2014-05-07 Thread Craig Ringer
On 05/08/2014 12:21 AM, Tom Lane wrote: If Craig has a concrete argument why all GUCs should be accessible to external modules, then let's see it Because they already are. The only difference here is that that access works only on !windows. I agree (strongly) that we should have a better

Re: [HACKERS] PGDLLEXPORTing all GUCs?

2014-05-07 Thread Tom Lane
Craig Ringer cr...@2ndquadrant.com writes: On 05/08/2014 12:21 AM, Tom Lane wrote: If Craig has a concrete argument why all GUCs should be accessible to external modules, then let's see it As for just GUCs: I suggested GUCs because GUCs are what's been coming up repeatedly as an actual

Re: [HACKERS] PGDLLEXPORTing all GUCs?

2014-05-07 Thread Craig Ringer
On 05/08/2014 10:53 AM, Tom Lane wrote: Craig Ringer cr...@2ndquadrant.com writes: On 05/08/2014 12:21 AM, Tom Lane wrote: If Craig has a concrete argument why all GUCs should be accessible to external modules, then let's see it As for just GUCs: I suggested GUCs because GUCs are what's