Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 59E79633387 for ; Tue, 6 Jul 2010 09:39:01 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 12829-07 for ; Tue, 6 Jul 2010 12:38:52 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mail.postgresql.org (Postfix) with ESMTP id EB291632CAA for ; Tue, 6 Jul 2010 09:38:53 -0300 (ADT) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OW7QJ-0005mi-52 for pgsql-docs@postgresql.org; Tue, 06 Jul 2010 14:38:51 +0200 Received: from d222146.adsl.hansenet.de ([80.171.222.146]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Jul 2010 14:38:51 +0200 Received: from tim by d222146.adsl.hansenet.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Jul 2010 14:38:51 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: pgsql-docs@postgresql.org To: pgsql-docs@postgresql.org From: Tim Landscheidt Subject: [PATCH] Clarify that "psql -c" ignores psqlrc files Date: Tue, 06 Jul 2010 12:38:39 +0000 Organization: Lines: 53 Message-ID: References: <1278349811-sup-6775@alvh.no-ip.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: d222146.adsl.hansenet.de Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:NlQJOfz09KZAyVOu7MoX5xYIdos= X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.001 tagged_above=-5 required=5 tests=BAYES_20=-0.001, T_RP_MATCHES_RCVD=-0.01, T_TVD_MIME_NO_HEADERS=0.01 X-Spam-Level: X-Archive-Number: 201007/56 X-Sequence-Number: 5712 --=-=-= 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 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=psql-clarify-c-option.patch Content-Description: Patch to clarify that \"psql -c\" ignores psqlrc files 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 --=-=-=--