User-Profile-Image
hankin
  • 5
  • 首页
  • 仓库
  • 留言
  • 免费下载v1.3.5
  • 分类
    • Yii2
    • wordpress
    • typeecho
    • server
    • qrcode
    • postgresql
    • php
    • jquery
    • javascript
    • html5
    • go
    • css3
    • coding
  • 页面
    • icon图标
    • 专题
    • 建站维护
    • 留言
    • 站点地图
  • 友链
    • 老赵茶馆
    • 淮城一只猫
    • 雨林寒舍
    • 饼子的博客
    • 轩枫阁
    • 广告联盟大事记
    • 主题笔记
    • 八方博客
    • 张维龙的个人博客
    • 瑞课学院
    • BBJ不败君
    • 悠悠吧
    • Heanny Blog
    • 资源谷
    • Yolen
Help?

Please contact us on our email for need any support

Support
    首页   ›   正文
postgresql

pgsql 简单命令

2018-05-13 10:56:01
1503  1 0

链接指定数据库 “xs_crm”

> psql -h 127.0.0.1 -U postgres -d xs_crm

退出psql

> \q

切换数据库

> \c databaseName

查看帮助

> \ ?

查看数据库列表

> \l 或 \l+
                                                                            List of databases
           Name            |  Owner   | Encoding |  Collation  |    Ctype    |   Access privileges   |  Size   | Tablespace |                Description
---------------------------+----------+----------+-------------+-------------+-----------------------+---------+------------+--------------------------------------------
 postgres                  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                       | 6804 kB | pg_default | default administrative connection database
 template0                 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres           | 6681 kB | pg_default | unmodifiable empty database
                                                                             : postgres=CTc/postgres
 template1                 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres           | 6689 kB | pg_default | default template for new databases
                                                                             : postgres=CTc/postgres
 xs_address                | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                       | 55 MB   | pg_default |
 xs_backoffice             | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                       | 7116 kB | pg_default |
 xs_code_release           | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                       | 7068 kB | pg_default |
 xs_company                | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                       | 7252 kB | pg_default |
 xs_crm                    | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                       | 16 MB   | pg_default |
 xs_hbird_agent            | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                       | 9332 kB | pg_default |
 xs_hefs                   | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                       | 8028 kB | pg_default |
 xs_job                    | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                       | 8084 kB | pg_default |
 xs_operation              | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                       | 6964 kB | pg_default |
 xs_passport_internal      | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                       | 7292 kB | pg_default |
 xs_public_account_backend | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                       | 7252 kB | pg_default |
 xs_static_resource        | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |                       | 7036 kB | pg_default |
(15 rows)

查看合同所有表结构

> \d+ contract.*

查看合同主表

> \d+ contract.contract_main
xs_crm-# \d+ contract.contract_main
                                                                                   Table "contract.contract_main"
        Column         |          Type          |                                  Modifiers                                   | Storage  |                       Description
-----------------------+------------------------+------------------------------------------------------------------------------+----------+----------------------------------------------------------
 contract_id           | integer                | not null default nextval('contract.contract_main_contract_id_seq'::regclass) | plain    | 合同标识
 contract_relation_id  | integer                | not null default 0                                                           | plain    | 所属关联合同
 contract_number       | character(14)          | not null default ''::bpchar                                                  | extended | 合同编号
 client_id             | integer                | not null default 0                                                           | plain    | 客户标识
 company_id            | integer                | not null default 0                                                           | plain    | 企业标识: 关联《系统-企业主表》的`company_id`字段
 type                  | smallint               | not null default 0                                                           | plain    | 合同类型: 1 分时就业,2 集中就业
 status                | smallint               | not null default 0                                                           | plain    | 合同状态: 1 合同签约,2 合同履约,3 合同到期,4 合同作废
 status_arrange        | smallint               | not null default 0                                                           | plain    | 安置状态: 1 未安置,2 安置中,3 安置完成
 status_money          | smallint               | not null default 0                                                           | plain    | 回款状态: 1 未回款,2 部分回款,3 回款完成
 money                 | integer                | not null default 0                                                           | plain    | 合同金额: 实际金额×100
 money_received        | integer                | not null default 0                                                           | plain    | 回款金额: 实际金额×100
 number_required       | integer                | not null default 0                                                           | plain    | 需要残障者人月
 number_arranged       | integer                | not null default 0                                                           | plain    | 已安排残障者人月
 time_start            | integer                | not null default 0                                                           | plain    | 合同开始时间
 time_end              | integer                | not null default 0                                                           | plain    | 合同结束时间
 complete_time         | integer                | not null default 0                                                           | plain    | 完成时间
 comment               | character varying(512) | not null default ''::character varying                                       | extended | 备注
 reason_close          | character varying(256) | not null default ''::character varying                                       | extended | 关闭原因
 number_job            | smallint               | not null default 0                                                           | plain    | 职位数量
 number_contract_image | smallint               | not null default 0                                                           | plain    | 合同图片数量
 add_user_id           | integer                | not null default 0                                                           | plain    | 添加人
 add_time              | integer                | not null default 0                                                           | plain    | 添加时间
 add_ip                | character varying(15)  | not null default ''::character varying                                       | extended | 添加IP
 update_user_id        | integer                | not null default 0                                                           | plain    | 更新人
 update_time           | integer                | not null default 0                                                           | plain    | 修改时间
 update_ip             | character varying(15)  | not null default ''::character varying                                       | extended | 修改IP

如本文“对您有用”,欢迎随意打赏作者,让我们坚持创作!

0 打赏
评论 (1)

点击这里取消回复。

欢迎您 游客  

  • Krystal

    共和国长谷川国产车

    8个月前
    回复
hankin
smarty_hankin主题 持续为开发者免费开源!
143文章 278评论 671点赞 164477浏览

关注公众号 回复【下载主题】
加QQ群1018841266
最新评论
+195
随机文章
Typecho免插件实现文章浏览次数统计(Cookie Enabled)
3年前
h5页面跳转微信小程序页面
10个月前
五个实用的密码强度检测样式推荐(附源码下载)
9个月前
如何实现一台服务器同时运行两个php版本
9个月前
php怎么post换行
10个月前
我的作品




tags
css3 html5 javascript php postgresql qrcode typeecho wordpress wordpress主题 Yii2
Copyright © 2021 网站备案号: 浙ICP备20002401号
smarty_hankin 主题. Designed by hankin
主页
页面
  • icon图标
  • 专题
  • 建站维护
  • 留言
  • 站点地图
博主
hankin
hankin 管理员
博客模板_网站模板_HTML模板_博客模板网站免费下载
143 文章 278 评论 164477 浏览
测试
测试
赞赏作者

请通过微信、支付宝 APP 扫一扫

感谢您对作者的支持!

 支付宝 微信支付