Re: Submitting cursored query support, docs, etc

From: Dave Page <dpage(at)postgresql(dot)org>
To: Kalle Hallivuori <kato(at)iki(dot)fi>
Cc: pgadmin-hackers(at)postgresql(dot)org
Subject: Re: Submitting cursored query support, docs, etc
Date: 2007-12-11 19:29:59
Message-ID: 475EE537.5020209@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Kalle Hallivuori wrote:
> Actually, I'm still wondering how to do this. We need to
>
> 1. submit the SELECT to server so that it produces a CURSOR instead of
> a result set,
> 2. fetch and view rows from CURSOR instead of a ready-made result set,
> 3. handle a new state where a query is running but passive in a way
> which enables more interaction than just stopping the current query.
> Maybe we can call this state "active".
>
> I'm reading the code but I'm still not crystal clear on where and how
> to make those changes. That is where I'm welcoming input. Maybe there
> are some classes, methods or properties that you could point me to? If
> you've considered it yourself, which parts of code have you thought
> you would change, and how?

I haven't looked at it in that much detail for a number of years
unfortunately. However, from the top of my head, I would start by
looking at ctlSQLResult::Execute/pgQueryThread::execute in which you can
create the cursor and retrieve the first batch of results. Then, look at
extending pgSet such that when run with a cursor, an attempt to access a
row that hasn't be retrieved yet results in the dataset being extended
before the value is returned. Currently pgSet is tied to a single
PGResult, but I guess in cursor mode we would probably need to make that
a list of PGResults each containing <= N rows where N is a configurable
batch size.

It shouldn't be too hard to tie this low level stuff in with the UI
because the grid control will automatically request data as it renders
each row.

Like I said though, this is largely off the top of my head, so I may
have missed a showstopper somewhere :-). Feel free to ping more
questions or ideas to the list for discussion though.

/D

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Guillaume Lelarge 2007-12-11 23:20:56 Foreign key dialog
Previous Message Roberts, Jon 2007-12-11 18:44:36 pgAgent sessions