You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/sql/alter.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -194,6 +194,7 @@ Currently following options are supported:
194
194
-`compaction.twcs.trigger_file_num`: the number of files in a specific time window to trigger a compaction.
195
195
-`sst_format`: the SST format of the table. The value can be `flat` or `primary_key`. A table supports changing the format in both directions: `primary_key` to `flat` and `flat` to `primary_key`.
196
196
-`write_buffer_size`: the per-region write buffer stall threshold of the table. For a positive value such as `512MB`, GreptimeDB schedules a flush when mutable memtable usage reaches half the value, stalls writes at the value, and rejects writes at twice the value. The table option overrides `region_engine.mito.default_region_write_buffer_size`. Setting it to `0` explicitly disables the per-region limit even when the engine default is nonzero. Unsetting it removes the table override and falls back to the engine default.
197
+
-`auto_flush_interval`: how long a region of this table may go without a flush before one is triggered. The value is a [time duration string](/reference/time-durations.md) and must be greater than zero. The table option overrides the engine-wide `region_engine.mito.auto_flush_interval`.
197
198
198
199
```sql
199
200
ALTERTABLE monitor SET'ttl'='1d';
@@ -211,8 +212,22 @@ ALTER TABLE monitor SET 'sst_format'='flat';
Copy file name to clipboardExpand all lines: docs/reference/sql/copy.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -138,13 +138,40 @@ COPY tbl FROM '/path/to/file.csv' WITH (
138
138
|`COMPRESSION_TYPE`| Compression algorithm for the imported file. Supported values: `gzip`, `zstd`, `bzip2`, `xz`. Only supported for CSV and JSON formats. | Optional |
139
139
|`HEADERS`| Whether the CSV file has a header row. Supported values: `true`, `false`. Default is `true`. | Optional |
140
140
|`SKIP_BAD_RECORDS`| Whether to skip rows with parsing or casting errors during CSV import. Supported values: `true`, `false`. Default is `false`. Only supported for CSV format. | Optional |
141
+
|`STRICT_HEADERS`| Whether to validate CSV headers against the table schema before importing. Supported values: `true`, `false`. Default is `false`. Only supported for CSV format, and requires `HEADERS = 'true'`. | Optional |
141
142
142
143
:::tip NOTE
143
144
By default, CSV files are parsed with headers and columns are matched by name.
144
145
145
146
To import headerless CSV files, set `HEADERS = 'false'`. In this mode, columns are mapped by position following the target table schema order. You can use `SHOW CREATE TABLE <table_name>` to inspect the table column order.
146
147
:::
147
148
149
+
#### STRICT_HEADERS Option
150
+
151
+
By default, header matching is lenient: CSV columns the table does not have are ignored, and table columns the CSV does not have fall back to the normal insert and default-value handling.
152
+
153
+
Set `STRICT_HEADERS = 'true'` to validate the header row before any data is read. The import fails if the CSV has:
154
+
155
+
- a column the table does not have,
156
+
- no column for a column the table does have,
157
+
- the same header name more than once.
158
+
159
+
```sql
160
+
COPY monitor FROM'monitor.csv' WITH (FORMAT ='CSV', STRICT_HEADERS ='true');
The missing-column check covers **every** column in the table, including nullable columns and columns with a default value. A CSV that omits any of them is rejected.
171
+
172
+
`STRICT_HEADERS = 'true'` cannot be combined with `HEADERS = 'false'` — a headerless CSV has no header names to validate. The combination returns `strict_headers=true requires headers=true`.
173
+
:::
174
+
148
175
#### `CONNECTION` Option
149
176
150
177
`COPY FROM` also supports importing data from cloud storage services. See [connect-to-s3](#connect-to-s3), [connect-to-gcs](#connect-to-gcs), or [connect-to-azure-blob-storage](#connect-to-azure-blob-storage) for more details.
Copy file name to clipboardExpand all lines: docs/reference/sql/create.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -162,6 +162,7 @@ Users can add table options by using `WITH`. The valid options contain the follo
162
162
|`comment`| Table level comment | String value. |
163
163
|`skip_wal`| Whether to disable Write-Ahead-Log for this table | String type. When set to `'true'`, the data written to the table will not be persisted to the write-ahead log, which can avoid storage wear and improve write throughput. However, when the process restarts, any unflushed data will be lost. Please use this feature only when the data source itself can ensure reliability. |
164
164
|`write_buffer_size`| Per-region write buffer stall threshold for this table | String type, such as `'512MB'` or `'1GB'`. For a positive value, GreptimeDB schedules a flush when mutable memtable usage reaches half the value, stalls writes at the value, and rejects writes at twice the value. The table option overrides `region_engine.mito.default_region_write_buffer_size`. An explicit `'0'` disables the per-region limit even when the engine default is nonzero. Unset the option to remove the table override and fall back to the engine default. |
165
+
|`auto_flush_interval`| How long a region of this table may go without a flush before one is triggered | String type, a time duration such as `'5m'` or `'1h'`. Must be greater than zero. The table option overrides the engine-wide `region_engine.mito.auto_flush_interval`. Set it to `NULL` with `ALTER TABLE` to drop the override and fall back to the engine setting. |
165
166
|`index.type`| Index type |**Only for metric engine** String value, supports `none`, `skipping`. |
Copy file name to clipboardExpand all lines: docs/user-guide/deployments-administration/authentication/static.md
+37-8Lines changed: 37 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,13 +60,15 @@ Since v1.1, a password can use an explicit verifier format, so that plaintext pa
60
60
-`plain:<password>` — plaintext. This is the default when no prefix is given.
61
61
-`pbkdf2_sha256:<iterations>:<hex_salt>:<hex_hash>` — a PBKDF2-SHA256 hash stored at rest.
62
62
-`mysql_native_password:<hex_sha1_sha1_password>` — a hashed verifier that still serves the MySQL `mysql_native_password` handshake.
63
+
-`pg_scram_sha256:<iterations>:<hex_salt>:<hex_stored_key>:<hex_server_key>` — a SCRAM-SHA-256 verifier that serves the PostgreSQL SASL handshake. Available since v1.2.
`pbkdf2_sha256` protects passwords at rest; it does not change wire security. Cleartext-capable protocols still need TLS in production.
89
92
90
93
:::warning Breaking change
91
-
Passwords are prefix-parsed. A legacy plaintext password that literally starts with `plain:`, `pbkdf2_sha256:`, or `mysql_native_password:` changes meaning. Use the `plain:` prefix to keep the literal value. For example, to keep the literal password `plain:secret`, configure it as `user=plain:plain:secret`.
94
+
Passwords are prefix-parsed. A legacy plaintext password that literally starts with `plain:`, `pbkdf2_sha256:`, `mysql_native_password:`, or `pg_scram_sha256:` changes meaning. Use the `plain:` prefix to keep the literal value. For example, to keep the literal password `plain:secret`, configure it as `user=plain:plain:secret`.
92
95
:::
93
96
97
+
#### PostgreSQL SCRAM-SHA-256
98
+
99
+
SCRAM-SHA-256 lets PostgreSQL clients authenticate without sending the password in cleartext.
100
+
101
+
PostgreSQL negotiates a single authentication method when a connection starts. The server does receive the username at that point, but picking the method per user would reveal whether that user exists and what verifier format it uses. GreptimeDB therefore decides globally: it offers SCRAM only when **every** user in the credential file can do SCRAM — that is, every verifier is `plain:` or `pg_scram_sha256:`. An unknown username is answered with a throwaway verifier and still runs the full handshake, so a failed login looks the same as a wrong password.
102
+
103
+
:::warning
104
+
A single `pbkdf2_sha256:` or `mysql_native_password:` user makes the whole instance fall back to cleartext for PostgreSQL, including users whose own verifier supports SCRAM. If you want SCRAM, do not mix verifier formats.
105
+
:::
106
+
107
+
Channel binding (`SCRAM-SHA-256-PLUS`) is not supported.
108
+
109
+
You can check which method the server offers with libpq's `require_auth` parameter, which needs libpq or `psql` 16 or newer:
When the instance has fallen back to cleartext, that command fails with `server requested a cleartext password`.
116
+
94
117
### Generating Password Verifiers
95
118
96
119
Since v1.1, you can use the `greptime user hash-password` command to generate a verifier string. It runs standalone without starting any server component:
-`--format <FORMAT>` — verifier format, `pbkdf2_sha256` (default)or `mysql_native_password`.
139
+
-`--format <FORMAT>` — verifier format, `pbkdf2_sha256` (default), `mysql_native_password`, or `pg_scram_sha256`.
117
140
-`--password <PASSWORD>` — plaintext password. Mutually exclusive with `--password-stdin`; exactly one is required. Prefer `--password-stdin` in scripts, since `--password` can leak through shell history or process listings.
118
141
-`--password-stdin` — read the plaintext password from stdin.
119
-
-`--iterations <N>` — PBKDF2-SHA256 iteration count (default `4096`, range `1..=1000000`).
-`--salt-len <N>` — random salt length in bytes (default `16`, range `1..=1024`).
121
144
-`--salt-hex <HEX>` — fixed salt as hex instead of a random one, for deterministic automation.
122
145
@@ -126,6 +149,12 @@ To generate a `mysql_native_password` verifier instead:
126
149
./greptime user hash-password --password-stdin --format mysql_native_password
127
150
```
128
151
152
+
To generate a PostgreSQL SCRAM-SHA-256 verifier:
153
+
154
+
```shell
155
+
./greptime user hash-password --password-stdin --format pg_scram_sha256
156
+
```
157
+
129
158
### Starting the Server
130
159
131
160
Start the server with the `--user-provider` parameter and set it to `static_user_provider:file:<path_to_file>` (replace `<path_to_file>` with the path to your user configuration file):
Copy file name to clipboardExpand all lines: docs/user-guide/deployments-administration/configuration.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -617,7 +617,7 @@ Available options:
617
617
|`max_background_flushes`| Integer |`Auto`| Max number of running background flush jobs (default: 1/2 of cpu cores). |
618
618
|`max_background_compactions`| Integer |`Auto`| Max number of running background compaction jobs (default: 1/4 of cpu cores). |
619
619
|`max_background_purges`| Integer |`Auto`| Max number of running background purge jobs (default: cpu cores). |
620
-
|`auto_flush_interval`| String |`1h`| Interval to auto flush a region if it has not flushed yet. |
620
+
|`auto_flush_interval`| String |`1h`| Interval to auto flush a region if it has not flushed yet. Can be overridden per table with the [`auto_flush_interval` table option](/reference/sql/create.md#table-options).|
621
621
|`global_write_buffer_size`| String |`1GB`| Global write buffer size for all regions. If not set, it's default to 1/8 of OS memory with a max limitation of 1GB. |
622
622
|`global_write_buffer_reject_size`| String |`2GB`| Global write buffer size threshold to reject write requests. If not set, it's default to 2 times of `global_write_buffer_size`|
623
623
|`default_region_write_buffer_size`| String |`0`| Default per-region write buffer stall threshold. For a positive value, GreptimeDB schedules a flush when mutable memtable usage reaches half the value, stalls writes at the value, and rejects writes at twice the value. Setting it to `0` disables the default per-region limit. A table's `write_buffer_size` overrides this value, including an explicit `0` that disables the limit for that table. |
0 commit comments