Postgresql is an object-relational database system that has the features of Traditional commercial database systems with enhancements to be found in next-generation DBMS systems.
InstallationTo install Postgresql,run the following command in the command prompt:
sudo apt-get install postgresql
Once the installation is complete,you should configure the Postgresql server based on your needs,although the default configuration is viable.
ConfigurationBy default,connection via TCP/IP is Disabled. Postgresql supports multiple clIEnt authentication methods. By default,IDENT authentication method is used for postgres and local users. Please refer the PostgreSQL Administrator's Guide.
The following discussion assumes that you wish to enable TCP/IP connections and use the MD5 method for clIEnt authentication. Postgresql configuration files are stored in the /etc/postgresql/<version>/main
directory. For example,if you install Postgresql 8.4,the configuration files are stored in the /etc/postgresql/8.4/main
directory.
To configure IDent authentication,add entrIEs to the |
To enable TCP/IP connections,edit the file /etc/postgresql/8.4/main/postgresql.conf
Locate the line #Listen_addresses = 'localhost' and change it to:
Listen_addresses = 'localhost'
To allow other computers to connect to your Postgresql server replace 'localhost' with the IP Address of your server. |
You may also edit all other parameters,if you kNow what you are doing! For details,refer to the configuration file or to the Postgresql documentation.
Now that we can connect to our Postgresql server,the next step is to set a password for the postgres user. Run the following command at a terminal prompt to connect to the default Postgresql template database:
sudo -u postgres psql template1
The above command connects to Postgresql database template1 as user postgres. Once you connect to the Postgresql server,you will be at a sql prompt. You can run the following sql command at the psql prompt to configure the password for the user postgres.
ALTER USER postgres with encrypted password 'your_password';
After configuring the password,edit the file /etc/postgresql/8.4/main/pg_hba.conf
to use MD5 authentication with the postgres user:
local all postgres md5
Finally,you should restart the Postgresql service to initialize the new configuration. From a terminal prompt enter the following to restart Postgresql:
sudo /etc/init.d/postgresql-8.4 restart
The above configuration is not complete by any means. Please refer the PostgreSQL Administrator's Guide to configure more parameters. |
As mentioned above the Administrator's Guide is an excellent resource. The guIDe is also available in the postgresql-doc-8.4 package. Execute the following in a terminal to install the package:
sudo apt-get install postgresql-doc-8.4
To vIEw the guIDe enter file:///usr/share/doc/postgresql-doc-8.4/HTML/index.HTML into the address bar of your browser.
For general sql information see Using SQL Special Edition by Rafe Colburn.
Also,see the PostgreSQL Ubuntu Wiki page for more information.
总结以上是内存溢出为你收集整理的PostgreSQL全部内容,希望文章能够帮你解决PostgreSQL所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)