From: Jeff Eckermann <jeckermann@verio.net>
To: 'david.brown@mviva.net' <david.brown@mviva.net>
To: pgsql-sql@postgresql.org
Subject: RE: arguments for query files
Date: Thu, 21 Jun 2001 09:48:30 -0500
Message-ID: <08CD1781F85AD4118E0800A0C9B8580B094AEF@NEZU> (raw)
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)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: jeckermann@verio.net, david.brown@mviva.net
Subject: RE: arguments for query files
In-Reply-To: <08CD1781F85AD4118E0800A0C9B8580B094AEF@NEZU>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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