postgresql
来源:互联网 发布:删除筛选出来的数据 编辑:程序博客网 时间:2024/05/16 07:21
passwprd:123456port:5432
1、linux 命令行连接
>su –postgres
>psql
>\list \l //list database
>\c testdb //connect to testdb
>\d //list all table
>\d campany //list the table campany
2、c++ 程序中 通过libpq libpqxx操作
#include <iostream>#include <pqxx/pqxx> using namespace std;using namespace pqxx;int connect(){try{string dst="dbname="+db_name+" user="+db_username+" password="+db_password+" hostaddr="+db_server + " port="+db_port;cout<<"pqxx::connection conn"<<endl;conn=new pqxx::connection(dst);cout<<"Psql connect"<<endl;if(conn->is_open()){std::cout<< "opened database successfully " << conn->dbname()<<endl;std::cout << conn->options()<<std::endl; //return 0;}else{cout<<"can not open database"<<endl;return -1;}//conn->disconnect();}catch (const exception& ex){cerr<<ex.what()<<endl;return -1;}cout <<"conn = "<<conn<<endl;return 0;}
0 0
- postgreSQL
- PostgreSQL
- PostgreSQL
- postgresql
- postgresql
- PostgreSQL
- PostgreSQL
- PostgreSQL
- PostgreSQL
- PostgreSQL
- PostgreSQL
- PostGresql
- PostgreSQL
- PostgreSQL
- postGreSql
- PostgreSQL
- PostgreSQL
- PostgreSQL
- FTP与SFTP的区别
- caffe的lmdb
- (十九)剑指offer之二叉搜索树与双向链表
- 判断一个单链表中是否存在环
- 视频编码(H264概述)
- postgresql
- web服务器该选择apache还是nginx
- 曼哈顿距离,欧式距离,明式距离,切比雪夫距离,汉明距离
- k8s nodeSelector&affinity
- (c++)求出10至1000之内能同时被2、3、7整除的数,并输出。 每行一个。
- 华为机试在线训练-牛客网(1)明明的随机数
- iOS textField 只输入数字
- javascript节点的增删改查
- 文章标题