Revision 8146
Added by Aaron Marcuse-Kubitza almost 12 years ago
schemas/functions.sql | ||
---|---|---|
639 | 639 |
|
640 | 640 |
|
641 | 641 |
-- |
642 |
-- Name: map_get(regclass, text); Type: FUNCTION; Schema: functions; Owner: - |
|
643 |
-- |
|
644 |
|
|
645 |
CREATE FUNCTION map_get(map regclass, key text) RETURNS text |
|
646 |
LANGUAGE plpgsql STABLE STRICT |
|
647 |
AS $_$ |
|
648 |
DECLARE |
|
649 |
value text; |
|
650 |
BEGIN |
|
651 |
EXECUTE $$SELECT "to" FROM $$||map||$$ WHERE "from" = $1$$ |
|
652 |
INTO STRICT value USING key; |
|
653 |
RETURN value; |
|
654 |
END; |
|
655 |
$_$; |
|
656 |
|
|
657 |
|
|
658 |
-- |
|
642 | 659 |
-- Name: mk_map_table(text); Type: FUNCTION; Schema: functions; Owner: - |
643 | 660 |
-- |
644 | 661 |
|
Also available in: Unified diff
schemas/functions.sql: Added map_get()