> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-3a82795f.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Server packets

> Native protocol server

| value | name                             | description                                                                      |
| ----- | -------------------------------- | -------------------------------------------------------------------------------- |
| 0     | [Hello](#hello)                  | Server handshake response                                                        |
| 1     | Data                             | Same as [client data](/resources/develop-contribute/native-protocol/client#data) |
| 2     | [Exception](#exception)          | Query processing exception                                                       |
| 3     | [Progress](#progress)            | Query progress                                                                   |
| 4     | [Pong](#pong)                    | Ping response                                                                    |
| 5     | [EndOfStream](#end-of-stream)    | All packets were transferred                                                     |
| 6     | [ProfileInfo](#profile-info)     | Profiling data                                                                   |
| 7     | Totals                           | Total values                                                                     |
| 8     | Extremes                         | Extreme values (min, max)                                                        |
| 9     | TablesStatusResponse             | Response to TableStatus request                                                  |
| 10    | [Log](#log)                      | Query system log                                                                 |
| 11    | TableColumns                     | Columns description                                                              |
| 12    | UUIDs                            | List of unique parts ids                                                         |
| 13    | ReadTaskRequest                  | String (UUID) describes a request for which next task is needed                  |
| 14    | [ProfileEvents](#profile-events) | Packet with profile events from server                                           |

The `Data`, `Totals` and `Extremes` can be compressed.

<h2 id="hello">
  Hello
</h2>

Response to [client hello](/resources/develop-contribute/native-protocol/client#hello).

| field          | type    | value           | description          |
| -------------- | ------- | --------------- | -------------------- |
| name           | String  | `Clickhouse`    | Server name          |
| version\_major | UVarInt | `21`            | Server major version |
| version\_minor | UVarInt | `12`            | Server minor version |
| revision       | UVarInt | `54452`         | Server revision      |
| tz             | String  | `Europe/Moscow` | Server timezone      |
| display\_name  | String  | `Clickhouse`    | Server name for UI   |
| version\_patch | UVarInt | `3`             | Server patch version |

<h2 id="exception">
  Exception
</h2>

Server exception during query processing.

| field        | type   | value                                  | description                  |
| ------------ | ------ | -------------------------------------- | ---------------------------- |
| code         | Int32  | `60`                                   | See [ErrorCodes.cpp][codes]. |
| name         | String | `DB::Exception`                        | Server major version         |
| message      | String | `DB::Exception: Table X doesn't exist` | Server minor version         |
| stack\_trace | String | \~                                     | C++ stack trace              |
| nested       | Bool   | `true`                                 | More errors                  |

Can be continuous list of exceptions until `nested` is `false`.

[codes]: https://clickhouse.com/codebrowser/ClickHouse/src/Common/ErrorCodes.cpp.html "List of error codes"

<h2 id="progress">
  Progress
</h2>

Progress of query execution periodically reported by server.

<Tip>
  Progress reported in **deltas**. For totals, accumulate it on client.
</Tip>

| field        | type    | value    | description       |
| ------------ | ------- | -------- | ----------------- |
| rows         | UVarInt | `65535`  | Row count         |
| bytes        | UVarInt | `871799` | Byte count        |
| total\_rows  | UVarInt | `0`      | Total rows        |
| wrote\_rows  | UVarInt | `0`      | Rows from client  |
| wrote\_bytes | UVarInt | `0`      | Bytes from client |

<h2 id="pong">
  Pong
</h2>

Response for [client ping](/resources/develop-contribute/native-protocol/client#ping), no packet body.

<h2 id="end-of-stream">
  End of stream
</h2>

No more **Data** packets will be sent, query result is fully steamed from server to client.

No packet body.

<h2 id="profile-info">
  Profile info
</h2>

| field                           | type    |
| ------------------------------- | ------- |
| rows                            | UVarInt |
| blocks                          | UVarInt |
| bytes                           | UVarInt |
| applied\_limit                  | Bool    |
| rows\_before\_limit             | UVarInt |
| calculated\_rows\_before\_limit | Bool    |

<h2 id="log">
  Log
</h2>

**Data block** with server log.

<Tip>
  Encoded as **data block** of columns, but is never compressed.
</Tip>

| column      | type     |
| ----------- | -------- |
| time        | DateTime |
| time\_micro | UInt32   |
| host\_name  | String   |
| query\_id   | String   |
| thread\_id  | UInt64   |
| priority    | Int8     |
| source      | String   |
| text        | String   |

<h2 id="profile-events">
  Profile events
</h2>

**Data block** with profile events.

<Tip>
  Encoded as **data block** of columns, but is never compressed.

  The `value` type is `UInt64` or `Int64`, depending on server revision.
</Tip>

| column        | type            |
| ------------- | --------------- |
| host\_name    | String          |
| current\_time | DateTime        |
| thread\_id    | UInt64          |
| type          | Int8            |
| name          | String          |
| value         | UInt64 or Int64 |
