blob: 78911752d1e405e55e5d0c98e2ef9be77e5cf0f3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
--
-- Perl Weekly Challenge 253
-- Task 1
-- See <https://perlweeklychallenge.org/blog/perl-weekly-challenge-253>
--
CREATE SCHEMA IF NOT EXISTS pwc253;
CREATE OR REPLACE FUNCTION
pwc253.task1_plpgsql( s char, words text[] )
RETURNS SETOF text
AS $CODE$
DECLARE
current_word text;
BEGIN
FOREACH current_word IN ARRAY words LOOP
RETURN QUERY
SELECT regexp_split_to_table( current_word, '[' || s || ']' );
END LOOP;
RETURN;
END
$CODE$
LANGUAGE plpgsql;
|