mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 16:42:05 +00:00
Some fixes
This commit is contained in:
parent
7f2561b853
commit
bedb7c0376
@ -122,11 +122,17 @@ Contribute all new information in English language. Other languages are translat
|
|||||||
| Cell C1 | Cell C2 | Cell C3 |
|
| Cell C1 | Cell C2 | Cell C3 |
|
||||||
```
|
```
|
||||||
|
|
||||||
{## <a name="adding-a-new-file"/>
|
<a name="adding-a-new-file"/>
|
||||||
|
|
||||||
### Adding a New File
|
### Adding a New File
|
||||||
|
|
||||||
When adding a new file:
|
When you add a new file, it should end with a link like:
|
||||||
|
|
||||||
|
`[Original article](https://clickhouse.tech/docs/<path-to-the-page>) <!--hide-->`
|
||||||
|
|
||||||
|
and there should be **a new empty line** after it.
|
||||||
|
|
||||||
|
{## When adding a new file:
|
||||||
|
|
||||||
- Make symbolic links for all other languages. You can use the following commands:
|
- Make symbolic links for all other languages. You can use the following commands:
|
||||||
|
|
||||||
|
@ -18,8 +18,6 @@ toc_title: "\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435"
|
|||||||
|
|
||||||
- [Lazy](../../engines/database-engines/lazy.md)
|
- [Lazy](../../engines/database-engines/lazy.md)
|
||||||
|
|
||||||
- [Atomic](../../engines/database-engines/atomic.md)
|
|
||||||
|
|
||||||
- [PostgreSQL](../../engines/database-engines/postgresql.md)
|
- [PostgreSQL](../../engines/database-engines/postgresql.md)
|
||||||
|
|
||||||
[Оригинальная статья](https://clickhouse.tech/docs/ru/database_engines/) <!--hide-->
|
[Оригинальная статья](https://clickhouse.tech/docs/ru/database_engines/) <!--hide-->
|
||||||
|
77
docs/ru/engines/table-engines/integrations/postgresql.md
Normal file
77
docs/ru/engines/table-engines/integrations/postgresql.md
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
---
|
||||||
|
toc_priority: 11
|
||||||
|
toc_title: PostgreSQL
|
||||||
|
---
|
||||||
|
|
||||||
|
#PostgreSQL {#postgresql}
|
||||||
|
|
||||||
|
Движок PostgreSQL позволяет выполнять запросы `SELECT` и `INSERT` для таблиц на удаленном сервере PostgreSQL.
|
||||||
|
|
||||||
|
## Создание таблицы {#creating-a-table}
|
||||||
|
|
||||||
|
``` sql
|
||||||
|
CREATE TABLE [IF NOT EXISTS] [db.]table_name [ON CLUSTER cluster]
|
||||||
|
(
|
||||||
|
name1 [type1] [DEFAULT|MATERIALIZED|ALIAS expr1] [TTL expr1],
|
||||||
|
name2 [type2] [DEFAULT|MATERIALIZED|ALIAS expr2] [TTL expr2],
|
||||||
|
...
|
||||||
|
) ENGINE = PostgreSQL('host:port', 'database', 'table', 'user', 'password');
|
||||||
|
```
|
||||||
|
|
||||||
|
См. подробное описание запроса [CREATE TABLE](../../../sql-reference/statements/create/table.md#create-table-query).
|
||||||
|
|
||||||
|
**Параметры движка**
|
||||||
|
|
||||||
|
- `host:port` — адрес сервера MySQL.
|
||||||
|
|
||||||
|
- `database` — имя удаленной БД.
|
||||||
|
|
||||||
|
- `table` — имя удаленной таблицы БД.
|
||||||
|
|
||||||
|
- `user` — пользователь MySQL.
|
||||||
|
|
||||||
|
- `password` — пароль пользователя.
|
||||||
|
|
||||||
|
## Примеры использования {#usage-example}
|
||||||
|
|
||||||
|
Рассмотрим таблицу ClickHouse, которая получает данные из таблицы PostgreSQL:
|
||||||
|
|
||||||
|
``` sql
|
||||||
|
CREATE TABLE test_table
|
||||||
|
(
|
||||||
|
`int_id` Int32,
|
||||||
|
'value' Int32
|
||||||
|
)
|
||||||
|
ENGINE = PostgreSQL('localhost:5432', 'test_database', 'test_table', 'postgres', 'mysecretpassword');
|
||||||
|
```
|
||||||
|
|
||||||
|
``` sql
|
||||||
|
SELECT * FROM test_database.test_table;
|
||||||
|
```
|
||||||
|
|
||||||
|
``` text
|
||||||
|
┌─int_id─┬─value─┐
|
||||||
|
│ 1 │ 2 │
|
||||||
|
└────────┴───────┘
|
||||||
|
```
|
||||||
|
|
||||||
|
Добавление данных из таблицы ClickHouse в таблицу PosegreSQL:
|
||||||
|
|
||||||
|
``` sql
|
||||||
|
INSERT INTO test_database.test_table VALUES (3,4);
|
||||||
|
SELECT * FROM test_database.test_table;
|
||||||
|
```
|
||||||
|
|
||||||
|
``` text
|
||||||
|
┌─int_id─┬─value─┐
|
||||||
|
│ 1 │ 2 │
|
||||||
|
│ 3 │ 4 │
|
||||||
|
└────────┴───────┘
|
||||||
|
```
|
||||||
|
|
||||||
|
## См. также {#see-also}
|
||||||
|
|
||||||
|
- [Функция 'postgresql'](../../../sql-reference/table-functions/postgresql.md)
|
||||||
|
- [Пример подключения PostgreSQL как источника внешнего словаря](../../../sql-reference/dictionaries/external-dictionaries/external-dicts-dict-sources.md#dicts-external_dicts_dict_sources-postgresql)
|
||||||
|
|
||||||
|
[Оригинальная статья](https://clickhouse.tech/docs/en/operations/table-engines/integrations/postgresql/) <!--hide-->
|
Loading…
Reference in New Issue
Block a user