From: John Morton <jwm@an...> - 2012-01-09 16:47:01
I was getting postgresql syntax errors running SMW_refreshdata recently:
Database returned error "1: ERROR: syntax error at or near ""t1""
LINE 1: ...rchyQuery 127.0.0.1 */ OR REPLACE FUNCTION create_"t1"() RET...
It boils down to the getCreateTempIDTableSQL being passed a quoted and escaped
table name, then naively concatenating that with "create_" and "_ignore" when
I've hacked around that by doing:
$funcname = ereg_replace("[^A-Za-z0-9]", "", $tablename );
And using that anywhere in the statement it tries to create a new thing,
rather than refer to the table itself. Seems to work.
(The unused props special also uses remarkably similar code, which suggests it
should be calling this function instead, but then it's been broken for
postgresql since 1.5 if not early, patches nonwithstanding.)