Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postgres #90

Open
isangil opened this issue Jun 6, 2015 · 6 comments
Open

postgres #90

isangil opened this issue Jun 6, 2015 · 6 comments

Comments

@isangil
Copy link
Member

isangil commented Jun 6, 2015

DEIMS and postgres do not seem to get along well -- reports from two folks indicate at least the data-set content type is not working with the post-gres backend. likewise the schema reference.

@mutolisp
Copy link
Contributor

mutolisp commented Jun 8, 2015

This issue due to the auto incremental of records id in MySQL, if deims create a data set in the editing/adding stage, the entity_id and revision_id in the table would be NULL before commit into the database, i.e.:

INSERT INTO [table] (id, field1, field2...) VALUES (NULL, 'v1', v2' ...) 

But postgres does not accept NULL insertion, Jason and I discussed about this case, and he suggested to unset entity_id if the id is null. I tried on my server but failed. Maybe we need to modify the schema if possible.

Refer to #74

@mutolisp
Copy link
Contributor

mutolisp commented Jun 8, 2015

Hi,

After testing adding data sets with data sources, I found the problem occurred when processing “parse csv into variables”. If just add a data set with data sources without adding variables, it works well. If add csv variables, the error shows:

PDOException: SQLSTATE[22003]: Numeric value out of range: 7 ERROR: 
setval: value 0 is out of bounds for sequence 
"test2_field_data_field_variables_field_variables_id_seq" (1..9223372036854775807): 
SELECT 
  setval('test2_field_data_field_variables_field_variables_id_seq', 
GREATEST(MAX(field_variables_id), :serial_value)) 
FROM {field_data_field_variables}; 
Array ( [:serial_value] => 0 ) in field_sql_storage_field_storage_write() 
(line 502 of /var/www/html/deimsp2/modules/field/modules/field_sql_storage/field_sql_storage.module).

@isangil
Copy link
Member Author

isangil commented Jun 8, 2015

Thanks for researching this in detail. It seems that the "Numeric value out of range" may be triggered by the 0 that we are trying to insert? postgres integers range by definition from 1 to a large integer..

@trashmai
Copy link

Hi,

I created an issue on https://www.drupal.org/node/2504323 and made patches for drupal core 7.x (don't know if they'll accept, though). It should work.

For current deims (drupal core 7.36), use this: http://twebi.net/download/deims-7.x-1.x-dev-pgsql-seq-bugs.patch

EDIT:
Rewrite the patch. Now only one file needs to be modified and will only affect drupal instances using pgsql as database. See:
https://www.drupal.org/node/2504323#comment-10020863

@isangil
Copy link
Member Author

isangil commented Jun 12, 2015

great! im sure the community will evaluate the feasibility of the drupal core patch. this is quite exciting, as it will not only help DEIMS, but thousands of other users in the d.o community.

trashmai added a commit to trashmai/deims that referenced this issue Jun 13, 2015
@mutolisp
Copy link
Contributor

Thanks for Jason’s patch! The DEIMS now can add data sets without pop-up error messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants