pg_version

Returns an array with client, protocol and server version (when available)

&reftitle.description; `array` `pg_version` ``PgSql\Connection``null```connection`&null;

`pg_version` returns an array with the client, protocol and server version. Protocol and server versions are only available if PHP was compiled with PostgreSQL 7.4 or later.

For more detailed server information, use `pg_parameter_status`.

&reftitle.parameters;

`connection`

- &pgsql.parameter.connection-with-nullable-default;
&reftitle.returnvalues;

Returns an array with `client`, `protocol` and `server` keys and values (if available).

&reftitle.changelog;

&Version; | &Description;
&pgsql.changelog.connection-object;
8.0.0 | `connection` is now nullable.

&reftitle.examples;

### `pg_version` example

    <?php
      $dbconn = pg_connect("host=localhost port=5432 dbname=mary")
         or die("Could not connect");

      $v = pg_version($dbconn);

      echo $v['client'];
    ?>

&example.outputs;

    7.4

&reftitle.seealso;

- `pg_parameter_status`