Revision 12356
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/schemas/util.sql | ||
---|---|---|
2481 | 2481 |
|
2482 | 2482 |
|
2483 | 2483 |
-- |
2484 |
-- Name: rtrim_n(text, integer); Type: FUNCTION; Schema: util; Owner: - |
|
2485 |
-- |
|
2486 |
|
|
2487 |
CREATE FUNCTION rtrim_n(str text, count integer) RETURNS text |
|
2488 |
LANGUAGE sql IMMUTABLE |
|
2489 |
AS $_$ |
|
2490 |
SELECT (CASE WHEN $2 <= 0 THEN $1 ELSE left($1, -$2) END) |
|
2491 |
$_$; |
|
2492 |
|
|
2493 |
|
|
2494 |
-- |
|
2484 | 2495 |
-- Name: save_drop_view(text); Type: FUNCTION; Schema: util; Owner: - |
2485 | 2496 |
-- |
2486 | 2497 |
|
Also available in: Unified diff
schemas/util.sql: added rtrim_n()