Revision 12460
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($1, '^(\S*)') match
|
|
1530 |
SELECT match[1] FROM regexp_matches(ltrim($1), '^(\S*)') match
|
|
1531 | 1531 |
$_$; |
1532 | 1532 |
|
1533 | 1533 |
|
Also available in: Unified diff
bugfix: schemas/util.sql: first_word(): need to ignore leading whitespace. this applies to many of our queries, which have a leading newline.