Re: basic debugging question

Поиск
Список
Период
Сортировка
От Tino Wildenhain
Тема Re: basic debugging question
Дата
Msg-id 1098821911.15791.170.camel@Andrea.peacock.de
обсуждение исходный текст
Ответ на basic debugging question  (Scott Frankel <leknarf@pacbell.net>)
Список pgsql-general
Am Di, den 26.10.2004 schrieb Scott Frankel um 21:39:
> I'm attempting to debug a script that should perform a simple INSERT of
> values,
> but for some reason doesn't.  The insert appears to occur without
> error, printing
> "INSERT 18015 1 upon completion."  Nonetheless, no data values appear
> to be
> added to the table when queried in psql.
>
> Questions:
>
> - What does the status msg, "INSERT 18015 1," refer to?
>
> - What is this output called?  (So I can search the documentation for
> it.)
>
> - Is there something clever I can access -- besides this list ;) -- so
> I can
>    peek inside INSERT 18015 1 to see what pgres is thinking about?
>
> Note that when I perform the INSERT by hand in psql, the row of data is
> entered
> without incident.

Ok, the script inserts, no error but the values dont appear.
You use the same SQL in psql to insert, you get the status
msg and the data appears?

Either your script ignores fail messages at all or
it is successfull with the insert but fails somehow
afterwards or just forget to commit() the transaction.
Closing the database connection or errors in subsequent
statements in the same transaction cause a rollback -
efectively whiping out all changes.

If the latter there would be no point in reading the
notices since you would get the very same message
but end up with no tuples in the table.

See for example in psql:

BEGIN work;
INSERT INTO ... (your insert you try);
-> you see the message INSERT 232354 1 upon completion
ROLLBACK;
look at your table - the inserted data isnt there anymore.

HTH
Tino


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

Предыдущее
От: Oliver Elphick
Дата:
Сообщение: Re: basic debugging question
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: basic debugging question