설문조사
PostgreSQL/PPAS 관련 듣고 싶은 교육은


총 게시물 73건, 최근 0 건
   

psql 의 내부 명령어 - 상편

글쓴이 : PostgresDBA 날짜 : 2012-12-15 (토) 00:32 조회 : 8375
[postgres@olmaster:~/oradba]$ psql -d scottdb -U scott -W
Password for user scott: 
Null display is "NULL".
Timing is on.
Pager is always used.
psql (9.2.1)
Type "help" for help.

scott@[local]:5432 scottdb#SQL> \copyright          -- 라이센스 출력
PostgreSQL Database Management System
(formerly known as Postgres, then as Postgres95)

Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group

Portions Copyright (c) 1994, The Regents of the University of California

Permission to use, copy, modify, and distribute this software and its
documentation for any purpose, without fee, and without a written agreement
is hereby granted, provided that the above copyright notice and this
paragraph and the following two paragraphs appear in all copies.

IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

scott@[local]:5432 scottdb#SQL> \dt            -- 테이블 목록 출력
         List of relations
 Schema |   Name   | Type  | Owner 
--------+----------+-------+-------
 public | bonus    | table | scott
 public | dept     | table | scott
 public | dummy    | table | scott
 public | emp      | table | scott
 public | salgrade | table | scott
 public | test     | table | scott
(6 rows)

scott@[local]:5432 scottdb#SQL> \di           -- 인덱스 목록 출력
             List of relations
 Schema |   Name    | Type  | Owner | Table 
--------+-----------+-------+-------+-------
 public | dept_pkey | index | scott | dept
 public | emp_pkey  | index | scott | emp
(2 rows)

scott@[local]:5432 scottdb#SQL> \ds        -- 시퀀스 목록 출력
No relations found.
scott@[local]:5432 scottdb#SQL> \dv         -- 뷰 목록 출력
No relations found.
scott@[local]:5432 scottdb#SQL> \da         -- 집합통계함수 목록 출력
                     List of aggregate functions
 Schema | Name | Result data type | Argument data types | Description 
--------+------+------------------+---------------------+-------------
(0 rows)

scott@[local]:5432 scottdb#SQL> \df          -- 함수 목록 출력
                       List of functions
 Schema | Name | Result data type | Argument data types | Type 
--------+------+------------------+---------------------+------
(0 rows)

scott@[local]:5432 scottdb#SQL> \do       -- 연산자 목록 출력
                             List of operators
 Schema | Name | Left arg type | Right arg type | Result type | Description 
--------+------+---------------+----------------+-------------+-------------
(0 rows)

scott@[local]:5432 scottdb#SQL> \dT            -- 자료형 목록 출력
     List of data types 
 Schema | Name | Description 
--------+------+-------------
(0 rows)

scott@[local]:5432 scottdb#SQL> \dp           -- 권한 목록 출력
                            Access privileges
 Schema |   Name   | Type  | Access privileges | Column access privileges 
--------+----------+-------+-------------------+--------------------------
 public | bonus    | table |                   | 
 public | dept     | table |                   | 
 public | dummy    | table |                   | 
 public | emp      | table |                   | 
 public | salgrade | table |                   | 
 public | test     | table |                   | 
(6 rows)

scott@[local]:5432 scottdb#SQL> \dl             -- 객체 목록 출력
      Large objects 
 ID | Owner | Description 
----+-------+-------------
(0 rows)


scott@[local]:5432 scottdb#SQL> \dS            -- 시스템 테이블 목록 출력
                        List of relations
   Schema   |              Name               | Type  |  Owner   
------------+---------------------------------+-------+----------
 pg_catalog | pg_aggregate                    | table | postgres
 pg_catalog | pg_am                           | table | postgres
 pg_catalog | pg_amop                         | table | postgres
 pg_catalog | pg_amproc                       | table | postgres
 pg_catalog | pg_attrdef                      | table | postgres
 pg_catalog | pg_attribute                    | table | postgres
 pg_catalog | pg_auth_members                 | table | postgres

단축어로 각종 오브젝트 내역을 살펴볼수 있네요.
오라클에서는 이런 기능이 없네요.
[이 게시물은 PostgresDBA님에 의해 2012-12-15 00:41:56 SQL에서 이동 됨]

   

postgresdba.com