Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hey all,
I've finally had a chance to port the install system to PostgreSQL. I've attached the files to this post. Of particular note:
- Added unsigned integer types for smallint, int and bigint types.
- Modified indexes to match the MySQL KEY statements where substrings are used in the index.
- Everything(™) that was unsigned in MySQL is now unsigned in PostgreSQL
Hopefully we get some people testing this baby out so we can see how it goes.
Cheers,
--
Sammy Spets
Synerger Pty Ltd
http://www.synerger.com
Comment | File | Size | Author |
---|---|---|---|
#21 | system.install.patch_2.txt | 7.5 KB | nuwanda |
#19 | system.install.patch_1.txt | 8.17 KB | nuwanda |
#10 | module.install.1.patch.txt | 17.3 KB | sammys |
#5 | install.pgsql_1.inc | 5.54 KB | sammys |
#3 | install.pgsql_0.inc | 5.54 KB | sammys |
Comments
Comment #1
sammys CreditAttribution: sammys commentedHere is the patch for system.install.
Comment #2
sammys CreditAttribution: sammys commentedOk.. i've rolled up all the [module].install patches into the one patch. Now, all core modules that have install files have been updated with PostgreSQL installation code.
Comment #3
sammys CreditAttribution: sammys commentedFound a remaining mysql_error() call in the install.pgsql.inc file. Now this file and the patch are ready for review.
Comment #4
breyten CreditAttribution: breyten commentedThe doxygen for drupal_test_pgsql still says MySQL ;-)
Comment #5
sammys CreditAttribution: sammys commentedhehe. nicely spotted. updated.
Comment #6
Dries CreditAttribution: Dries commentedI lost track. What patches should I apply? :)
Comment #7
sammys CreditAttribution: sammys commentedheh... apply module.install.patch and put install.pgsql_1.inc into the includes directory as install.pgsql.inc. Voila!
Comment #8
Steve Simms CreditAttribution: Steve Simms commentedThere are a few odd constructions with sequences for a few tables, but this existed in the old code, so I filed a separate issue to deal with that. I'll submit a patch once this one gets committed.
Comment #9
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks sammys. Keep 'em coming. :)
Comment #10
sammys CreditAttribution: sammys commentedChanged my mind about the type naming. Making the 'u', for unsigned, a suffix so compatibility code in modules like CCK and core database code can easily use the unsigned types. So, rather than having a smalluint there is a smallint_unsigned. In addition to this the pgsql version of the node_type table has been added to the system.install file. Here's the patch.
Comment #11
drummCommitted to HEAD.
Comment #12
(not verified) CreditAttribution: commentedComment #13
dwwthere's no update to migrate a 4.7 pgsql DB to this new system. in particular, the stuff to define the int_unsigned type only happens when you first install the system DB. if you're updating an old install, then the int_unsigned type is unavailable to you. this is particularly problematic for update 1005, which is trying (incorrectly, see http://drupal.org/node/82822) to add a {node_type} table with some unsigned fields. ideally, the fix for #82822 would be able to just convert those "integer unsigned" (mysql syntax) into "int_unsigned" (the new drupal-specific pgsql syntax). however, without a proper system update to add these types to the DB, you can't do that. cramming them in via update 1005 seems wrong. however, it seems even worse to fix 1005 to use plain old integer, and then add a new update 1012 that both defines int_unsigned (if not already there from the system install) and then converts the 3 fields in {node_type} to use int_unsigned.
Comment #14
sammys CreditAttribution: sammys commentedThis issue is closed. See http://drupal.org/node/82822 instead.
Comment #15
dwwi don't want to get into a pushing match, but no, this isn't closed. ;) there are 48 references to "int_unsigned" in system.install. none of them in an update. if someone takes a 4.7 pgsql DB and wants to update to 5.0, their version of all of these fields are going to be signed ints, not unsigned like we're expecting. i believe we really need a new system update that works as an upgrade path to alter all of these fields. it should probably be the one that defines the new int_unsigned types, too. this is a separate (though related) issue to how we fix update 1005's incorrect use of "unsigned" via http://drupal.org/node/82822.
does that make sense?
thanks,
-derek
Comment #16
sammys CreditAttribution: sammys commentedFair enough then. Semantics. :)
I understand your concern for consistency across both upgraded platforms and the new install base. The more I think about it, the more I feel it's a necessary thing to do. There are some reasons why it doesn't make any difference.
Alternatives:
Any comments?
Cheers,
--
Sammy Spets
Synerger
http://synerger.com
Comment #17
dww(at chx's request)
Comment #18
dwwbump: this is still broken, right? it'd be nice to fix this before 5.0 RC2, wouldn't it? i'm not nearly the pgsql guru as others, but i think i'd vote for option #1 from comment #16. sammys, any reason *not* to take that approach? seems simpler than #2, and for all the reasons already discussed, better than #3.
Comment #19
nuwanda CreditAttribution: nuwanda commentedHi there,
am a Newbie to Drupal, but I think this patch, extending system_update_1005, will bring update and install back in sync, as far as the *int_unsigned types are concerned. Ran the patch against DRUPAL-5. Tested with upgrades from 4.7.3 to 5.2 on postgres 8.1 and 7.4.
Cheers
Comment #20
drummThe first chunk no longer applies since that was fixed separately.
Comment #21
nuwanda CreditAttribution: nuwanda commentedSo it was. Thanks for spotting that drumm!
Comment #22
sammys CreditAttribution: sammys commentedHi,
Thanks for taking ownership of this nuwanda. Hopefully you're still around. I've taken a look at your patch and most of it looks good. Without applying the patch and testing it I can see there are missing {} around table names in a few of the direct db_query() calls. Could you fix that and reroll the patch please?
Comment #23
StevenPatzComment #24
TR CreditAttribution: TR commentedThe part of this issue that is still open has to do with the upgrade path from Drupal 4 to Drupal 5. Neither of those major versions are supported anymore. Closing this as "won't fix".