Postgresql and the .install file
satori12 - February 25, 2008 - 04:06
| Project: | Organic groups |
| Version: | 5.x-6.1 |
| Component: | og.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
Hi, I've noticed that for postgresql dbs the 'numeric' data type is used for fields like 'nid'.
According to http://www.postgresql.org/docs/8.1/interactive/datatype.html#DATATYPE-NU... numeric is designed for high-precision calculations rather than the integers that Drupal uses.
Is using the numeric data type a mistake, or was there a good reason for doing this? If there isn't I suggest changing the install file to use INTEGER as it's a more appropriate data type.
Cheers,
Steve

#1
I think I will wait until the D6 port to make this change. Makes sense.
#2
#3
i'd say this is a major enough issue with PostgreSQL support to
fix it now if possible...
so here is my patch attempt
#4
+1 for a Drupal 5 fix... With a vanilla Drupal 5 installation, enabling OG with story as the Group home page node type, I was getting the warnings reported in http://drupal.org/node/212771 when creating a story. I applied the patch and started the DB over from scratch, no messages. It'll take a little more work to see if there are other Postgres issues, but this patch is definitely a step forward.
#5
OK, D5 it is. Do we need a new update function for all the existing PG installs?
#6
Yes, I would think so - I can't see successfully using the 5.x-6.1 OG with PostgreSQL, but I imagine there must be existing installations out there if the issue hasn't come up before now...
Thanks.
#7
I think an update _should_ work ok since converting from numeric
to integer should be 1:1. I can write an update but I don't have much
of a test site to test the update with...
#8
well, i went ahead and committed this. hopefully someone will contribute an upgrade function.
#9
Automatically closed -- issue fixed for two weeks with no activity.