pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnakangas@vmware.com>
To: olegjobs@mail.ru
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #11761: range_in dosn't work via direct functional call
Date: Fri, 24 Oct 2014 16:08:30 +0300
Message-ID: <544A4F4E.9080407@vmware.com> (raw)
In-Reply-To: <20141022172703.2662.31056@wrigleys.postgresql.org>
References: <20141022172703.2662.31056@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

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



view thread (3+ messages)  latest in thread

Message-ID: <544A4F4E.9080407@vmware.com>
Permalink:  ../544A4F4E.9080407@vmware.com/
Also on:    postgresql.org/message-id/544A4F4E.9080407@vmware.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: hlinnakangas@vmware.com, olegjobs@mail.ru
  Subject: Re: BUG #11761: range_in dosn't work via direct functional call
  In-Reply-To: <544A4F4E.9080407@vmware.com>
  References: <20141022172703.2662.31056@wrigleys.postgresql.org> <544A4F4E.9080407@vmware.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox