Thread: libpq debug

libpq debug

From
"Darko Prenosil"
Date:
Does anyone know how to set the debug TTY in libpq client library ?
I did not find any example what to put in property pgtty:
 
PGconn *PQsetdbLogin(const char *pghost,
                     const char *pgport,
                     const char *pgoptions,
                     const char *pgtty,
                     const char *dbName,
                     const char *login,
                     const char *pwd)
 
I tried with :
    /dev/ptsxx
    /dev/pts/xx
    ptsxx
    pts/xx
but no result.
 
I've also tried with -o pgoption to set debug log file, but no output was written to that file.
I'm trying to debug some functions and without those two methods, it is very hard work !!!
 
Darko

Re: libpq debug

From
Tom Lane
Date:
"Darko Prenosil" <Darko.Prenosil@finteh.hr> writes:
> Does anyone know how to set the debug TTY in libpq client library ?

You can't anymore (it was deemed a security risk some time ago).
The backend ignores the tty argument now.
        regards, tom lane


Re: libpq debug

From
"Darko Prenosil"
Date:
----- Original Message -----
From: "Tom Lane" <tgl@sss.pgh.pa.us>
To: "Darko Prenosil" <Darko.Prenosil@finteh.hr>
Cc: "pgsql interfaces" <pgsql-interfaces@postgresql.org>
Sent: Thursday, November 22, 2001 7:01 PM
Subject: Re: [INTERFACES] libpq debug


> "Darko Prenosil" <Darko.Prenosil@finteh.hr> writes:
> > Does anyone know how to set the debug TTY in libpq client library ?
>
> You can't anymore (it was deemed a security risk some time ago).
> The backend ignores the tty argument now.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>

Is there any other way to debug plpgsql functions through libpq ?
I know that I can catch notice with error message, but this message often
looks like this:

Error near ''''

If I have function with more than one line, message like this does not help.

Thanks for Your previous answer !

Darko



Re: libpq debug

From
Tom Lane
Date:
"Darko Prenosil" <Darko.Prenosil@finteh.hr> writes:
> I know that I can catch notice with error message, but this message often
> looks like this:
> Error near ''''
> If I have function with more than one line, message like this does not help.

Try 7.2 beta ... it reports the line number for plpgsql syntax errors.
        regards, tom lane