Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Browscap use "REPLACE INTO" to import php_browscap.ini. The "REPLACE INTO" is MySQL specific SQL, and not work with postgresql.
The attached patch make SELECT and INSERT or UPDATE to import php_browscap.ini whenever DB is postgresql.
Also fix another SELECT error on postgresql.
Comment | File | Size | Author |
---|---|---|---|
#5 | browscap.module-300627-5.patch | 1.37 KB | Darren Oh |
#2 | browscap-300627-2-pgsql.patch | 1.04 KB | cedarm |
#2 | browscap-300627-2-sqlsyntax.patch | 617 bytes | cedarm |
browscap.module.diff | 1.51 KB | iktaka |
Comments
Comment #1
RobLoachThis patch has quite a lot of tabs and coding standard typos.
Comment #2
cedarm CreditAttribution: cedarm commentedHere's the same patch cleaned up, and split into the two fixes.
Also, it looks like CVS code has moved on, so I'm mainly posting this for the benefit of those trying to use PostgreSQL with browscap-6.x-1.0.
Comment #3
veriKami CreditAttribution: veriKami commentedsubscribing :-) I have just started this module on postgres and have lots of errors, eg.:
...propably this could help...
...after 'quick patchwork' it seems it does :-)
Comment #4
veriKami CreditAttribution: veriKami commented...but when trying to import Browscap data I have msg.:
however imported data are in db, displaying: 'New version of browscap imported: 4409'
Comment #5
Darren OhSimplified patch.
Comment #6
RobLoachAlthough I haven't tested wiht Postres, it does use DELETE and INSERT instead of REPLACE properly. If anyone comes along and says it works on Postgres, I'd be happy to commit it.
Comment #7
Darren OhPostgreSQL is what I use this on. I still get the error in comment #4, but it's not related. It results from the encoding not being converted to UTF8 before data is passed to the database.
Comment #8
henmue CreditAttribution: henmue commentedHi there! I'm using PostgreSQL, too. The "REPLACE INTO" part is still in the development snapshot. Will it be replaced by compatible commands?
Best regards
Henry
Comment #9
RobLoachThanks for reminding me.... http://drupal.org/cvs?commit=222442
Comment #10
henmue CreditAttribution: henmue commentedYeah, Rob! That was a fast one, thank you.
I reinstalled Browsecap and also got the "invalid byte sequence for encoding "UTF8": 0xe26e63" error mentioned earlier. But it doesn't seem to have any effect on the module (up to now :-).
Regards
Henry