From aba754a759f28701d94551e85c6b9c369e63698c Mon Sep 17 00:00:00 2001 From: Sandeep Somasekharan Date: Sun, 16 Jul 2023 13:49:00 +0530 Subject: [PATCH] fix crash during "reset sequences" on tables with case-sensitive column names (quote-identifiers) --- src/pgsql/pgsql-create-schema.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pgsql/pgsql-create-schema.lisp b/src/pgsql/pgsql-create-schema.lisp index 0a41bf12..4ab32dd9 100644 --- a/src/pgsql/pgsql-create-schema.lisp +++ b/src/pgsql/pgsql-create-schema.lisp @@ -409,7 +409,7 @@ BEGIN from replace(pg_get_expr(d.adbin, d.adrelid), 'nextval', 'setval')) || ', (select greatest(max(' || quote_ident(a.attname) || '), (select seqmin from pg_sequence where seqrelid = (''' - || pg_get_serial_sequence(quote_ident(nspname) || '.' || quote_ident(relname), quote_ident(a.attname)) || ''')::regclass limit 1), 1) from only ' + || pg_get_serial_sequence(quote_ident(nspname) || '.' || quote_ident(relname), a.attname) || ''')::regclass limit 1), 1) from only ' || quote_ident(nspname) || '.' || quote_ident(relname) || '));' as sql FROM pg_class c JOIN pg_namespace n on n.oid = c.relnamespace