Steps to Reproduce:
When having to write SQL for both MSSQL and Postgres for my job, it's rather annoying that this extension has no idea about other SQL syntax that's very much valid
@NitroGhost thanks for raising this. We're somewhat limited by how VSCode supports language extensions - for a given file type, 1 editor is chosen. What might work is if you modified the PostGre extension to have additional, more specific file type (e.g. .pg.sql) and that way it would get used instead of our extension when opening that file type.
Regarding support for PostGre - this isn't in the plans for right now. With community involvement we could certainly look at not listing errors on syntax / allowing a setting to disable our parsing on files. Again there are some limitations since VSCode accepts a syntax file for a lot of its processing, but it's certainly interesting to think about.
@NitroGhost another possible workaround for this issue is to add "mssql.intelliSense.enableErrorChecking": false option to your settings file. This will turn off error highlighting for SQL files, but you'll still be able to use other language service and query execution features.
Longer term we can look at possibly detecting Postgres or MySQL syntax and disabling our error checker for those SQL files.
@kburtram how's the progress now? I'm including some MySQL .sql scripts in my project, jump into this annoying issue. How about adding a configuration item to exclude specified file extension, or read the very first line of the .sql file to determine syntax? Like shebang #! in Linux world.
@kburtram @kevcunnane
Is there any hope of this arriving soon? I have to work with both T-SQL and MySQL daily and after 2-3 weeks had over 2k "problems" in VSCode
I can confirm that Karl's suggestion of setting mssql.intelliSense.enableErrorChecking to false in the settings file does suppress all errors, but I do mean _all_ errors (T-SQL included). It's not ideal, but if you know how to wrap queries in transactions then the only negative effect of this solution is inconvenience
vscode-mssql fails to recognise Postgres syntax and incorrectly reports errors. It's very annoying and for this reason I've had to disable the extension.
Please expand to recognise Postgres syntax, or find a way to stop reporting it as errors.
can we put this into queue now as this is very annoying that vscode cannot recognize the syntax for postgresql.
Setting mssql.intelliSense.enableErrorChecking to false isn't a great solution. It does quit falsely calling out valid pg syntax (as well as actual problems), but formatting gets applied up until an "error" occurs and is not applied past that point. For example, converting types to upper case works up until pg-only syntax is encountered, and then no more formatting is applied.
Most helpful comment
@kburtram how's the progress now? I'm including some MySQL .sql scripts in my project, jump into this annoying issue. How about adding a configuration item to exclude specified file extension, or read the very first line of the .sql file to determine syntax? Like shebang
#!in Linux world.