[PATCH] Clarify that "psql -c" ignores psqlrc files
[PATCH] Clarify that "psql -c" ignores psqlrc files
От:
Tim Landscheidt <tim@tim-landscheidt.de>
Дата:
Balkrishna Sharma wrote on -admin:
> Thanks. If I want to do at system-wide level, where do I store the psqlrc file (assuming I want to change the timing behavior system-wide)?
> (CentOS 5, Postgres 8.4)
> $ ./pg_config --sysconfdir/opt/PostgreSQL/8.4/etc/postgresql
> But I don't have /opt/PostgreSQL/8.4/etc/postgresql directory. Just creating the directory and putting a psqlrc file over there does not seem to work.
> On a side-note, I observered that timing value in ~/.psqlrc was ignored by psql -c "..." command but not by echo "...."|psqlThought it was strange.
> [...]
Patch attached to clarify the latter.
Tim
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index df06517..4f3ef5c 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -79,7 +79,9 @@ PostgreSQL documentation
Specifies that psql is to execute one
command string, command,
- and then exit. This is useful in shell scripts.
+ and then exit. This is useful in shell scripts. Start-up files
+ (psqlrc and ~/.psqlrc) are
+ ignored with this option.
command must be either
@@ -3090,10 +3092,12 @@ $endif
- Before starting up, psql attempts to
+ Unless it is passed an
+ or option,
+ psql attempts to
read and execute commands from the system-wide
psqlrc file and the user's
- ~/.psqlrc file.
+ ~/.psqlrc file before starting up.
(On Windows, the user's startup file is named
%APPDATA%\postgresql\psqlrc.conf.)
See PREFIX</>/share/psqlrc.sample</>
Re: [PATCH] Clarify that "psql -c" ignores psqlrc files
От:
Robert Haas <robertmhaas@gmail.com>
Дата:
On Tue, Jul 6, 2010 at 8:38 AM, Tim Landscheidt wrote: > Balkrishna Sharma wrote on -admin: > >> Thanks. If I want to do at system-wide level, where do I store the psqlrc file (assuming I want to change the timing behavior system-wide)? >> (CentOS 5, Postgres 8.4) >> $ ./pg_config --sysconfdir/opt/PostgreSQL/8.4/etc/postgresql >> But I don't have /opt/PostgreSQL/8.4/etc/postgresql directory. Just creating the directory and putting a psqlrc file over there does not seem to work. > >> On a side-note, I observered that timing value in ~/.psqlrc was ignored by psql -c "..." command but not by echo "...."|psqlThought it was strange. >> [...] > > Patch attached to clarify the latter. Committed. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise Postgres Company