Thread: Bug/Feature Request: pgAdmin should show "context" part of error message for problems with COPY command

When issueing a COPY command like this one

--------------------
COPY tablename FROM '/var/www/hdberat.tab' WITH NULL AS '';
--------------------


The error-message in pgadminIII is quite short 

********** Error ***********************************************
FEHLER: fehlende Daten für Spalte »termin_dauer_eingabe«
SQL state: 22P04
-----------------------------------------------------------------

(For those who don't understand German: it says: missing data for column
xy). In PHP-pgadmin the errormessage is much more meaningful, because it
adds the CONTEXT-line, where it actually tells me the number of the line
("Zeile") in the source-file, where the error occurred:


****************************************************************
FEHLER:  fehlende Daten für Spalte »termin_dauer_eingabe«
CONTEXT:  COPY fm_hdberat, Zeile 10421: »admin1    Gründler Pius    archiviert    "Texteingabe"     "Texteingabe"
"Texteingabe"    "Texteingabe"     "Textein...«
 
-------------------------------------------------------------------

It'd be a big help, if pgadmin was as verbose as php-pgadmin.
Best regards
pl



On Tue, Aug 5, 2008 at 2:08 PM, kaeptn haddock <kaeptn.haddock@gmail.com> wrote:
> When issueing a COPY command like this one
>
> --------------------
> COPY tablename FROM '/var/www/hdberat.tab' WITH NULL AS '';
> --------------------
>
>
> The error-message in pgadminIII is quite short
>
> ********** Error ***********************************************
> FEHLER: fehlende Daten für Spalte »termin_dauer_eingabe«
> SQL state: 22P04
> -----------------------------------------------------------------
>
> (For those who don't understand German: it says: missing data for column
> xy). In PHP-pgadmin the errormessage is much more meaningful, because it
> adds the CONTEXT-line, where it actually tells me the number of the line
> ("Zeile") in the source-file, where the error occurred:
>
>
> ****************************************************************
> FEHLER:  fehlende Daten für Spalte »termin_dauer_eingabe«
> CONTEXT:  COPY fm_hdberat, Zeile 10421: »admin1        Gründler Pius   archiviert      "Texteingabe"   "Texteingabe"
 "Texteingabe"   "Texteingabe"   "Textein...« 
> -------------------------------------------------------------------
>
> It'd be a big help, if pgadmin was as verbose as php-pgadmin.

pgAdmin does include the context line, if the server gives us one:

-- Executing query:

select foo();

ERROR:  division by zero
CONTEXT:  PL/pgSQL function "foo" line 4 at assignment

********** Error **********

ERROR: division by zero
SQL state: 22012
Context: PL/pgSQL function "foo" line 4 at assignment


--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com


On Wed, Aug 6, 2008 at 10:46 AM, Dave Page <dpage@pgadmin.org> wrote:
>
> pgAdmin does include the context line, if the server gives us one:
>
> -- Executing query:
>
> select foo();
>
> ERROR:  division by zero
> CONTEXT:  PL/pgSQL function "foo" line 4 at assignment
>

Hi Dave. Since you mention this, there have been a couple of previous
threads requesting an option in pgAdmin to _disable_ the print-out of
context messages, similar to what 'set verbose terse' does in psql.
There are times when context messages clutter scripts output so bad
that it makes them unreadable.
I am aware its not a critical request at all, but it would be nice to
see it included in the to-do list for some future version.

Regards,
Fernando.