Re: Change to 'timing on' globally - Mailing list pgsql-admin

From Bruce Momjian
Subject Re: Change to 'timing on' globally
Date
Msg-id 201007061448.o66EmmF10095@momjian.us
Whole thread Raw
In response to Re: Change to 'timing on' globally  (Balkrishna Sharma <b_ki@hotmail.com>)
Responses Re: Change to 'timing on' globally
List pgsql-admin
Balkrishna Sharma wrote:
>
> 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.

I just tested it here on Ubuntu and it worked:

    $ sudo mkdir etc
    $ sudo mkdir etc/postgresql
    $ cd etc/postgresql/
    $ sudo vi psqlrc
    # add \echo test
    $ pwd
    /opt/PostgreSQL/8.4/etc/postgresql
    $ ../../bin/psql -U postgres postgres
-->    test
    psql (8.4.2)
    Type "help" for help.

    postgres=#

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

Yeah, that is odd.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + None of us is going to be here forever. +

pgsql-admin by date:

Previous
From: Greg Smith
Date:
Subject: Re: Postmaster taking up 100% of CPU
Next
From: Balkrishna Sharma
Date:
Subject: Re: Change to 'timing on' globally