问题
Using Windows 10, Postgres 11. I have a file C:\Users\myname\some path\query.sql
containing a typical SELECT query:
select a.id,m.toagentid,m.maxstart from agent a
left join
mostrecentfromtopair m
on
a.id=m.fromagentid
When I'm in the psql
terminal, and I try to run this query as follows:
\i "C:\Users\myname\some path\query.sql"
then I get this error:
\i: Invalid argument
How should I be running this .SQL file?
回答1:
You can use single quotes and slashes:
\i 'C:/Users/myname/some path/query.sql'
来源:https://stackoverflow.com/questions/53975117/trying-to-use-i-filename-in-psql-getting-invalid-argument