Re: basic debugging question

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: Scott Frankel <leknarf(at)pacbell(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: basic debugging question
Date: 2004-10-26 20:18:32
Message-ID: 1098821911.15791.170.camel@Andrea.peacock.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2004-10-26 20:20:57 Re: basic debugging question
Previous Message Oliver Elphick 2004-10-26 20:12:37 Re: basic debugging question