【Gitlab】访问默认PostgreSQL数据库
本地访问PostgreSQL
gitlab有可以直接访问内部PostgreSQL的命令
sudo gitlab-rails dbconsole # 或者 sudo gitlab-psql -d gitlabhq_production
效果截图
常用SQL
# 查看用户状态 select id,name,email,state,last_sign_in_at,updated_at,last_credential_check_at,last_activity_on from users; # 查看今年活跃的用户 select id,name,email,state,last_sign_in_at,updated_at,last_credential_check_at,last_activity_on from users where TO_CHAR(NOW(), 'YYYY')=TO_CHAR(last_activity_on, 'YYYY'); # 屏蔽今年不活跃的用户 update users set state='blocked' where TO_CHAR(NOW(), 'YYYY')TO_CHAR(last_activity_on, 'YYYY');
参考资料
- 《Git/Gitlab进阶》六:远端访问gitlab默认PostgreSQL数据库
文章版权声明:除非注明,否则均为主机测评原创文章,转载或复制请以超链接形式并注明出处。