Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
on pgsql node_save produces errors when saving certain fields like the boolean sticky. FALSE as string returns as '' instead of 0 as it should be in db - resulting in this error:
warning: pg_query() [<a href='/manual/en/function.pg-query.html'>function.pg-query.html</a>]: Query failed: ERROR: invalid input syntax for integer: "" in D:\amp\htdocs\projekte\drupal_head\includes\database.pgsql.inc on line 76.
user error:
query:
INSERT INTO node (title, body, format, uid, type, teaser, status, moderate, promote, sticky, comment, created, changed, nid) VALUES('!SimpleTest test node! simpletest_xwn9wlV2_S', '!SimpleTest test body! simpletest_oiZZeQw0LqeHVhfrk0twJ_RYNOQbbB5p simpletest_WU5E8tu0dmtvwg_1RN7B9byh5OuFw02u', '1', '12', 'page', '!SimpleTest test body! simpletest_oiZZeQw0LqeHVhfrk0twJ_RYNOQbbB5p simpletest_WU5E8tu0dmtvwg_1RN7B9byh5OuFw02u', '1', '', '1', '', '2', '1125165026', '1125165026', '5') in D:\amp\htdocs\projekte\drupal_head\includes\database.pgsql.inc on line 93.
I consider this a quite major design flaw as the looped general mixed->string conversion strongly relies on the forgiving string->mixed conversions of MySQL.
However I have crafted a fix that solves the issue for me when creating pages, maybe needs more work or even redesign.
Thats the curse of dynamic typing!
Comment | File | Size | Author |
---|---|---|---|
pgsql_node_save.patch | 764 bytes | Thomas Ilsche | |
Comments
Comment #1
Thomas Ilsche CreditAttribution: Thomas Ilsche commentedhttp://drupal.org/node/17656 might be a better solution for the problem.
Comment #2
Zen CreditAttribution: Zen commentedMarking this as a duplicate. The issue you've linked to also seems to have hit a full stop atm. But, if you'd like to chase this up, please take it up on that thread..
Thanks
-K