BEGIN;


CREATE TABLE queue (
    num serial,
    elem text
);

CREATE OR REPLACE FUNCTION add_q(text) RETURNS SETOF text AS $$
    INSERT INTO queue (elem) VALUES ($1);
    SELECT elem FROM queue;
$$ LANGUAGE sql;

COMMIT;
