Fix a bug in params.lisp init when PGPORT isn't set.

This commit is contained in:
Dimitri Fontaine 2013-11-04 22:53:00 +01:00
parent beba2bc5b0
commit 70a9a46537
2 changed files with 10 additions and 6 deletions

View File

@ -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.")

View File

@ -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.")