Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PostgreSQL syntax highlighting in Visual Studio 2017

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?

like image 759
Guerrilla Avatar asked Oct 31 '18 13:10

Guerrilla


People also ask

Can I use PostgreSQL with Visual Studio?

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 .

How do I run a PostgreSQL script?

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.


1 Answers

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.

like image 95
rfkortekaas Avatar answered Nov 15 '22 04:11

rfkortekaas