SQL Error
| Project: | Node approval |
| Version: | 4.7.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | robertDouglass |
| Status: | active |
Jump to:
* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "nodeapproval" does not exist in /home/herni/public_html/test/includes/database.pgsql.inc on line 84.
* user warning: query: SELECT COUNT(*) FROM node n LEFT JOIN nodeapproval app ON n.nid = app.nid WHERE app.approved IS NULL AND n.type IN ('book page', 'fileshare', 'Event Calendar', 'image', 'page', 'story') in /home/herni/public_html/test/includes/database.pgsql.inc on line 103.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "nodeapproval" does not exist in /home/herni/public_html/test/includes/database.pgsql.inc on line 84.
* user warning: query: SELECT n.nid, app.approved FROM node n LEFT JOIN nodeapproval app ON n.nid = app.nid WHERE app.approved IS NULL AND n.type IN ('book page', 'fileshare', 'Event Calendar', 'image', 'page', 'story') ORDER BY created DESC LIMIT 30 OFFSET 0 in /home/herni/public_html/test/includes/database.pgsql.inc on line 103.

#1
The postgres tables aren't created in nodeapproval.info. Please provide a tested pg schema and I'll update.
#2
did u mean a database schema?
#3
Yes, I meant "a tested PostGres schema" =)
#4
this is the amendment but have the errors :(
function nodeapproval_install() {
drupal_set_message('Installing node approval');
switch ($GLOBALS['db_type']) {
case 'mysql':
case 'mysqli':
db_query("CREATE TABLE nodeapproval (
nid INT NOT NULL ,
uid INT NOT NULL ,
time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
approved TINYINT NOT NULL ,
PRIMARY KEY ( nid ) ,
INDEX ( approved );
);");
break;
case 'pgsql':
$query = db_query("CREATE TABLE nodeapproval (
nid integer NOT NULL,
uid integer NOT NULL,
'time' timestamp with time zone NOT NULL,
approved smallint NOT NULL,
PRIMARY KEY (nid)
); CREATE INDEX {nodeapproval}_approved_key ON {nodeapproval} (approved);");
break;
}
}
#5
correction:
above is the amendment..but have the SAME errors.