unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#46249] [PATCH] Update documented default PostgreSQL socket-directory
@ 2021-02-02  0:08 guix-patches--- via
  2021-02-02  8:31 ` Mathieu Othacehe
  0 siblings, 1 reply; 3+ messages in thread
From: guix-patches--- via @ 2021-02-02  0:08 UTC (permalink / raw)
  To: 46249

[-- Attachment #1: Type: text/plain, Size: 612 bytes --]

Hi Folks,

It looks like the documented default for PostgreSQL's socket-directory
variable should be "/var/run/postgresql", when it's currently
"/var/lib/postgresql" (the data directory). I've attached a patch.
Here's the original commit (thanks lfam for the IRC help):

https://git.savannah.gnu.org/cgit/guix.git/commit/?id=6c0679215f4ffa534c1eb2e8c8a6e043a0c993fe

Also noticed that since a recent reconfigure, my `psql` and `createdb`
commands now need an explicit `-h /var/run/postgresql` argument to
connect to the local database where one wasn't needed before - they look
in /tmp by default.

Regards,
Ben

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: postgres_update_socket_directory.patch --]
[-- Type: text/x-patch, Size: 1022 bytes --]

From bfd7c9f015718eadd62bac0e85aa4a3b38a556d4 Mon Sep 17 00:00:00 2001
From: Ben Sturmfels <ben@sturm.com.au>
Date: Tue, 2 Feb 2021 10:49:21 +1100
Subject: [PATCH] services: postgresql: Update documented socket directory to
 match code.

* doc/guix.texi (Database Services): Update it.
---
 doc/guix.texi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index beff276f9d..b75c4f505c 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -19531,7 +19531,7 @@ configuration.
 @item @code{ident-file} (default: @code{%default-postgres-ident})
 Filename or G-expression for the user name mapping configuration.
 
-@item @code{socket-directory} (default: @code{"/var/lib/postgresql"})
+@item @code{socket-directory} (default: @code{"/var/run/postgresql"})
 Specifies the directory of the Unix-domain socket(s) on which PostgreSQL
 is to listen for connections from client applications.  If set to
 @code{#false} PostgreSQL does not listen on any Unix-domain sockets, in
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#46249] [PATCH] Update documented default PostgreSQL socket-directory
  2021-02-02  0:08 [bug#46249] [PATCH] Update documented default PostgreSQL socket-directory guix-patches--- via
@ 2021-02-02  8:31 ` Mathieu Othacehe
  2021-02-02 11:20   ` guix-patches--- via
  0 siblings, 1 reply; 3+ messages in thread
From: Mathieu Othacehe @ 2021-02-02  8:31 UTC (permalink / raw)
  To: 46249; +Cc: Ben Sturmfels, 46249-done


Hey Ben,

> It looks like the documented default for PostgreSQL's socket-directory
> variable should be "/var/run/postgresql", when it's currently
> "/var/lib/postgresql" (the data directory). I've attached a patch.
> Here's the original commit (thanks lfam for the IRC help):

That's a dumb mistake on my part, thanks for fixing it.

> https://git.savannah.gnu.org/cgit/guix.git/commit/?id=6c0679215f4ffa534c1eb2e8c8a6e043a0c993fe
>
> Also noticed that since a recent reconfigure, my `psql` and `createdb`
> commands now need an explicit `-h /var/run/postgresql` argument to
> connect to the local database where one wasn't needed before - they look
> in /tmp by default.

Yes when the socket directory is enabled in PostgreSQL those tools try
to use it but with the default directory set to "/tmp". I have pushed a
patch on core-updates to set the default socket directory to
"/var/run/postgresql" like most of the other distributions.

In the meantime you can set the "socket-directory" field of
"postgresql-config-file" to #f to restore the previous behaviour.

Thanks,

Mathieu




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [bug#46249] [PATCH] Update documented default PostgreSQL socket-directory
  2021-02-02  8:31 ` Mathieu Othacehe
@ 2021-02-02 11:20   ` guix-patches--- via
  0 siblings, 0 replies; 3+ messages in thread
From: guix-patches--- via @ 2021-02-02 11:20 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 46249, 46249-done, ben

On Tue, 02 Feb 2021, Mathieu Othacehe wrote:

> Hey Ben,
>
>> It looks like the documented default for PostgreSQL's socket-directory
>> variable should be "/var/run/postgresql", when it's currently
>> "/var/lib/postgresql" (the data directory). I've attached a patch.
>> Here's the original commit (thanks lfam for the IRC help):
>
> That's a dumb mistake on my part, thanks for fixing it.
>
>> https://git.savannah.gnu.org/cgit/guix.git/commit/?id=6c0679215f4ffa534c1eb2e8c8a6e043a0c993fe
>>
>> Also noticed that since a recent reconfigure, my `psql` and `createdb`
>> commands now need an explicit `-h /var/run/postgresql` argument to
>> connect to the local database where one wasn't needed before - they look
>> in /tmp by default.
>
> Yes when the socket directory is enabled in PostgreSQL those tools try
> to use it but with the default directory set to "/tmp". I have pushed a
> patch on core-updates to set the default socket directory to
> "/var/run/postgresql" like most of the other distributions.
>
> In the meantime you can set the "socket-directory" field of
> "postgresql-config-file" to #f to restore the previous behaviour.

Thanks for the quick follow-up Mathieu, that's very helpful.

While I'm bothering you, those comments "XXX: Remove when postgresql
default socket directory is changed to /var/run/postgresql" looked like
they could be might be redundant now. Is that the case?

Thanks again,
Ben




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-02 11:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-02  0:08 [bug#46249] [PATCH] Update documented default PostgreSQL socket-directory guix-patches--- via
2021-02-02  8:31 ` Mathieu Othacehe
2021-02-02 11:20   ` guix-patches--- via

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).