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}"); }