{"id":3035,"date":"2021-07-21T12:27:41","date_gmt":"2021-07-21T12:27:41","guid":{"rendered":"https:\/\/www.bearloga.space\/?page_id=3035"},"modified":"2021-07-21T12:27:41","modified_gmt":"2021-07-21T12:27:41","slug":"postgresql-interfejs-c-c","status":"publish","type":"page","link":"https:\/\/www.bearloga.space\/uk\/postgresql-interfejs-c-c\/","title":{"rendered":"PostgreSQL \u2014 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 C \/ C ++"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u0412 \u044d\u0442\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430&nbsp;<strong>libpqxx<\/strong>&nbsp;, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u043c API C ++ \u0434\u043b\u044f PostgreSQL.&nbsp;\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f libpqxx \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0438 BSD, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0435\u0433\u043e, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u043c, \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c, \u043f\u0440\u043e\u0434\u0430\u0432\u0430\u0442\u044c, \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0432 \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0438\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u0441 \u043b\u044e\u0431\u044b\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u043f\u043e \u0441\u0432\u043e\u0435\u043c\u0443 \u0432\u044b\u0431\u043e\u0440\u0443.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u041c\u043e\u043d\u0442\u0430\u0436<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0432\u0435\u0440\u0441\u0438\u044e libpqxx \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435&nbsp;<a href=\"https:\/\/translate.googleusercontent.com\/translate_c?depth=1&amp;rurl=translate.google.ru&amp;sl=en&amp;sp=nmt4&amp;tl=ru&amp;u=http:\/\/pqxx.org\/download\/software\/libpqxx\/&amp;xid=17259,15700022,15700186,15700190,15700256,15700259,15700262&amp;usg=ALkJrhjNxmTACGvG24asZ8zvJd7KLlCP6w\" target=\"_blank\" rel=\"noreferrer noopener\">Download Libpqxx<\/a>&nbsp;.&nbsp;\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wget http:\/\/pqxx.org\/download\/software\/libpqxx\/libpqxx-4.0.tar.gz\ntar xvfz libpqxx-4.0.tar.gz\ncd libpqxx-4.0\n.\/configure\nmake\nmake install<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043d\u0430\u0447\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 C \/ C ++ PostgreSQL, \u043d\u0430\u0439\u0434\u0438\u0442\u0435 \u0444\u0430\u0439\u043b&nbsp;<strong>pg_hba.conf<\/strong>&nbsp;\u0432 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 PostgreSQL \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"># IPv4 local connections:\nhost    all         all         127.0.0.1\/32          md5<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \/ \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 postgres, \u0435\u0441\u043b\u0438 \u043e\u043d \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u2014<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[root@host]# service postgresql restart\nStopping postgresql service:                               [  OK  ]\nStarting postgresql service:                               [  OK  ]<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">API \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 C \/ C ++<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0432\u0430\u0436\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u0442\u044c \u0432\u0430\u0448\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 PostgreSQL \u0438\u0437 \u0432\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430 C \/ C ++.&nbsp;\u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0449\u0435\u0442\u0435 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e libpqxx \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u044e\u0449\u0438\u0435\u0441\u044f \u0432 \u043f\u0440\u043e\u0434\u0430\u0436\u0435 API.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>\u0421. \u041d\u0435\u0442.<\/th><th>API \u0438 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/th><\/tr><tr><td>1<\/td><td><strong>pqxx :: \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 C (const std :: string &amp; dbstring)<\/strong>\u042d\u0442\u043e typedef, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.&nbsp;\u0417\u0434\u0435\u0441\u044c dbstring \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,&nbsp;<strong>dbname = testdb user = postgres password = pass123 hostaddr = 127.0.0.1 port = 5432<\/strong>&nbsp;.\u0415\u0441\u043b\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f C \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 public function.<\/td><\/tr><tr><td>2<\/td><td><strong>C.is_open ()<\/strong>\u041c\u0435\u0442\u043e\u0434 is_open () \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.&nbsp;\u0415\u0441\u043b\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0430\u043a\u0442\u0438\u0432\u043d\u043e, \u0442\u043e \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 true, \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 false.<\/td><\/tr><tr><td>3<\/td><td><strong>C.disconnect ()<\/strong>\u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445.<\/td><\/tr><tr><td>4<\/td><td><strong>pqxx :: \u0440\u0430\u0431\u043e\u0442\u0430 W (C)<\/strong>\u042d\u0442\u043e typedef, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f C, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0438\u0442\u043e\u0433\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 SQL \u0432 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435.\u0415\u0441\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d, \u043e\u043d \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 W, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438.<\/td><\/tr><tr><td>5<\/td><td><strong>W.exec (const std :: string &amp; sql)<\/strong>\u042d\u0442\u043e\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0438\u0437 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 SQL.<\/td><\/tr><tr><td>6<\/td><td><strong>W.commit ()<\/strong>\u042d\u0442\u043e\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0438\u0437 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0444\u0438\u043a\u0441\u0430\u0446\u0438\u0438 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438.<\/td><\/tr><tr><td>7<\/td><td><strong>W.abort ()<\/strong>\u042d\u0442\u043e\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0438\u0437 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043e\u0442\u043a\u0430\u0442\u0430 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438.<\/td><\/tr><tr><td>8<\/td><td><strong>pqxx :: \u043d\u0435\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f N (C)<\/strong>\u042d\u0442\u043e typedef, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u0435\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f C, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0438\u0442\u043e\u0433\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 SQL \u0432 \u043d\u0435\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435.\u0415\u0441\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d, \u043e\u043d \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 N, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c \u0441 \u043d\u0435\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c.<\/td><\/tr><tr><td>9<\/td><td><strong>N.exec (const std :: string &amp; sql)<\/strong>\u042d\u0442\u043e\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0438\u0437 \u043d\u0435\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 SQL \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0442\u043e\u0440\u043e\u043c, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u043c \u0432\u0441\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>pqxx :: \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 C (const std :: string &amp; dbstring)<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u042d\u0442\u043e typedef, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.&nbsp;\u0417\u0434\u0435\u0441\u044c dbstring \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,&nbsp;<strong>dbname = testdb user = postgres password = pass123 hostaddr = 127.0.0.1 port = 5432<\/strong>&nbsp;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0415\u0441\u043b\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e, \u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f C \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 public function.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>C.is_open ()<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041c\u0435\u0442\u043e\u0434 is_open () \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.&nbsp;\u0415\u0441\u043b\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0430\u043a\u0442\u0438\u0432\u043d\u043e, \u0442\u043e \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 true, \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 false.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>C.disconnect ()<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>pqxx :: \u0440\u0430\u0431\u043e\u0442\u0430 W (C)<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u042d\u0442\u043e typedef, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f C, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0438\u0442\u043e\u0433\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 SQL \u0432 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0415\u0441\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d, \u043e\u043d \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 W, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c \u0441 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>W.exec (const std :: string &amp; sql)<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u042d\u0442\u043e\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0438\u0437 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 SQL.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>W.commit ()<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u042d\u0442\u043e\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0438\u0437 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0444\u0438\u043a\u0441\u0430\u0446\u0438\u0438 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>W.abort ()<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u042d\u0442\u043e\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0438\u0437 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043e\u0442\u043a\u0430\u0442\u0430 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>pqxx :: \u043d\u0435\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f N (C)<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u042d\u0442\u043e typedef, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u0435\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f C, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0438\u0442\u043e\u0433\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 SQL \u0432 \u043d\u0435\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0415\u0441\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043d, \u043e\u043d \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 N, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u043c \u0441 \u043d\u0435\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>N.exec (const std :: string &amp; sql)<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u042d\u0442\u043e\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0438\u0437 \u043d\u0435\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 SQL \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0442\u043e\u0440\u043e\u043c, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u043c \u0432\u0441\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0435 \u043a\u043e\u0434\u0430 C \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e, \u043a\u0430\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0439 \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0440\u0442 5432. \u0417\u0434\u0435\u0441\u044c \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u043a\u043e\u0441\u0443\u044e \u0447\u0435\u0440\u0442\u0443 \\ \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a\u0438.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#include &lt;iostream&gt;\n#include &lt;pqxx\/pqxx&gt; \n\nusing namespace std;\nusing namespace pqxx;\n\nint main(int argc, char* argv[]) {\n   try {\n      connection C(\"dbname = testdb user = postgres password = cohondob \\\n      hostaddr = 127.0.0.1 port = 5432\");\n      if (C.is_open()) {\n         cout &lt;&lt; \"Opened database successfully: \" &lt;&lt; C.dbname() &lt;&lt; endl;\n      } else {\n         cout &lt;&lt; \"Can't open database\" &lt;&lt; endl;\n         return 1;\n      }\n      C.disconnect ();\n   } catch (const std::exception &amp;e) {\n      cerr &lt;&lt; e.what() &lt;&lt; std::endl;\n      return 1;\n   }\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c&nbsp;<strong>\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e<\/strong>&nbsp;\u0432\u044b\u0448\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u043d\u0430\u0448\u0435\u0439 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445&nbsp;<strong>testdb<\/strong>&nbsp;, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u0436\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0432 \u0432\u0430\u0448\u0435\u0439 \u0441\u0445\u0435\u043c\u0435 \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445&nbsp;<em>postgres<\/em>&nbsp;\u0438 \u043f\u0430\u0440\u043e\u043b\u044f&nbsp;<em>pass123<\/em>&nbsp;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0432\u0430\u0448\u0435\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445.&nbsp;\u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c -lpqxx \u0438 -lpq \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435!&nbsp;\u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u0449\u0438\u043a \u0431\u0443\u0434\u0435\u0442 \u0433\u043e\u0440\u044c\u043a\u043e \u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u0438\u043c\u0435\u043d\u0430\u043c\u0438, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u043c\u0438\u0441\u044f \u0441 \u00abPQ\u00bb.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$g++ test.cpp -lpqxx -lpq\n$.\/a.out\nOpened database successfully: testdb<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u0435\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 C \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u2014<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#include &lt;iostream&gt;\n#include &lt;pqxx\/pqxx&gt; \n\nusing namespace std;\nusing namespace pqxx;\n\nint main(int argc, char* argv[]) {\n   char * sql;\n   \n   try {\n      connection C(\"dbname = testdb user = postgres password = cohondob \\\n      hostaddr = 127.0.0.1 port = 5432\");\n      if (C.is_open()) {\n         cout &lt;&lt; \"Opened database successfully: \" &lt;&lt; C.dbname() &lt;&lt; endl;\n      } else {\n         cout &lt;&lt; \"Can't open database\" &lt;&lt; endl;\n         return 1;\n      }\n\n      \/* Create SQL statement *\/\n      sql = \"CREATE TABLE COMPANY(\"  \\\n      \"ID INT PRIMARY KEY     NOT NULL,\" \\\n      \"NAME           TEXT    NOT NULL,\" \\\n      \"AGE            INT     NOT NULL,\" \\\n      \"ADDRESS        CHAR(50),\" \\\n      \"SALARY         REAL );\";\n\n      \/* Create a transactional object. *\/\n      work W(C);\n      \n      \/* Execute SQL query *\/\n      W.exec( sql );\n      W.commit();\n      cout &lt;&lt; \"Table created successfully\" &lt;&lt; endl;\n      C.disconnect ();\n   } catch (const std::exception &amp;e) {\n      cerr &lt;&lt; e.what() &lt;&lt; std::endl;\n      return 1;\n   }\n\n   return 0;\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041a\u043e\u0433\u0434\u0430 \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430, \u043e\u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 COMPANY \u0432 \u0432\u0430\u0448\u0435\u0439 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 testdb \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Opened database successfully: testdb\nTable created successfully\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u0412\u0421\u0422\u0410\u0412\u0418\u0422\u042c \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u0435\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 C \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u043d\u0430\u0448\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 COMPANY, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0435.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#include &lt;iostream&gt;\n#include &lt;pqxx\/pqxx&gt; \n\nusing namespace std;\nusing namespace pqxx;\n\nint main(int argc, char* argv[]) {\n   char * sql;\n   \n   try {\n      connection C(\"dbname = testdb user = postgres password = cohondob \\\n      hostaddr = 127.0.0.1 port = 5432\");\n      if (C.is_open()) {\n         cout &lt;&lt; \"Opened database successfully: \" &lt;&lt; C.dbname() &lt;&lt; endl;\n      } else {\n         cout &lt;&lt; \"Can't open database\" &lt;&lt; endl;\n         return 1;\n      }\n\n      \/* Create SQL statement *\/\n      sql = \"INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY) \"  \\\n         \"VALUES (1, 'Paul', 32, 'California', 20000.00 ); \" \\\n         \"INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY) \"  \\\n         \"VALUES (2, 'Allen', 25, 'Texas', 15000.00 ); \"     \\\n         \"INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY)\" \\\n         \"VALUES (3, 'Teddy', 23, 'Norway', 20000.00 );\" \\\n         \"INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY)\" \\\n         \"VALUES (4, 'Mark', 25, 'Rich-Mond ', 65000.00 );\";\n\n      \/* Create a transactional object. *\/\n      work W(C);\n      \n      \/* Execute SQL query *\/\n      W.exec( sql );\n      W.commit();\n      cout &lt;&lt; \"Records created successfully\" &lt;&lt; endl;\n      C.disconnect ();\n   } catch (const std::exception &amp;e) {\n      cerr &lt;&lt; e.what() &lt;&lt; std::endl;\n      return 1;\n   }\n\n   return 0;\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041a\u043e\u0433\u0434\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0430\u044f \u0432\u044b\u0448\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u043e\u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 COMPANY \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0432\u0435 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Opened database successfully: testdb\nRecords created successfully\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u0412\u042b\u0411\u0415\u0420\u0418\u0422\u0415 \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044e<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u0435\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 C \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0438 \u0438\u0437 \u043d\u0430\u0448\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b COMPANY, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0435.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#include &lt;iostream&gt;\n#include &lt;pqxx\/pqxx&gt; \n\nusing namespace std;\nusing namespace pqxx;\n\nint main(int argc, char* argv[]) {\n   char * sql;\n   \n   try {\n      connection C(\"dbname = testdb user = postgres password = cohondob \\\n      hostaddr = 127.0.0.1 port = 5432\");\n      if (C.is_open()) {\n         cout &lt;&lt; \"Opened database successfully: \" &lt;&lt; C.dbname() &lt;&lt; endl;\n      } else {\n         cout &lt;&lt; \"Can't open database\" &lt;&lt; endl;\n         return 1;\n      }\n\n      \/* Create SQL statement *\/\n      sql = \"SELECT * from COMPANY\";\n\n      \/* Create a non-transactional object. *\/\n      nontransaction N(C);\n      \n      \/* Execute SQL query *\/\n      result R( N.exec( sql ));\n      \n      \/* List down all the records *\/\n      for (result::const_iterator c = R.begin(); c != R.end(); ++c) {\n         cout &lt;&lt; \"ID = \" &lt;&lt; c[0].as&lt;int&gt;() &lt;&lt; endl;\n         cout &lt;&lt; \"Name = \" &lt;&lt; c[1].as&lt;string&gt;() &lt;&lt; endl;\n         cout &lt;&lt; \"Age = \" &lt;&lt; c[2].as&lt;int&gt;() &lt;&lt; endl;\n         cout &lt;&lt; \"Address = \" &lt;&lt; c[3].as&lt;string&gt;() &lt;&lt; endl;\n         cout &lt;&lt; \"Salary = \" &lt;&lt; c[4].as&lt;float&gt;() &lt;&lt; endl;\n      }\n      cout &lt;&lt; \"Operation done successfully\" &lt;&lt; endl;\n      C.disconnect ();\n   } catch (const std::exception &amp;e) {\n      cerr &lt;&lt; e.what() &lt;&lt; std::endl;\n      return 1;\n   }\n\n   return 0;\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041a\u043e\u0433\u0434\u0430 \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430, \u043e\u043d\u0430 \u0434\u0430\u0441\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Opened database successfully: testdb\nID = 1\nName = Paul\nAge = 32\nAddress = California\nSalary = 20000\nID = 2\nName = Allen\nAge = 25\nAddress = Texas\nSalary = 15000\nID = 3\nName = Teddy\nAge = 23\nAddress = Norway\nSalary = 20000\nID = 4\nName = Mark\nAge = 25\nAddress = Rich-Mond\nSalary = 65000\nOperation done successfully\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u041e\u0411\u041d\u041e\u0412\u041b\u0415\u041d\u0418\u0415 \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u0435\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 C \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e UPDATE, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0438\u0437 \u043d\u0430\u0448\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b COMPANY \u2014<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#include &lt;iostream&gt;\n#include &lt;pqxx\/pqxx&gt; \n\nusing namespace std;\nusing namespace pqxx;\n\nint main(int argc, char* argv[]) {\n   char * sql;\n   \n   try {\n      connection C(\"dbname = testdb user = postgres password = cohondob \\\n      hostaddr = 127.0.0.1 port = 5432\");\n      if (C.is_open()) {\n         cout &lt;&lt; \"Opened database successfully: \" &lt;&lt; C.dbname() &lt;&lt; endl;\n      } else {\n         cout &lt;&lt; \"Can't open database\" &lt;&lt; endl;\n         return 1;\n      }\n      \n      \/* Create a transactional object. *\/\n      work W(C);\n      \/* Create  SQL UPDATE statement *\/\n      sql = \"UPDATE COMPANY set SALARY = 25000.00 where ID=1\";\n      \/* Execute SQL query *\/\n      W.exec( sql );\n      W.commit();\n      cout &lt;&lt; \"Records updated successfully\" &lt;&lt; endl;\n      \n      \/* Create SQL SELECT statement *\/\n      sql = \"SELECT * from COMPANY\";\n\n      \/* Create a non-transactional object. *\/\n      nontransaction N(C);\n      \n      \/* Execute SQL query *\/\n      result R( N.exec( sql ));\n      \n      \/* List down all the records *\/\n      for (result::const_iterator c = R.begin(); c != R.end(); ++c) {\n         cout &lt;&lt; \"ID = \" &lt;&lt; c[0].as&lt;int&gt;() &lt;&lt; endl;\n         cout &lt;&lt; \"Name = \" &lt;&lt; c[1].as&lt;string&gt;() &lt;&lt; endl;\n         cout &lt;&lt; \"Age = \" &lt;&lt; c[2].as&lt;int&gt;() &lt;&lt; endl;\n         cout &lt;&lt; \"Address = \" &lt;&lt; c[3].as&lt;string&gt;() &lt;&lt; endl;\n         cout &lt;&lt; \"Salary = \" &lt;&lt; c[4].as&lt;float&gt;() &lt;&lt; endl;\n      }\n      cout &lt;&lt; \"Operation done successfully\" &lt;&lt; endl;\n      C.disconnect ();\n   } catch (const std::exception &amp;e) {\n      cerr &lt;&lt; e.what() &lt;&lt; std::endl;\n      return 1;\n   }\n\n   return 0;\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041a\u043e\u0433\u0434\u0430 \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430, \u043e\u043d\u0430 \u0434\u0430\u0441\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Opened database successfully: testdb\nRecords updated successfully\nID = 2\nName = Allen\nAge = 25\nAddress = Texas\nSalary = 15000\nID = 3\nName = Teddy\nAge = 23\nAddress = Norway\nSalary = 20000\nID = 4\nName = Mark\nAge = 25\nAddress = Rich-Mond\nSalary = 65000\nID = 1\nName = Paul\nAge = 32\nAddress = California\nSalary = 25000\nOperation done successfully\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u0423\u0414\u0410\u041b\u0415\u041d\u0418\u0415 \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u0435\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 C \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e DELETE, \u0447\u0442\u043e\u0431\u044b \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c, \u0430 \u0437\u0430\u0442\u0435\u043c \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0435\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0438\u0437 \u043d\u0430\u0448\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b COMPANY \u2014<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#include &lt;iostream&gt;\n#include &lt;pqxx\/pqxx&gt; \n\nusing namespace std;\nusing namespace pqxx;\n\nint main(int argc, char* argv[]) {\n   char * sql;\n   \n   try {\n      connection C(\"dbname = testdb user = postgres password = cohondob \\\n      hostaddr = 127.0.0.1 port = 5432\");\n      if (C.is_open()) {\n         cout &lt;&lt; \"Opened database successfully: \" &lt;&lt; C.dbname() &lt;&lt; endl;\n      } else {\n         cout &lt;&lt; \"Can't open database\" &lt;&lt; endl;\n         return 1;\n      }\n      \n      \/* Create a transactional object. *\/\n      work W(C);\n      \/* Create  SQL DELETE statement *\/\n      sql = \"DELETE from COMPANY where ID = 2\";\n      \/* Execute SQL query *\/\n      W.exec( sql );\n      W.commit();\n      cout &lt;&lt; \"Records deleted successfully\" &lt;&lt; endl;\n      \n      \/* Create SQL SELECT statement *\/\n      sql = \"SELECT * from COMPANY\";\n\n      \/* Create a non-transactional object. *\/\n      nontransaction N(C);\n      \n      \/* Execute SQL query *\/\n      result R( N.exec( sql ));\n      \n      \/* List down all the records *\/\n      for (result::const_iterator c = R.begin(); c != R.end(); ++c) {\n         cout &lt;&lt; \"ID = \" &lt;&lt; c[0].as&lt;int&gt;() &lt;&lt; endl;\n         cout &lt;&lt; \"Name = \" &lt;&lt; c[1].as&lt;string&gt;() &lt;&lt; endl;\n         cout &lt;&lt; \"Age = \" &lt;&lt; c[2].as&lt;int&gt;() &lt;&lt; endl;\n         cout &lt;&lt; \"Address = \" &lt;&lt; c[3].as&lt;string&gt;() &lt;&lt; endl;\n         cout &lt;&lt; \"Salary = \" &lt;&lt; c[4].as&lt;float&gt;() &lt;&lt; endl;\n      }\n      cout &lt;&lt; \"Operation done successfully\" &lt;&lt; endl;\n      C.disconnect ();\n   } catch (const std::exception &amp;e) {\n      cerr &lt;&lt; e.what() &lt;&lt; std::endl;\n      return 1;\n   }\n\n   return 0;\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u0412 \u044d\u0442\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430&nbsp;libpqxx&nbsp;, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u043c API C ++ \u0434\u043b\u044f PostgreSQL.&nbsp;\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u043b\u044f libpqxx \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043f\u043e [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[104],"tags":[],"class_list":["post-3035","page","type-page","status-publish","hentry","category-postgresql"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages\/3035","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/comments?post=3035"}],"version-history":[{"count":0,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages\/3035\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/media?parent=3035"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/categories?post=3035"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/tags?post=3035"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}