Re: proposal: prefix function

2018-09-21 Thread Pavel Stehule
Hi pá 21. 9. 2018 v 12:37 odesílatel Chris Travers napsal: > > > On Fri, Sep 21, 2018 at 10:09 AM Pavel Stehule > wrote: > >> Hi >> >> can we implement prefix function for fast test if substr is prefix of >> some string? >> >> create or replace function prefix(str text, substr text) >> returns

Re: proposal: prefix function

2018-09-21 Thread Pavel Stehule
pá 21. 9. 2018 v 12:37 odesílatel Chris Travers napsal: > > > On Fri, Sep 21, 2018 at 10:09 AM Pavel Stehule > wrote: > >> Hi >> >> can we implement prefix function for fast test if substr is prefix of >> some string? >> >> create or replace function prefix(str text, substr text) >> returns bool

Re: proposal: prefix function

2018-09-21 Thread Chris Travers
On Fri, Sep 21, 2018 at 10:09 AM Pavel Stehule wrote: > Hi > > can we implement prefix function for fast test if substr is prefix of some > string? > > create or replace function prefix(str text, substr text) > returns boolean as $$ > select substr(str, 1, length(substr)) = substr > $$ language

proposal: prefix function

2018-09-21 Thread Pavel Stehule
Hi can we implement prefix function for fast test if substr is prefix of some string? create or replace function prefix(str text, substr text) returns boolean as $$ select substr(str, 1, length(substr)) = substr $$ language sql; This function can be very effective in C language. Now it should