0
votes

Trying to do something really simple, not sure why it's not working.

I downloaded SQL workbench and connected to my Redshift driver. Connection is fine. I created a database using CREATE DATABASE dbexample

Now I'm trying to connect to the database. I've tried \c dbexample and \connect dbexample and am getting the following error:

An error occurred when executing the SQL command:
\connect dbname

[Amazon](500310) Invalid operation: syntax error at or near "\" 
Position: 1;

\connect dbname
^
1 statement failed.

Anyone know why it's not connecting?

2
It clearly says : syntax error at or near "\" Position: 1; that means you have an issue with your query...Tushar Niras
do you know what query to use to connect to a database in postgresql? All the tutorials I can find say \c or \connect dbname is how you connect.kaysuez
Workbench is working fine .... "Now I'm trying to connect to the database. I've tried \c dbexample and \connect dbexample and am getting the following error; " from where you trying this ?Tushar Niras
I created the database in workbench by querying CREATE DATABASE dbexample. It says Database dbexample created Execution time: 0.23s, now the tutorial tells me to connect to this database by querying \c dbexample. I get the error message when I try thiskaysuez
share ur tutorial linkTushar Niras

2 Answers

0
votes

The \backslash commands are specific to the psql utility and are not generic SQL commands for use in a product such as SQL Workbench.

Instead, specify the database name when you connect SQL Workbench to the database.

0
votes

Provide the name of the database in the URL itself:

enter image description here