Обсуждение: Debugging code on server?

Поиск
Список
Период
Сортировка

Debugging code on server?

От
Guyren Howe
Дата:
This is a fork from my "Love your database" question. It's a separable concern, so I moved it here.

Let's say I want to use Postgres' *amazing* support for lots of languages. I want to use Javascript or PERL or Ruby or
something.How do I debug the code? 

I can imagine things you might set up: using LISTEN/NOTIFY to a simple logger that would let you see what's going on.
Thereare breakpoints and such in PGAdmin, but I'll be that doesn't work for other languages. 

Any thoughts?

Re: Debugging code on server?

От
Vick Khera
Дата:
Good old fashioned "print" :)

I tend to use RAISE DEBUG, and look in the logs. The most complicated procedures we have in our system are enforcing state diagram changes for a given field that tracks an object status, so maybe this doesn't scale well.

On Wed, May 4, 2016 at 12:43 PM, Guyren Howe <guyren@gmail.com> wrote:
This is a fork from my "Love your database" question. It's a separable concern, so I moved it here.

Let's say I want to use Postgres' *amazing* support for lots of languages. I want to use Javascript or PERL or Ruby or something. How do I debug the code?

I can imagine things you might set up: using LISTEN/NOTIFY to a simple logger that would let you see what's going on. There are breakpoints and such in PGAdmin, but I'll be that doesn't work for other languages.

Any thoughts?

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: Debugging code on server?

От
Thomas Kellerer
Дата:
Guyren Howe schrieb am 04.05.2016 um 18:43:
> This is a fork from my "Love your database" question. It's a
> separable concern, so I moved it here.
>
> Let's say I want to use Postgres' *amazing* support for lots of
> languages. I want to use Javascript or PERL or Ruby or something. How
> do I debug the code?
>
> I can imagine things you might set up: using LISTEN/NOTIFY to a
> simple logger that would let you see what's going on. There are
> breakpoints and such in PGAdmin, but I'll be that doesn't work for
> other languages.
>

There is a unit test framework for Postgres

http://pgtap.org/

Re: Debugging code on server?

От
Szymon Lipiński
Дата:


On 4 May 2016 at 20:30, Thomas Kellerer <spam_eater@gmx.net> wrote:
Guyren Howe schrieb am 04.05.2016 um 18:43:
This is a fork from my "Love your database" question. It's a
separable concern, so I moved it here.

Let's say I want to use Postgres' *amazing* support for lots of
languages. I want to use Javascript or PERL or Ruby or something. How
do I debug the code?

I can imagine things you might set up: using LISTEN/NOTIFY to a
simple logger that would let you see what's going on. There are
breakpoints and such in PGAdmin, but I'll be that doesn't work for
other languages.


There is a unit test framework for Postgres

http://pgtap.org/



Right, and it is quite painful to use compared to writing tests as some external program. 

--
    regards Szymon Lipiński