示例:购买并连接PostgreSQL实例 操作步骤3:安装PostgreSQL客户端并连接RDSPostgreSQL实例 1. 本地使用Linux远程连接工具登录弹性云主机。连接IP为弹性云主机绑定的弹性公网IP。 2. 输入创建弹性云主机时设置的密码。 3. 获取安装包。 sudo yum install y 4. 安装PostgreSQL。 shell sudo yum install y postgresql12server 5. 连接RDSPostgreSQL实例。 shell psql h xx.xx.xx.xx p xxxx U root –d postgres 6. 创建数据库test1。 create database test1; 7. 切换数据库test1。 c test1; 8. 创建schema:myschema。 create schema myschema; 9. 创建表testtable。 shell create table myschema.testtable(id int primary key not null, name text not null, age int not null); 10. 向表中插入一条数据。 shell insert into myschema.testtable(id, name, age) values(1, 'zhujiasi', 30); 11. 查询表数据。 shell select from myschema.testtable; 12. 更新表中id为1的age字段值。 shell update myschema.testtable set age31 where id1; 13. 查询更新后的表数据。 shell select from myschema.testtable where id1; 14. 删除表中id为1的数据。 shell delete from myschema.testtable where id1; 15. 删除表结构。 shell drop table myschema.testtable; 16. 删除数据库。 shell drop database testdb;