Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect parsing of view DDLs #174

Open
shubham-yb opened this issue Feb 27, 2023 · 0 comments
Open

Incorrect parsing of view DDLs #174

shubham-yb opened this issue Feb 27, 2023 · 0 comments

Comments

@shubham-yb
Copy link

shubham-yb commented Feb 27, 2023

Hi Team,
If we have columns in square brackets in the source sql server schema as well as the dump, the columns in the view DDL gets parsed as is with the brackets which causes errors.

Source schema:

CREATE VIEW [Male_emp] 
AS
SELECT 
[Name], [Gender]
FROM Employee
WHERE Gender = 'Male';

go

Dump file using mssql-scripter:

/****** Object:  View [dbo].[Male_emp]    Script Date: 2/27/23 8:17:03 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO

CREATE VIEW [dbo].[Male_emp]
AS
SELECT
[Name], [Gender]
FROM Employee
WHERE Gender = 'Male';

GO

Converted schema:

CREATE VIEW "public"."male_emp" AS
SELECT
[Name], [Gender]
FROM Employee
WHERE Gender = 'Male';

Corresponding error:

ERROR:  syntax error at or near "["
LINE 3: [Name], [Gender]
        ^

Thanks a lot for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant