CREATE TABLE orders
(ordid	SERIAL NOT NULL PRIMARY KEY);

CREATE FUNCTION new_order() RETURNS VOID LANGUAGE PLPGSQL AS
$$
DECLARE
BEGIN
	INSERT INTO orders DEFAULT VALUES;
EXCEPTION
	WHEN unique_violation THEN
	--do nothing
END;
$$;
