pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feed[PATCH] Clarify that "psql -c" ignores psqlrc files
2+ messages / 2 participants
[nested] [flat]
* [PATCH] Clarify that "psql -c" ignores psqlrc files
@ 2010-07-06 12:38 Tim Landscheidt <tim@tim-landscheidt.de>
0 siblings, 1 reply; 2+ messages in thread
From: Tim Landscheidt @ 2010-07-06 12:38 UTC (permalink / raw)
To: pgsql-docs@postgresql.org
> 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
Attachments:
psql-clarify-c-option.patch (text/x-patch, 1.4K) download
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
<para>
Specifies that <application>psql</application> is to execute one
command string, <replaceable class="parameter">command</replaceable>,
- and then exit. This is useful in shell scripts.
+ and then exit. This is useful in shell scripts. Start-up files
+ (<filename>psqlrc</filename> and <filename>~/.psqlrc</filename>) are
+ ignored with this option.
</para>
<para>
<replaceable class="parameter">command</replaceable> must be either
@@ -3090,10 +3092,12 @@ $endif
<itemizedlist>
<listitem>
<para>
- Before starting up, <application>psql</application> attempts to
+ Unless it is passed an <option>-X</option>
+ or <option>-c</option> option,
+ <application>psql</application> attempts to
read and execute commands from the system-wide
<filename>psqlrc</filename> file and the user's
- <filename>~/.psqlrc</filename> file.
+ <filename>~/.psqlrc</filename> file before starting up.
(On Windows, the user's startup file is named
<filename>%APPDATA%\postgresql\psqlrc.conf</filename>.)
See <filename><replaceable>PREFIX</>/share/psqlrc.sample</>
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [PATCH] Clarify that "psql -c" ignores psqlrc files
@ 2010-07-10 00:50 Robert Haas <robertmhaas@gmail.com>
parent: Tim Landscheidt <tim@tim-landscheidt.de>
0 siblings, 0 replies; 2+ messages in thread
From: Robert Haas @ 2010-07-10 00:50 UTC (permalink / raw)
To: pgsql-docs@postgresql.org
On Tue, Jul 6, 2010 at 8:38 AM, Tim Landscheidt <tim@tim-landscheidt.de> wrote:
> Balkrishna Sharma <b_ki@hotmail.com> 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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2010-07-10 00:50 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-07-06 12:38 [PATCH] Clarify that "psql -c" ignores psqlrc files Tim Landscheidt <tim@tim-landscheidt.de>
2010-07-10 00:50 ` Robert Haas <robertmhaas@gmail.com>
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