Hi All,
I modified webform to solve two issues to support PostgreSQL.
The first was that there wasn't a PostgreSQL compatible SQL file to setup the DB for the webform module. Here's what I came up with for that:
BEGIN;
CREATE TABLE webform (
nid integer not null,
confirm text,
email varchar(50),
primary key(nid)
);
CREATE TABLE webform_component (
nid integer not null,
cid integer not null,
name varchar(128),
type varchar(16),
value varchar(128),
extra text,
mandatory integer,
weight integer,
PRIMARY KEY(nid, cid)
);
CREATE TABLE webform_role_node (
nid integer not null,
rid integer not null,
PRIMARY KEY(nid, rid)
);
CREATE TABLE webform_submited_data (
nid integer not null,
sid integer not null,
name varchar(255) not null,
data text,
PRIMARY KEY(nid, sid, name)
);
CREATE SEQUENCE webform_submissions_id_seq START 1 INCREMENT BY 1 CACHE 1 NO CYCLE;
-- Setting default variables
INSERT INTO variable VALUES ('webform_version', 'a:2:{s:4:"text";s:5:"4.5.1";s:5:"build";i:451;}');
COMMIT;
The second issue was that the _webform_save_submission function tried to insert multiple rows inside one db query. Either this wasn't formatted correctly or PostgreSQL doesn't support this feature so I modified it to insert each row individually. The function was modified as below: