559,589d558
< static int pgsql_stmt_get_column_meta(pdo_stmt_t *stmt, long colno, zval *return_value TSRMLS_DC)
< {
< 	pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
< 	PGresult *res;
< 	char *q=NULL;
< 	ExecStatusType status;
< 	
< 	if (!S->result) {
< 		return FAILURE;
< 	}
< 	
< 	if (colno >= stmt->column_count) {
< 		return FAILURE;
< 	}
< 	
< 	array_init(return_value);
< 	add_assoc_long(return_value, "pgsql:oid", S->cols[colno].pgsql_type);
< 
< 	/* Fetch metadata from Postgres system catalogue */
< 	spprintf(&q, 0, "SELECT TYPNAME FROM PG_TYPE WHERE OID=%d", S->cols[colno].pgsql_type);
< 	res = PQexec(S->H->server, q);
< 	efree(q);
< 	
< 	status = PQresultStatus(res);
< 	
< 	if (status != PGRES_TUPLES_OK) {
< 		/* Failed to get system catalogue, but return success
< 		 * with the data we have collected so far
< 		 */
< 		goto done;
< 	}
591,599c560,561
< 	/* We want exactly one row returned */
< 	if (1 != PQntuples(res)) {
< 		goto done;
< 	}
< 
< 	add_assoc_string(return_value, "native_type", PQgetvalue(res, 0, 0), 1);
< done:
< 	PQclear(res);		
< 	return 1;
---
> static int pgsql_stmt_get_column_meta(pdo_stmt_t *stmt, long colno, zval *return_value TSRMLS_DC) {
> 	return _pgsql_stmt_get_column_meta(stmt, colno, return_value );
