php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #64542 PDO/pgsql get_column_meta() do DB request on every call
Submitted: 2013-03-28 14:36 UTC Modified: 2017-04-24 19:20 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: vaksenov at avito dot ru Assigned:
Status: Open Package: PDO PgSQL
PHP Version: 5.4.13 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2013-03-28 14:36 UTC] vaksenov at avito dot ru
Description:
------------
PDO/pgsql function get_column_meta() return column type id.
But also it return "native_type".
To get "native_type" it make a sql-request: "SELECT TYPNAME FROM PG_TYPE WHERE OID=%d" for each column.

But for our project numeric value of "column type id" is enough.
Requesting "native_type" just slowing down system performance.

So, this is workaround: 
Add new statement option "PGSQL_ATTR_DISABLE_RESOLV_NATIVE_TYPE_ON_META", which prevents resolving "native_type".


Patches

patch_pdo_meta.diff (last revision 2013-03-28 14:37 UTC by vaksenov at avito dot ru)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-24 19:20 UTC] adambaratz@php.net
-Package: PDO related +Package: PDO PgSQL
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Apr 22 14:01:25 2019 UTC