database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
ㆍPostgreSQL
Firebird
Oracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
PostgreSQL Q&A 2646 게시물 읽기
No. 2646
Re: PostgreSQL에서 유저를 생성하는 것은요...
작성자
김일형
작성일
2001-04-25 22:40
조회수
5,527

허긴 옛날에 useradd나 groupadd라는 것을 쓴적이 있는데요....

요즘엔 그 것이 없어지고 대신 psql 내에서 생성할 수 있게 되었습니다. (맞나??? /_/;;)

 

어쨌거나 PostgreSQL용 유저나 그룹을 만드는 것은 ...

일단 psql로 들어가서...

CREATE USER user_name 를 입력합니다. 아시겠지만 이것은 cygwin user name과는 전혀 상관이 없습니다.

 

그리고 그 유저의 속성(권한)을 주는 것은

USER user_name attribute 로 주시면 되는데 그 속성은

 

superuser//////////////CREATEUSER

database creatation////CREATEDB

password///////////////WITH PASSWORD 'password'

 

입니다.

 

예를들어 생성하고자하는 유저이름이 user1이라고 하면...

수퍼유저: CREATE USER user1 CREATEUSER

디비를 만들수 있는 유저: CREATE USER user1 CREATEDB

패스워드를 요구하는 유저: CREATE USER user1 WITH PASSWORD 'password'

로 하면 됩니다.

 

어차피 저는 Windog환경이 백업환경이서 필요한 유저를 그저 편안하게 수퍼유저로 만들어서 사용하는데 리눅스에서 pg_dump로 받은 것도 윈도그로 잘 restore되더군요.

 

혹 필요하실까봐 PosgreSQL Admin 해당부분 매뉴얼을 퍼넣어봅니다. 도움이 되기를...

//////////////////////////////////////////////////////////////

7.1. Database Users

Database users are conceptually completely separate from any operating system users. In practice it might be convenient to maintain a correspondence, but this is not required. Database user names are global across a database cluster installation (and not per individual database). To create a user use the CREATE USER SQL command:

 

CREATE USER name

name follows the rules for SQL identifiers: either unadorned without special characters, or double/quoted. To remove an existing user, use the analog DROP USER command.

 

For convenience, the shell scripts createuser and dropuser are wrappers around these SQL commands.

 

In order to bootstrap the database system, a freshly initialized system always contains one predefined user. This user will have the same name as the operating system user that initialized the area (and is presumably being used as the user that runs the server). Thus, often an initial user "postgres" exists. In order to create more users you have to first connect as this initial user.

 

The user name to use for a particular database connection is indicated by the client that is initiating the connection request in an application/specific fashion. For example, the psql program uses the /U command line option to indicate the user to connect as. The set of database users a given client connection may connect as is determined by the client authentication setup, as explained in Chapter 4. (Thus, a client is not necessarily limited to connect as the user with the same name as its operating system user in the same way a person is not constrained in its login name by her real name.)

 

7.1.1. User attributes

A database user may have a number of attributes that define its privileges and interact with the client authentication system.

 

 

superuser

A database superuser bypasses all permission checks. Also, only a superuser can create new users. To create a database superuser, use CREATE USER name CREATEUSER.

 

database creation

A user must be explicitly given permission to create databases (except for superusers, since those bypass all permission checks). To create such a user, use CREATE USER name CREATEDB.

 

password

A password is only significant if password authentication is used for client authentication. Database passwords a separate from any operating system passwords. Specify a password upon user creating as in CREATE USER name WITH PASSWORD 'string'.

 

See the reference pages for CREATE USER and ALTER USER for details.

/////////////////////////////////////////////////////////////////////////////

 

그럼 즐겁게 DB를 디비십시요. 물러갑니다.

 

김일형.

 

 

 

>>김진곤 님께서 쓰시길<<

 

:: 윈도우 컴퓨터관리자로 드러가서 postgres, ... 기타의 임포트할 pg_dump의 유저아이디를 등록하고 이

:: 넘들을 administrator그룹으로 지정했습니다. 그리고 다시 cygwin을 깔면 이것들이 cygwin에 잡힙니다.

:: 따로 useradd나 groupadd할 방법이 없더군여..이렇게 했을때 비로서 pg_dump할때 문제가 발생하지 않

:: 는것 같습니다. 계속 테스트중입니다. 그럼 이만~

[Top]
No.
제목
작성자
작성일
조회
2654안녕하세요, PostgreSQL을 운영하게된 김일형입니다.
김일형
2001-04-28
4422
2655┕>Re: 안녕하세요, PostgreSQL을 운영하게된 김일형입니다.
정재익
2001-04-29 03:00:51
4610
2651[질문] 알파컴에서 postgresql 을 어케 설치해야 하나여??
박기정
2001-04-26
3820
2652┕>Re: [질문] 알파컴에서 postgresql 을 어케 설치해야 하나여??
정재익
2001-04-26 19:14:42
3877
2644안녕하세요
silver
2001-04-25
3914
2645┕>Re: 안녕하세요
정재익
2001-04-25 18:50:12
3735
2640윈도우용 pgsql의 초기 user는 무엇인지요?
서종근
2001-04-25
4508
2641┕>Re: 윈도우용 pgsql의 초기 user는 무엇인지요?
김일형
2001-04-25 10:22:28
4473
2642 ┕>Re: Re: 윈도우용 pgsql의 초기 user는 무엇인지요?
서종근
2001-04-25 10:30:03
4037
2647  ┕>Re: Cygwin이요? ......
김일형
2001-04-25 23:29:29
4555
2643 ┕>Re: Re: 바로 그것이 안되더군여~ 그래서 꽁수로 이렇게 했습니다. :-)
김진곤
2001-04-25 10:34:24
4336
2646  ┕>Re: PostgreSQL에서 유저를 생성하는 것은요...
김일형
2001-04-25 22:40:27
5527
2635Linux상의 PostgresSQL에 WinCE로의 접근... ㅠ.ㅠ
이태웅
2001-04-24
4724
2648┕>Re: Linux상의 PostgresSQL에 WinCE로의 접근... ㅠ.ㅠ
정재익
2001-04-26 02:57:08
4373
2634조인&amp;서브쿼리 잘모르겠군요 알려주세요
김재청
2001-04-24
4263
2636┕>Re: 조인&amp;서브쿼리 잘모르겠군요 알려주세요
정재익
2001-04-24 18:36:24
4659
2650 ┕>Re: 7.1에서 가능한 구분으로 바꾸면...
김상기
2001-04-26 05:07:44
4367
2658  ┕>Re: Re: 7.1에서 가능한 구분으로 바꾸면...
정재익
2001-04-30 00:36:11
4398
2628다들 아시겠지만 outer join 입니다.
이승현
2001-04-23
4599
2633┕>Re: 다들 아시겠지만 outer join 입니다.
fith
2001-04-24 13:57:37
4791
2637 ┕>Re: Re: 다들 아시겠지만 outer join 입니다.
정재익
2001-04-25 02:09:48
5885
2638  ┕>Re: Re: Re: 다들 아시겠지만 outer join 입니다.
fith
2001-04-25 02:38:09
4572
2649  ┕>Re: 7.1 에서 지원합니다.
김상기
2001-04-26 05:01:39
4573
2653   ┕>Re: Re: 7.1 에서 지원합니다.
정재익
2001-04-26 19:40:31
4891
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.019초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다