php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #59262 Add support for Arrays/Composite types
Submitted: 2010-06-16 07:26 UTC Modified: -
Votes:4
Avg. Score:3.5 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: dmitry dot chirkin at gmail dot com Assigned:
Status: Open Package: PDO_PGSQL (PECL)
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dmitry dot chirkin at gmail dot com
New email:
PHP Version: OS:

 

 [2010-06-16 07:26 UTC] dmitry dot chirkin at gmail dot com
Description:
------------
Hi!
Is it posible to add support for Composite types and Array-
datatypes in Postgres?

Now they returned as "strings" and it is hard to parse it.







Reproduce code:
---------------
Here the example: 

CREATE TYPE gender AS ENUM
   ('male',
    'female',
    'undefined');


CREATE TYPE facebook AS
   (id bigint,
    "login" character varying(255),
    "key" text);

CREATE TABLE "user"
(
  id serial NOT NULL,
  "login" character varying(127) NOT NULL,
  "password" character(32) NOT NULL,
  email character varying(255) NOT NULL,
  gender gender NOT NULL DEFAULT 'undefined'::gender,
  facebook facebook,
  CONSTRAINT user_pkey PRIMARY KEY (id)
  )
WITH (
  OIDS=FALSE
);


>> select id, password, email, facebook, gender from "user";
 id |             password             |     email      |       facebook        | gender 
----+----------------------------------+----------------+-----------------------+--------
  1 | 123                              | test@test.com | (1,josser,"long key") | male




Expected result:
----------------
I think it will be very helpful if the facebook type will be 
represented as OBJ or as ARRAY (FETCH_OBJ/FETCH_ASSOC?).

Thanks!
Sorry about my bad english. 

Actual result:
--------------
Currently they are represented as strings which is hard to 
parse.

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 18:01:30 2024 UTC