Search Postgresql Archives

Re: Processing data from table using awk.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 6, 2015 at 10:15 AM, Melvin Davidson <melvin6925@xxxxxxxxx> wrote:
Your best bet is something like

#!/bin/bash

get_data ()
{
QRY=$(psql $HOST $PORT $USER $DBNAME <<_QUERY_

\o your_output_file
SELECT col1, col2, ...., coln
  FROM your_table
WHERE <blah>;

_QUERY_

)
}

awk <blah> your_table


​I presume you mean "awk <blah> your_output_file" ...

David J.​
 


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux