Re: Stored function signature incompatibility in index (probably a bug) - Mailing list pgsql-general

From Sergey Konoplev
Subject Re: Stored function signature incompatibility in index (probably a bug)
Date
Msg-id CAL_0b1sa20jh-29pdZJmh5XDNG3R6O+XBYBxoQPc7-cvUPgQ_A@mail.gmail.com
Whole thread Raw
In response to Re: Stored function signature incompatibility in index (probably a bug)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Thu, Jun 28, 2012 at 8:59 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> A potential workaround is illustrated by:
>
> regression=# create index foobari on foobar (foosum(row(foobar.*)::foo));
> CREATE INDEX
> regression=# \d foobari
>           Index "public.foobari"
>  Column |  Type   |        Definition
> --------+---------+--------------------------
>  foosum | integer | foosum(ROW(f1, f2)::foo)
> btree, for table "public.foobar"

Thank you, Tom. It is a good idea. I need it for partitioning. So I am
going to create a parent table and the first partition with this
whole-row casted to the parent's type in index. Other partitions will
be created by CREATE...LIKE.

> but this seems like kind of a kluge.  I'm not sure that we ought to
> insert such a thing rather than just throwing an error.

May be this issue and workaround is worth to be mentioned in docs
besides throwing an error?

--
Sergey Konoplev

a database architect, software developer at PostgreSQL-Consulting.com
http://www.postgresql-consulting.com

Jabber: gray.ru@gmail.com Skype: gray-hemp Phone: +79160686204

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Stored function signature incompatibility in index (probably a bug)
Next
From: Jeff Davis
Date:
Subject: Re: Postgresql 9.0.6 alway run VACUUM ANALYZE pg_catalog.pg_attribute