I am trying to make a one line psql request. I would like to send both credentials and query in the same time. I am using this :
psql.exe "dbname=dbname user=postgres password=postgres host=localhost" -c 'select * from table'
Actually if i take back the -c option it works but right now it sends me this :
psql: attention : option supplémentaire « 'select » ignorée
psql: attention : option supplémentaire « * » ignorée
psql: attention : option supplémentaire « from » ignorée
psql: attention : option supplémentaire « view' » ignorée
The connection to the database worked but thoose logs are in french but they mean "care : option skipped".
I tried with Url request
psql.exe postgresql://postgres:postgres@localhost/dbname -c 'select * from view'
But this is the same.
Do you have any idea where i am misplaying this ?
Thanks !