I receive the following error when I try to save a panels view. I am using Drupal 5.5 with PostgreSQL.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "offset" LINE 1: ..., view_type, use_pager, pager_id, nodes_per_page, offset, li... ^ in /usr/local/apache2/htdocs/drupal/includes/database.pgsql.inc on line 125.
* user warning: query: INSERT INTO panels_views (pvid, view, name, description, title, category, category_weight, view_type, use_pager, pager_id, nodes_per_page, offset, link_to_view, more_link, feed_icons, url_override, url, url_from_panel, contexts, allow_type, allow_nodes_per_page, allow_offset, allow_use_pager, allow_link_to_view, allow_more_link, allow_feed_icons, allow_url_override, allow_url_from_panel) VALUES (1, 'circle_events', 'circle_events', 'Events for Circle of Interest', '', 'Views', -1, 'page', 0, 0, 10, 0, 0, 0, 0, 0, '', 0, 'a:4:{i:0;a:5:{s:4:"type";s:7:"context";s:7:"context";s:3:"any";s:5:"panel";s:1:"0";s:5:"fixed";s:0:"";s:5:"label";s:16:"OG: Group nid(s)";}i:1;a:5:{s:4:"type";s:7:"context";s:7:"context";s:3:"any";s:5:"panel";s:1:"0";s:5:"fixed";s:0:"";s:5:"label";s:14:"Calendar: Year";}i:2;a:5:{s:4:"type";s:7:"context";s:7:"context";s:3:"any";s:5:"panel";s:1:"0";s:5:"fixed";s:0:"";s:5:"label";s:15:"Calendar: Month";}i:3;a:5:{s:4:"type";s:7:"context";s:7:"context";s:3:"any";s:5:"panel";s:1:"0";s:5:"fixed";s:0:"";s:5:"label";s:13:"Calendar: Day";}}', 0, 0, 0, 0, 0, 0, 0, 0, 0) in /usr/local/apache2/htdocs/drupal/includes/database.pgsql.inc on line 144.
Comments
Comment #1
eleybourn commentedoffset is a reserved word. You can get around this by quoting the word in double quotes.
ie
pager_id, nodes_per_page, "offset", link_to_viewComment #2
simeComment #3
jruberto commentedYep, add these few lines to panels_views.install and it will work in PostgreSQL. I don't know enough about PostgreSQL to say so with any authority, but it might be better to just put all the field names in quotes?
Comment #4
linuxpoet commentedWell a better solution would be to not use the word offset. However yes, if you quote the names you should be safe.
Comment #5
sun#244208: ERROR: syntax error at or near "offset" in CREATE TABLES panels_views .... has been marked as duplicate of this issue.
Comment #6
sdboyer commentedYeah...ugly to fix it this way, but cleaner to do it this way and fix things more permanently when we're making bigger changes later.
Hack in #3 has been committed.
Comment #7
sunAttached patch fixes coding-style of previous commit (indent & remark).
Comment #8
sdboyer commentedPicky picky ;p
committed, and since I had to roll a beta4b release anyway, I've included it in there.
Comment #9
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.