PostgreSQL fails table creation

AlexisWilke - April 17, 2009 - 01:03
Project:Mail API
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:patch (to be ported)
Description

Hi there,

The installation fails because you have a couple of int default '0' with quotes around the zero. That is not acceptable to PostgreSQL (it's an integer, not a string.)

Thank you.
Alexis Wilke

AttachmentSize
mail_api-6.x-1.0-invalid-default-integer.patch912 bytes

#1

AlexisWilke - April 17, 2009 - 03:33
Status:active» patch (to be ported)

I actually included a patch so I'm fixing the status.

#2

AlexisWilke - April 17, 2009 - 05:41

This is another patch to fix the other problem: You named a field in your database 'default' which is a reserved keyword in most database systems. You just cannot do that!

It looks like at this time you are not accessing that field so I simply commented it out. Otherwise, you need to rename it something like 'default_value' or use a name that represents what that default is...

Thank you.
Alexis Wilke

P.S. You will need to apply my first patch to be able to apply this patch automatically. But I suspect you won't want to just apply this patch...

AttachmentSize
mail_api-6.x-1.0-invalid-field-name.patch 629 bytes

#3

jleinenbach - November 20, 2009 - 13:44
Version:6.x-1.0» 6.x-1.x-dev

First, I tried to install the recommended final mail_api, v6.x-1.7, but it failed with this many PostgreSQL error messages.

I had the same problem with the latest mail_api, v1.6.2.3 (2009/10/02 20:47:14).

But commenting out the line as seen in the patch by AlexisWilke finally solved this problem.

mail_api.install:
//'default' => array('type' => 'int', 'not null' => TRUE, 'default' => '0'),

Please apply the patch in all future versions for PostgreSQL users.

 
 

Drupal is a registered trademark of Dries Buytaert.