29 if ($this->resultFields ==
null)
31 $this->resultFields = array();
35 && (is_resource($this->resource) || is_object($this->resource))
38 $fields = pg_num_fields($this->resource);
41 $helper = $this->connection->getSqlHelper();
42 for ($i = 0; $i < $fields; $i++)
44 $fieldName = mb_strtoupper(pg_field_name($this->resource, $i));
45 $fieldType = pg_field_type($this->resource, $i);
46 $this->resultFields[$fieldName] = $helper->getFieldByColumnType($fieldName, $fieldType);
52 return $this->resultFields;
64 $result = pg_fetch_assoc($this->resource);
67 if ($this->byteaFields ===
false)
69 $this->byteaFields = [];
71 foreach ($result as $fieldName => $_)
73 $fieldType = pg_field_type($this->resource, $fieldNum);
74 if ($fieldType ===
'bytea')
76 $this->byteaFields[$fieldName] = $fieldType;
82 if ($this->byteaFields)
84 foreach ($this->byteaFields as $fieldName => $fieldType)
86 $result[$fieldName] = pg_unescape_bytea($result[$fieldName]);
90 return array_change_key_case($result, \CASE_UPPER);