Created
April 17, 2014 14:53
-
-
Save davecramer/10989512 to your computer and use it in GitHub Desktop.
sql to create function and data for example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE usecase01 ( | |
testcolumn text[][] | |
); | |
CREATE FUNCTION usecase01_get() | |
RETURNS TABLE | |
( | |
testcolumn text[][] | |
) | |
AS $$ | |
BEGIN | |
RETURN QUERY SELECT | |
usecase01.testcolumn | |
FROM | |
usecase01; | |
RETURN; | |
END; | |
$$ LANGUAGE plpgsql; | |
INSERT INTO usecase01 VALUES('{"Use","Case","01"}'); | |
--SELECT * FROM usecase01_get(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment