I'm trying to run sql command through the windows prompt but I do not know the initial settings to do this. Can anyone tell me?
Detail: It must be in the windows terminal.
I'm trying to run sql command through the windows prompt but I do not know the initial settings to do this. Can anyone tell me?
Detail: It must be in the windows terminal.
Use the psql tool in the PostgreSQL installation.
To login, type:
psql -U usuarioDoBanco nomeDeUmBanco
Then you can execute commands, such as:
select datname, oid from pg_database;
follow an example without logging in
psql --command="select codigo from produto where codigo = 'codigo_do_produto'" --host=localhost --port=5432 --username=postgres --dbname=banco