Postgres not supported by panels_views

stormsweeper - May 22, 2008 - 17:15
Project:Panels
Version:5.x-2.0-beta3
Component:Views panes
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

The first issue is that the create table statement has that mysql-specific construct at the end of it. The other is that "offset" is a reserved word in Postgres.

I have attached patches for the install and module files. The install file has been changed to only add the mysql-specific construct if the dbtype is mysql or mysqli, and to wrap all column names in double quotes if the dbtype is pgsql. The module file has been changed to wrap the column names in quotes for the insert/update statements, again only for pgsql. The diffs have been made against the files from the beta3 tarball, as I can't connect to the CVS server currently.

AttachmentSize
panels_views.install.diff.txt701 bytes
panels_views.module.diff.txt658 bytes

#1

sdboyer - May 22, 2008 - 17:46

Thanks for this, I still haven't had the time to set up my local pgsql db for testing. I'll review & likely commit these when I get a minute.

#2

stormsweeper - May 27, 2008 - 19:45

Oops, missed the sequence. I added another check that changes the definition of the primary key column to 'serial PRIMARY KEY' for pgsql. Sequences created thusly are "attached" to the table, so no need for further uninstall sql.

#3

stormsweeper - May 27, 2008 - 19:46

Attaching the file again this time.

AttachmentSize
panels_views.install.diff2_.txt802 bytes

#4

sun - May 27, 2008 - 20:10
Status:patch (code needs review)» patch (code needs work)

offset bug has been fixed in the meantime.
And, a primary key is not the same as auto_increment, which is what 'serial' type columns are intended for.

#5

stormsweeper - May 27, 2008 - 23:04

The {panels_views}.pvid column is a sequence-driven column, and if you don't have a sequence declared for the column you will get errors when actually using the module to create a new views pane. The mySql-specific sequences table will handle undeclared sequences but that is of no use in Postgres. The serial type is used for all such primary key columns in Drupal core to avoid exactly what I am avoiding here - having to have explicit calls to create and destroy the sequences.

http://www.postgresql.org/docs/7.4/interactive/datatype.html#DATATYPE-SE...

#6

stormsweeper - May 27, 2008 - 23:38

New patch attached, made against the DRUPAL-5--2 branch.

  1. panels_views.install: Added a check for db type before adding the mysql version check to the sql.
  2. panels_views.module: Added check for the offset column name in panels_views_save($pv)
  3. panels_views.module: Changed definition for pvid column to be "serial PRIMARY KEY" for pgsql only
AttachmentSize
panels_views.DRUPAL-5--2.txt1.81 KB

#7

sdboyer - July 11, 2008 - 07:38
Status:patch (code needs work)» fixed

#8

Anonymous (not verified) - July 31, 2008 - 04:46
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.