When I create a .sql
file in Visual Studio 2017 the syntax highlighting assumes I am using MSSQL and highlights valid PostgreSQL queries as having errors.
Is there any way to get Visual Studio 2017 to have proper syntax highlighting in .sql
files for PostgreSQL?
and select PostgreSQL: New Query (this will open a blank file). Step 2: Next, you need to select a Postgres Server (click on the icon Select Postgres Server ) in the side bar (at the bottom) of the Visual Studio Code user interface. Select the server of your choice and choose the default database postgres .
Another easiest and most used way to run any SQL file in PostgreSQL is via its SQL shell. Open the SQL shell from the menu bar of Windows 10. Add your server name, database name where you want to import the file, the port number you are currently active on, PostgreSQL username, and password to start using SQL shell.
If you are using a PostgreSQL plug-in, you need to rename your file to either ‘psql’ or ‘pgsql’ to enable to correct syntax highlighting.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With