I would like to support PostgreSQL with my extension, however I'm running into a problem when I attempt to install it. Currently, I have the following in my XML for the install section:
<install>
<sql>
<file driver="mysql" charset="utf8">sql/install.mysql.utf8.sql</file>
<file driver="postgresql" charset="utf8">sql/install.postgresql.utf8.sql</file>
</sql>
</install>
And here is the code for install.postgresql.utf8.sql:
CREATE TABLE "#__shoutbox" (
"id" serial NOT NULL,
"name" character varying(25) DEFAULT '' NOT NULL,
"when" timestamp without time zone DEFAULT '' NOT NULL,
"ip" character varying(15) DEFAULT '' NOT NULL,
"msg" text NOT NULL,
"user_id" bigint(11) DEFAULT 0 NOT NULL,
PRIMARY KEY ("id")
);
INSERT INTO "#__shoutbox" ("name", "when", "msg", "user_id") VALUES ('JoomJunk', '2013-04-04 20:00:00', 'Welcome to the Shoutbox', '0');
I have noticed a few differences between the query for MySQL and PostgreSQL which I think I have taken into consideration, but when I attempt to install the extension, I get the following error:
Database query failed (error # %s): %s SQL=CREATE TABLE "pdo31_shoutbox" ( "id" serial NOT NULL, "name" character varying(25) DEFAULT '' NOT NULL, "when" timestamp without time zone DEFAULT '' NOT NULL, "ip" character varying(15) DEFAULT '' NOT NULL, "msg" text NOT NULL, "user_id" bigint(11) DEFAULT 0 NOT NULL, PRIMARY KEY ("id") );
There is no documentation on supporting PostgreSQL for extensions so I have done what I can by looking at the SQL file from the Joomla 3.1 installation folder.
Is the problem with my query?