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

moshe weitzman - February 25, 2008 - 16:22

I think I will wait until the D6 port to make this change. Makes sense.

#2

moshe weitzman - March 30, 2008 - 13:39
Status:active» postponed

#3

jaydub - April 13, 2008 - 05:30
Version:5.x-5.3» 5.x-6.1
Status:postponed» patch (code needs review)

i'd say this is a major enough issue with PostgreSQL support to
fix it now if possible...

so here is my patch attempt

AttachmentSize
og.install.226336.patch5.79 KB

#4

mikeryan - April 14, 2008 - 20:14

+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

moshe weitzman - April 14, 2008 - 20:18

OK, D5 it is. Do we need a new update function for all the existing PG installs?

#6

mikeryan - April 14, 2008 - 20:59

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

jaydub - April 15, 2008 - 00:35

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

moshe weitzman - April 15, 2008 - 14:04
Status:patch (code needs review)» fixed

well, i went ahead and committed this. hopefully someone will contribute an upgrade function.

#9

Anonymous (not verified) - April 29, 2008 - 14:05
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.