Re: binary array and record recv

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Andrew Chernow" <ac(at)esilo(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: binary array and record recv
Date: 2007-12-18 17:49:30
Message-ID: b42b73150712180949nd3dc220v1bee592c785ef846@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Dec 18, 2007 11:30 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Andrew Chernow <ac(at)esilo(dot)com> writes:
> > When dealing with binary, the Oid the client sends may match what the
> > server thinks but the data is wrong (client sent binary formatted data
> > of the wrong type). Thus, the only real check we saw was on the data
> > length (which is rolling the dice).
>
> Yes, the available checks to detect client-vs-server datatype mismatch
> are very weak, but that hardly comes across as a good argument for
> removing one of the ones we have.

We are not suggesting to remove the check...but only to disable it
when the client explicitly asks the server. Right now, the checking
on composites is actually much stricter than on regular query
parameters. This strictness forces the client to 'know' the oid of
every field inside the composite.

> > How is the client supposed to send back composite types without having a
> > meaningful way to get the Oids from the server?
>
> On what grounds do you claim that it can't get the type Oids from the
> server?

Well, it's certainly possible, but awkward. The client has to
directly query the system catalogs. This has problems....there are
invalidation issues (which our idea does not address) and the user is
not guaranteed to have permission to access the proper catalogs. If
we go this route, IMO there should be a API function to expose this
behavior.

With the above issues, it seems that it would be nicer not to expose
Oids to the client at all but instead do parameter binding directly on
typename. ISTM this is not possible though.

merlin & andrew
eSilo

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2007-12-18 18:41:45 Re: Board for developers
Previous Message Tom Lane 2007-12-18 17:14:53 Re: ecxt_scantuple has wrong TupleDesc