diff --git a/pgloader.1 b/pgloader.1 index 9b17dcc..bd3cece 100644 --- a/pgloader.1 +++ b/pgloader.1 @@ -830,6 +830,20 @@ postgresql://unix:/tmp:54321/dbname . .IP The \fInetloc\fR defaults to the value of the \fBPGHOST\fR environment variable, and if it is unset, to either the default \fBunix\fR socket path when running on a Unix system, and \fBlocalhost\fR otherwise\. +. +.IP +Socket path containing colons are supported by doubling the colons within the path, as in the following example: +. +.IP "" 4 +. +.nf + +postgresql://unix:/tmp/project::region::instance:5432/dbname +. +.fi +. +.IP "" 0 + . .IP "\(bu" 4 \fIdbname\fR diff --git a/pgloader.1.md b/pgloader.1.md index e1bc0bf..ee326d9 100644 --- a/pgloader.1.md +++ b/pgloader.1.md @@ -704,6 +704,11 @@ Where: variable, and if it is unset, to either the default `unix` socket path when running on a Unix system, and `localhost` otherwise. + Socket path containing colons are supported by doubling the colons + within the path, as in the following example: + + postgresql://unix:/tmp/project::region::instance:5432/dbname + - *dbname* Should be a proper identifier (letter followed by a mix of letters, diff --git a/src/parsers/command-db-uri.lisp b/src/parsers/command-db-uri.lisp index 1bcc494..6351172 100644 --- a/src/parsers/command-db-uri.lisp +++ b/src/parsers/command-db-uri.lisp @@ -60,7 +60,8 @@ (or (member char #.(quote (coerce "/.-_" 'list))) (alphanumericp char))) -(defrule socket-directory (and "unix:" (* (socket-directory-character-p character))) +(defrule socket-directory (and "unix:" + (* (or (not ":") doubled-colon))) (:destructure (unix socket-directory) (declare (ignore unix)) (list :unix (when socket-directory (text socket-directory)))))