regarding debugging?

Started by AKHILESH GUPTAabout 20 years ago4 messagesgeneral
Jump to latest
#1AKHILESH GUPTA
akhilesh.davim@gmail.com

hi all,
i have a query regarding debbuging in PGSQL.
just like there is a debugger in C/C++, where we can check the execution of
our program or we can dry run our code, is there aby option or feature with
PGSQL for the same purpose that we can check our PGSQL statements?
thanks in advance................................................!!
(waiting for your response)

--
Thanks & Regards,
Akhilesh
DAV Institute of Management
Faridabad(Haryana)
GSM:-(+919891606064)
(+911744293789)

"FAILURES CAN BE FORGIVEN BUT AIMING LOW IS A CRIME"

#2Scott Ribe
scott_ribe@killerbytes.com
In reply to: AKHILESH GUPTA (#1)
Re: regarding debugging?

where we can check the execution of our program or we can dry run our code, is
there aby option or feature with PGSQL for the same purpose that we can check
our PGSQL statements?

No, unfortunately not. What I do is:

- error check everything you can, and use RAISE EXCEPTION with descriptive
error messages

- come up with test cases to exercise all branches of code

- print useful debugging info while tracking down problems

--
Scott Ribe
scott_ribe@killerbytes.com
http://www.killerbytes.com/
(303) 665-7007 voice

#3SunWuKung
Balazs.Klein@axelero.hu
In reply to: AKHILESH GUPTA (#1)
Re: regarding debugging?

In article <C00437CF.3F9D0%scott_ribe@killerbytes.com>,
scott_ribe@killerbytes.com says...

where we can check the execution of our program or we can dry run our code, is
there aby option or feature with PGSQL for the same purpose that we can check
our PGSQL statements?

No, unfortunately not. What I do is:

- error check everything you can, and use RAISE EXCEPTION with descriptive
error messages

- come up with test cases to exercise all branches of code

- print useful debugging info while tracking down problems

EMS Postgresql Manager has a debugger in it. Its not perfect but still
it is quite useful.

B.

#4BigSmoke
bigsmoke@gmail.com
In reply to: AKHILESH GUPTA (#1)
Re: regarding debugging?

Checking how your PgSQL statements are executed, can be done using
EXPLAIN [1]http://www.postgresql.org/docs/current/interactive/sql-explain.html.

EXPLAIN ANALYZE will also execute (but not dry-run!) your statement.

I work with a seperate development and production database. Once the
changes to the schema in the development DB are done, I commit them to
the production DB using ActiveRecord migrations. You could do the same
with an advanced schema diff tool such as pgdiff [2]http://pgdiff.sourceforge.net/ or zongle [3]http://zongle.sourceforge.net/.

- Rowan

[1]: http://www.postgresql.org/docs/current/interactive/sql-explain.html
[2]: http://pgdiff.sourceforge.net/
[3]: http://zongle.sourceforge.net/