reutsey
reutsey

Reputation: 1993

psql extra command line argument

Can someone tell me why I get the error extra command line argument here? When I use -f and give it the full path to the sql file it works fine. I would like to use a relative path instead so I was trying to use the \ir command.

psql -c \c postgresql://docker:1234/nbt?ssl=true -U admin -v username='user73291' -v recipeId=2 -c \ir '../../../resources/sql/myfile.sql'

Error:

psql: warning: extra command-line argument "../../../resources/sql/myfile.sql" ignored
ERROR:  syntax error at or near "ir"
LINE 1: ir
    ^

Thanks!

Upvotes: 1

Views: 4424

Answers (1)

Clodoaldo Neto
Clodoaldo Neto

Reputation: 125214

\i is a meta-command to be used in the psql command line, not in the shell command line. What is the problem with -f?

Upvotes: 1

Related Questions