mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-05 02:46:10 +02:00
Fix a bug in params.lisp init when PGPORT isn't set.
This commit is contained in:
parent
beba2bc5b0
commit
70a9a46537
@ -55,11 +55,20 @@
|
||||
(defparameter *copy-batch-split* 5
|
||||
"Number of batches in which to split a batch with bad data")
|
||||
|
||||
;;;
|
||||
;;; We need that to setup our default connection parameters
|
||||
;;;
|
||||
(eval-when (:compile-toplevel :load-toplevel :execute)
|
||||
(defun getenv-default (name &optional default)
|
||||
"Return the value of the NAME variable as found in the environment, or
|
||||
DEFAULT if that variable isn't set"
|
||||
(or (uiop:getenv name) default)))
|
||||
|
||||
;;;
|
||||
;;; PostgreSQL Connection Credentials and Session Settings
|
||||
;;;
|
||||
(defparameter *pgconn-host* "localhost")
|
||||
(defparameter *pgconn-port* (or (parse-integer (uiop:getenv "PGPORT")) 5432))
|
||||
(defparameter *pgconn-port* (parse-integer (getenv-default "PGPORT" "5432")))
|
||||
(defparameter *pgconn-user* (uiop:getenv "USER"))
|
||||
(defparameter *pgconn-pass* "pgpass")
|
||||
(defparameter *pg-settings* nil "An alist of GUC names and values.")
|
||||
|
||||
@ -4,11 +4,6 @@
|
||||
|
||||
(in-package :pgloader.parser)
|
||||
|
||||
(defun getenv-default (name &optional default)
|
||||
"Return the value of the NAME variable as found in the environment, or
|
||||
DEFAULT if that variable isn't set"
|
||||
(or (uiop:getenv name) default))
|
||||
|
||||
(defvar *data-expected-inline* nil
|
||||
"Set to :inline when parsing an INLINE keyword in a FROM clause.")
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user