pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@postgreSQL.org
To: pgsql-interfaces@postgreSQL.org
Subject: Re: [HACKERS] Re: retrieving varchar size
Date: Mon, 27 Apr 1998 10:39:27 -0400
Message-ID: <4148.893687967@sss.pgh.pa.us> (raw)
In-Reply-To: <l03110705b1698217f47d@[204.179.136.2]>

Michael Hirohama <kamesan@ricochet.net> writes:
> The historical reason why the POSTGRES backend is required to send multiple
> result sets is to support cursors on queries involving type inheritance and
> anonymous target lists.
> 	begin
> 	declare c cursor for
> 		select e.oid, e.* from EMP* e
> 	fetch 10 in c
> 	...
> To handle the command sequence above, frontend applications would need to
> be provided with a new result descriptor when the "fetch 10 in c" crosses a
> result set boundary.

Hmm.  I noted the place in libpq where it fails if multiple 'T' (tuple
descriptor) messages arrive during a query retrieval.  But the comments
made it sound like the condition shouldn't occur.

Does what you describe actually work in the current backend?

The problem on the libpq side is basically that the PGresult structure
is not able to represent more than one tuple descriptor.  AFAICS, we can't
tamper with that without breaking all existing applications.  However,
if we make the changes being discussed in this thread then it would be
a simple matter to return a *series* of PGresult structures for this
sort of query.

Whether an application is capable of handling that is another story,
but at least the data could be passed through.

			regards, tom lane



view thread (41+ messages)  latest in thread

Message-ID: <4148.893687967@sss.pgh.pa.us>
Permalink:  ../4148.893687967@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4148.893687967@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-hackers@postgreSQL.org
  Subject: Re: [HACKERS] Re: retrieving varchar size
  In-Reply-To: <4148.893687967@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox