As installed, the CVS version would always fail to successfully create new tables or table rows. I noticed that in tablemanager.module, there are two INSERT INTO commands on lines 1190 and 1397 that attempt to insert NULL data into a serial column. I don't know how MySQL would handle that, but Postgres sure doesn't like it. I changed the lines to

db_query("INSERT INTO {tablemanager_data} (id, tid, uid, data, format) VALUES ('', %d, %d, '%s', %d)", ...

and

db_query("INSERT INTO {tablemanager} (uid, name, description, header) VALUES (%d, '%s', '%s', '%s')", ...

So far, this has worked just fine for me.

Comments

Eric3’s picture

Also, at line 2146 I removed the blank insert into tid, so the modified line is:

      db_query("INSERT INTO {tablemanager} (uid, name, header) VALUES (%d, '', '%s')", $user->uid, $header);
pobster’s picture

Status: Needs review » Reviewed & tested by the community

Ah yeah now there's a reason for this... I got a rap on the knuckles for bad coding by a Drupal dev and he pointed me to the coding practises page of the manual where it says don't use '' when you mean NULL, use NULL instead (or words to that effect), so I just did a replace on every instance I had of '' into NULL and completely broke everything... Anyways, I gradually changed all the ones that threw up errors back to what they were before and left the ones that worked in. Obviously, those ones worked! I'll change them, thanks for pointing this out.

Pobster

pobster’s picture

Status: Reviewed & tested by the community » Closed (fixed)