Re: How to query pgsql from a BASH script ?

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: How to query pgsql from a BASH script ?
Дата
Msg-id Pine.LNX.4.44.0504032306340.12689-100000@kix.fsv.cvut.cz
обсуждение исходный текст
Ответ на Re: How to query pgsql from a BASH script ?  (Michelle Konzack <linux4michelle@freenet.de>)
Ответы Re: How to query pgsql from a BASH script ?  (Martijn van Oosterhout <kleptog@svana.org>)
Re: How to query pgsql from a BASH script ?  (Michelle Konzack <linux4michelle@freenet.de>)
Список pgsql-general
> So if I understand it right, if I have a table like
>
> Table:  ip_table
>        ip       |   ctime    |   atime
> ----------------+------------+------------
> aaa.bbb.ccc.ddd | 1234567890 | 2345678901
> eee.fff.ggg.hhh | 3456789012 | 4567890123
>
> and I need only
>
>     CONNECT TO localhost USER michelle.konzack;
>     RETVAL=`SELECT ctime, atime FROM ip_table WHERE ip = $SEARCH;`
>
test=# select * from foo;
 a  | b
----+----
 10 | 10
 10 | 20

pgbash> retval=`select a,b from foo;`
pgbash> echo $retval
a | b ----+---- 10 | 10 10 | 20 (2 rows)

I remeber other project

http://www.edlsystems.com/shellsql

bye

Pavel Stehule



В списке pgsql-general по дате отправления:

Предыдущее
От: Daniel Schuchardt
Дата:
Сообщение: Re: Inheritance and such
Следующее
От: Keary Suska
Дата:
Сообщение: Re: Empty date