PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Mail » Mail_Queue » Bug #2300

PostgreSQL table definition does not work

Details

Submitted2004-09-08 08:23 UTC
Fromon at morlock dot nu
Assignedquipo
StatusClosed
PackageMail_Queue
PHP Version4.3.1
OSAny
Roadmaps(Not assigned)

Comments

[2004-09-08 08:23 UTC] on at morlock dot nu

Description:
------------
Version 1.1.2

The supplied postgresql schema does not work. You have defined body and headers as NOT NULL values, but attempt an insert with NULL values for theese fields.

See Mail/Queue/Container/mdb.php line 262

Reproduce code:
---------------
Changing the schema to the following works:

CREATE TABLE "mail_queue" (
"id" INTEGER NOT NULL DEFAULT 0 PRIMARY KEY,
"create_time" TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL,
"time_to_send" TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL,
"sent_time" TIMESTAMP WITH TIME ZONE DEFAULT NULL,
"id_user" INTEGER NOT NULL DEFAULT 0,
"ip" VARCHAR(20) NOT NULL DEFAULT 'unknown',
"sender" VARCHAR(50) NOT NULL DEFAULT '',
"recipient" VARCHAR(50) NOT NULL DEFAULT '',
"headers" OID NULL,
"body" OID NULL,
"try_sent" INTEGER NOT NULL DEFAULT 0,
"delete_after_send" INTEGER NOT NULL DEFAULT 1
);
CREATE INDEX "mailq_time_to_send" ON "mail_queue" ("time_to_send");
CREATE INDEX "mailq_id_user" ON "mail_queue" ("id_user");

Expected result:
----------------
An inserted row

Actual result:
--------------
Insert fails