#56 [Opn->Asn]: createTables.php doesn't handle bytea columns
| From: | alan_k@php.net | Date: | Tue, 14 Oct 2003 00:53:24 +0000 |
| Subject: | #56 [Opn->Asn]: createTables.php doesn't handle bytea columns | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-22665@lists.php.net to get a copy of this message | ||
ID: 56
Updated by: alan_k@php.net
Reported By: ieure at debian dot org
-Status: Open
+Status: Assigned
Bug Type: DB_DataObject
Operating System: Debian GNU/Linux 3.0
PHP Version: Irrelevant
-Assigned To:
+Assigned To: alan_k
New Comment:
will be implemented as a string in the table column type. - will also
test the ability to cast any column this using $dataObject->table(
array('mymoney'=>'%s:money') + $dataObject->table()
);
Previous Comments:
------------------------------------------------------------------------
[2003-10-03 00:28:20] 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
------------------------------------------------------------------------
[2003-10-02 19:49:36] alan_k@php.net
I dont normally use databases for blobs - so is flagging this as a
string going to work?
Thanks
Alan
------------------------------------------------------------------------
[2003-10-02 14:37:01] 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.
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=56&edit=1