· 6 years ago · Mar 27, 2019, 01:34 PM
1andrey@andrey-Aspire-SW5-012:~$ sudo apt-get update
2[sudo] пароль Ð´Ð»Ñ andrey:
3Сущ:1 http://ru.archive.ubuntu.com/ubuntu bionic InRelease
4Сущ:2 http://ru.archive.ubuntu.com/ubuntu bionic-updates InRelease
5Пол:3 http://security.ubuntu.com/ubuntu bionic-security InRelease [88,7 kB]
6Сущ:4 http://ru.archive.ubuntu.com/ubuntu bionic-backports InRelease
7Сущ:5 http://apt.postgresql.org/pub/repos/apt xenial-pgdg InRelease
8Получено 88,7 kB за 3Ñ (28,6 kB/s)
9Чтение ÑпиÑков пакетов… Готово
10andrey@andrey-Aspire-SW5-012:~$ sudo apt-get install postgresql postgresql-contrib
11Чтение ÑпиÑков пакетов… Готово
12ПоÑтроение дерева завиÑимоÑтей
13Чтение информации о ÑоÑтоÑнии… Готово
14Ðекоторые пакеты не могут быть уÑтановлены. Возможно, то, что вы проÑите,
15неоÑущеÑтвимо, или же вы иÑпользуете неÑтабильную верÑию диÑтрибутива, где
16запрошенные вами пакеты ещё не Ñозданы или были удалены из Incoming.
17Ð¡Ð»ÐµÐ´ÑƒÑŽÑ‰Ð°Ñ Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ, возможно, вам поможет:
18
19Следующие пакеты имеют неудовлетворённые завиÑимоÑти:
20 postgresql : ЗавиÑит: postgresql-11 но он не будет уÑтановлен
21 postgresql-contrib : ЗавиÑит: postgresql-contrib-11
22E: Ðевозможно иÑправить ошибки: у Ð²Ð°Ñ Ð·Ð°Ñ„Ð¸ÐºÑированы Ñломанные пакеты.
23andrey@andrey-Aspire-SW5-012:~$ sudo apt install postgresql postgresql-contrib
24Чтение ÑпиÑков пакетов… Готово
25ПоÑтроение дерева завиÑимоÑтей
26Чтение информации о ÑоÑтоÑнии… Готово
27Ðекоторые пакеты не могут быть уÑтановлены. Возможно, то, что вы проÑите,
28неоÑущеÑтвимо, или же вы иÑпользуете неÑтабильную верÑию диÑтрибутива, где
29запрошенные вами пакеты ещё не Ñозданы или были удалены из Incoming.
30Ð¡Ð»ÐµÐ´ÑƒÑŽÑ‰Ð°Ñ Ð¸Ð½Ñ„Ð¾Ñ€Ð¼Ð°Ñ†Ð¸Ñ, возможно, вам поможет:
31
32Следующие пакеты имеют неудовлетворённые завиÑимоÑти:
33 postgresql : ЗавиÑит: postgresql-11 но он не будет уÑтановлен
34 postgresql-contrib : ЗавиÑит: postgresql-contrib-11
35E: Ðевозможно иÑправить ошибки: у Ð²Ð°Ñ Ð·Ð°Ñ„Ð¸ÐºÑированы Ñломанные пакеты.
36andrey@andrey-Aspire-SW5-012:~$ sudo -i -u postgres
37postgres@andrey-Aspire-SW5-012:~$ psql
38psql (10.6 (Ubuntu 10.6-0ubuntu0.18.04.1))
39Type "help" for help.
40
41postgres=# sudo -u postgres psql^Z
42[1]+ ОÑтановлен psql
43postgres@andrey-Aspire-SW5-012:~$ sudo -u postgres psql
44psql (10.6 (Ubuntu 10.6-0ubuntu0.18.04.1))
45Type "help" for help.
46
47postgres=# ^Z
48[2]+ ОÑтановлен sudo -u postgres psql
49postgres@andrey-Aspire-SW5-012:~$ createuser --interactive
50Enter name of role to add: ^?postgres
51Shall the new role be a superuser? (y/n) n
52Shall the new role be allowed to create databases? (y/n) y
53Shall the new role be allowed to create more new roles? (y/n) n
54postgres@andrey-Aspire-SW5-012:~$ createuser --interactive
55Enter name of role to add: postgres
56Shall the new role be a superuser? (y/n) y
57createuser: creation of new role failed: ERROR: role "postgres" already exists
58postgres@andrey-Aspire-SW5-012:~$ sudo su - postgres
59[sudo] пароль Ð´Ð»Ñ postgres:
60postgres@andrey-Aspire-SW5-012:~$ CREATE DATABASE test
61CREATE: команда не найдена
62postgres@andrey-Aspire-SW5-012:~$ psql
63psql (10.6 (Ubuntu 10.6-0ubuntu0.18.04.1))
64Type "help" for help.
65
66postgres=# CREATE DATABASE test
67postgres-# CREATE DATABASE test owner ^C
68postgres=# create database test owner postgres
69postgres-# print test
70postgres-# current_database()
71postgres-# \q
72postgres@andrey-Aspire-SW5-012:~$ ^C
73postgres@andrey-Aspire-SW5-012:~$ CREATE DATABASE test
74CREATE: команда не найдена
75postgres@andrey-Aspire-SW5-012:~$ createdb test
76postgres@andrey-Aspire-SW5-012:~$ CREATE TABLE test_table (
77-su: ÑинтакÑичеÑÐºÐ°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° Ñ€Ñдом Ñ Ð½ÐµÐ¾Ð¶Ð¸Ð´Ð°Ð½Ð½Ñ‹Ð¼ маркером «(»
78postgres@andrey-Aspire-SW5-012:~$
79postgres@andrey-Aspire-SW5-012:~$ column_name1 DI (index) column_constraints,
80-su: ÑинтакÑичеÑÐºÐ°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° Ñ€Ñдом Ñ Ð½ÐµÐ¾Ð¶Ð¸Ð´Ð°Ð½Ð½Ñ‹Ð¼ маркером «(»
81postgres@andrey-Aspire-SW5-012:~$
82postgres@andrey-Aspire-SW5-012:~$ column_name2 text (string)
83-su: ÑинтакÑичеÑÐºÐ°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° Ñ€Ñдом Ñ Ð½ÐµÐ¾Ð¶Ð¸Ð´Ð°Ð½Ð½Ñ‹Ð¼ маркером «(»
84postgres@andrey-Aspire-SW5-012:~$
85postgres@andrey-Aspire-SW5-012:~$
86postgres@andrey-Aspire-SW5-012:~$ );CREATE TABLE test_table (column_name1 DI (index) column_constraints,column_name2 text (string));
87-su: ÑинтакÑичеÑÐºÐ°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° Ñ€Ñдом Ñ Ð½ÐµÐ¾Ð¶Ð¸Ð´Ð°Ð½Ð½Ñ‹Ð¼ маркером «)»
88postgres@andrey-Aspire-SW5-012:~$ CREATE TABLE test
89CREATE: команда не найдена
90postgres@andrey-Aspire-SW5-012:~$ psql
91psql (10.6 (Ubuntu 10.6-0ubuntu0.18.04.1))
92Type "help" for help.
93
94postgres=# createdb test
95postgres-# CREATE TABLE test (ID int, text (varchar (15));
96postgres(# insert into test values (1, 'Hello world');
97postgres(# select * from test
98postgres(# \q
99postgres@andrey-Aspire-SW5-012:~$ CREATE TABLE test
100CREATE: команда не найдена
101postgres@andrey-Aspire-SW5-012:~$ REATE TABLE table_name (
102-su: ÑинтакÑичеÑÐºÐ°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° Ñ€Ñдом Ñ Ð½ÐµÐ¾Ð¶Ð¸Ð´Ð°Ð½Ð½Ñ‹Ð¼ маркером «(»
103postgres@andrey-Aspire-SW5-012:~$
104postgres@andrey-Aspire-SW5-012:~$ column_name1 col_type (field_length) column_constraints,
105-su: ÑинтакÑичеÑÐºÐ°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° Ñ€Ñдом Ñ Ð½ÐµÐ¾Ð¶Ð¸Ð´Ð°Ð½Ð½Ñ‹Ð¼ маркером «(»
106postgres@andrey-Aspire-SW5-012:~$
107postgres@andrey-Aspire-SW5-012:~$ column_name2 col_type (field_length),
108-su: ÑинтакÑичеÑÐºÐ°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° Ñ€Ñдом Ñ Ð½ÐµÐ¾Ð¶Ð¸Ð´Ð°Ð½Ð½Ñ‹Ð¼ маркером «(»
109postgres@andrey-Aspire-SW5-012:~$
110postgres@andrey-Aspire-SW5-012:~$ column_name3 col_type (field_length)
111-su: ÑинтакÑичеÑÐºÐ°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° Ñ€Ñдом Ñ Ð½ÐµÐ¾Ð¶Ð¸Ð´Ð°Ð½Ð½Ñ‹Ð¼ маркером «(»
112postgres@andrey-Aspire-SW5-012:~$
113postgres@andrey-Aspire-SW5-012:~$ );createuser --interactive
114-su: ÑинтакÑичеÑÐºÐ°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° Ñ€Ñдом Ñ Ð½ÐµÐ¾Ð¶Ð¸Ð´Ð°Ð½Ð½Ñ‹Ð¼ маркером «)»
115postgres@andrey-Aspire-SW5-012:~$ createuser --interactive
116Enter name of role to add: postgres
117Shall the new role be a superuser? (y/n) y
118createuser: creation of new role failed: ERROR: role "postgres" already exists
119postgres@andrey-Aspire-SW5-012:~$ create db test
120
121Command 'create' not found, did you mean:
122
123 command 'pcreate' from deb pbuilder-scripts
124 command 'pcreate' from deb python-pyramid
125
126Try: sudo apt install <deb name>
127
128postgres@andrey-Aspire-SW5-012:~$ createdb test
129createdb: database creation failed: ERROR: database "test" already exists
130postgres@andrey-Aspire-SW5-012:~$ dropdb test
131postgres@andrey-Aspire-SW5-012:~$ createdb test
132postgres@andrey-Aspire-SW5-012:~$ create table test (id serial primary key, text varchar (15) not null);
133-su: ÑинтакÑичеÑÐºÐ°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° Ñ€Ñдом Ñ Ð½ÐµÐ¾Ð¶Ð¸Ð´Ð°Ð½Ð½Ñ‹Ð¼ маркером «(»
134postgres@andrey-Aspire-SW5-012:~$ ~ CREATE TABLE test_table (id int, text varchar (15) NOT NULL);
135-su: ÑинтакÑичеÑÐºÐ°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° Ñ€Ñдом Ñ Ð½ÐµÐ¾Ð¶Ð¸Ð´Ð°Ð½Ð½Ñ‹Ð¼ маркером «(»
136postgres@andrey-Aspire-SW5-012:~$ CREATE TABLE test_table (id int, text varchar (15) NOT NULL);
137-su: ÑинтакÑичеÑÐºÐ°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° Ñ€Ñдом Ñ Ð½ÐµÐ¾Ð¶Ð¸Ð´Ð°Ð½Ð½Ñ‹Ð¼ маркером «(»
138postgres@andrey-Aspire-SW5-012:~$ sudo CREATE TABLE test_table (id int, text varchar (15) NOT NULL);
139-su: ÑинтакÑичеÑÐºÐ°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° Ñ€Ñдом Ñ Ð½ÐµÐ¾Ð¶Ð¸Ð´Ð°Ð½Ð½Ñ‹Ð¼ маркером «(»
140postgres@andrey-Aspire-SW5-012:~$ CREATE TABLE test_table (id int, text varchar (15) NOT NULL);
141-su: ÑинтакÑичеÑÐºÐ°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° Ñ€Ñдом Ñ Ð½ÐµÐ¾Ð¶Ð¸Ð´Ð°Ð½Ð½Ñ‹Ð¼ маркером «(»
142postgres@andrey-Aspire-SW5-012:~$ CREATE TABLE test_table (
143-su: ÑинтакÑичеÑÐºÐ°Ñ Ð¾ÑˆÐ¸Ð±ÐºÐ° Ñ€Ñдом Ñ Ð½ÐµÐ¾Ð¶Ð¸Ð´Ð°Ð½Ð½Ñ‹Ð¼ маркером «(»
144postgres@andrey-Aspire-SW5-012:~$ CREATE TABLE test_table
145CREATE: команда не найдена
146postgres@andrey-Aspire-SW5-012:~$ psql
147psql (10.6 (Ubuntu 10.6-0ubuntu0.18.04.1))
148Type "help" for help.
149
150postgres=# createdb test
151postgres-# /q
152postgres-# \q
153postgres@andrey-Aspire-SW5-012:~$ psql
154psql (10.6 (Ubuntu 10.6-0ubuntu0.18.04.1))
155Type "help" for help.
156
157postgres=# ^C
158postgres=# ^Z
159[1]+ ОÑтановлен psql
160postgres@andrey-Aspire-SW5-012:~$ psql
161psql (10.6 (Ubuntu 10.6-0ubuntu0.18.04.1))
162Type "help" for help.
163
164postgres=#
165postgres=#
166postgres=# CREATE TABLE weather (
167postgres(#
168postgres(# city varchar(80),
169postgres(#
170postgres(# temp_lo int, -- Ð¼Ð¸Ð½Ð¸Ð¼Ð°Ð»ÑŒÐ½Ð°Ñ Ñ‚ÐµÐ¼Ð¿ÐµÑ€Ð°Ñ‚ÑƒÑ€Ð° днÑ
171postgres(#
172postgres(# temp_hi int, -- макÑÐ¸Ð¼Ð°Ð»ÑŒÐ½Ð°Ñ Ñ‚ÐµÐ¼Ð¿ÐµÑ€Ð°Ñ‚ÑƒÑ€Ð° днÑ
173postgres(#
174postgres(# prcp real, -- уровень оÑадков
175postgres(#
176postgres(# date date
177postgres(#
178postgres(# );
179CREATE TABLE
180postgres=#
181postgres=# select * from weather
182postgres-# drop database test
183postgres-# \q
184postgres@andrey-Aspire-SW5-012:~$ createdb test
185createdb: database creation failed: ERROR: database "test" already exists
186postgres@andrey-Aspire-SW5-012:~$ dropdb test
187postgres@andrey-Aspire-SW5-012:~$ createdb test
188postgres@andrey-Aspire-SW5-012:~$ psql
189psql (10.6 (Ubuntu 10.6-0ubuntu0.18.04.1))
190Type "help" for help.
191
192postgres=# \l
193postgres=# \q
194postgres@andrey-Aspire-SW5-012:~$ dropdb TEST
195postgres@andrey-Aspire-SW5-012:~$ psql
196psql (10.6 (Ubuntu 10.6-0ubuntu0.18.04.1))
197Type "help" for help.
198
199postgres=# \l
200 List of databases
201 Name | Owner | Encoding | Collate | Ctype | Access privileges
202-----------+----------+----------+-------------+-------------+-----------------------
203 postgres | postgres | UTF8 | ru_RU.UTF-8 | ru_RU.UTF-8 |
204 template0 | postgres | UTF8 | ru_RU.UTF-8 | ru_RU.UTF-8 | =c/postgres +
205 | | | | | postgres=CTc/postgres
206 template1 | postgres | UTF8 | ru_RU.UTF-8 | ru_RU.UTF-8 | =c/postgres +
207 | | | | | postgres=CTc/postgres
208 test | postgres | UTF8 | ru_RU.UTF-8 | ru_RU.UTF-8 |
209(4 rows)
210
211postgres=# CREATE TABLE test (
212postgres(# id int,
213postgres(# text varchar (15));
214CREATE TABLE
215postgres=# select * from test
216postgres-# \l
217 List of databases
218 Name | Owner | Encoding | Collate | Ctype | Access privileges
219-----------+----------+----------+-------------+-------------+-----------------------
220 postgres | postgres | UTF8 | ru_RU.UTF-8 | ru_RU.UTF-8 |
221 template0 | postgres | UTF8 | ru_RU.UTF-8 | ru_RU.UTF-8 | =c/postgres +
222 | | | | | postgres=CTc/postgres
223 template1 | postgres | UTF8 | ru_RU.UTF-8 | ru_RU.UTF-8 | =c/postgres +
224 | | | | | postgres=CTc/postgres
225 test | postgres | UTF8 | ru_RU.UTF-8 | ru_RU.UTF-8 |
226(4 rows)
227
228postgres-# \d
229 List of relations
230 Schema | Name | Type | Owner
231--------+---------+-------+----------
232 public | test | table | postgres
233 public | weather | table | postgres
234(2 rows)
235
236postgres-# drop table weather
237postgres-# \d
238 List of relations
239 Schema | Name | Type | Owner
240--------+---------+-------+----------
241 public | test | table | postgres
242 public | weather | table | postgres
243(2 rows)
244
245postgres-# drop table weather
246postgres-# \d
247 List of relations
248 Schema | Name | Type | Owner
249--------+---------+-------+----------
250 public | test | table | postgres
251 public | weather | table | postgres
252(2 rows)
253
254postgres-# drop table weather;
255ERROR: syntax error at or near "table"
256LINE 2: drop table weather
257 ^
258postgres=# \d
259 List of relations
260 Schema | Name | Type | Owner
261--------+---------+-------+----------
262 public | test | table | postgres
263 public | weather | table | postgres
264(2 rows)
265
266postgres=# DROP TABLE weather;
267DROP TABLE
268postgres=# \d
269 List of relations
270 Schema | Name | Type | Owner
271--------+------+-------+----------
272 public | test | table | postgres
273(1 row)
274
275postgres=# \q
276postgres@andrey-Aspire-SW5-012:~$ SELECT * FROM test
277SELECT: команда не найдена
278postgres@andrey-Aspire-SW5-012:~$ psql
279psql (10.6 (Ubuntu 10.6-0ubuntu0.18.04.1))
280Type "help" for help.
281
282postgres=# SELECT *FRON test
283postgres-# select * from tet
284postgres-# select * from test
285postgres-# \d
286 List of relations
287 Schema | Name | Type | Owner
288--------+------+-------+----------
289 public | test | table | postgres
290(1 row)
291
292postgres-# SELECT * FROM test;
293ERROR: syntax error at or near "FRON"
294LINE 1: SELECT *FRON test
295 ^
296postgres=# \d
297 List of relations
298 Schema | Name | Type | Owner
299--------+------+-------+----------
300 public | test | table | postgres
301(1 row)
302
303postgres=# INSERT INTO test VALUES (1, 'Hello world'):
304postgres-# INSERT INTO test VALUES (1, 'Hello world');
305ERROR: syntax error at or near ":"
306LINE 1: INSERT INTO test VALUES (1, 'Hello world'):
307 ^
308postgres=# INSERT INTO test VALUES (1, 'Hello world');
309INSERT 0 1
310postgres=# SELECT * FROM test;
311 id | text
312----+-------------
313 1 | Hello world
314(1 row)
315
316postgres=# \d
317 List of relations
318 Schema | Name | Type | Owner
319--------+------+-------+----------
320 public | test | table | postgres
321(1 row)
322
323postgres=# \l
324 List of databases
325 Name | Owner | Encoding | Collate | Ctype | Access privileges
326-----------+----------+----------+-------------+-------------+-----------------------
327 postgres | postgres | UTF8 | ru_RU.UTF-8 | ru_RU.UTF-8 |
328 template0 | postgres | UTF8 | ru_RU.UTF-8 | ru_RU.UTF-8 | =c/postgres +
329 | | | | | postgres=CTc/postgres
330 template1 | postgres | UTF8 | ru_RU.UTF-8 | ru_RU.UTF-8 | =c/postgres +
331 | | | | | postgres=CTc/postgres
332 test | postgres | UTF8 | ru_RU.UTF-8 | ru_RU.UTF-8 |
333(4 rows)
334
335postgres=# ^C
336postgres=# \d
337 List of relations
338 Schema | Name | Type | Owner
339--------+------+-------+----------
340 public | test | table | postgres
341(1 row)
342
343postgres=# SELECT * FROM test;
344 id | text
345----+-------------
346 1 | Hello world
347(1 row)
348
349postgres=# \dt+
350 List of relations
351 Schema | Name | Type | Owner | Size | Description
352--------+------+-------+----------+------------+-------------
353 public | test | table | postgres | 8192 bytes |
354(1 row)
355
356postgres=# \h
357postgres=# help
358You are using psql, the command-line interface to PostgreSQL.
359Type: \copyright for distribution terms
360 \h for help with SQL commands
361 \? for help with psql commands
362 \g or terminate with semicolon to execute query
363 \q to quit
364postgres=# \?
365postgres=# pg_dumpall -U postgres -w > backup
366postgres-# \й
367Invalid command \й. Try \? for help.
368postgres-# \q
369postgres@andrey-Aspire-SW5-012:~$ pg_dumpall -U postgres -w > backup
370postgres@andrey-Aspire-SW5-012:~$ pg_dump -h 212.220.22.43 -U postgres -w > backup
371^[[B^[[A^[[A^C
372postgres@andrey-Aspire-SW5-012:~$ pg_dumpall -h 212.220.22.4 -p 22024 3 -U postgres -w > backup
373pg_dumpall: too many command-line arguments (first is "3")
374Try "pg_dumpall --help" for more information.
375postgres@andrey-Aspire-SW5-012:~$ pg_dump -h 212.220.22.4 -p 22024 3 -U postgres -w > backup
376^C
377postgres@andrey-Aspire-SW5-012:~$ pg_dump –-host=212.220.22.43:22024 --username=postgres --dbname=test --file=test.sql
378pg_dump: too many command-line arguments (first is "–-host=212.220.22.43:22024")
379Try "pg_dump --help" for more information.
380postgres@andrey-Aspire-SW5-012:~$ pg_dump --help
381pg_dump dumps a database as a text file or to other formats.
382
383Usage:
384 pg_dump [OPTION]... [DBNAME]
385
386General options:
387 -f, --file=FILENAME output file or directory name
388 -F, --format=c|d|t|p output file format (custom, directory, tar,
389 plain text (default))
390 -j, --jobs=NUM use this many parallel jobs to dump
391 -v, --verbose verbose mode
392 -V, --version output version information, then exit
393 -Z, --compress=0-9 compression level for compressed formats
394 --lock-wait-timeout=TIMEOUT fail after waiting TIMEOUT for a table lock
395 --no-sync do not wait for changes to be written safely to disk
396 -?, --help show this help, then exit
397
398Options controlling the output content:
399 -a, --data-only dump only the data, not the schema
400 -b, --blobs include large objects in dump
401 -B, --no-blobs exclude large objects in dump
402 -c, --clean clean (drop) database objects before recreating
403 -C, --create include commands to create database in dump
404 -E, --encoding=ENCODING dump the data in encoding ENCODING
405 -n, --schema=SCHEMA dump the named schema(s) only
406 -N, --exclude-schema=SCHEMA do NOT dump the named schema(s)
407 -o, --oids include OIDs in dump
408 -O, --no-owner skip restoration of object ownership in
409 plain-text format
410 -s, --schema-only dump only the schema, no data
411 -S, --superuser=NAME superuser user name to use in plain-text format
412 -t, --table=TABLE dump the named table(s) only
413 -T, --exclude-table=TABLE do NOT dump the named table(s)
414 -x, --no-privileges do not dump privileges (grant/revoke)
415 --binary-upgrade for use by upgrade utilities only
416 --column-inserts dump data as INSERT commands with column names
417 --disable-dollar-quoting disable dollar quoting, use SQL standard quoting
418 --disable-triggers disable triggers during data-only restore
419 --enable-row-security enable row security (dump only content user has
420 access to)
421 --exclude-table-data=TABLE do NOT dump data for the named table(s)
422 --if-exists use IF EXISTS when dropping objects
423 --inserts dump data as INSERT commands, rather than COPY
424 --no-publications do not dump publications
425 --no-security-labels do not dump security label assignments
426 --no-subscriptions do not dump subscriptions
427 --no-synchronized-snapshots do not use synchronized snapshots in parallel jobs
428 --no-tablespaces do not dump tablespace assignments
429 --no-unlogged-table-data do not dump unlogged table data
430 --quote-all-identifiers quote all identifiers, even if not key words
431 --section=SECTION dump named section (pre-data, data, or post-data)
432 --serializable-deferrable wait until the dump can run without anomalies
433 --snapshot=SNAPSHOT use given snapshot for the dump
434 --strict-names require table and/or schema include patterns to
435 match at least one entity each
436 --use-set-session-authorization
437 use SET SESSION AUTHORIZATION commands instead of
438 ALTER OWNER commands to set ownership
439
440Connection options:
441 -d, --dbname=DBNAME database to dump
442 -h, --host=HOSTNAME database server host or socket directory
443 -p, --port=PORT database server port number
444 -U, --username=NAME connect as specified database user
445 -w, --no-password never prompt for password
446 -W, --password force password prompt (should happen automatically)
447 --role=ROLENAME do SET ROLE before dump
448
449If no database name is supplied, then the PGDATABASE environment
450variable value is used.
451
452Report bugs to <pgsql-bugs@postgresql.org>.
453postgres@andrey-Aspire-SW5-012:~$ pg_dump –-host=212.220.22.43^C2024 --username=postgres --dbname=test --file=test.sql
454postgres@andrey-Aspire-SW5-012:~$ pg_dump -h 212.220.22.43 -p 22024 -U postgres -d test -f test.sql
455pg_dump: [archiver (db)] connection to database "test" failed: SSL error: wrong version number
456expected authentication request from server, but received S
457postgres@andrey-Aspire-SW5-012:~$ pg_dump -h 212.220.22.43 -p 22024 -U postgres -d test
458pg_dump: [archiver (db)] connection to database "test" failed: SSL error: wrong version number
459expected authentication request from server, but received S
460postgres@andrey-Aspire-SW5-012:~$ pg_dumpall -h 212.220.22.43 -p 22024 -U postgres -d test
461pg_dumpall: missing "=" after "test" in connection info string
462postgres@andrey-Aspire-SW5-012:~$ pg_dumpall -h 212.220.22.43 -p 22024 -U postgres --role=postgres -d test -w
463pg_dumpall: missing "=" after "test" in connection info string
464postgres@andrey-Aspire-SW5-012:~$ pg_dumpall -h 212.220.22.43 -p 22024 -U postgres --role=postgres -w
465pg_dumpall: could not connect to database "template1": SSL error: wrong version number
466expected authentication request from server, but received S
467postgres@andrey-Aspire-SW5-012:~$ ^C
468postgres@andrey-Aspire-SW5-012:~$ pg-dump -c test | ssh -C root@212.220.22.43 -p 22024 testdb.sql
469
470Command 'pg-dump' not found, did you mean:
471
472 command 'pgpdump' from deb pgpdump
473 command 'pg_dump' from deb postgresql-client-common
474
475Try: sudo apt install <deb name>
476
477The authenticity of host '[212.220.22.43]:22024 ([212.220.22.43]:22024)' can't be established.
478ECDSA key fingerprint is SHA256:IsGxR2y+gRIH8KVhchN6cDPoEFXxYTnrzYiJr2u4uJ0.
479Are you sure you want to continue connecting (yes/no)? no
480Host key verification failed.
481postgres@andrey-Aspire-SW5-012:~$ pg_dump -c test | ssh -C root@212.220.22.43 -p 22024 testdb.sql
482The authenticity of host '[212.220.22.43]:22024 ([212.220.22.43]:22024)' can't be established.
483ECDSA key fingerprint is SHA256:IsGxR2y+gRIH8KVhchN6cDPoEFXxYTnrzYiJr2u4uJ0.
484Are you sure you want to continue connecting (yes/no)? yes
485Warning: Permanently added '[212.220.22.43]:22024' (ECDSA) to the list of known hosts.
486root@212.220.22.43's password:
487bash: testdb.sql: команда не найдена
488postgres@andrey-Aspire-SW5-012:~$ pg_dump test > backup.sql
489postgres@andrey-Aspire-SW5-012:~$ pg_dump -c test | ssh -C root@212.220.22.43 -p 22024 testdb.sql
490root@212.220.22.43's password:
491Permission denied, please try again.
492root@212.220.22.43's password:
493Permission denied, please try again.
494root@212.220.22.43's password:
495
496[2]+ ОÑтановлен pg_dump -c test | ssh -C root@212.220.22.43 -p 22024 testdb.sql
497postgres@andrey-Aspire-SW5-012:~$ sudo pg_dump -c test | ssh -C root@212.220.22.43 -p 22024 testdb.sql
498[sudo] пароль Ð´Ð»Ñ postgres: root@212.220.22.43's password:
499Permission denied, please try again.
500root@212.220.22.43's password:
501
502
503[3]+ ОÑтановлен sudo pg_dump -c test | ssh -C root@212.220.22.43 -p 22024 testdb.sql
504postgres@andrey-Aspire-SW5-012:~$ sudo su
505[sudo] пароль Ð´Ð»Ñ postgres:
506root@andrey-Aspire-SW5-012:/var/lib/postgresql# pg_dump -c test | ssh -C root@212.220.22.43 -p 22024 testdb.sql
507pg_dump: [archiver (db)] connection to database "test" failed: FATAL: role "root" does not exist
508root@212.220.22.43's password:
509bash: testdb.sql: команда не найдена
510root@andrey-Aspire-SW5-012:/var/lib/postgresql# pg_dump -c test | ssh -C postgres@212.220.22.43 -p 22024
511Pseudo-terminal will not be allocated because stdin is not a terminal.
512pg_dump: [archiver (db)] connection to database "test" failed: FATAL: role "root" does not exist
513postgres@212.220.22.43's password:
514
515[1]+ ОÑтановлен pg_dump -c test | ssh -C postgres@212.220.22.43 -p 22024
516root@andrey-Aspire-SW5-012:/var/lib/postgresql# pg_dump -c postres | ssh -C root@212.220.22.43 -p 22024 "psql test"
517pg_dump: [archiver (db)] connection to database "postres" failed: FATAL: role "root" does not exist
518root@212.220.22.43's password:
519
520[2]+ ОÑтановлен pg_dump -c postres | ssh -C root@212.220.22.43 -p 22024 "psql test"
521root@andrey-Aspire-SW5-012:/var/lib/postgresql# pg_dump -c test | ssh -C root@212.220.22.43 -p 22024 "psql test"
522pg_dump: [archiver (db)] connection to database "test" failed: FATAL: role "root" does not exist
523root@212.220.22.43's password:
524
525[3]+ ОÑтановлен pg_dump -c test | ssh -C root@212.220.22.43 -p 22024 "psql test"
526root@andrey-Aspire-SW5-012:/var/lib/postgresql# pg_dump -c test | ssh -C root@212.220.22.43 -p 22024 -role=postgres "psql test"
527unknown option -- r
528usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec]
529 [-D [bind_address:]port] [-E log_file] [-e escape_char]
530 [-F configfile] [-I pkcs11] [-i identity_file]
531 [-J [user@]host[:port]] [-L address] [-l login_name] [-m mac_spec]
532 [-O ctl_cmd] [-o option] [-p port] [-Q query_option] [-R address]
533 [-S ctl_path] [-W host:port] [-w local_tun[:remote_tun]]
534 [user@]hostname [command]
535pg_dump: [archiver (db)] connection to database "test" failed: FATAL: role "root" does not exist
536root@andrey-Aspire-SW5-012:/var/lib/postgresql# pg_dump