Skip site navigation (1) Skip section navigation (2)

Re: Colors/bold chars in a select?

From: Ennio-Sr <nasr(dot)laili(at)tin(dot)it>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Colors/bold chars in a select?
Date: 2006-04-20 20:40:40
Message-ID: 20060420204040.GA6460@deby.ei.hnet (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
* Andrew Chambers <andychambers2002(at)yahoo(dot)co(dot)uk> [150406, 12:31]:
> * Ennio-Sr <nasr(dot)laili(at)tin(dot)it> [2006-04-14 23:27:38 +0200]:

> ..... 

> This task sounds like a job for awk.  The syntax of the script below
> might not be quite correct but you should be able to do something
> like...
> psql -f query.sql |awk ' { if($2 >= $1) print "\e[32;01m" $0
>                            else print $0
>                          } '
Hi Andrew, 
thank you for your suggestion: I wouldn't expect it was possible to pipe the psql
command output and was looking for a psql command ...

Unfortunately, awk does the job perfectly in a test table (having
only a few output fields) whereas it seems to get confused when I use it
for the real table and with multiple conditions ( if .. do; else if ..
do ; else do ). I'm reading man awk just now ... ;)

Best regards,

[Perche' usare Win$ozz (dico io) se ..."anche uno sciocco sa farlo.   \\?//
 Fa' qualche cosa di cui non sei capace!"  (diceva Henry Miller) ]    (°|°)
[Why use Win$ozz (I say) if ... "even a fool can do that.              )=(
 Do something you aren't good at!" (as Henry Miller used to say) ]

In response to


pgsql-novice by date

Next:From: Ketema HarrisDate: 2006-04-20 21:16:54
Subject: Constraining future rows based on past rows
Previous:From: Frances CollierDate: 2006-04-20 15:47:36
Subject: Re: postgresql connection problems

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group