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

Started by Andrew Pennebakerover 11 years ago8 messagesbugs
Jump to latest
#1Andrew Pennebaker
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.

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#2Fujii Masao
masao.fujii@gmail.com
In reply to: Andrew Pennebaker (#1)
Re: BUG #10991: psql -c ignores my pager settings in ~/.psqlrc

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

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#3David G. Johnston
david.g.johnston@gmail.com
In reply to: Fujii Masao (#2)
Re: BUG #10991: psql -c ignores my pager settings in ~/.psqlrc

Fujii Masao-2 wrote

On Sat, Jul 19, 2014 at 1:04 AM, &lt;

andrew.pennebaker@

&gt; 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.

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#4Matheus de Oliveira
matioli.matheus@gmail.com
In reply to: Fujii Masao (#2)
Re: BUG #10991: psql -c ignores my pager settings in ~/.psqlrc

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,
--
Matheus de Oliveira
Analista de Banco de Dados
Dextra Sistemas - MPS.Br nível F!
www.dextra.com.br/postgres

#5Bruce Momjian
bruce@momjian.us
In reply to: Matheus de Oliveira (#4)
Re: BUG #10991: psql -c ignores my pager settings in ~/.psqlrc

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

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

#6Matheus de Oliveira
matioli.matheus@gmail.com
In reply to: Bruce Momjian (#5)
Re: BUG #10991: psql -c ignores my pager settings in ~/.psqlrc

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ível F!
www.dextra.com.br/postgres

#7Andrew Pennebaker
andrew.pennebaker@gmail.com
In reply to: Matheus de Oliveira (#6)
Re: BUG #10991: psql -c ignores my pager settings in ~/.psqlrc

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:

Show quoted text

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ível F!
www.dextra.com.br/postgres

#8Bruce Momjian
bruce@momjian.us
In reply to: Andrew Pennebaker (#7)
Re: BUG #10991: psql -c ignores my pager settings in ~/.psqlrc

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

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs