From 451861cfd5acb2573475ff40fd4b1b94240966c3 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Sun, 24 Nov 2013 16:43:59 +0100 Subject: [PATCH] Don't query PostgreSQL for the OIDs of an empty list of tables. --- src/pgsql/queries.lisp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/pgsql/queries.lisp b/src/pgsql/queries.lisp index 589f528..54cbff7 100644 --- a/src/pgsql/queries.lisp +++ b/src/pgsql/queries.lisp @@ -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))))