I have a PostgreSQL script (say MAIN.sql
in ~/sql/
) that has lines like
\ i components / helper-functions.sql
This works fine if $ PWD matches the directory of my script ( ~/sql/
), but if it doesnβt, it searches for the included file relative to $ PWD instead of the relative MAIN.sql
.
So, if I call the script from ~/
, it will look for ~/components/helper-functions.sql
, and not for ~/sql/components/helper-functions.sql
.
I think the new \ir
directive will be included in 9.2 for this problem, but I am running 8.3
source share