Thread: writting a large store procedure

writting a large store procedure

From
"Rodríguez Rodríguez, Pere"
Date:

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

Re: writting a large store procedure

From
Date:
I use EMS postgresql manager 2.8.0.3
 
----- Original Message -----
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

Re: writting a large store procedure

From
Sean Davis
Date:
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


Re: writting a large store procedure

From
Tony Caduto
Date:
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:

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



Re: writting a large store procedure

From
Russ Brown
Date:
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.

Re: writting a large store procedure

From
Bob
Date:
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


Re: writting a large store procedure

From
"Bob"
Date:
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


Re: writting a large store procedure

From
"Rodríguez Rodríguez, Pere"
Date:
 
-----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> 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