Re: [HACKERS] Could regexp_matches be immutable?

2009-10-21 Thread Peter Eisentraut
On Tue, 2009-10-20 at 20:48 -0400, Tom Lane wrote: So I went to see about making the changes to remove regex_flavor, and was astonished to find that all the regex-related functions are already marked immutable, and AFAICS always have been. This is clearly wrong, and we would have to fix it if

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-21 Thread Tom Lane
Peter Eisentraut pete...@gmx.net writes: On Tue, 2009-10-20 at 20:48 -0400, Tom Lane wrote: So I went to see about making the changes to remove regex_flavor, and was astonished to find that all the regex-related functions are already marked immutable, and AFAICS always have been. This is

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-21 Thread Rod Taylor
So, having dismissed my original off-the-cuff answer to Rod, the next question is what's really going wrong for him.  I get this from a quick trial: I wish I had kept specific notes on what I was actually trying to do. I tried to_number first then the expression as seen below. I guess I saw

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-21 Thread Tom Lane
Rod Taylor rod.tay...@gmail.com writes: It is interesting that citext seems to be functional with exactly the same statements. Huh, it looks to me like that's an error in the declaration of the citext versions of regexp_matches --- they should be declared to return setof text[], the same as the

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-21 Thread David E. Wheeler
On Oct 21, 2009, at 7:27 AM, Tom Lane wrote: Huh, it looks to me like that's an error in the declaration of the citext versions of regexp_matches --- they should be declared to return setof text[], the same as the underlying text functions. David, do you agree? Ooh, yeah, dunno how I

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-21 Thread Tom Lane
David E. Wheeler da...@kineticode.com writes: On Oct 21, 2009, at 7:27 AM, Tom Lane wrote: Huh, it looks to me like that's an error in the declaration of the citext versions of regexp_matches --- they should be declared to return setof text[], the same as the underlying text functions.

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-21 Thread David E. Wheeler
On Oct 21, 2009, at 9:37 AM, Tom Lane wrote: Ooh, yeah, dunno how I missed that. I think we're probably stuck in 8.4, but we should fix it going forward. Would you make a quick check if any of the other citext functions have the same bug? I've fixed it in my [version for

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-21 Thread David E . Wheeler
On Oct 21, 2009, at 9:40 AM, David E. Wheeler wrote: On Oct 21, 2009, at 9:37 AM, Tom Lane wrote: Ooh, yeah, dunno how I missed that. I think we're probably stuck in 8.4, but we should fix it going forward. Would you make a quick check if any of the other citext functions have the same

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-21 Thread Tom Lane
David E. Wheeler da...@kineticode.com writes: FWIW, I think that this is a bug, and that the variation from the text version will be unexpected. I recommend fixing it for 8.4.2. Well, it's certainly a bug, but I don't think it's back-patchable. A back-patch will not affect existing

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-21 Thread Tom Lane
David E. Wheeler da...@kineticode.com writes: Is there a straight-foward way to check such a thing programmatically, with a query perhaps? Or should I just put aside an hour to do an audit? I was wondering whether you could query pg_proc to look for functions with the same name and

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-21 Thread David E. Wheeler
On Oct 21, 2009, at 9:48 AM, Tom Lane wrote: I was wondering whether you could query pg_proc to look for functions with the same name and different arguments/results. It's a bit tricky though because you'd expect s/citext/text/ in at least some positions (maybe not all)? Yeah, almost all.

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-20 Thread Tom Lane
Rod Taylor rod.tay...@gmail.com writes: I tried making a functional index based on an expression containing the 2 argument regexp_matches() function. Is there a reason why this function is not marked immutable instead of normal? So I went to see about making the changes to remove regex_flavor,

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-15 Thread Josh Berkus
(I'd bet lunch that the one about add_missing_from is bogus, too, or could easily be made so. mysql isn't forgiving about missing FROM items, so it's hard to believe that they have a lot of such things no matter how little they care about Postgres.) OpenACS does the old-style DELETEs

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-15 Thread David Fetter
On Thu, Oct 15, 2009 at 10:22:52AM -0700, Josh Berkus wrote: (I'd bet lunch that the one about add_missing_from is bogus, too, or could easily be made so. mysql isn't forgiving about missing FROM items, so it's hard to believe that they have a lot of such things no matter how little they

[HACKERS] Could regexp_matches be immutable?

2009-10-14 Thread Rod Taylor
I tried making a functional index based on an expression containing the 2 argument regexp_matches() function. Is there a reason why this function is not marked immutable instead of normal? regards, Rod Taylor -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-14 Thread Tom Lane
Rod Taylor rod.tay...@gmail.com writes: I tried making a functional index based on an expression containing the 2 argument regexp_matches() function. Is there a reason why this function is not marked immutable instead of normal? regex_flavor affects its result.

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-14 Thread David Fetter
On Wed, Oct 14, 2009 at 04:51:03PM -0400, Tom Lane wrote: Rod Taylor rod.tay...@gmail.com writes: I tried making a functional index based on an expression containing the 2 argument regexp_matches() function. Is there a reason why this function is not marked immutable instead of normal?

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-14 Thread Andrew Dunstan
David Fetter wrote: On Wed, Oct 14, 2009 at 04:51:03PM -0400, Tom Lane wrote: Rod Taylor rod.tay...@gmail.com writes: I tried making a functional index based on an expression containing the 2 argument regexp_matches() function. Is there a reason why this function is not marked

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-14 Thread Kevin Grittner
David Fetter da...@fetter.org wrote: On Wed, Oct 14, 2009 at 04:51:03PM -0400, Tom Lane wrote: Rod Taylor rod.tay...@gmail.com writes: I tried making a functional index based on an expression containing the 2 argument regexp_matches() function. Is there a reason why this function is not

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-14 Thread Josh Berkus
On 10/14/09 2:07 PM, David Fetter wrote: On Wed, Oct 14, 2009 at 04:51:03PM -0400, Tom Lane wrote: Rod Taylor rod.tay...@gmail.com writes: I tried making a functional index based on an expression containing the 2 argument regexp_matches() function. Is there a reason why this function is not

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-14 Thread David Fetter
On Wed, Oct 14, 2009 at 05:14:31PM -0400, Andrew Dunstan wrote: David Fetter wrote: On Wed, Oct 14, 2009 at 04:51:03PM -0400, Tom Lane wrote: Rod Taylor rod.tay...@gmail.com writes: I tried making a functional index based on an expression containing the 2 argument regexp_matches()

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-14 Thread Josh Berkus
+1 It would seem to me to be more valuable to have the benefits of IMMUTABLE than preserve pre-7.4 compatibility forever. Just create a shell function which calls it in a specific flavor, and make that immutable. --Josh -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-14 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: David Fetter wrote: Speaking of which, can we see about deprecating and removing this GUC? I've yet to hear of anyone using a flavor other than the default. You have now. I have a client who sadly uses a non-default setting. And on 8.4, what is

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-14 Thread David Fetter
On Wed, Oct 14, 2009 at 06:06:23PM -0400, Tom Lane wrote: Andrew Dunstan and...@dunslane.net writes: David Fetter wrote: Speaking of which, can we see about deprecating and removing this GUC? I've yet to hear of anyone using a flavor other than the default. You have now. I have a client

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-14 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan and...@dunslane.net writes: David Fetter wrote: Speaking of which, can we see about deprecating and removing this GUC? I've yet to hear of anyone using a flavor other than the default. You have now. I have a client who sadly uses a

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-14 Thread Tom Lane
Andrew Dunstan and...@dunslane.net writes: They are probably quite open to changing it, but IIRC it is a setting imposed by OpenACS, which is what they are based on. I seem to recall having asked this before ... but does OpenACS even know what they're doing here? The difference between ERE

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-14 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan and...@dunslane.net writes: They are probably quite open to changing it, but IIRC it is a setting imposed by OpenACS, which is what they are based on. I seem to recall having asked this before ... but does OpenACS even know what they're doing here?

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-14 Thread David Fetter
On Wed, Oct 14, 2009 at 11:51:13PM -0400, Andrew Dunstan wrote: Tom Lane wrote: Andrew Dunstan and...@dunslane.net writes: They are probably quite open to changing it, but IIRC it is a setting imposed by OpenACS, which is what they are based on. I seem to recall having asked this

Re: [HACKERS] Could regexp_matches be immutable?

2009-10-14 Thread Tom Lane
David Fetter da...@fetter.org writes: On Wed, Oct 14, 2009 at 11:51:13PM -0400, Andrew Dunstan wrote: That's not the worst of it :-( See http://openacs.org/xowiki/How_to_install_in_Postgres_8.x This just illustrates the fact that at least as far as PostgreSQL is concerned, OpenACS is a dead