Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id D0E3D6335B4 for ; Mon, 25 May 2009 20:14:00 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 58349-08 for ; Mon, 25 May 2009 20:13:52 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pz0-f118.google.com (mail-pz0-f118.google.com [209.85.222.118]) by mail.postgresql.org (Postfix) with ESMTP id 423496331F9 for ; Mon, 25 May 2009 20:13:59 -0300 (ADT) Received: by pzk16 with SMTP id 16so2920755pzk.15 for ; Mon, 25 May 2009 16:13:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=x+re4Vgb6caetj02qOaQ0ZxntSJvjolVuMUqx4DDmGw=; b=dT3bwafTEQM5NbJSZ16d8TbV/5r8RBFFKSBk+ULjTDfAO/+a1jpJkUKSPMWCky9TQO eAmne5FSFf365GPd9VClHbyWUxPM3sB8G+mGRWlzERqOWchfCGAoEnueUKKh7JfK8gcv JzqdUbBC0j+KVo5dt5tFhoJPo0PL9oKb/Wf0c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=nuAXNpuNdpcjZAZD11qHXa/u9gx6r/pjCLGaaycFlax9M3KOjD4ZwJc1lZcHXVo809 7rxlQaK65IVrohqtufksaVK+GnYDvvXi53AVMRZzqk3iFFRnlaJailTHyFwiIDZ7vHnZ vBesv60IPTowyO0fDR0ZIO8PL8mXtNew4nejM= Received: by 10.114.53.1 with SMTP id b1mr15003430waa.173.1243293232751; Mon, 25 May 2009 16:13:52 -0700 (PDT) Received: from ?192.168.2.65? (office.squiz.net [203.206.128.174]) by mx.google.com with ESMTPS id l28sm15578798waf.19.2009.05.25.16.13.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 25 May 2009 16:13:52 -0700 (PDT) Message-ID: <4A1B262B.60301@gmail.com> Date: Tue, 26 May 2009 09:13:47 +1000 From: Chris User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: Developer CC: pgsql-php@postgresql.org Subject: Re: PDO, postgre and PHP data types References: <1243278537.18371.16.camel@localhost.localdomain> In-Reply-To: <1243278537.18371.16.camel@localhost.localdomain> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200905/9 X-Sequence-Number: 4029 Developer wrote: > Hello, > I have some problem with data type of PDO returned instance, array of > integer (_int4[]) is returned as string. > > I read ref.pgsql.php, but nothing said how solve this problem. > > I use something like this for it: > $dat=array($k=>explode(',',trim($v,'{}'))); // One dimension array > But it is very slow. Any method to return correct data types from > DATABASE to PHP parsed with high speed code (like C)? > Any postgresql driver version? PDO will only know basic data types (strings, int, possibly bool) and an int array is not a basic type. It's also designed to be 'database independent' so this won't be included at all most likely. If you want it in C, you'll have to put it together yourself but I doubt it'd ever be included in php core (but you can always try). -- Postgresql & php tutorials http://www.designmagick.com/