PEAR is archived and read-only

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

Home » Database » DB_DataObject » Bug #56

createTables.php doesn't handle bytea columns

Details

Submitted2003-10-02 18:37 UTC
Fromieure at debian dot org
Assignedalan_k
StatusClosed
PackageDB_DataObject
PHP VersionIrrelevant
OSDebian GNU/Linux 3.0
Roadmaps(Not assigned)

Comments

[2003-10-02 18:37 UTC] ieure at debian dot org

Description:
------------
I have a PostgreSQL database, with a table which has a 'bytea' field
type. 'bytea' is the PostgreSQL equivalent of MySQL's BLOB type, e.g.
a binary string.

When I run createTables.php, the bytea field is flagged as an integer
(type 1) type in the schema.

Reproduce code:
---------------
This is the create statement for the offending table:

CREATE TABLE "terminals" (
"model" text,
"manufacturer" integer,
"resolution" character varying(12),
"bpp" smallint,
"image" bytea,
"id" integer DEFAULT nextval('"terminals_id_seq"'::text) NOT NULL
);

Expected result:
----------------
The bytea field should be flagged as a string (type 2), not an integer.

Actual result:
--------------
The bytea field is flagged as an integer.

[2003-10-03 04:28 UTC] ieure at debian dot org

With the (revised) patch posted to pear-dev[1], I'm able to
work with bytea fields in a PostgreSQL 7.2.1 database.
Versions newer than 7.2.1 don't require a cast to work,
though there are other situations where it can be useful.

[1]:
http://marc.theaimsgroup.com/?l=pear-dev&m=106513287909758&w=2