8000 Update add_data_node() API description by pmwkaa · Pull Request #541 · timescale/docs.timescale.com-content · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Update add_data_node() API description #541

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
-->
Diff view
29 changes: 13 additions & 16 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,26 +260,14 @@ error or a notice depending on the value of `if_not_exists`.

If `bootstrap` is true, the function will attempt to bootstrap the
data node by:
1. Connecting to the database given in `bootstrap_database`.
2. Creating the database given in `database` that will serve as the
1. Creating the database given in `database` that will serve as the
new data node.
3. Loading the TimescaleDB extension 8000 in the new database.
4. Setting metadata to make the data node part of the distributed
2. Loading the TimescaleDB extension in the new database.
3. Setting metadata to make the data node part of the distributed
database.

See [boostrapping description][multinode-bootstrap] for details.

#### Errors

An error will be given if:
* The function is executed inside a transaction.
* The function is executed in a database that is already a data node.
* The data node already exists and `if_not_exists` is `FALSE`.
* The port number is not valid for use as a port number.
* If `boostrap` is `FALSE` and the database was not previously
bootstrapped.


#### Required Arguments [](add_data_node-required-arguments)

| Name | Description |
Expand All @@ -295,7 +283,6 @@ An error will be given if:
| `port` | Port to use on the remote data node. The default is the PostgreSQL port used by the access node on which the function is executed. |
| `if_not_exists` | Do not fail if the data node already exists. The default is `FALSE`. |
| `bootstrap` | Bootstrap the remote data node. The default is `TRUE`. |
| `bootstrap_database` | Database to use when bootstrapping as described above. The default is `'postgres'`. |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this optional at all? Or it /only/ supports postgres or template1? (If both postgres and template1 supported, which one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic here is equal to the way how PostgreSQL itself handles it. I think we support only those two choices for now. It will try to connect to the postgres database first and if it fails then try template1: https://github.com/timescale/timescaledb/blob/master/tsl/src/data_node.c#L552


#### Returns [](add_data_node-returns)

Expand All @@ -309,6 +296,16 @@ An error will be given if:
| `database_created` | Was the database created on the remote data node |
| `extension_created` | Was the extension created on the remote data node |

#### Errors

An error will be given if:
* The function is executed inside a transaction.
* The function is executed in a database that is already a data node.
* The data node already exists and `if_not_exists` is `FALSE`.
* The port number is not valid for use as a port number.
* If `boostrap` is `FALSE` and the database was not previously
bootstrapped.

#### Sample usage [](add_data_node-examples)

Let's assume that you have an existing hypertable `conditions` and
Expand Down
0