473,396 Members | 2,030 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

basic debugging question


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.

Thanks in advance!
Scott

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #1
4 1959
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
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #2
On Tue, 2004-10-26 at 12:39 -0700, Scott Frankel wrote:
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?
It means one row was added to some table and the row's oid is 18015.

.... - 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?


Try

SELECT * FROM <tablename> WHERE oid = 18015;

If that returns nothing, the row must have been added to some other
table, which would imply the existence of another table with a
compatible structure.

--
Oliver Elphick ol**@lfix.co.uk
Isle of Wight http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA
========================================
"Whosoever therefore shall be ashamed of me and of my
words in this adulterous and sinful generation; of him
also shall the Son of man be ashamed, when he cometh
in the glory of his Father with the holy angels."
Mark 8:38
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #3
On Tue, Oct 26, 2004 at 12:39:46PM -0700, Scott Frankel wrote:

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.
Wild stab: did you do it within a transaction and not commit. Note that
some database interfaces automatically start a transaction. Look for
"autocommit" or "commit".
Questions:

- What does the status msg, "INSERT 18015 1," refer to?
The first is the OID of the row, the second is the number of rows
inserted.
- What is this output called? (So I can search the documentation for
it.)
No idea, it's generated by psql. In a database interface you can get
the values directly.

Hope this helps,
--
Martijn van Oosterhout <kl*****@svana.org> http://svana.org/kleptog/ Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
tool for doing 5% of the work and then sitting around waiting for someone
else to do the other 95% so you can sue them.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQFBfrGpY5Twig3Ge+YRAmxeAJ9TD50Rv3/7biuwY5hgfRjzZn4FFgCfdjhL
8AYR1QaqlpxN5Jez2SJUrLo=
=Rf6G
-----END PGP SIGNATURE-----

Nov 23 '05 #4

I should have *myself* committed.

Thanks for the suggestions (and OID tip)! It turned out that my script
was
not committing the transaction, so the insert was getting rolled-back.

Thanks
Scott

On Oct 26, 2004, at 12:39 PM, Scott Frankel wrote:

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.

Thanks in advance!
Scott

---------------------------(end of
broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Troy Erickson | last post by:
I am very new to web developing. What is the best way to create a web project. I will be using asp with vs.net. What do most people do for computers more specifically. Do I remote debug to a...
3
by: Nosnets | last post by:
I am learning from a text book. Debugging breakpoints does not work. The Breakpoint properties dialogue contains the following comment "The breakpoint will not currently be hit. No symbols have...
0
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs...
7
by: Frank | last post by:
I'm running a mixed ASP / ASP.NET environment. I can use the debugger in for the ASP.NET code, no problems. But when I turn on ASP Debugging for the project, I get the error message: "Error...
2
by: Alex Clark | last post by:
Hi All, My system: WinXP Pro, VS.NET 2003, SQL Server Personal Edition. I'm having problems with my old favourite demon, SQL Debugging from within VS.NET. I have to say I've found this...
1
by: sher | last post by:
I just reinstalled Visual Basic.NET because I was receiving the following error: "Error while trying to run project. Unable to start debugging. No such interface supported." BUT, I am still...
2
by: Bob | last post by:
In code when I'm handling an exception, I'd like to be able to tell the debugger, if it's attached, to break and then navigate to where the exception was thrown, which won't be where I break. Is...
0
by: JT | last post by:
Hi, I've just realized that I'm not as smart as I thought I was. I have no problem creating Windows apps, class libraries, using windows references, etc. But, I absolutely cannot create and...
8
by: razael1 | last post by:
I am putting debugging messages into my program by putting blocks that look like this: #ifdef DEBUG errlog << "Here is some information"; #endif All these #ifdef blocks make the code bulky and...
25
by: Marco | last post by:
Hi everyone. I've been trying to move some small applications written in vb.net 2003 to vb.net 2005 express just for testing purposes. I have noticed so far that the applications seem to run ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.