diff --git a/src/pgsql/queries.lisp b/src/pgsql/queries.lisp index b9a2f59..6ccd77e 100644 --- a/src/pgsql/queries.lisp +++ b/src/pgsql/queries.lisp @@ -170,11 +170,19 @@ "Set given GUCs to given values for the current session." (let ((pomo:*database* (or database pomo:*database*))) (loop - for (name . value) in alist - for set = (format nil "SET~:[~; LOCAL~] ~a TO '~a'" transaction name value) - do - (log-message :debug set) - (pomo:execute set)))) + :for (name . value) :in alist + :for set := (cond + ((string-equal "search_path" name) + ;; for search_path, don't quote the value + (format nil "SET~:[~; LOCAL~] ~a TO ~a" + transaction name value)) + (t + ;; general case: quote the value + (format nil "SET~:[~; LOCAL~] ~a TO '~a'" + transaction name value))) + :do (progn ; indent helper + (log-message :debug set) + (pomo:execute set))))) (defun pgsql-connect-and-execute-with-timing (pgconn section label sql &key (count 1)) "Run pgsql-execute-with-timing within a newly establised connection." diff --git a/test/sakila.load b/test/sakila.load index 8dd849b..ee85b7a 100644 --- a/test/sakila.load +++ b/test/sakila.load @@ -9,10 +9,11 @@ load database WITH concurrency = 1, workers = 6 - SET maintenance_work_mem to '128MB', work_mem to '12MB', search_path to 'sakila' + SET maintenance_work_mem to '128MB', + work_mem to '12MB', + search_path to 'sakila, public, "$user"' - CAST -- type datetime to timestamptz drop default drop not null using zero-dates-to-null, - type date drop not null drop default using zero-dates-to-null, + CAST type date drop not null drop default using zero-dates-to-null, type datetime to timestamp drop default drop not null using zero-dates-to-null -- type tinyint to boolean using tinyint-to-boolean,