- Архив списков рассылки pgsql-general

Поиск
Список
Период
Сортировка
От rx
Тема
Дата
Msg-id 000901c2f471$d7702d10$16e1f48a@IPSM7N
обсуждение исходный текст
Список pgsql-general

hallo,

my Name is Rong. I am student at TU-Munich. I have some questions for Postgresql under SuSe Linux.

I want save something in Postgresql-Table, when I get a fax from "Hylafax".

I insert "

psql -U postgres dbname <<END_OF_INSTR

insert into "CSID_TIF"("CSID","suspens_file","actDatum") values('0049891234567','test.tif','01.01.2003'))

END_OF_INSTR "

in shell script.

It work very good.

Now I want enhance it.

When there are some error in Postgresql, or There are some Error at insert, I want give a message per email to me. 

But I do not know, how  can I get the Error from Postgresql in Linux Shell Script.

When an Postgresql-Error is to happen, how can I get the Error-Message-Event in shell script and send a email to me.  

I hope I can get your Help!

Thank you very much!

best regards!

rong

PS: faxrcvd is my shell-script in Hylafax.

#! /bin/sh

psql -U postgres dbname <<END_OF_INSTR

insert into "CSID_TIF"("CSID","suspens_file","actDatum") values('0049891234567','test.tif','01.01.2003'))

END_OF_INSTR

##end script

Вложения

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

Предыдущее
От: Tim Ashman
Дата:
Сообщение: Re: Development Language, OS and PostgreSQL
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Cursors with Large, Ordered Result Sets