Revision 12461
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/schemas/util.sql | ||
---|---|---|
1527 | 1527 |
CREATE FUNCTION first_word(str text) RETURNS text |
1528 | 1528 |
LANGUAGE sql IMMUTABLE |
1529 | 1529 |
AS $_$ |
1530 |
SELECT match[1] FROM regexp_matches(ltrim($1), '^(\S*)') match
|
|
1530 |
SELECT match[1] FROM regexp_matches(util.ltrim_nl($1), '^(\S*)') match
|
|
1531 | 1531 |
$_$; |
1532 | 1532 |
|
1533 | 1533 |
|
Also available in: Unified diff
bugfix: schemas/util.sql: first_word(): ignore leading whitespace: need to use util.ltrim_nl(), as ltrim() only removes spaces