How to query pgsql from a BASH script ? - Mailing list pgsql-general

From Michelle Konzack
Subject How to query pgsql from a BASH script ?
Date
Msg-id 20050403141615.GD15347@freenet.de
Whole thread Raw
Responses Re: How to query pgsql from a BASH script ?  (Pavel Stehule <stehule@kix.fsv.cvut.cz>)
Re: How to query pgsql from a BASH script ?  (Adrian Klaver <aklaver@comcast.net>)
List pgsql-general
Hello *,

I am puzzeling around, how to query a postgresql from a BASH script.
Generaly it must do nothing else as

1)  Get VALUEs from a DB/TABLE
    e.g.
    program --db pgsql.sld.tld --search "$COLNAME,$VAL" \
                               --get "COL1,COL3,COL4,..."

2)  Write one or more new VALUEs in the DB/TABLE
    e.g.
    program --db pgsql.sld.tld --search "$COLNAME,$VAL" \
                               --set "COL1:VAL1,COL3:VAL3,..."

3)  Remove ROWS from the DB/TABLE
    e.g.
    program --db pgsql.sld.tld --search "$COLNAME,$VAL" --remove


Curently I have only a sulution with a text/plain file but
there is a problem with locking and the file is already
180 kByte, which mean grep/cut/sed are to slow for it.

Under "heavy" load I need to access the database around
1-3 times (maybe in the future more) per second.

Any suggestions ?

Greetings
Michelle

--
Linux-User #280138 with the Linux Counter, http://counter.li.org/
Michelle Konzack   Apt. 917                  ICQ #328449886
                   50, rue de Soultz         MSM LinuxMichi
0033/3/88452356    67100 Strasbourg/France   IRC #Debian (irc.icq.com)

Attachment

pgsql-general by date:

Previous
From: Karsten Hilbert
Date:
Subject: Re: Empty date
Next
From: Bruno Wolff III
Date:
Subject: Re: Empty date