CREATE SCHEMA http; /* The purpose of this schema, tables, and associated roles to process HTTP responses. I may even include a table to keep track of the XML responses */ /* Add a role to manage permissions on the http schema */ CREATE ROLE http_requestor; GRANT CONNECT ON DATABASE aact_db to http_requestor; GRANT USAGE ON SCHEMA http TO http_requestor; GRANT INSERT,SELECT ON ALL TABLES IN SCHEMA http TO http_requestor; /* Create tables related to http requests As not every request will have an xml doc, split them. */ CREATE TABLE IF NOT EXISTS http.responses ( id SERIAL PRIMARY KEY, nct_id VARCHAR(15), version_a SMALLINT, version_b SMALLINT, url VARCHAR(255), response_code SMALLINT, response_date TIMESTAMP WITH TIME ZONE, html TEXT );