mirror of
https://github.com/dimitri/pgloader.git
synced 2026-05-05 10:56:10 +02:00
Don't query PostgreSQL for the OIDs of an empty list of tables.
This commit is contained in:
parent
81f5f95e1d
commit
451861cfd5
@ -237,9 +237,10 @@ $$; " tables)))
|
||||
(defun list-table-oids (table-names)
|
||||
"Return an alist of (TABLE-NAME . TABLE-OID) for all table in the
|
||||
TABLE-NAMES list. A connection must be established already."
|
||||
(loop for (name oid)
|
||||
in (pomo:query
|
||||
(format nil
|
||||
"select n, n::regclass::oid from (values ~{('~a')~^,~}) as t(n)"
|
||||
table-names))
|
||||
collect (cons name oid)))
|
||||
(when table-names
|
||||
(loop for (name oid)
|
||||
in (pomo:query
|
||||
(format nil
|
||||
"select n, n::regclass::oid from (values ~{('~a')~^,~}) as t(n)"
|
||||
table-names))
|
||||
collect (cons name oid))))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user