From 2a786acfb6f1dfad69473f1b485dfc5e93ebb0da Mon Sep 17 00:00:00 2001 From: alireza Date: Sat, 10 Oct 2026 01:05:14 +0330 Subject: [PATCH] =?UTF-8?q?fix(datacopy):=20use=20pg=5Fget=5Fserial=5Fsequ?= =?UTF-8?q?ence(text,=20text)=20overload=20=E2=80=94=20verified=20against?= =?UTF-8?q?=20local=20PG=2018?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/GreenHome.DataCopy/Program.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/GreenHome.DataCopy/Program.cs b/src/GreenHome.DataCopy/Program.cs index 6f3286f..ce1cde4 100644 --- a/src/GreenHome.DataCopy/Program.cs +++ b/src/GreenHome.DataCopy/Program.cs @@ -169,10 +169,10 @@ internal static class Program if (max > 0) { // Keep the identity sequence above the copied max so new rows don't collide. - // pg_get_serial_sequence needs a regclass (or table+column text); %I keeps - // the exact case EF used, and ::regclass resolves it unambiguously + // pg_get_serial_sequence(text, text) — verified signature. format('%I', ...) + // preserves the exact table case EF used; the column is passed as plain text. await target.Database.ExecuteSqlRawAsync( - $"SELECT setval(pg_get_serial_sequence(format('%I', '{table}')::regclass, '{pkName}'), {max})"); + $"SELECT setval(pg_get_serial_sequence(format('%I', '{table}'), '{pkName}'), {max})"); } Console.WriteLine($"\n[done ] {table}: copied={copied}, maxId={max}"); }