skip to Main Content

I tried connecting my Postgres database Employees to a SQL Server, however, whenever I try, I get an error saying the request was ignored.

Trying to create database on sql server

I tried to create a new database called employees with template0 on SQL Server from postgres after initializing the postgres on SQL Server by typing in

~psql -U postgres 

and I get an error :

enter image description here

2

Answers


  1. In the screenshot you provided you are writing queries in the fields of host, post and username that’s why you get an error because you are writing queries before even connecting to the database.

    You should follow the prompts and enter the required information like hostname, port and username If you want to use the default values (which is between brackets) hit enter.

    After connecting to the database you can now write your queries.

    Login or Signup to reply.
  2. You can ignore all the warnings, the important part is that it cannot find the host from Your shell, check the command syntax.

    https://hasura.io/blog/top-psql-commands-and-flags-you-need-to-know-postgresql/

    So this command you display is only part of what you need

    psql -d <db-name> -U <username> -W
    

    apparently the default will be this implementation if you do not specify anyting, like in your case:

    psql -h <host-address> -d <db-name> -U <username> -W
    

    so then it interprets your "-U" as the host which cannot be found,
    so try using explicit arguments and if your database is on your local host, you can ignore the host argument

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search