Dangers of mislabelled immutable functions - Mailing list pgsql-general

From Jeff Janes
Subject Dangers of mislabelled immutable functions
Date
Msg-id CAMkU=1wyJGj-PWg2Pt24hiGS0mXs601MX=QEjN8z=asvfwNS9Q@mail.gmail.com
Whole thread Raw
Responses Re: Dangers of mislabelled immutable functions
List pgsql-general
I want to index the textual representations of a table's rows.

You can cast a row to text by using the name of the table where you would usually use the name of a column, like "table_name::text".  But this is not immutable and so can't be used in an expression index.

I can easily make a pl/perl function which does the same thing as the text cast, and label it as immutable and use it in an index.  But are the dangers of doing this?

I know that configuration changes to the date and time formats could change the way that the data is shown in ways that would cause the rows inserted under a different configuration to be missed. That doesn't bother me.

I know that if I drop a table column, the contents of the column will still be in the index.  That doesn't bother me either, as all the indexes I plan to use are lossy and so will do a recheck anyway.

What other problems am I setting myself up for by doing this?

Cheers,

Jeff

pgsql-general by date:

Previous
From: Joseph Kregloh
Date:
Subject: Re: hot backup with zfs ?
Next
From: Aviel Buskila
Date:
Subject: Re: repmgr won't update witness after failover