pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tim Landscheidt <tim@tim-landscheidt.de>
To: pgsql-docs@postgresql.org
Subject: [PATCH] Clarify that "psql -c" ignores psqlrc files
Date: Tue, 06 Jul 2010 12:38:39 +0000
Message-ID: <m3k4p8944w.fsf_-_@passepartout.tim-landscheidt.de> (raw)
References: <BAY149-w4CD2A104FF9FA0BEADD3AF0B10@phx.gbl>
	<1278349811-sup-6775@alvh.no-ip.org>
	<BAY149-w7B72F20DF56F3177081E8F0B10@phx.gbl>

> 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</>

view thread (2+ messages)  latest in thread

Message-ID: <m3k4p8944w.fsf_-_@passepartout.tim-landscheidt.de>
Permalink:  ../m3k4p8944w.fsf_-_@passepartout.tim-landscheidt.de/
Also on:    postgresql.org/message-id/m3k4p8944w.fsf_-_@passepartout.tim-landscheidt.de

 ·  · 

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: pgsql-admin@postgresql.org
  Cc: tim@tim-landscheidt.de, pgsql-docs@postgresql.org
  Subject: Re: [PATCH] Clarify that "psql -c" ignores psqlrc files
  In-Reply-To: <m3k4p8944w.fsf_-_@passepartout.tim-landscheidt.de>

* 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