From 7daee9405f12dff7807534c812ab45c636cc5643 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Mon, 20 Jun 2016 20:05:06 +0200 Subject: [PATCH] Fix column names quoting in reset-all-sequences. The other user-provided names (schema and table) were already quoted using the quote_ident() PostgreSQL functio, but the column name (attname in the catalogs) were not. Blind attempt to fix #425. --- src/pgsql/queries.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pgsql/queries.lisp b/src/pgsql/queries.lisp index 48d5f5c..4762f57 100644 --- a/src/pgsql/queries.lisp +++ b/src/pgsql/queries.lisp @@ -485,7 +485,7 @@ BEGIN || trim(trailing ')' from replace(pg_get_expr(d.adbin, d.adrelid), 'nextval', 'setval')) - || ', (select greatest(max(' || a.attname || '), 1) from only ' + || ', (select greatest(max(' || quote_ident(a.attname) || '), 1) from only ' || quote_ident(nspname) || '.' || quote_ident(relname) || '));' as sql FROM pg_class c JOIN pg_namespace n on n.oid = c.relnamespace