Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XhecB-0002ur-Og for pgsql-bugs@arkaria.postgresql.org; Fri, 24 Oct 2014 13:09:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XhecB-0007zM-3H for pgsql-bugs@arkaria.postgresql.org; Fri, 24 Oct 2014 13:09:11 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XhecA-0007y3-2j for pgsql-bugs@postgresql.org; Fri, 24 Oct 2014 13:09:10 +0000 Received: from smtp-outbound-2.vmware.com ([208.91.2.13]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1Xhec6-0003KY-Ha for pgsql-bugs@postgresql.org; Fri, 24 Oct 2014 13:09:08 +0000 Received: from sc9-mailhost2.vmware.com (sc9-mailhost2.vmware.com [10.113.161.72]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 1F58A283E8; Fri, 24 Oct 2014 06:09:04 -0700 (PDT) Received: from EX13-CAS-002.vmware.com (EX13-CAS-002.vmware.com [10.113.191.52]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 1BAA5A8589; Fri, 24 Oct 2014 06:09:04 -0700 (PDT) Received: from EX13-MBX-024.vmware.com (10.113.191.44) by EX13-MBX-002.vmware.com (10.113.191.22) with Microsoft SMTP Server (TLS) id 15.0.775.38; Fri, 24 Oct 2014 06:08:51 -0700 Received: from [192.168.1.90] (10.113.160.246) by EX13-MBX-024.vmware.com (10.113.191.44) with Microsoft SMTP Server (TLS) id 15.0.775.38; Fri, 24 Oct 2014 06:08:45 -0700 Message-ID: <544A4F4E.9080407@vmware.com> Date: Fri, 24 Oct 2014 16:08:30 +0300 From: Heikki Linnakangas Organization: VMware User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.1.2 MIME-Version: 1.0 To: , Subject: Re: BUG #11761: range_in dosn't work via direct functional call References: <20141022172703.2662.31056@wrigleys.postgresql.org> In-Reply-To: <20141022172703.2662.31056@wrigleys.postgresql.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.113.160.246] X-ClientProxiedBy: EX13-CAS-013.vmware.com (10.113.191.65) To EX13-MBX-024.vmware.com (10.113.191.44) X-Pg-Spam-Score: -9.0 (---------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 10/22/2014 08:27 PM, olegjobs@mail.ru wrote: > This function test_ext_get_range(cstring) returns int4range: > > Datum test_ext_get_range(PG_FUNCTION_ARGS) > { > char *ts = PG_GETARG_CSTRING(0); > > return DirectFunctionCall3(range_in, CStringGetDatum(ts), > ObjectIdGetDatum(3904), Int32GetDatum(0); > } > In psql: > select test_ext_get_range('[1,1]'); > error: > connection to the server was lost. > > it seems to me that some memory problems because of "The range I/O functions > need a bit more cached info than other range > * functions, so they store a RangeIOData struct in fn_extra, not just a > * pointer to a type cache entry. " Yeah, DirectFunctionCall cannot be used with range_in. Use FunctionCall3 instead. See this comment in fmgr.c, above DirectFunctionCall1Coll: > /* > * These are for invocation of a specifically named function with a > * directly-computed parameter list. Note that neither arguments nor result > * are allowed to be NULL. Also, the function cannot be one that needs to > * look at FmgrInfo, since there won't be any. > */ range_in needs to look at FmgrInfo. - Heikki -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs