writting a large store procedure

Started by "Rodríguez Rodríguez, Pere"almost 21 years ago8 messagesgeneral
Jump to latest

Hello,

I'm writing a large store procedures (more than 700 lines) and I have much
problems to debug it. How can I debug it easily?
I use pgAdmin, is there another editor (free software) that permit write
large store procedure more easily?

Thanks in advance.

pere

#2Noname
ouyang_jw@hoperun.com
In reply to: "Rodríguez Rodríguez, Pere" (#1)
Re: writting a large store procedure

writting a large store procedureI use EMS postgresql manager 2.8.0.3

----- Original Message -----
From: Rodr�guez Rodr�guez, Pere
To: pgsql-general@postgresql.org
Sent: Thursday, June 02, 2005 3:57 PM
Subject: [GENERAL] writting a large store procedure

Hello,

I'm writing a large store procedures (more than 700 lines) and I have much
problems to debug it. How can I debug it easily?

I use pgAdmin, is there another editor (free software) that permit write
large store procedure more easily?

Thanks in advance.

pere

#3Sean Davis
sdavis2@mail.nih.gov
In reply to: "Rodríguez Rodríguez, Pere" (#1)
Re: writting a large store procedure

I have to recommend pgEdit (nearly free and does have a nearly
fully-functional test version).

Sean

On Jun 2, 2005, at 3:57 AM, Rodríguez Rodríguez, Pere wrote:

Show quoted text

Hello,

I'm writing a large store procedures (more than 700 lines) and I have
much problems to debug it. How can I debug it easily?

I use pgAdmin, is there another editor (free software) that permit
write large store procedure more easily?

Thanks in advance.

pere

#4Tony Caduto
tony_caduto@amsoftwaredesign.com
In reply to: Sean Davis (#3)
Re: writting a large store procedure

Sean,
I am tooting my own horn here, but I would recomend PG Lightning Admin.
It has a incredible function editor (and query editor) that is based on
Synedit(synedit.sourceforge.net), and has full code completion that includes
all the Postgres built in functions,exception names,types etc etc, and
it it has schema and table completion as well.
Just type the name of a schema and the .
i.e. public. and you will see all objects for that schema including
functions tables,domains etc.
Type the name of a table i.e. public.mytable. and you will see all the
fields for that table.

We have a large internal project that has stored functions that are 1000
lines long and of course we use PG Lightning Admin.

You can check it out here http://www.amsoftwaredesign.com , and get a
full 30 day demo.
You will not be disappointed.

The price right now is only 15.99 USD, which is a incredible deal.
After the pre-release the price is going up to 29.99, so if you grab a
copy now you can get it for the cost of lunch :-)

Tony Caduto
http://www.amsoftwaredesign.com
Home of PG Lightning Admin for Postgresql 8.x

Sean Davis wrote:

Show quoted text

I have to recommend pgEdit (nearly free and does have a nearly
fully-functional test version).

Sean

On Jun 2, 2005, at 3:57 AM, Rodr�guez Rodr�guez, Pere wrote:

Hello,

I'm writing a large store procedures (more than 700 lines) and I have
much problems to debug it. How can I debug it easily?

I use pgAdmin, is there another editor (free software) that permit
write large store procedure more easily?

Thanks in advance.

pere

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

#5Russ Brown
pickscrape@gmail.com
In reply to: Tony Caduto (#4)
Re: writting a large store procedure

Tony Caduto wrote:

Sean,
I am tooting my own horn here, but I would recomend PG Lightning Admin.
It has a incredible function editor (and query editor) that is based on
Synedit(synedit.sourceforge.net), and has full code completion that
includes
all the Postgres built in functions,exception names,types etc etc, and
it it has schema and table completion as well.
Just type the name of a schema and the .
i.e. public. and you will see all objects for that schema including
functions tables,domains etc.
Type the name of a table i.e. public.mytable. and you will see all the
fields for that table.

We have a large internal project that has stored functions that are 1000
lines long and of course we use PG Lightning Admin.

You can check it out here http://www.amsoftwaredesign.com , and get a
full 30 day demo.
You will not be disappointed.

The price right now is only 15.99 USD, which is a incredible deal.
After the pre-release the price is going up to 29.99, so if you grab a
copy now you can get it for the cost of lunch :-)

Tony Caduto
http://www.amsoftwaredesign.com
Home of PG Lightning Admin for Postgresql 8.x

I was about to go and buy this and then saw that it's Windows-only. Oh well!

--

Russ.

#6Bob
luckyratfoot@gmail.com
In reply to: "Rodríguez Rodríguez, Pere" (#1)
Re: writting a large store procedure

Well first off can you break those 700 lines out into more stored functions?

Maybe you have logic that would be best in its own function and than call
one function from another. Makes testing many times easier. I always think
in small chuncks when I write code.
Once code gets to be more than a few pages it can become hell to debug and
work with. Plus breaking it out might allow you to use that same logic in
other parts of your system because it will be stand alone piece of
logic/code.

Show quoted text

On 6/2/05, "Rodríguez Rodríguez, Pere" <prr@hosppal.es> wrote:

Hello,

I'm writing a large store procedures (more than 700 lines) and I have much
problems to debug it. How can I debug it easily?

I use pgAdmin, is there another editor (free software) that permit write
large store procedure more easily?

Thanks in advance.

pere

#7Bob
luckyratfoot@gmail.com
In reply to: "Rodríguez Rodríguez, Pere" (#1)
Re: writting a large store procedure

Well first off can you break those 700 lines out into more stored functions?

Maybe you have logic that would be best in its own function and than call one function from another. Makes testing many times easier. I always think in small chuncks when I write code.

Once code gets to be more than a few pages it can become hell to debug and work with. Plus breaking it out might allow you to use that same logic in other parts of your system because it will be stand alone piece of logic/code.

On 6/2/05, "Rodríguez Rodríguez, Pere" <prr@hosppal.es> wrote:

Hello,

I'm writing a large store procedures (more than 700 lines) and I have much problems to debug it. How can I debug it easily?

I use pgAdmin, is there another editor (free software) that permit write large store procedure more easily?

Thanks in advance.

pere

In reply to: Bob (#7)
Re: writting a large store procedure

-----Mensaje original-----
De: Bob [mailto:luckyratfoot@gmail.com]
Enviado el: viernes 3 de junio de 2005 23:34
Para: Rodríguez Rodríguez, Pere
CC: pgsql-general@postgresql.org
Asunto: Re: [GENERAL] writting a large store procedure

Well first off can you break those 700 lines out into more stored functions?

No, I can't. Is a stored procedure with a lot of particularities.

Maybe you have logic that would be best in its own function and than call
one function from another. Makes testing many times easier. I always think
in small chuncks when I write code.

Once code gets to be more than a few pages it can become hell to debug and
work with. Plus breaking it out might allow you to use that same logic in
other parts of your system because it will be stand alone piece of
logic/code.

On 6/2/05, "Rodríguez Rodríguez, Pere" < prr@hosppal.es
<mailto:prr@hosppal.es> > wrote:

Hello,

I'm writing a large store procedures (more than 700 lines) and I have much
problems to debug it. How can I debug it easily?

I use pgAdmin, is there another editor (free software) that permit write
large store procedure more easily?

Thanks in advance.

pere