[Mailr] Patch for db/schema.pgsql.sql

Michael Smith smith at xml-doc.org
Wed Dec 14 08:17:30 EST 2005


Luben,

I needed to make some adjustments to the default
db/schema.pgsql.sql file in order to get mailr working correctly
with the postgresql connection adapter and database.

The following patch shows the changes I made to get it work in my
environment: 

  - Changed the MySQL-style backtick quoting to double-quotes (I
    think single ones would work with Postgres as well)

  - Changed the data type for From, To, and Subject fields from
    VARCHAR(255) to TEXT. Because none of the e-mail RFCs place
    any limits on the maximum length of the contents of those
    fields, and I have test messages with From headers that mailr
    was choking on because they were longer than what the db
    schema expected.

  Index: db/schema.pgsql.sql
  ===================================================================
  --- db/schema.pgsql.sql (revision 148)
  +++ db/schema.pgsql.sql (working copy)
  @@ -95,15 +95,15 @@
     username             VARCHAR(100) NOT NULL,
     msg_id               VARCHAR(100),
     uid                  BIGINT NOT NULL,
  -  `from`               VARCHAR(255),
  -  `from_flat`  VARCHAR(255),
  -  `to`                         VARCHAR(255),
  -  `to_flat`    VARCHAR(255),
  -  `subject`    VARCHAR(255),
  -  `content_type` VARCHAR(30),
  -  `date`               TIMESTAMP,
  -  `unread`             BOOL default false,
  -  `size`               BIGINT,
  +  "from"               TEXT,
  +  "from_flat"  TEXT,
  +  "to"                         TEXT,
  +  "to_flat"    TEXT,
  +  "subject"    TEXT,
  +  "content_type" VARCHAR(30),
  +  "date"               TIMESTAMP,
  +  "unread"             BOOL default false,
  +  "size"               BIGINT,
     PRIMARY KEY (id)
   );

By the way, how do you prefer to get patches and/or bug reports?
On this list?  (I notice that the Tracker for the mailr project at
Rubyforge is turned off.)

-- 
Michael Smith
http://sideshowbarker.net/


More information about the Mailr-list mailing list