[HACKERS] Exposing DEFAULT_PGSOCKET_DIR via a libpq function?

2006-03-28 Thread Larry Rosenman
Greetings, After helping a user on irc, I was wondering if there would be any objection to my making a patch that would: 1) expose DEFAULT_PGSOCKET_DIR via a libpq call 2) add this information to the psql --version output (or some other switch, I'm agnostic). for those weird times when some

Re: [HACKERS] Exposing DEFAULT_PGSOCKET_DIR via a libpq function?

2006-03-28 Thread Tom Lane
Larry Rosenman [EMAIL PROTECTED] writes: 1) expose DEFAULT_PGSOCKET_DIR via a libpq call 2) add this information to the psql --version output (or some other switch, I'm agnostic). pg_config would seem to be the appropriate place, not libpq nor psql. regards, tom lane

Re: [HACKERS] Exposing DEFAULT_PGSOCKET_DIR via a libpq function?

2006-03-28 Thread Darcy Buskermolen
On Tuesday 28 March 2006 14:07, Larry Rosenman wrote: Greetings, After helping a user on irc, I was wondering if there would be any objection to my making a patch that would: 1) expose DEFAULT_PGSOCKET_DIR via a libpq call 2) add this information to the psql --version output (or some

Re: [HACKERS] Exposing DEFAULT_PGSOCKET_DIR via a libpq function?

2006-03-28 Thread Larry Rosenman
Tom Lane wrote: Larry Rosenman [EMAIL PROTECTED] writes: 1) expose DEFAULT_PGSOCKET_DIR via a libpq call 2) add this information to the psql --version output (or some other switch, I'm agnostic). pg_config would seem to be the appropriate place, not libpq nor psql. The issue is when you

Re: [HACKERS] Exposing DEFAULT_PGSOCKET_DIR via a libpq function?

2006-03-28 Thread Larry Rosenman
Darcy Buskermolen wrote: On Tuesday 28 March 2006 14:07, Larry Rosenman wrote: Greetings, After helping a user on irc, I was wondering if there would be any objection to my making a patch that would: 1) expose DEFAULT_PGSOCKET_DIR via a libpq call 2) add this information to the psql

Re: [HACKERS] Exposing DEFAULT_PGSOCKET_DIR via a libpq function?

2006-03-28 Thread Tom Lane
Larry Rosenman ler@lerctr.org writes: Tom Lane wrote: pg_config would seem to be the appropriate place, not libpq nor psql. The issue is what psql (and any libpq using program) is going to use to find the UNIX socket. No, the issue is where the server put the socket. libpq is the wrong

Re: [HACKERS] Exposing DEFAULT_PGSOCKET_DIR via a libpq function?

2006-03-28 Thread Larry Rosenman
Tom Lane wrote: Larry Rosenman ler@lerctr.org writes: Tom Lane wrote: pg_config would seem to be the appropriate place, not libpq nor psql. The issue is what psql (and any libpq using program) is going to use to find the UNIX socket. No, the issue is where the server put the socket.

Re: [HACKERS] Exposing DEFAULT_PGSOCKET_DIR via a libpq function?

2006-03-28 Thread Tom Lane
Larry Rosenman ler@lerctr.org writes: The other issue is borked installs where the server and libpq disagree. What I'm looking for is to expose what libpq has for it's default as well as what the server is using. There is currently no way to determine what libpq has for it's default. What

Re: [HACKERS] Exposing DEFAULT_PGSOCKET_DIR via a libpq function?

2006-03-28 Thread Larry Rosenman
Tom Lane wrote: Larry Rosenman ler@lerctr.org writes: The other issue is borked installs where the server and libpq disagree. What I'm looking for is to expose what libpq has for it's default as well as what the server is using. There is currently no way to determine what libpq has for

Re: [HACKERS] Exposing DEFAULT_PGSOCKET_DIR via a libpq function?

2006-03-28 Thread Tom Lane
Larry Rosenman ler@lerctr.org writes: That's making the assumption that you know which libpq. I was hoping to have a psql commandline Switch to dump the info, but with your objection(s), I'll just crawl back under my rock. It's not that I don't feel your pain ... but if you don't know what

Re: [HACKERS] Exposing DEFAULT_PGSOCKET_DIR via a libpq function?

2006-03-28 Thread Larry Rosenman
Tom Lane wrote: Larry Rosenman ler@lerctr.org writes: That's making the assumption that you know which libpq. I was hoping to have a psql commandline Switch to dump the info, but with your objection(s), I'll just crawl back under my rock. It's not that I don't feel your pain ... but if you

Re: [HACKERS] Exposing DEFAULT_PGSOCKET_DIR via a libpq function?

2006-03-28 Thread Tom Lane
Larry Rosenman ler@lerctr.org writes: What's the harm of a (pseudo code): const char *PQgetunixsocketdir(void) { return(DEFAULT_PGSOCKET_DIR) } In libpq, and a psql command line switch to call it. By the time you get done adding the infrastructure and documentation for those two

Re: [HACKERS] Exposing DEFAULT_PGSOCKET_DIR via a libpq function?

2006-03-28 Thread Larry Rosenman
Jeremy Drake wrote: When I encounter such behavior, my tool of choice tends to be strace(1) rather than strings(1). That way, you know what exactly the thing it wants that it is not finding is... That assumes that the user has strace(1) installed. Yes, I've run into systems that don't

Re: [HACKERS] Exposing DEFAULT_PGSOCKET_DIR via a libpq function?

2006-03-28 Thread Larry Rosenman
Tom Lane wrote: Larry Rosenman ler@lerctr.org writes: What's the harm of a (pseudo code): const char *PQgetunixsocketdir(void) { return(DEFAULT_PGSOCKET_DIR) } In libpq, and a psql command line switch to call it. By the time you get done adding the infrastructure and

Re: [HACKERS] Exposing DEFAULT_PGSOCKET_DIR via a libpq function?

2006-03-28 Thread Jeremy Drake
On Tue, 28 Mar 2006, Tom Lane wrote: Larry Rosenman ler@lerctr.org writes: The other issue is borked installs where the server and libpq disagree. What I'm looking for is to expose what libpq has for it's default as well as what the server is using. There is currently no way to