pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
arguments for query files
2+ messages / 2 participants
[nested] [flat]

* arguments for query files
@ 2001-06-19 17:05  David Brown <david.brown@mviva.net>
  0 siblings, 0 replies; 2+ messages in thread

From: david.brown@mviva.net @ 2001-06-19 17:05 UTC (permalink / raw)
  To: pgsql-sql

Does anybody know how I can pass arguments into files which I execute
from within psql using \i?

I want to be able to do something like:
\i file arg1 arg2



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* RE: arguments for query files
@ 2001-06-21 14:48  Jeff Eckermann <jeckermann@verio.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Jeff Eckermann @ 2001-06-21 14:48 UTC (permalink / raw)
  To: 'david.brown@mviva.net' <david.brown@mviva.net>; pgsql-sql

I don't think this is possible in the way that you specify.
What works for me is to include psql variable names in the script file, then
set the values before each run.
psql variables are of the form " :<variable name> ".
To assign a value, just do " \set variable=value ".
I like to include lines at the end of my script to unset these values, of
the form " \unset variable ".
HTH.

> -----Original Message-----
> From:	david.brown@mviva.net [SMTP:david.brown@mviva.net]
> Sent:	Tuesday, June 19, 2001 12:06 PM
> To:	pgsql-sql@postgresql.org
> Subject:	arguments for query files
> 
> Does anybody know how I can pass arguments into files which I execute
> from within psql using \i?
> 
> I want to be able to do something like:
> \i file arg1 arg2
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2001-06-21 14:48 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-06-19 17:05 arguments for query files David Brown <david.brown@mviva.net>
2001-06-21 14:48 RE: arguments for query files Jeff Eckermann <jeckermann@verio.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox