Thread: view data causes pgadmin to hang or die

view data causes pgadmin to hang or die

From
Miha Radej
Date:
hi!

i have a table with 204 rows of data which contain about 700k of text
alltogether. when i tried to use "view data" in the table, pgadmin
either crashes or hangs, no apparent pattern so far. in pgadmin log, set
to debug, there is nothing to indicate the problem. but according to it
(and to pgsql log) it seems pgadmin gets the data, then sends a query to
get the column names. here are the last lines from pgsql log:

DNEVNIK:  statement: SELECT oid, * FROM problematic_table ORDER BY oid ASC
DNEVNIK:  statement: SELECT n.nspname AS nspname, relname, t.typname,
nt.nspname AS typnspname, attname, attnum, COALESCE(b.oid, t.oid) AS
basetype, atthasdef, adsrc,
                CASE WHEN t.typbasetype::oid=0 THEN att.atttypmod else
t.typtypmod END AS typmod,
                CASE WHEN t.typbasetype::oid=0 THEN att.attlen else
t.typlen END AS typlen
           FROM pg_attribute att
           JOIN pg_type t ON t.oid=att.atttypid
           JOIN pg_namespace nt ON nt.oid=t.typnamespace
           JOIN pg_class c ON c.oid=attrelid
           JOIN pg_namespace n ON n.oid=relnamespace
           LEFT OUTER JOIN pg_type b ON b.oid=t.typbasetype
           LEFT OUTER JOIN pg_attrdef def ON adrelid=attrelid AND
adnum=attnum
          WHERE attnum > 0 AND NOT attisdropped AND attrelid=56359::oid
          ORDER BY attnum
DNEVNIK:  unexpected EOF on client connection

dnevnik = log

i'm guessing pgadmin gets the data, asks for the column names and then
has problems displaying the data.

if i copy&paste the queries into the query tool, it works without
problems (on all pgadmin versions i've tried this on), the data displays
very fast.

i am using pgadmin3, compiled from cvs, revision 5056, on opensuse 10.0.
the same happened with pgadmin3 1.4.x for debian (used on kubuntu 5.10)
and revision 5056 built on the same kubuntu.

i tried building the latest revision (5057) but it fails with the
following error, on both kubuntu and suse:

if g++ -DHAVE_CONFIG_H -I. -I. -I..
-DDATA_DIR=\"/usr/local/pgadmin-svn/share/pgadmin3/\" -Wall
-Wno-non-virtual-dtor -I../src/include -I../src/agent/include
-I../src/slony/include -I/usr/include/pgsql -DSSL
-I/usr/lib/wx/include/gtk2-unicode-release-2.6 -I/usr/include/wx-2.6
-DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES
-D_LARGEFILE_SOURCE=1 -DNO_GCC_PRAGMA -O2 -I/usr/include/libxml2
-DDATA_DIR=\"/usr/local/pgadmin-svn/share/pgadmin3/\" -Wall
-Wno-non-virtual-dtor -I../src/include -I../src/agent/include
-I../src/slony/include  -MT ctlSQLBox.o -MD -MP -MF
".deps/ctlSQLBox.Tpo" -c -o ctlSQLBox.o `test -f './ctl/ctlSQLBox.cpp'
|| echo './'`./ctl/ctlSQLBox.cpp; \
then mv -f ".deps/ctlSQLBox.Tpo" ".deps/ctlSQLBox.Po"; else rm -f
".deps/ctlSQLBox.Tpo"; exit 1; fi
make[2]: *** No rule to make target `ctl/ctlSQLGrid.cpp', needed by
`ctlSQLGrid.o'.  Stop.
make[2]: Leaving directory `/net/programs/pgadmin-svn/pgadmin3/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/net/programs/pgadmin-svn/pgadmin3'
make: *** [all] Error 2

i cannot provide the table structure or data unfortunately but if you
need any more information, i'd be happy to try to provide it.

regards,
Miha

Re: view data causes pgadmin to hang or die

From
Miha Radej
Date:
Hi!

I'm sorry for bumping this but if it is possible, it would be great if
the described problem can be resolved. Even hints as to what I may be
doing wrong would help a lot :-)

Thank you,
Miha

Miha Radej wrote:
> hi!
>
> i have a table with 204 rows of data which contain about 700k of text
> alltogether. when i tried to use "view data" in the table, pgadmin
> either crashes or hangs, no apparent pattern so far. in pgadmin log, set
> to debug, there is nothing to indicate the problem. but according to it
> (and to pgsql log) it seems pgadmin gets the data, then sends a query to
> get the column names. here are the last lines from pgsql log:
>
> DNEVNIK:  statement: SELECT oid, * FROM problematic_table ORDER BY oid ASC
> DNEVNIK:  statement: SELECT n.nspname AS nspname, relname, t.typname,
> nt.nspname AS typnspname, attname, attnum, COALESCE(b.oid, t.oid) AS
> basetype, atthasdef, adsrc,
>                CASE WHEN t.typbasetype::oid=0 THEN att.atttypmod else
> t.typtypmod END AS typmod,
>                CASE WHEN t.typbasetype::oid=0 THEN att.attlen else
> t.typlen END AS typlen
>           FROM pg_attribute att
>           JOIN pg_type t ON t.oid=att.atttypid
>           JOIN pg_namespace nt ON nt.oid=t.typnamespace
>           JOIN pg_class c ON c.oid=attrelid
>           JOIN pg_namespace n ON n.oid=relnamespace
>           LEFT OUTER JOIN pg_type b ON b.oid=t.typbasetype
>           LEFT OUTER JOIN pg_attrdef def ON adrelid=attrelid AND
> adnum=attnum
>          WHERE attnum > 0 AND NOT attisdropped AND attrelid=56359::oid
>          ORDER BY attnum
> DNEVNIK:  unexpected EOF on client connection
>
> dnevnik = log
>
> i'm guessing pgadmin gets the data, asks for the column names and then
> has problems displaying the data.
>
> if i copy&paste the queries into the query tool, it works without
> problems (on all pgadmin versions i've tried this on), the data displays
> very fast.
>
> i am using pgadmin3, compiled from cvs, revision 5056, on opensuse 10.0.
> the same happened with pgadmin3 1.4.x for debian (used on kubuntu 5.10)
> and revision 5056 built on the same kubuntu.
>
> i tried building the latest revision (5057) but it fails with the
> following error, on both kubuntu and suse:
>
> if g++ -DHAVE_CONFIG_H -I. -I. -I..
> -DDATA_DIR=\"/usr/local/pgadmin-svn/share/pgadmin3/\" -Wall
> -Wno-non-virtual-dtor -I../src/include -I../src/agent/include
> -I../src/slony/include -I/usr/include/pgsql -DSSL
> -I/usr/lib/wx/include/gtk2-unicode-release-2.6 -I/usr/include/wx-2.6
> -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES
> -D_LARGEFILE_SOURCE=1 -DNO_GCC_PRAGMA -O2 -I/usr/include/libxml2
> -DDATA_DIR=\"/usr/local/pgadmin-svn/share/pgadmin3/\" -Wall
> -Wno-non-virtual-dtor -I../src/include -I../src/agent/include
> -I../src/slony/include  -MT ctlSQLBox.o -MD -MP -MF
> ".deps/ctlSQLBox.Tpo" -c -o ctlSQLBox.o `test -f './ctl/ctlSQLBox.cpp'
> || echo './'`./ctl/ctlSQLBox.cpp; \
> then mv -f ".deps/ctlSQLBox.Tpo" ".deps/ctlSQLBox.Po"; else rm -f
> ".deps/ctlSQLBox.Tpo"; exit 1; fi
> make[2]: *** No rule to make target `ctl/ctlSQLGrid.cpp', needed by
> `ctlSQLGrid.o'.  Stop.
> make[2]: Leaving directory `/net/programs/pgadmin-svn/pgadmin3/src'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/net/programs/pgadmin-svn/pgadmin3'
> make: *** [all] Error 2
>
> i cannot provide the table structure or data unfortunately but if you
> need any more information, i'd be happy to try to provide it.
>
> regards,
> Miha

Re: view data causes pgadmin to hang or die

From
"Dave Page"
Date:

> -----Original Message-----
> From: pgadmin-hackers-owner@postgresql.org
> [mailto:pgadmin-hackers-owner@postgresql.org] On Behalf Of Miha Radej
> Sent: 28 March 2006 08:27
> To: pgadmin-hackers
> Subject: Re: [pgadmin-hackers] view data causes pgadmin to hang or die
>
> > i have a table with 204 rows of data which contain about
> 700k of text
> > alltogether. when i tried to use "view data" in the table, pgadmin
> > either crashes or hangs, no apparent pattern so far. in
> pgadmin log, set
> > to debug, there is nothing to indicate the problem. but
> according to it
> > (and to pgsql log) it seems pgadmin gets the data, then
> sends a query to
> > get the column names. here are the last lines from pgsql log:

Does the query tool display it properly if you increase the "Max
characters per column" option under File->Options->Query so it is large
enough to hold the data?

Regards, Dave

Re: view data causes pgadmin to hang or die

From
Miha Radej
Date:
Hi!

Now that you mention it... I've played around a bit and I've observed
the following.

The "View Data" function: crashes or hangs regardless of any settings.

The Query tool: it wasn't a problem. I said "select * from table;" and
it happily displayed the results. The result set returned more than 100
rows (the limit set in options) so the query tool asked me if I wanted
to display everything. I said "Yes" and of 204 records only 101 got
displayed. I then increased the max number of returned rows to 500 and
again I only got 101 row.

The "View Data" works OK on any other table I have so I'm really baffled
by this. The query tool however limits the display to 101 tuples,
regardless of the row limit settings.

Btw, any ideas on the build error in the previous mail? I have no ideas
what to do to "make it happen" :)

