You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed this while migrating a mssql databse with many custom schemas to Postgres. The resulting columns in Postgres weren't SERIAL.
pgloader --version
3.6.9 (this docker image because the db is on Azure), but I think I already know the cause which is still an issue in latest master.
did you test a fresh compile from the source tree?
No (first try failed because I'm on ARM), but as mentioned above can reproduce by running the query that is in master.
did you search for other similar issues?
how can I reproduce the bug?
Set up a mssql instance (e.g. using docker: docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Secret123" -p 1433:1433 --name repro-mssql -d mcr.microsoft.com/mssql/server:2019-latest)
Run these queries:
CREATESCHEMApg_loader_test;
CREATETABLEpg_loader_test.MyTable (
id INT IDENTITY(1,1) PRIMARY KEY
);
selectc.TABLE_SCHEMA,
c.TABLE_NAME,
c.COLUMN_NAME,
c.DATA_TYPE,
c.IS_NULLABLE,
COLUMNPROPERTY(object_id(c.TABLE_NAME), c.COLUMN_NAME, 'IsIdentity') AS IsIdentity
fromINFORMATION_SCHEMA.COLUMNS c
joinINFORMATION_SCHEMA.TABLES t
onc.TABLE_SCHEMA=t.TABLE_SCHEMAandc.TABLE_NAME=t.TABLE_NAMEwherec.TABLE_SCHEMA='pg_loader_test'
=> IsIdentity is NULL, but expected is 1.
Replacing the selection with COLUMNPROPERTY(OBJECT_ID(c.TABLE_SCHEMA + '.' + c.TABLE_NAME), c.COLUMN_NAME, 'IsIdentity') AS IsIdentity seems to work as expected.
The text was updated successfully, but these errors were encountered:
I noticed this while migrating a mssql databse with many custom schemas to Postgres. The resulting columns in Postgres weren't
SERIAL
.pgloader --version
3.6.9 (this docker image because the db is on Azure), but I think I already know the cause which is still an issue in latest master.
did you test a fresh compile from the source tree?
No (first try failed because I'm on ARM), but as mentioned above can reproduce by running the query that is in master.
did you search for other similar issues?
how can I reproduce the bug?
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=Secret123" -p 1433:1433 --name repro-mssql -d mcr.microsoft.com/mssql/server:2019-latest
)pgloader/src/sources/mssql/sql/list-all-columns.sql
Line 33 in 2079646
=> IsIdentity is
NULL
, but expected is 1.Replacing the selection with
COLUMNPROPERTY(OBJECT_ID(c.TABLE_SCHEMA + '.' + c.TABLE_NAME), c.COLUMN_NAME, 'IsIdentity') AS IsIdentity
seems to work as expected.The text was updated successfully, but these errors were encountered: