Скачать в pdf «PostgreSQL»
19.5 Summary

Extending PostgreSQL is a complicated process. This chapter has covered only the basic concepts. Refer to the Programmer’s Manual for more detailed information.

Chapter 20


This chapter covers a variety of administrative tasks. The chapter assumes PostgreSQL is installed and running. If it is not, see Appendix B.

20.1    Files

When PostgreSQL is installed, it creates files in its home directory, typically /usr/loeal/pgsql. This directory holds all the files needed by PostgreSQL in various subdirectories:

/bin PostgreSQL command-line programs, such as psql.

/data Configuration files and tables shared by all databases. For example, pg_shadow is a table shared by all databases.

/data/base A subdirectory for each database. Using the du and ls commands, administrators can display the amount of disk space used by each database, table, or index.

/doc PostgreSQL documentation.

/include Include files used by various programming languages.

/lib Libraries used by various programming languages. This subdirectory also contains files used during initialization and sample configuration files that can be copied to /data and modified.

/man PostgreSQL manual pages.

20.2    Creating Users

To create new users, you run ereateuser from an operating system prompt. Initially, only the PostgreSQL superuser, typically postgres, can create new users. Other users can be given permission to create new users and databases.

$ ereateuser demouserl

Shall the new user be allowed to create databases? (y/n) n Shall the new user be allowed to create more new users? (y/n) n

create user

$ psql test

Скачать в pdf «PostgreSQL»