Обсуждение: Any way to selectively color query output in psql?

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

Any way to selectively color query output in psql?

От
"David G. Johnston"
Дата:
Basically I want to write this:

psql -c "SELECT E'\e[1;33m Some Text Here \e[0m';"

And have just the text "Some Text Here" colored while everything else is default white.

The \e constructs are the ANSI color escapes which work when using echo -e

I am using bash 4.2.25(1) on Ubuntu 14.04

Is this possible?

Thanks!

David J.

Re: Any way to selectively color query output in psql?

От
Gavin Flower
Дата:
On 08/01/16 10:25, David G. Johnston wrote:
> Basically I want to write this:
>
> psql -c "SELECT E'\e[1;33m Some Text Here \e[0m';"
>
> And have just the text "Some Text Here" colored while everything else
> is default white.
>
> The \e constructs are the ANSI color escapes which work when using echo -e
>
> I am using bash 4.2.25(1) on Ubuntu 14.04
>
> Is this possible?
>
> Thanks!
>
> David J.
>
But what is the version of Postgres?  :-)



Re: Any way to selectively color query output in psql?

От
"David G. Johnston"
Дата:
On Thu, Jan 7, 2016 at 2:32 PM, Gavin Flower <GavinFlower@archidevsys.co.nz> wrote:
On 08/01/16 10:25, David G. Johnston wrote:
Basically I want to write this:

psql -c "SELECT E'\e[1;33m Some Text Here \e[0m';"

And have just the text "Some Text Here" colored while everything else is default white.

The \e constructs are the ANSI color escapes which work when using echo -e

I am using bash 4.2.25(1) on Ubuntu 14.04

Is this possible?

Thanks!

David J.

But what is the version of Postgres?  :-)



​Touché

​9.3.10