{"id":1268,"date":"2007-12-20T17:47:40","date_gmt":"2007-12-20T22:47:40","guid":{"rendered":"http:\/\/blogs.terrorware.com\/geoff\/2007\/12\/20\/drupal-contemplate-module-with-postgres\/"},"modified":"2007-12-20T17:49:12","modified_gmt":"2007-12-20T22:49:12","slug":"drupal-contemplate-module-with-postgres","status":"publish","type":"post","link":"http:\/\/blogs.terrorware.com\/geoff\/2007\/12\/20\/drupal-contemplate-module-with-postgres\/","title":{"rendered":"drupal contemplate module with postgres"},"content":{"rendered":"<p>I&#8217;ve been working on setting up a Drupal instance for work and have, for the first time been using Postgres for the database instead of MySQL.  I was installing the Content Template module and got errors when the module tried to create the tables by default.  I think the problem is with the fact that the CREATE statements in contemplate.install use MySQL-only data types.\u00c2\u00a0 It seems that others have reported this problem as there is an issue on the Drupal site at <a href=\"http:\/\/drupal.org\/node\/172775\">http:\/\/drupal.org\/node\/172775<\/a> .<\/p>\n<p>I was able to create working tables manually with the following syntax:<\/p>\n<blockquote>\n<pre>\r\nCREATE TABLE contemplate (\r\n    type character(32) DEFAULT '' NOT NULL,\r\n    teaser text NOT NULL,\r\n    body text NOT NULL,   rss text NOT NULL,\r\n    enclosure character(128) NOT NULL,\r\n    flags integer DEFAULT 0 NOT NULL,\r\n    PRIMARY KEY (type)\r\n);CREATE TABLE contemplate_files (\r\n    site character(255) NOT NULL,\r\n    data bytea NOT NULL,\r\n    UNIQUE (site)\r\n);<\/pre>\n<\/blockquote>\n<p>I made a patch to contemplate.install that fixed this issue. <a href=\"http:\/\/geoff.terrorware.com\/hacks\/drupal_modules\/patches\/contemplate\/contemplate.install.patch\" title=\"Patch to contemplate.install\">download<\/a><\/p>\n<p>Once I got past the table creation, the module still returned SQL errors when I tried to update the template for a CCK content type.  This seemed to be due to a problem with the SQL syntax.  I made a patch to contemplate.module that fixes this in Postgres.  I don&#8217;t know if it ends up breaking MySQL in the process.  <a href=\"http:\/\/geoff.terrorware.com\/hacks\/drupal_modules\/patches\/contemplate\/contemplate.module.patch\" title=\"Patch to contemplate.module\">download<\/a><\/p>\n<p>Oh yeah.  I&#8217;m using Drupal 5.5 with contemplate 5.x-1.8 and Postgres 8.1.9<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been working on setting up a Drupal instance for work and have, for the first time been using Postgres for the database instead of MySQL. I was installing the Content Template module and got errors when the module tried to create the tables by default. I think the problem is with the fact that&hellip; <a class=\"more-link\" href=\"http:\/\/blogs.terrorware.com\/geoff\/2007\/12\/20\/drupal-contemplate-module-with-postgres\/\">Continue reading <span class=\"screen-reader-text\">drupal contemplate module with postgres<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[27],"tags":[382,263,383,381,384],"class_list":["post-1268","post","type-post","status-publish","format-standard","hentry","category-hacks","tag-contemplate","tag-drupal","tag-module","tag-patch","tag-postgres","entry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4wnIz-ks","_links":{"self":[{"href":"http:\/\/blogs.terrorware.com\/geoff\/wp-json\/wp\/v2\/posts\/1268","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blogs.terrorware.com\/geoff\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blogs.terrorware.com\/geoff\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blogs.terrorware.com\/geoff\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/blogs.terrorware.com\/geoff\/wp-json\/wp\/v2\/comments?post=1268"}],"version-history":[{"count":0,"href":"http:\/\/blogs.terrorware.com\/geoff\/wp-json\/wp\/v2\/posts\/1268\/revisions"}],"wp:attachment":[{"href":"http:\/\/blogs.terrorware.com\/geoff\/wp-json\/wp\/v2\/media?parent=1268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blogs.terrorware.com\/geoff\/wp-json\/wp\/v2\/categories?post=1268"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blogs.terrorware.com\/geoff\/wp-json\/wp\/v2\/tags?post=1268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}