Database error

glennnz - January 21, 2009 - 01:38
Project:UC Discounts
Version:5.x-1.x-dev
Component:Code
Category:support request
Priority:critical
Assigned:Unassigned
Status:active
Description

Hi

I'm trying to get this to work with a PostgreSQL database installation.

I've manually added the required tables with the required primary keys, but am not sure what to do with 'INDEX discount_id (discount_id)' in my PostgreSQL database.

I am getting this error when trying to add a new Discount:

* warning: pg_query() [function.pg-query]: Query failed: ERROR: relation "uc_discounts_id_seq" does not exist in /Library/WebServer/Documents/includes/database.pgsql.inc on line 126.
* user warning: query: SELECT nextval('uc_discounts_id_seq') in /Library/WebServer/Documents/includes/database.pgsql.inc on line 145.
* warning: pg_query() [function.pg-query]: Query failed: ERROR: value for domain smallint_unsigned violates check constraint "smallint_unsigned_check" in /Library/WebServer/Documents/includes/database.pgsql.inc on line 126.
* user warning: query: INSERT INTO uc_discounts (name, description, max_discounts, do_end_processing, is_exclusive, weight, start_time, end_time, is_active, id) VALUES ('erhsdth', 'jytetjy', 0, 0, 0, -1, 1231585200, 1256122799, 1, 0) in /Library/WebServer/Documents/includes/database.pgsql.inc on line 145.

You can see that it is replicating the id and trying to put it into the primary key field.

I have id set up on all three tables as the primary key, and have set up a foreign key in the _actions and _conditions tables, called 'uc_discounts_id_seq' which links the discount_id field back to the id field in uc_discounts.

This obviously hasn't fixed my problem...

Any help would be much appreciated...

Thanks

Glenn

 
 

Drupal is a registered trademark of Dries Buytaert.