---
title: "SQL.PostgreSQL"
description: "PostgreSQL connection prototype."
canonical_url: "https://www.zeyos.com/zymba/ref/sql/sql-postgresql"
markdown_url: "https://www.zeyos.com/ai/guide/zymba/ref/sql/sql-postgresql.md"
section: "zymba-reference"
authority: "reference"
language: "en"
source_repository: "https://cloud.zeyos.com/__doc/zymbaref.json"
source_sha256: "05a361c6ddc32e74f4a6dc16fd06f218210ff1b7ce57f26ca1994bfffc407915"
---

# SQL.PostgreSQL

## SQL.PostgreSQL

```
object @SQL.PostgreSQL(@SQL.Connection) {
	construct(string $server, string $dbname, string $username, string $password) {}
	disableTracing(): $this {}
	enableTracing(string $path): $this {}
	getHost(): string {}
	getPort(): int {}
	insertReturning(string $table, object $data, object $fields, bool $indexed): object {}
	isConnected(): bool {}
}
```

**PostgreSQL connection prototype.**

### Prototype

**[SQL.Connection](#)**

## Methods


### `$this.construct()`


```code
$this.construct(string $server, string $dbname, string $username, string $password): void
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| server | `string`  |  | "" |
| dbname | `string`  |  | "" |
| username | `string`  |  | "" |
| password | `string`  |  | "" |




### `$this.disableTracing()`


```code
$this.disableTracing(): this
```

##### Returns

| Type | Value |
| --- | ---  |
| `$this` |  |




### `$this.enableTracing()`


```code
$this.enableTracing(string $path): this
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| path | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `$this` |  |




### `$this.getHost()`


```code
$this.getHost(): string
```

##### Returns

| Type | Value |
| --- | ---  |
| `string` |  |




### `$this.getPort()`


```code
$this.getPort(): int
```

##### Returns

| Type | Value |
| --- | ---  |
| `int` |  |




### `$this.insertReturning()`


```code
$this.insertReturning(string $table, object $data, object $fields, bool $indexed): object
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| table | `string`  |  | "" |
| data | `object`  | [field: value, ...] | [] |
| fields | `object`  | [field, ...] | [] |
| indexed | `bool`  |  | false |

##### Returns

| Type | Value |
| --- | ---  |
| `object` | [field: value, ...] |
| `null` |  |




### `$this.isConnected()`


```code
$this.isConnected(): bool
```

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |
