mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-04 10:31:02 +02:00
Support for colon characters in PostgreSQL socket path.
Google Cloud SQL instances are now using the following format for the name of their socket <PROJECT-ID>:<REGION>:<INSTANCE_NAME>. We do that by allowing to escape a colon in the socket directory name by doubling it, as in the username field. It also allows to accept any character in the socket directory name, which is a good cleanup. Fix #621.
This commit is contained in:
parent
d5072d11e5
commit
a9e8bfd4d7
14
pgloader.1
14
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
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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)))))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user