Re: Debugging question ...

From: "Josh Tolley" <eggyknap(at)gmail(dot)com>
To: "Robert Bernabe" <rbernabe(at)sandmansystems(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Debugging question ...
Date: 2007-11-09 05:50:49
Message-ID: e7e0a2570711082150x1017108fq6217011f2931f7ec@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Nov 7, 2007 8:56 PM, Robert Bernabe <rbernabe(at)sandmansystems(dot)com> wrote:
> Hi All,
> I've been using MS SQL 2k and it's bundled query analyzer SQL editor for
> more than 5 years. I am exploring postgres right now and I hit a snag I
> don't understand...
>
> MS SQL : debugging - use query analyzer, declare variables, plug in code
> and test...
>
> PG : using PGAdminIII editor :
>
> declare
>
> tst int; (or whatever variable)
>
> there is an error already....syntax error...
>
> I did some research and it seems that variables cannot be declared
> outside a function scope? Looking at functions within PG, the
> implementation looks like one massive dynamic sql string....
>
> I wanted to figure out how PG handles single quotes, double quotes,
> string concats and such.... problem is that the editor won't even let me
> declare variables...ahmm help? how does one debug in PG? what tool?
> anything like query analyzer of MS SQL? why can't I declare variables
> and print the values out to check and debug? HELP? Many Thanks in
> advance...
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>

I recommend starting with the documentation. It sounds like you'd like
to do pl/pgsql stuff, so you might try this link:
http://www.postgresql.org/docs/8.2/interactive/plpgsql.html. Take
sample functions from there, and adapt them to do what you need. It's
easier to take something that works and learn the postgresql idioms
from that rather than to take something from MS SQL and try to replace
MS SQL-isms with PostgreSQL-isms.

- Josh/eggyknap

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Robert Bernabe 2007-11-09 06:32:32 Re: Debugging question ...
Previous Message David Monarchi 2007-11-09 00:13:28 Constructing two-dimensional arrays from a query