Re: Does psql use nested transactions?

Поиск
Список
Период
Сортировка
От Honza Pazdziora
Тема Re: Does psql use nested transactions?
Дата
Msg-id 20040818063919.GB14034@anxur.fi.muni.cz
обсуждение исходный текст
Ответ на Re: Does psql use nested transactions?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Does psql use nested transactions?  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Список pgsql-hackers
On Tue, Aug 17, 2004 at 02:56:19PM -0400, Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Doing it only for interactive mode seems too error-prone to me (it works
> > in psql, but not from my script).
> 
> You're missing the point: a script cannot safely work this way.  A human
> typing at the terminal can notice that his command failed and react to
> that, but a psql script cannot.

It is not just a typo that you make in the SQL command. You often need
to do
insert into table which has primary keyif the insert failed, do update of the existing record

It should be upto the application to decide if the failed insert
should lead to abortion of the transaction, or if it should be
silently ignored and based on the return value of the insert proceed
with update.

-- 
------------------------------------------------------------------------Honza Pazdziora | adelton@fi.muni.cz |
http://www.fi.muni.cz/~adelton/.project:Perl, mod_perl, DBI, Oracle, large Web systems, XML/XSL, ...    Only
self-confidentpeople can be simple.
 


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

Предыдущее
От: Oliver Jowett
Дата:
Сообщение: Re: 7.4.3 & 8.0.0beta1 + Solaris 9: default pg_hba.conf
Следующее
От: Christopher Kings-Lynne
Дата:
Сообщение: Re: Does psql use nested transactions?