Обсуждение: BUG #10991: psql -c ignores my pager settings in ~/.psqlrc

Поиск
Список
Период
Сортировка

BUG #10991: psql -c ignores my pager settings in ~/.psqlrc

От
andrew.pennebaker@gmail.com
Дата:
The following bug has been logged on the website:

Bug reference:      10991
Logged by:          Andrew Pennebaker
Email address:      andrew.pennebaker@gmail.com
PostgreSQL version: 9.3.4
Operating system:   Ubuntu 14.04
Description:

I never want to use the pager, as it comes up at the most inopportune times
in Emacs shell-mode, so I have configured my ~/.psqlrc with:

\pset pager off

This works for psql -f <script>.psql. However, when I run one-off commands
with psql -c <command>, the pager pops up again, making psql -c really hard
to use in my Emacs workflow.

Re: BUG #10991: psql -c ignores my pager settings in ~/.psqlrc

От
Fujii Masao
Дата:
On Sat, Jul 19, 2014 at 1:04 AM,  <andrew.pennebaker@gmail.com> wrote:
> The following bug has been logged on the website:
>
> Bug reference:      10991
> Logged by:          Andrew Pennebaker
> Email address:      andrew.pennebaker@gmail.com
> PostgreSQL version: 9.3.4
> Operating system:   Ubuntu 14.04
> Description:
>
> I never want to use the pager, as it comes up at the most inopportune times
> in Emacs shell-mode, so I have configured my ~/.psqlrc with:
>
> \pset pager off
>
> This works for psql -f <script>.psql. However, when I run one-off commands
> with psql -c <command>, the pager pops up again, making psql -c really hard
> to use in my Emacs workflow.

.psqlrc file is ignored with -c option. This behavior is documented.
http://www.postgresql.org/docs/devel/static/app-psql.html#R1-APP-PSQL-3

Regards,

--
Fujii Masao

Re: BUG #10991: psql -c ignores my pager settings in ~/.psqlrc

От
David G Johnston
Дата:
Fujii Masao-2 wrote
> On Sat, Jul 19, 2014 at 1:04 AM,  <

> andrew.pennebaker@

> > wrote:
>> The following bug has been logged on the website:
>>
>> Bug reference:      10991
>> Logged by:          Andrew Pennebaker
>> Email address:

> andrew.pennebaker@

>> PostgreSQL version: 9.3.4
>> Operating system:   Ubuntu 14.04
>> Description:
>>
>> I never want to use the pager, as it comes up at the most inopportune
>> times
>> in Emacs shell-mode, so I have configured my ~/.psqlrc with:
>>
>> \pset pager off
>>
>> This works for psql -f
> <script>
> .psql. However, when I run one-off commands
>> with psql -c
> <command>
> , the pager pops up again, making psql -c really hard
>> to use in my Emacs workflow.
>
> .psqlrc file is ignored with -c option. This behavior is documented.
> http://www.postgresql.org/docs/devel/static/app-psql.html#R1-APP-PSQL-3

If you use "psql -c" a lot you should probably create a function/alias that
configures it in a way that is similar to the .psqlrc file you created.

Also, psql -c isn't just ignoring your pager settings but anything that is
in the .psqlrc file...as Fujii said this is documented quite explicitly in
the psql arguments section.

David J.




--
View this message in context:
http://postgresql.1045698.n5.nabble.com/BUG-10991-psql-c-ignores-my-pager-settings-in-psqlrc-tp5811971p5811989.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.

Re: BUG #10991: psql -c ignores my pager settings in ~/.psqlrc

От
Matheus de Oliveira
Дата:
On Fri, Jul 18, 2014 at 2:36 PM, Fujii Masao <masao.fujii@gmail.com> wrote:

> > This works for psql -f <script>.psql. However, when I run one-off
> commands
> > with psql -c <command>, the pager pops up again, making psql -c really
> hard
> > to use in my Emacs workflow.
>
> .psqlrc file is ignored with -c option. This behavior is documented.
> http://www.postgresql.org/docs/devel/static/app-psql.html#R1-APP-PSQL-3


A nice workaround is:

    $ echo "YOUR COMMANDS HERE" | psql

Regards,
--=20
Matheus de Oliveira
Analista de Banco de Dados
Dextra Sistemas - MPS.Br n=C3=ADvel F!
www.dextra.com.br/postgres

Re: BUG #10991: psql -c ignores my pager settings in ~/.psqlrc

От
Bruce Momjian
Дата:
On Fri, Jul 18, 2014 at 05:17:42PM -0300, Matheus de Oliveira wrote:
>
> On Fri, Jul 18, 2014 at 2:36 PM, Fujii Masao <masao.fujii@gmail.com> wrote:
>
>     > This works for psql -f <script>.psql. However, when I run one-off
>     commands
>     > with psql -c <command>, the pager pops up again, making psql -c really
>     hard
>     > to use in my Emacs workflow.
>
>     .psqlrc file is ignored with -c option. This behavior is documented.
>     http://www.postgresql.org/docs/devel/static/app-psql.html#R1-APP-PSQL-3
>
>
> A nice workaround is:
>
>     $ echo "YOUR COMMANDS HERE" | psql

I assume psql --no-psqlrc also works.

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

  + Everyone has their own god. +

Re: BUG #10991: psql -c ignores my pager settings in ~/.psqlrc

От
Matheus de Oliveira
Дата:
2014-07-30 19:49 GMT-03:00 Bruce Momjian <bruce@momjian.us>:

> I assume psql --no-psqlrc also works.


Well, I assumed the OP wanted the .psqlrc file to be loaded, this will do
exactly the opposite.

Regards,
--=20
Matheus de Oliveira
Analista de Banco de Dados
Dextra Sistemas - MPS.Br n=C3=ADvel F!
www.dextra.com.br/postgres

Re: BUG #10991: psql -c ignores my pager settings in ~/.psqlrc

От
Andrew Pennebaker
Дата:
Yeah, I was scratching my head on that one, haha.
On Jul 31, 2014 6:32 AM, "Matheus de Oliveira" <matioli.matheus@gmail.com>
wrote:

>
> 2014-07-30 19:49 GMT-03:00 Bruce Momjian <bruce@momjian.us>:
>
>> I assume psql --no-psqlrc also works.
>
>
> Well, I assumed the OP wanted the .psqlrc file to be loaded, this will do
> exactly the opposite.
>
> Regards,
> --
> Matheus de Oliveira
> Analista de Banco de Dados
> Dextra Sistemas - MPS.Br n=C3=ADvel F!
> www.dextra.com.br/postgres
>
>

Re: BUG #10991: psql -c ignores my pager settings in ~/.psqlrc

От
Bruce Momjian
Дата:
On Thu, Jul 31, 2014 at 07:16:51AM -0500, Andrew Pennebaker wrote:
> Yeah, I was scratching my head on that one, haha.
>
> On Jul 31, 2014 6:32 AM, "Matheus de Oliveira" <matioli.matheus@gmail.com>
> wrote:
>
>
>     2014-07-30 19:49 GMT-03:00 Bruce Momjian <bruce@momjian.us>:
>
>         I assume psql --no-psqlrc also works.

Oops, sorry, yeah.

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

  + Everyone has their own god. +