Skip to content

Commit

Permalink
Add hydrate_table_metadata function (#48)
Browse files Browse the repository at this point in the history
Related to questdb/questdb#4848

Documents a new function which can be used to refresh the static
metadata cache.

Shouldn't be closed until after the main issue is merged.

---------

Co-authored-by: goodroot <[email protected]>
  • Loading branch information
nwoolmer and goodroot authored Oct 10, 2024
1 parent 96b15b2 commit da97b9b
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions reference/function/meta.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,3 +437,45 @@ SELECT pg_catalog.version();
| version |
| ------------------------------------------------------------------- |
| PostgreSQL 12.3, compiled by Visual C++ build 1914, 64-bit, QuestDB |


## hydrate_table_metadata('table1', 'table2' ...)

`hydrate_table_metadata' re-reads table metadata from disk to update the static metadata cache.

:::warning

This function should only be used when directed by QuestDB support. Misuse could cause corruption of the metadata
cache, requiring the database to be restarted.

:::

**Arguments:**

A variable list of strings, corresponding to table names.

Alternatively, a single asterisk, '*', representing all tables.

**Return value:**

Returns `boolean`. `true` if successful, `false` if unsuccessful.


**Examples:**

Simply pass table names as arguments to the function.

```
SELECT hydrate_table_metadata('trades', 'trips')
```

| hydrate_table_metadata |
|------------------------|
| true |


If you want to re-read metadata for all user tables, simply use an asterisk:

```
SELECT hydrate_table_metadata('*')
```

0 comments on commit da97b9b

Please sign in to comment.