var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Passing in paramters to scripts run with \i
I have a ton of experience using Oracle. PostgreSQL... not so much. I am banging my head against the wall trying to do stuff that was really easy in Oracle.
My Question: I am using "psql" interactively and I want to run a script using the "\i" command, how can I pass in arguments on the fly?
Ie. I would like to do something like:
\i my_script.psql arg1 arg2 arg3
And in my script would be something like:
SELECT :arg1 FROM :arg2 WHERE mycolumn = ':arg3';
I really DON'T want to use \set to set each variable in advance. Sorry if this is a totally noob question... I couldn't find an answer using Search.
I think you cant do it with \i but you can with psql (-v option). I think you can call psql command when logged to database using \!.
Tags for this Thread