dimitri / pgloader

Migrate to PostgreSQL in a single command!
http://pgloader.io
Other
5.45k stars 548 forks source link

Mssql: IDENTITY columns not detected in tables outside the default schema. #1586

Open nathanael-ruf opened 5 months ago

nathanael-ruf commented 5 months ago

I noticed this while migrating a mssql databse with many custom schemas to Postgres. The resulting columns in Postgres weren't SERIAL.

Replacing the selection with COLUMNPROPERTY(OBJECT_ID(c.TABLE_SCHEMA + '.' + c.TABLE_NAME), c.COLUMN_NAME, 'IsIdentity') AS IsIdentity seems to work as expected.

nathanael-ruf commented 5 months ago

I forked https://github.com/jahangiranwari/pgloader and fixed the bug. All my columns are now serial as expected.