Revision 8144
Added by Aaron Marcuse-Kubitza over 11 years ago
schemas/functions.sql | ||
---|---|---|
758 | 758 |
|
759 | 759 |
|
760 | 760 |
-- |
761 |
-- Name: table2hstore(regclass); Type: FUNCTION; Schema: functions; Owner: - |
|
762 |
-- |
|
763 |
|
|
764 |
CREATE FUNCTION table2hstore(table_ regclass) RETURNS hstore |
|
765 |
LANGUAGE plpgsql IMMUTABLE STRICT |
|
766 |
AS $_$ |
|
767 |
DECLARE |
|
768 |
hstore hstore; |
|
769 |
BEGIN |
|
770 |
EXECUTE $$SELECT hstore(ARRAY(SELECT unnest(ARRAY["from", "to"]) FROM $$|| |
|
771 |
table_||$$))$$ INTO STRICT hstore; |
|
772 |
RETURN hstore; |
|
773 |
END; |
|
774 |
$_$; |
|
775 |
|
|
776 |
|
|
777 |
-- |
|
761 | 778 |
-- Name: to_global_col_names(regclass); Type: FUNCTION; Schema: functions; Owner: - |
762 | 779 |
-- |
763 | 780 |
|
Also available in: Unified diff
schemas/functions.sql: Added table2hstore()