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
| Attachment | Size |
|---|---|
| mail_api-6.x-1.0-invalid-default-integer.patch | 912 bytes |

#1
I actually included a patch so I'm fixing the status.
#2
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...
#3
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.