Skip site navigation (1) Skip section navigation (2)

Re: BUG #5748: Invalid oidvector data during binary recv

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Yeb Havinga <yebhavinga(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs(at)postgresql(dot)org, "w(dot)p(dot)dijkstra(at)mgrid(dot)net" <w(dot)p(dot)dijkstra(at)mgrid(dot)net>
Subject: Re: BUG #5748: Invalid oidvector data during binary recv
Date: 2010-11-11 16:14:33
Message-ID: 4CDC1669.5060909@enterprisedb.com (view raw or flat)
Thread:
Lists: pgsql-bugs
On 11.11.2010 18:11, Yeb Havinga wrote:
> On 2010-11-11 16:48, Tom Lane wrote:
>> "Yeb Havinga"<yebhavinga(at)gmail(dot)com> writes:
>>> postgres=# create table a as select ''::oidvector;
>>> SELECT 1
>>> postgres=# copy a to '/tmp/test' with binary;
>>> COPY 1
>>> postgres=# copy a from '/tmp/test' with binary;
>>> ERROR: invalid oidvector data
>> The problem seems to be that array_recv passes back a zero-dimensional
>> array, *not* a 1-D array, when it observes that the input has no
>> elements. A zero-D array is not part of the subset of possible arrays
>> that we allow for oidvector.
>>
>> I'm less than convinced that this is worth fixing. oidvector is not
>> intended for general-purpose use anyway. What's the use-case where this
>> would come up?
> We're currently reading data from a remote pg_statistics, in particular
> stavalues1.. etc. Even when our own user defined relations do not make
> use of oidvectors (or intvectors), during testing on arbitrary
> pg_statistic rows we encountered this error message. Nonetheless we
> decided to report it as a bug, since it was not related to anyarray
> handling, but clearly a bug that oidvector cannot input binary, what it
> can input as text and output binary.

Just reading such an oidvector should not throw an error, you must've 
tried to send it back to the server, perhaps to store it to a table. But 
pg_statistic.stavalues* are a special anyway. They are defined as 
anyarray, but we don't normally allow you to create a table with 
anyarray columns.

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2010-11-11 16:17:35
Subject: Re: BUG #5748: Invalid oidvector data during binary recv
Previous:From: Tom LaneDate: 2010-11-11 16:11:23
Subject: Re: BUG #5748: Invalid oidvector data during binary recv

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group