zoukankan      html  css  js  c++  java
  • Postgresql 常用操作

    表所有者一括变更

    select 'alter table public.'|| tablename ||' owner to appuser;' from pg_tables where tableowner='postgres' and schemaname='public';

    改变操作数据库

    HBS=# c TEST;

    查看所有表

    HCS=# dt;

    查看表结构

    HCS=# d tablename;

    批量执行SQL

    psql -d db1 -U userA -f E://p/xxx.sql

     本地数据库迁移到RDS阿里云数据库

    1,本地数据库备份

    pg_dump -U William -h localhost -p 3433 -d pg001 -f pg001.sql

    2,数据库迁移

    psql -U username -h hostname -d desintationdb -p port -f dumpfilename.sql
  • 相关阅读:
    01模拟面试面试题汇总
    第一轮面试
    大觅网03Day
    大觅网02Day
    大觅网01Day
    树状数组
    HH的项链
    小z的袜子
    分块
    扩展欧几里德
  • 原文地址:https://www.cnblogs.com/lixiaobin/p/Postgresql.html
Copyright © 2011-2022 走看看