Re: Index on regexes

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Erik Rijkers <er(at)xs4all(dot)nl>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Index on regexes
Date: 2013-06-13 21:32:52
Message-ID: CAPpHfdukOiq72MgkyG-wH=8=kSvdbTfjcxRW2hQYj8-KXGtUqw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jun 14, 2013 at 1:30 AM, Erik Rijkers <er(at)xs4all(dot)nl> wrote:

> On Thu, June 13, 2013 22:19, Alexander Korotkov wrote:
>
> > [index_on_regexes.1.patch.gz ]
>
> Hi,
>
> Compile of core is OK, but contrib compilation fails:
>
> -- [2013.06.13 23:23:14 idxregex] make contrib
> trgm_gin.c: In function ‘gin_regexp_trgm_config’:
> trgm_gin.c:410:2: error: unknown type name ‘GinConfig’
> GinConfig *ginConfig = (GinConfig *)PG_GETARG_POINTER(0);
> ^
> trgm_gin.c:410:26: error: ‘GinConfig’ undeclared (first use in this
> function)
> GinConfig *ginConfig = (GinConfig *)PG_GETARG_POINTER(0);
> ^
> trgm_gin.c:410:26: note: each undeclared identifier is reported only once
> for each function it appears in
> trgm_gin.c:410:37: error: expected expression before ‘)’ token
> GinConfig *ginConfig = (GinConfig *)PG_GETARG_POINTER(0);
> ^
> trgm_gin.c:412:11: error: request for member ‘addInfoTypeOid’ in something
> not a structure or union
> ginConfig->addInfoTypeOid = BYTEAOID;
> ^
> make[1]: *** [trgm_gin.o] Error 1
> make: *** [all-pg_trgm-recurse] Error 2
> trgm_gin.c: In function ‘gin_regexp_trgm_config’:
> trgm_gin.c:410:2: error: unknown type name ‘GinConfig’
> GinConfig *ginConfig = (GinConfig *)PG_GETARG_POINTER(0);
> ^
> trgm_gin.c:410:26: error: ‘GinConfig’ undeclared (first use in this
> function)
> GinConfig *ginConfig = (GinConfig *)PG_GETARG_POINTER(0);
> ^
> trgm_gin.c:410:26: note: each undeclared identifier is reported only once
> for each function it appears in
> trgm_gin.c:410:37: error: expected expression before ‘)’ token
> GinConfig *ginConfig = (GinConfig *)PG_GETARG_POINTER(0);
> ^
> trgm_gin.c:412:11: error: request for member ‘addInfoTypeOid’ in something
> not a structure or union
> ginConfig->addInfoTypeOid = BYTEAOID;
> ^
> make[1]: *** [trgm_gin.o] Error 1
> make: *** [install-pg_trgm-recurse] Error 2
>

Likely I wasn't explicit enough. You need to apply this patch first:
http://www.postgresql.org/message-id/CAPpHfduxv-iL7aedwPW0W5fXrWGAKfxijWM63_hZujaCRxnmFQ@mail.gmail.com

> It is also not entirely clear from your post how this index is created, I
> suppose the regex index is only in trgm?
>
> create index test_gin_idx on test (s gin_regexp_trgm_ops); --> right?
>

Oh, it was missed. Right.

------
With best regards,
Alexander Korotkov.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2013-06-13 21:46:48 Re: MD5 aggregate
Previous Message Erik Rijkers 2013-06-13 21:30:17 Re: Index on regexes