Skip to content

Instantly share code, notes, and snippets.

@gabtastic
Last active September 29, 2015 18:46
Show Gist options
  • Save gabtastic/0f72bd6a84376acf4b4c to your computer and use it in GitHub Desktop.
Save gabtastic/0f72bd6a84376acf4b4c to your computer and use it in GitHub Desktop.
$ ssh [email protected]
Last login: Tue Sep 29 14:10:28 2015 from 173.176.236.193
[root@gitlab-c7 ~]# su gitlab-psql
sh-4.2$ /opt/gitlab/embedded/bin/psql --list
                                         List of databases
         Name         |    Owner    | Encoding | Collate | Ctype |        Access privileges
----------------------+-------------+----------+---------+-------+---------------------------------
 gitlab_ci_production | gitlab_ci   | UTF8     | C       | C     |
 gitlabhq_production  | gitlab      | UTF8     | C       | C     |
 postgres             | gitlab-psql | UTF8     | C       | C     |
 template0            | gitlab-psql | UTF8     | C       | C     | =c/"gitlab-psql"               +
                      |             |          |         |       | "gitlab-psql"=CTc/"gitlab-psql"
 template1            | gitlab-psql | UTF8     | C       | C     | =c/"gitlab-psql"               +
                      |             |          |         |       | "gitlab-psql"=CTc/"gitlab-psql"
(5 rows)

sh-4.2$ /opt/gitlab/embedded/bin/psql gitlabhq_production;
could not change directory to "/root"
psql (9.2.8)
Type "help" for help.

gitlabhq_production=# \dt
               List of relations
 Schema |         Name         | Type  | Owner
--------+----------------------+-------+--------
 public | broadcast_messages   | table | gitlab
 public | deploy_keys_projects | table | gitlab
 public | emails               | table | gitlab
 public | events               | table | gitlab
 public | forked_project_links | table | gitlab
 public | identities           | table | gitlab
 public | issues               | table | gitlab
 public | keys                 | table | gitlab
 public | label_links          | table | gitlab
 public | labels               | table | gitlab
 public | members              | table | gitlab
 public | merge_request_diffs  | table | gitlab
 public | merge_requests       | table | gitlab
 public | milestones           | table | gitlab
 public | namespaces           | table | gitlab
 public | notes                | table | gitlab
 public | projects             | table | gitlab
 public | protected_branches   | table | gitlab
 public | schema_migrations    | table | gitlab
 public | services             | table | gitlab
 public | snippets             | table | gitlab
 public | taggings             | table | gitlab
 public | tags                 | table | gitlab
 public | users                | table | gitlab
 public | users_star_projects  | table | gitlab
 public | web_hooks            | table | gitlab
(26 rows)

gitlabhq_production=# \d+ issues
                                                         Table "public.issues"
    Column    |           Type           |                      Modifiers                      | Storage  | Stats target | Description
--------------+--------------------------+-----------------------------------------------------+----------+--------------+-------------
 id           | integer                  | not null default nextval('issues_id_seq'::regclass) | plain    |              |
 title        | character varying(510)   | default NULL::character varying                     | extended |              |
 assignee_id  | integer                  |                                                     | plain    |              |
 author_id    | integer                  |                                                     | plain    |              |
 project_id   | integer                  |                                                     | plain    |              |
 created_at   | timestamp with time zone | not null                                            | plain    |              |
 updated_at   | timestamp with time zone | not null                                            | plain    |              |
 position     | integer                  | default 0                                           | plain    |              |
 branch_name  | character varying(510)   | default NULL::character varying                     | extended |              |
 description  | text                     |                                                     | extended |              |
 milestone_id | integer                  |                                                     | plain    |              |
 state        | character varying(510)   | default NULL::character varying                     | extended |              |
 iid          | integer                  |                                                     | plain    |              |
Indexes:
    "issues_pkey" PRIMARY KEY, btree (id)
    "issues_project_id_iid_key" UNIQUE CONSTRAINT, btree (project_id, iid)
Has OIDs: no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment