public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tim Landscheidt <[email protected]>
To: [email protected]
Subject: [PATCH] Clarify that "psql -c" ignores psqlrc files
Date: Tue, 06 Jul 2010 12:38:39 +0000
Message-ID: <[email protected]> (raw)
References: <[email protected]>
	<[email protected]>
	<[email protected]>

Balkrishna Sharma <[email protected]> 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


Attachments:

  [text/x-patch] psql-clarify-c-option.patch (1.4K, 2-psql-clarify-c-option.patch)
  download | inline diff:
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</>


view thread (14+ messages)  latest in thread

reply

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: [email protected]
  Cc: [email protected]
  Subject: Re: [PATCH] Clarify that "psql -c" ignores psqlrc files
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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