Regards,
Miha

Dave Page wrote:
>
>
>> -----Original Message-----
>> From: pgadmin-hackers-owner@postgresql.org
>> [mailto:pgadmin-hackers-owner@postgresql.org] On Behalf Of Miha Radej
>> Sent: 28 March 2006 08:27
>> To: pgadmin-hackers
>> Subject: Re: [pgadmin-hackers] view data causes pgadmin to hang or die
>>
>>> i have a table with 204 rows of data which contain about
>> 700k of text
>>> alltogether. when i tried to use "view data" in the table, pgadmin
>>> either crashes or hangs, no apparent pattern so far. in
>> pgadmin log, set
>>> to debug, there is nothing to indicate the problem. but
>> according to it
>>> (and to pgsql log) it seems pgadmin gets the data, then
>> sends a query to
>>> get the column names. here are the last lines from pgsql log:
>
> Does the query tool display it properly if you increase the "Max
> characters per column" option under File->Options->Query so it is large
> enough to hold the data?
>
> Regards, Dave
>

Re: view data causes pgadmin to hang or die

From
"Dave Page"
Date:

> -----Original Message-----
> From: Miha Radej [mailto:miha.radej@siix.com]
> Sent: 29 March 2006 12:28
> To: Dave Page
> Cc: pgadmin-hackers
> Subject: Re: [pgadmin-hackers] view data causes pgadmin to hang or die
>
> Hi!
>
> Now that you mention it... I've played around a bit and I've observed
> the following.
>
> The "View Data" function: crashes or hangs regardless of any settings.
>
> The Query tool: it wasn't a problem. I said "select * from
> table;" and
> it happily displayed the results. The result set returned
> more than 100
> rows (the limit set in options) so the query tool asked me if
> I wanted
> to display everything. I said "Yes" and of 204 records only 101 got
> displayed. I then increased the max number of returned rows
> to 500 and
> again I only got 101 row.

OK, but what if you increase the max column size as I suggested? If it's
a grid problem, the data truncation in the query tool might be masking
it.

> The "View Data" works OK on any other table I have so I'm
> really baffled
> by this. The query tool however limits the display to 101 tuples,
> regardless of the row limit settings.

Are those tables of similar structure, with similarly long data items?

> Btw, any ideas on the build error in the previous mail? I
> have no ideas
> what to do to "make it happen" :)

Sorry, you'll have to remind me what the problem is.

Regards, Dave

Re: view data causes pgadmin to hang or die

From
Miha Radej
Date:
Hi!

Dave Page wrote:
>> Now that you mention it... I've played around a bit and I've observed
>> the following.
>>
>> The "View Data" function: crashes or hangs regardless of any settings.
>>
>> The Query tool: it wasn't a problem. I said "select * from
>> table;" and
>> it happily displayed the results. The result set returned
>> more than 100
>> rows (the limit set in options) so the query tool asked me if
>> I wanted
>> to display everything. I said "Yes" and of 204 records only 101 got
>> displayed. I then increased the max number of returned rows
>> to 500 and
>> again I only got 101 row.
>
> OK, but what if you increase the max column size as I suggested? If it's
> a grid problem, the data truncation in the query tool might be masking
> it.

Hmm, yes, sorry, I tried it but forgot to report it. I tried increasing
the column size to various values, from very small to large, a few
hundred kilobytes. Crash/hang still there.

>> The "View Data" works OK on any other table I have so I'm
>> really baffled
>> by this. The query tool however limits the display to 101 tuples,
>> regardless of the row limit settings.
>
> Are those tables of similar structure, with similarly long data items?

The closest possible. I am making some copies, where I'll reduce the row
set and increase them... I will report back what happens then, however I
won't be able to do that today.

>> Btw, any ideas on the build error in the previous mail? I
>> have no ideas
>> what to do to "make it happen" :)
>
> Sorry, you'll have to remind me what the problem is.

Of course :)

I wanted to see if the problem is present in the latest code from SVN. I
can compile revision 5056 just fine, but building revision 5057 yields:

if g++ -DHAVE_CONFIG_H -I. -I. -I..
-DDATA_DIR=\"/usr/local/pgadmin-svn/share/pgadmin3/\" -Wall
-Wno-non-virtual-dtor -I../src/include -I../src/agent/include
-I../src/slony/include -I/usr/include/pgsql -DSSL
-I/usr/lib/wx/include/gtk2-unicode-release-2.6 -I/usr/include/wx-2.6
-DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES
-D_LARGEFILE_SOURCE=1 -DNO_GCC_PRAGMA -O2 -I/usr/include/libxml2
-DDATA_DIR=\"/usr/local/pgadmin-svn/share/pgadmin3/\" -Wall
-Wno-non-virtual-dtor -I../src/include -I../src/agent/include
-I../src/slony/include  -MT ctlSQLBox.o -MD -MP -MF
".deps/ctlSQLBox.Tpo" -c -o ctlSQLBox.o `test -f './ctl/ctlSQLBox.cpp'
|| echo './'`./ctl/ctlSQLBox.cpp; \
then mv -f ".deps/ctlSQLBox.Tpo" ".deps/ctlSQLBox.Po"; else rm -f
".deps/ctlSQLBox.Tpo"; exit 1; fi
make[2]: *** No rule to make target `ctl/ctlSQLGrid.cpp', needed by
`ctlSQLGrid.o'.  Stop.
make[2]: Leaving directory `/net/programs/pgadmin-svn/pgadmin3/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/net/programs/pgadmin-svn/pgadmin3'
make: *** [all] Error 2

Thank you,
Miha

Re: view data causes pgadmin to hang or die

From
"Dave Page"
Date:

> -----Original Message-----
> From: Miha Radej [mailto:miha.radej@siix.com]
> Sent: 29 March 2006 14:42
> To: Dave Page
> Cc: pgadmin-hackers
> Subject: Re: [pgadmin-hackers] view data causes pgadmin to hang or die
>
> Hmm, yes, sorry, I tried it but forgot to report it. I tried
> increasing
> the column size to various values, from very small to large, a few
> hundred kilobytes. Crash/hang still there.

Still there? I thought you said it was working in the query tool?

> I wanted to see if the problem is present in the latest code
> from SVN. I
> can compile revision 5056 just fine, but building revision
> 5057 yields:
>
> if g++ -DHAVE_CONFIG_H -I. -I. -I..
> -DDATA_DIR=\"/usr/local/pgadmin-svn/share/pgadmin3/\" -Wall
> -Wno-non-virtual-dtor -I../src/include -I../src/agent/include
> -I../src/slony/include -I/usr/include/pgsql -DSSL
> -I/usr/lib/wx/include/gtk2-unicode-release-2.6 -I/usr/include/wx-2.6
> -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64
> -D_LARGE_FILES
> -D_LARGEFILE_SOURCE=1 -DNO_GCC_PRAGMA -O2 -I/usr/include/libxml2
> -DDATA_DIR=\"/usr/local/pgadmin-svn/share/pgadmin3/\" -Wall
> -Wno-non-virtual-dtor -I../src/include -I../src/agent/include
> -I../src/slony/include  -MT ctlSQLBox.o -MD -MP -MF
> ".deps/ctlSQLBox.Tpo" -c -o ctlSQLBox.o `test -f
> './ctl/ctlSQLBox.cpp'
> || echo './'`./ctl/ctlSQLBox.cpp; \
> then mv -f ".deps/ctlSQLBox.Tpo" ".deps/ctlSQLBox.Po"; else rm -f
> ".deps/ctlSQLBox.Tpo"; exit 1; fi
> make[2]: *** No rule to make target `ctl/ctlSQLGrid.cpp', needed by
> `ctlSQLGrid.o'.  Stop.
> make[2]: Leaving directory `/net/programs/pgadmin-svn/pgadmin3/src'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/net/programs/pgadmin-svn/pgadmin3'
> make: *** [all] Error 2

Ah, part of the filename was in lower case. I'm surprised that didn't
show up when I tested it on Linux.

Fixed in SVN.

Regards, Dave.

Re: view data causes pgadmin to hang or die

From
Dave Page
Date:



On 29/3/06 17:08, "Miha Radej" <miha.radej@siix.com> wrote:




Dave Page wrote:
>> -----Original Message-----
>> Hmm, yes, sorry, I tried it but forgot to report it. I tried
>> increasing
>> the column size to various values, from very small to large, a few
>> hundred kilobytes. Crash/hang still there.
>
> Still there? I thought you said it was working in the query tool?

Still there in "View Data". I am too tired I guess to think and type
straight :)

If I (try to) summarize: it is only "View Data" which causes the
crash/hang. Doing a "select *" on the table in question in the Query
Tool works and displays the data OK, although I seem to not be able to
pass the limit of 101 displayed tuples, regardless of the settings.

So my problem is why does using "View Data" (to display all data in a
table) cause pgAdmin to crash/hang. It seems to happen when pgAdmin
tries to display the data it had received from the DB. I've just
compiled the latest revision and it is the same.

So, just to be clear, the query tool will display the data correctly, even if the maximum column length option is increased to accommodate the largest data item?

I want to be clear about this because in SVN trunk now, the grid code is shared between the two tools so both /should/ fail, but the column length option might be masking the problem in the query tool.

Regards, Dave

Re: view data causes pgadmin to hang or die

From
Miha Radej
Date:
Hi!

Dave Page wrote:
> So, just to be clear, the query tool will display the data correctly,
> even if the maximum column length option is increased to accommodate the
> largest data item?
>
> I want to be clear about this because in SVN trunk now, the grid code is
> shared between the two tools so both /should/ fail, but the column
> length option might be masking the problem in the query tool.

I've checked out a fresh copy from SVN today. I've set "Max rows to
retrieve" to 0, "Max. characters per column" to 700000. "View data"
hangs/crashes, as does "Query tool".

A few days ago when I hadn't had the latest build the "Query tool" had
worked. But that may have been due to the fact that no matter what I had
set for "Max rows to retrieve", I'd only get 101 rows. I now get
everything, including the crash :)

And what is even more strange, the original table (I've been playing
with copies of it) grew for a few records and now everything works fine
- both "View data" and "Query tool". I don't know what to make of it.

Thank you for your time and help!

Regards,
Miha

Re: view data causes pgadmin to hang or die

From
"Dave Page"
Date:

> -----Original Message-----
> From: Miha Radej [mailto:miha.radej@siix.com]
> Sent: 30 March 2006 08:07
> To: Dave Page
> Cc: pgadmin-hackers
> Subject: Re: [pgadmin-hackers] view data causes pgadmin to hang or die
>
> Hi!
>
> Dave Page wrote:
> > So, just to be clear, the query tool will display the data
> correctly,
> > even if the maximum column length option is increased to
> accommodate the
> > largest data item?
> >
> > I want to be clear about this because in SVN trunk now, the
> grid code is
> > shared between the two tools so both /should/ fail, but the column
> > length option might be masking the problem in the query tool.
>
> I've checked out a fresh copy from SVN today. I've set "Max rows to
> retrieve" to 0, "Max. characters per column" to 700000. "View data"
> hangs/crashes, as does "Query tool".

OK, that's what I was expecting to happen.

> A few days ago when I hadn't had the latest build the "Query
> tool" had
> worked. But that may have been due to the fact that no matter
> what I had
> set for "Max rows to retrieve", I'd only get 101 rows. I now get
> everything, including the crash :)

Well, the query tool was recently changed to use the same grid control
as the view data tool, however even if you had a post-change version I
think the problem was being masked by the auto-truncation of the results
that only happens in the query tool.

> And what is even more strange, the original table (I've been playing
> with copies of it) grew for a few records and now everything
> works fine
> - both "View data" and "Query tool". I don't know what to make of it.

Now that's really weird. I don't suppose you still have a copy of the
data prior to the changes do you? Is it something you can let me see?

> Thank you for your time and help!

You're welcome.

Regards, Dave.