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.
| Attachment | Size |
|---|---|
| panels_views.install.diff.txt | 701 bytes |
| panels_views.module.diff.txt | 658 bytes |

#1
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
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
Attaching the file again this time.
#4
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
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
New patch attached, made against the DRUPAL-5--2 branch.
#7
#8
Automatically closed -- issue fixed for two weeks with no activity.