The following bug has been logged on the website:
Bug reference: 9578
Logged by: Jack Douglas
Email address: jack@douglastechnology.co.uk
PostgreSQL version: 9.3.2
Operating system: Debian Wheezy 64-bit
Description:
A temp table created inside an SQL function does not override existing
permanent tables with the same name as the documentation here indicates it
should:
http://www.postgresql.org/docs/9.3/static/sql-createtable.html#AEN72676
I've reproduced this on the major versions back to 8.4.
More details, test case and investigation here:
http://dba.stackexchange.com/q/60997/1396