After running update.php the following errors are displayed when adding a Node Queue
* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "nodequeue_subqueue_sqid_seq" does not exist in /home/anthony/domains/anthony.thrillist-dev.com/public_html/thrilldrupal/includes/database.pgsql.inc on line 125.
* user warning: query: SELECT nextval('nodequeue_subqueue_sqid_seq') in /home/anthony/domains/anthony.thrillist-dev.com/public_html/thrilldrupal/includes/database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "nodequeue_subqueue" does not exist in /home/anthony/domains/anthony.thrillist-dev.com/public_html/thrilldrupal/includes/database.pgsql.inc on line 125.
* user warning: query: INSERT INTO nodequeue_subqueue (qid, sqid, reference, title) VALUES (1, 0, '1', 'Test Node Queue') in /home/anthony/domains/anthony.thrillist-dev.com/public_html/thrilldrupal/includes/database.pgsql.inc on line 144.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "nodequeue_subqueue" does not exist in /home/anthony/domains/anthony.thrillist-dev.com/public_html/thrilldrupal/includes/database.pgsql.inc on line 125.
* user warning: query: SELECT q.*, COUNT(s.sqid) AS subqueues FROM nodequeue_queue q LEFT JOIN nodequeue_subqueue s ON q.qid = s.qid WHERE q.qid IN (1) GROUP BY q.qid in /home/anthony/domains/anthony.thrillist-dev.com/public_html/thrilldrupal/includes/database.pgsql.inc on line 144.
Look around in the install file and I see that the table never gets created in the PgSQL case. I have modified the install file to include the following in the PgSQL case under nodequeue_install();
The new section looks like:
// anthony [at] thrillist dot com matches mysql/mysqli cases
// Subqueues are minor queues that inherit all of the properties of
// the parent queue. A parent queue must have at least 1 subqueue
// to do anything. Reference is for the use of whatever is creating
// the subqueues in order to link it to some other ID easily.
db_query("CREATE TABLE {nodequeue_subqueue} (
sqid integer PRIMARY KEY,
qid integer NOT NULL,
reference varchar(255) default 0,
title varchar(255) default ''
)");
db_query("CREATE INDEX {nodequeue_subqueue}_qid_idx ON {nodequeue_subqueue} (qid)");
db_query("CREATE INDEX {nodequeue_subqueue}reference_idx ON {nodequeue_subqueue} (reference)");
db_query("CREATE INDEX {nodequeue_subqueue}_title_idx ON {nodequeue_subqueue} (title)");
// end of my custom PgSQL
Also the following line:
db_query("CREATE SEQUENCE nodequeue_queue_qid_seq INCREMENT 1 START 1");
has turned into:
db_query("CREATE SEQUENCE nodequeue_queue_qid_seq INCREMENT 1 START 1");
db_query("CREATE SEQUENCE nodequeue_subqueue_sqid_seq INCREMENT 1 START 1"); // added by me
I have tested these changes in my Drupal environment and work 100%. I guess this has not been reported before due to the lack of PgSQL users, hopefully that will change.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | nodequeue-269459-2.pqsql_.patch | 7.71 KB | telex-1 |
Comments
Comment #1
telex-1 commentedI ran into this problem too and there's also another one with several SELECT queries in 'nodequeue.module'. Without really understanding the database stuff, the difference between PgSQL and MySQL and exact purpose of these queries, I was able to somehow tweak them so the module now works with PgSQL at least without error messages. I briefly tested the patch also on MySQL based installation and it seems to work fine too.. The queries are probably not optimal, so you may experience slower performance - the code really needs some expert work.. The patch is against 5.x-2.x.-dev. I also rolled in the code from this issue: #269541: PgSQL for insert statements.
Comment #2
Gijs commentedThis patch failes on my Debian system with Drupal 5-8
and that reject file says:
The error now (still) reported by site:
Comment #3
socki commentedYou might check out this thread.. its possible you are having the same error... and the same solution will work:
Different version of the module, but seems same error with Postgres.
#286918: Schema mismatch errors reported by schema.module
Comment #4
ezra-g commentedThis is a duplicate of #290969: Postgres compatibility. Let's continue working over there.