허긴 옛날에 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할때 문제가 발생하지 않
:: 는것 같습니다. 계속 테스트중입니다. 그럼 이만~
|