Re: [HACKERS] Re: [INTERFACES] retrieving varchar size

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Byron Nikolaidis <byronn(at)insightdist(dot)com>
Cc: pgsql-hackers(at)postgreSQL(dot)org, pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Re: [INTERFACES] retrieving varchar size
Date: 1998-04-24 16:52:23
Message-ID: 1535.893436743@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-interfaces

Byron Nikolaidis <byronn(at)insightdist(dot)com> writes:
> Yes, it rings a bell alright, When you execute a multiple query
> (denoted by semicolans) like "set geqo to 'off'; show datestyle;
> select * from table", you get that multiple returns and MUST read
> until you get the 'I'. If you don't, your screwed the next time you
> try and read anything cause all that stuff is still in the pipe.

That seems pretty bogus. What happens if you do
select * from table1; select * from table2
? The way the code in libpq looks, I think the response from the
first select would get lost entirely (probably even cause a memory
leak). It's not set up to handle receipt of more than one command
response in any clean fashion. We'd need to revise the application
API to make that work right.

Playing around with psql, it seems that you can't actually get psql
to submit a multi-command line as a single query; it seems to break
it up into separate queries. Which is what libpq can cope with.

I think we should either forbid multiple commands per PQexec call,
or fix libpq to handle them properly (and hence be able to return
a series of PGresults, not just one).

> Question though, I didnt think my request would have caused a major
> protocol change. I though that the '-1' would simply be replaced by
> the correct size?

I assumed we'd want to add the restypmod as a new field in PGresult
and in the protocol. But I'm just a newbie.

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Constantin Teodorescu 1998-04-25 05:58:44 Re: [PHP3] BIG, BIG problems with pg_pConnect in PHP3, PostgreSQL and Apache httpd
Previous Message Tom Ivar Helbekkmo 1998-04-24 15:43:47 Re: [HACKERS] create operator problem

Browse pgsql-interfaces by date

  From Date Subject
Next Message Patrick Shelley 1998-04-25 21:20:24 graphic-objects
Previous Message uggowitzers 1998-04-24 15:21:05