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:3
Avg. Score:4.0 ± 0.8
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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: vaksenov at avito dot ru
New email:
PHP Version: OS:

 

 [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-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 12:01:31 2024 UTC