Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 5F1D81337B5A for ; Thu, 11 Nov 2010 12:14:54 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 52015-02 for ; Thu, 11 Nov 2010 16:14:47 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og111.obsmtp.com (exprod7og111.obsmtp.com [64.18.2.175]) by mail.postgresql.org (Postfix) with SMTP id 45E121337B34 for ; Thu, 11 Nov 2010 12:14:46 -0400 (AST) Received: from source ([209.85.215.179]) by exprod7ob111.postini.com ([64.18.6.12]) with SMTP ID DSNKTNwWdcv+3TM1TBASo1VGwq+U3JyWzNqA@postini.com; Thu, 11 Nov 2010 08:14:46 PST Received: by eyg24 with SMTP id 24so1147816eyg.38 for ; Thu, 11 Nov 2010 08:14:35 -0800 (PST) Received: by 10.14.124.201 with SMTP id x49mr677364eeh.7.1289492074387; Thu, 11 Nov 2010 08:14:34 -0800 (PST) Received: from [192.168.1.183] (dsl-hkibrasgw2-ff7ac300-240.dhcp.inet.fi [88.195.122.240]) by mx.google.com with ESMTPS id x54sm2079521eeh.17.2010.11.11.08.14.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 11 Nov 2010 08:14:33 -0800 (PST) Message-ID: <4CDC1669.5060909@enterprisedb.com> Date: Thu, 11 Nov 2010 18:14:33 +0200 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; fi-FI; rv:1.9.1.12) Gecko/20100913 Icedove/3.0.7 MIME-Version: 1.0 To: Yeb Havinga CC: Tom Lane , pgsql-bugs@postgresql.org, "w.p.dijkstra@mgrid.net" Subject: Re: BUG #5748: Invalid oidvector data during binary recv References: <201011111430.oABEUVPe067398@wwwmaster.postgresql.org> <15298.1289490490@sss.pgh.pa.us> <4CDC15A5.7050003@gmail.com> In-Reply-To: <4CDC15A5.7050003@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.2 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3 X-Spam-Level: X-Archive-Number: 201011/72 X-Sequence-Number: 28652 On 11.11.2010 18:11, Yeb Havinga wrote: > On 2010-11-11 16:48, Tom Lane wrote: >> "Yeb Havinga" 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