(plz excuse my poor english)
I've installed latest version of module from cvs.
Table's column type seems to be wrong for PostgreSQL. or need some work done with panels_page.module.
panels_page module is using DB columns(no_blocks, menu, menu_tab, menu_tab_default) as interger. but postgreSQL's column type is boolean. So updating query will have an error. And selecting query will not work as it suppose to.
If I turn off the checkbox for Disable Drupal blocks/regions from admin menu, i get following error msg.

ser warning: query: UPDATE panels_page SET name = 'welcome_panel', title = 'welcome', arguments = 'a:0:{}', displays = 'a:0:{}', contexts = 'a:0:{}', relationships = 'a:0:{}', access = '', path = 'welcome', css_id = '', css = '', no_blocks = 0, menu = 1, menu_tab = 1, menu_tab_weight = 0, menu_title = '', menu_tab_default = 1, menu_tab_default_parent_type = 'tab', menu_parent_title = '', menu_parent_tab_weight = 0 WHERE pid = 1 in /var/www/html/includes/database.pgsql.inc on line 144.

Error is saying : " cant insert interger 0 to boolean column. "
And if I change that interger to boolean with some changing to the code, then it works. But selecting from DB malfunctions.
Because selecting boolean column from postgreSQL DB will have results like 't' for true 'f' for false. so script's column value will be always 1(true).

Changing column type is easy to patch(boolean to smallint), but uses more disk space.
And other way is convert boolean to integer for select query result.. My patch is not a good code(I'm not good at php)

change column type or patch... I cant decide, maintainer should.

CommentFileSizeAuthor
panels_page.module.patch3.38 KByagur

Comments

yagur’s picture

and CVS's branch is not HEAD, it's DRUPAL-5--2(which maintainer's currently working on)

HorsePunchKid’s picture

I think Postgres will accept the strings '1' and '0' as valid booleans. If MySQL will, too, then fixing the UPDATE may just be a matter of quoting the parameters. On the SELECT side of things, you can Cast(TRUE AS integer) in Postgres. I'm having trouble finding a cast that works in both Postgres and MySQL.

Maybe the simpler solution is just to not use the boolean type in Postgres. This patch seems pretty hefty just to work around that minor point. See also here.

merlinofchaos’s picture

Status: Needs review » Fixed

Ok, rather than doing the weirdo conversions, I've changed the boolean types to integer; I didn't bother with an update; since nobody's installations can possibly work, it is probably better to just uninstall and reinstall the module, and assume a baseline: PGSQL never worked prior to beta1.

I'm marking this fixed, but I urge postgres users who are following this to keep a close eye on Panels' database so we can get as much of the pgsql stuff working prior to beta1. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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