Re: [HACKERS] Patch: Allow substring/replace() to get/set bit values

2010-01-08 Thread Leonardo F
What we can do in the back branches is make the code treat any negative value as meaning two-arg form. To throw an error we'd need to refactor the pg_proc representation ... I was going to fix that myself, but I think it has just been done. How can I keep up with who's doing what? --

Re: [HACKERS] Patch: Allow substring/replace() to get/set bit values

2010-01-08 Thread Alvaro Herrera
Leonardo F wrote: What we can do in the back branches is make the code treat any negative value as meaning two-arg form. To throw an error we'd need to refactor the pg_proc representation ... I was going to fix that myself, but I think it has just been done. How can I keep up with

Re: [HACKERS] Patch: Allow substring/replace() to get/set bit values

2010-01-08 Thread Dimitri Fontaine
Alvaro Herrera alvhe...@commandprompt.com writes: Leonardo F wrote: How can I keep up with who's doing what? Read this list and pgsql-committers. Or subscribe to the RSS feed from: http://git.postgresql.org/gitweb?p=postgresql.git;a=summary -- dim -- Sent via pgsql-hackers mailing list

[HACKERS] Patch: Allow substring/replace() to get/set bit values

2010-01-07 Thread Leonardo F
Hi all, attached a patch that adds the following functions for bit string: - overlay - get_bit - set_bit Some info: 1) overlay is implemented as calls to substring; given the different way substring behaves when used with strings vs bit strings: test=# SELECT substring(B'0001'

Re: [HACKERS] Patch: Allow substring/replace() to get/set bit values

2010-01-07 Thread Robert Haas
On Thu, Jan 7, 2010 at 7:02 AM, Leonardo F m_li...@yahoo.it wrote: attached a patch that adds the following functions for bit string: Thanks! Please add your patch here: https://commitfest.postgresql.org/action/commitfest_view/open The next CommitFest starts January 15th. ...Robert -- Sent

Re: [HACKERS] Patch: Allow substring/replace() to get/set bit values

2010-01-07 Thread Leonardo F
Thanks! Please add your patch here: https://commitfest.postgresql.org/action/commitfest_view/open Ok; but what about what I said about the difference between bit/string substring? That affects overlay behaviour for bit... I've even got ERROR: invalid memory alloc request size

Re: [HACKERS] Patch: Allow substring/replace() to get/set bit values

2010-01-07 Thread Robert Haas
On Thu, Jan 7, 2010 at 11:05 AM, Leonardo F m_li...@yahoo.it wrote: Thanks!  Please add your patch here: https://commitfest.postgresql.org/action/commitfest_view/open Ok; but what about what I said about the difference between bit/string substring? That affects overlay behaviour for

Re: [HACKERS] Patch: Allow substring/replace() to get/set bit values

2010-01-07 Thread Tom Lane
Leonardo F m_li...@yahoo.it writes: I've even got ERROR: invalid memory alloc request size 4244635647 with: SELECT substring(B'0001' from 5 for -2); Hm, yeah, somebody was sloppy about exposing the three-argument form of varbit substring and using -1 to represent the