sqlserver2pgsql icon indicating copy to clipboard operation
sqlserver2pgsql copied to clipboard

-ignore_errors flag for schema conversion as well

Open shubham-yb opened this issue 2 years ago • 1 comments

Hi Team, The current behaviour of the tool is that it errors out during schema conversion if it finds some unknown clause. Example

Cannot determine the PostgreSQL's datatype corresponding to hierarchyid. This is a bug
 at ./sqlserver2pgsql.pl line 379, <$file> line 690.
	main::convert_type('hierarchyid', undef, 'OrganizationNode', 'Employee', undef, 'HumanResources') called at ./sqlserver2pgsql.pl line 1424
	main::add_column_to_table('HumanResources', 'Employee', 'OrganizationNode', undef, 'hierarchyid', undef, undef, 'NULL') called at ./sqlserver2pgsql.pl line 1546
	main::parse_dump() called at ./sqlserver2pgsql.pl line 3316

And then it stops here without providing anything in the output files. Is there a way to skip/ignore such statements and go ahead with converting the rest?

The -ignore_errors flag exists for the data side but a similar flag during schema conversion will be a huge help.

Thank You in advance!

shubham-yb avatar Feb 21 '23 12:02 shubham-yb

Hi Team, when I wiill be exicuting the below query give error how can I fix . plz help

aanchal@it-OptiPlex-5060:~/Documents/migrateDatabase$ perl sqlserver2pgsql.pl -f input_sql_dump.sql -b output_before_script -a output_after_script -u output_unsure_script Types: $VAR1 = { 'bigint' => 'bigint', 'rowversion' => 'bytea', 'xml' => 'xml', 'datetimeoffset' => 'timestamp with time zone', 'nchar' => 'char', 'nvarchar' => 'varchar', 'varbinary' => 'bytea', 'binary' => 'bytea', 'time' => 'time', 'tinyint' => 'smallint', 'float' => 'double precision', 'timestamp' => 'bytea', 'real' => 'real', 'datetime' => 'timestamp', 'int' => 'int', 'money' => 'numeric', 'uniqueidentifier' => 'uuid', 'smallint' => 'smallint', 'smallmoney' => 'numeric(6,4)', 'text' => 'text', 'date' => 'date', 'image' => 'bytea', 'varchar' => 'varchar', 'datetime2' => 'timestamp', 'decimal' => 'numeric', 'smalldatetime' => 'timestamp', 'char' => 'char' }; Cannot determine the PostgreSQL's datatype corresponding to public.xdtID. This is a bug at sqlserver2pgsql.pl line 382, <$file> line 6. main::convert_type("public.xdtID", undef, "item_id", "xtItem", undef, "public") called at sqlserver2pgsql.pl line 1445 main::add_column_to_table("public", "xtItem", "item_id", "dbo", "xdtID", undef, undef, "NOT NULL") called at sqlserver2pgsql.pl line 1567 main::parse_dump() called at sqlserver2pgsql.pl line 3338

usyadav3001 avatar Apr 19 '24 10:04 usyadav3001