mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-05 19:06:11 +02:00
Handle PostgreSQL notifications early, fix #311.
In some cases, like when client_min_messages is set to debug5, PostgreSQL might send notification messages to the connecting client even while opening a connection. Those are still considered WARNINGs by the Postmodern driver... Handle those warnings by just printing them out in the pgloader logs, rather than considering those conditions as hard failures (signaling a db-connection-error).
This commit is contained in:
parent
93b6be43d4
commit
533a49a261
@ -140,7 +140,14 @@
|
||||
(let ((conn (gensym "conn")))
|
||||
`(let* ((,conn ,connection)
|
||||
(,var (handler-case
|
||||
(open-connection ,conn)
|
||||
;; in some cases (client_min_messages set to debug5
|
||||
;; for example), PostgreSQL might send us some
|
||||
;; WARNINGs already when opening a new connection
|
||||
(handler-bind ((cl-postgres:postgresql-warning
|
||||
#'(lambda (w)
|
||||
(log-message :warning "~a" w)
|
||||
(muffle-warning))))
|
||||
(open-connection ,conn))
|
||||
(condition (e)
|
||||
(cond ((typep ,connection 'fd-connection)
|
||||
(error 'fd-connection-error
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user