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.

Comments

sdboyer’s picture

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.

stormsweeper’s picture

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.

stormsweeper’s picture

StatusFileSize
new802 bytes

Attaching the file again this time.

sun’s picture

Status: Needs review » 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.

stormsweeper’s picture

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...

stormsweeper’s picture

StatusFileSize
new1.81 KB

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
sdboyer’s picture

Status: Needs work » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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