Re: basic debugging question - Mailing list pgsql-general

From Tino Wildenhain
Subject Re: basic debugging question
Date
Msg-id 1098821911.15791.170.camel@Andrea.peacock.de
Whole thread Raw
In response to basic debugging question  (Scott Frankel <leknarf@pacbell.net>)
List 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 by date:

Previous
From: Oliver Elphick
Date:
Subject: Re: basic debugging question
Next
From: Martijn van Oosterhout
Date:
Subject: Re: basic debugging question