It would appear that the error is occuring within the __new procedure that you created. I say that because that's the place where "p_creation_date" appears. So you modified the stored procedure, and it compiled but fails to run. Look for obvious errors there; then try running the same commands directly (in psql or in sql mode in emacs) to get more information.