PostgreSQL Installation:
The installation process under Windows
Installation media: Postgresql-9.1.3-1-windows.exe (46M), the installation process is very simple, the process is as follows:
1. Start Installation:
2, select the program installation directory:
Note: The partition that installs the PostgreSQL is preferably in NTFS format. PostgreSQL's primary task is to ensure data integrity, and fat and FAT32 file systems do not provide such reliability, and the FAT file system lacks security to ensure that the original data is not changed without authorization. In addition, the "PostgreSQL" feature used by the user to complete the table space feature is not implemented under the FAT file system.
However, in some systems, there is only one FAT partition, in which case the PostgreSQL can be installed normally, but not the initialization of the database. Once the installation is complete, the Initdb.exe program can be manually executed on the FAT partition, but it does not guarantee its security and reliability, and the creation of tablespace will fail.
3, select the data storage directory:
4. Enter the password for the database Superuser and the OS user you created
Note: The database superuser is a non-administrator account, which is to reduce the damage to the system caused by hackers exploiting defects found in PostgreSQL, so you need to set a password for the database Superuser, as shown in the following illustration, the user name of the service user that Setup automatically establishes defaults to Postgres.
5, set the service listening port, the default is 5432
6, choose the Runtime language environment
Note: Select the Run-time locale (character encoding format) of the database storage area.
When you select the locale, "default locale" will cause the installation to be incorrect, and PostgreSQL does not support GBK and GB18030 as the character set if you choose another four Chinese character sets: Chinese Traditional Hong Kong (chinese[traditional) , Kong S.A.R.), Chinese Simplified Singapore (chinese[simplified], Singapore), Chinese Traditional Taiwan (chinese[traditional), Taiwan) and Chinese Traditional Macau (chinese[ Traditional], Marco S.A.R, can cause query results and sorting effects to be incorrect. It is recommended that you select "C", that is, no area.
----I chose default Localt, the installation is correct, and we recommend that default Localt be selected.
7, installation process (2 minutes)
8. Installation Complete
After the installation is complete, you can see from the Start folder:
In the installation directory you can see:
Where data is stored in the file, log file, control file, configuration file, etc.
Uninstall-postgresql.exe is used to uninstall an installed database management system.
Several environment variables for the database are configured in the Pg_env.bat, as follows:
Second, pgadmin (elephant)
For each database management system, there are quite a number of design and management tools (visual interface management tools), some of the database manufacturer's own (generally at least one), some third-party companies developed, you can even write a simple and easy-to-use management tools. For example Oracle SQL Developer (developed by itself), Plsql Developer (developed by a third-party company), SQL Server Management Studio (developed by itself), http:// Www.oschina.net/project (open source China) Web site provides a simple and compact management tool developed by individuals or organizations.
PostgreSQL has several popular management tools, such as: Pgadmin, Navicat_pgsql, Phppgsql and so on.
Pgadmin is a design and management interface for PostgreSQL databases that can be run on most operating systems. The software is written in C + + with excellent performance.
Pgadmin is released separately from the Postgres and can be downloaded from the www.pgadmin.org. At present, install a fully functional PostgreSQL database, with this management tool.
Open Pgadmin to see the properties of the local database installed in the first section, as shown in the following illustration:
As can be seen in the diagram, the newly installed PostgreSQL database management system has a database postgres, two tablespaces have been built: Pg_default, Pg_global.
Initdb.exe initializes the two default Tablespace Pg_global, Pg_default. The database default Tablespace pg_default is used to store the default space for system directory objects, user tables, User table index, and temporary tables, temporary table index, and internal temporary tables, which is the default tablespace for the template database Template0 and template1. Initdb.exe initializes the two default Tablespace Pg_global, Pg_default. The database default Tablespace Pg_global is the default space used to store the shared system directory.
Pg_default for PostgreSQL can also be understood as the system tablespace, which corresponds to the physical location of the $PGDATA/base directory.
Some data dictionaries and data dictionary views of the Postgers database can be seen under PostgreSQL (Pg_catalog).
Create a new server connection to connect to the PostgreSQL database on a remote Linux server (assuming that the PostgreSQL database management system is already installed on remote Linux):
Get the database properties as shown in the following illustration:
As can be seen in the diagram, the remote database management system has two databases: Postgres, Cpost, four tablespaces: Pg_default, Pg_global, Pis_data, Pis_index.
Third, Pgsql
For each database management system, a command-line management interface is provided, such as the isql and osql of Oracle's SQLPLUS,SQL server.
All the functions that can be realized with the graphical management interface can be implemented in principle through command line interface commands. Both have advantages and disadvantages, different use of the situation. The graphical management interface is commonly used under Windows, because there are often command line tools embedded in the image management interface, and in Unix and Linux, of course, the command-line tools are commonly used, except for the reason that we use the character interface mainly under UNIX. And because most of the time we can only operate remotely by using the Telnet or SSH tool, we can only use the command line.
Open the SQL Shell (Pgsql) from the start directory, which is E:\PostgreSQL\bin\psql.exe. Enter the password to get the following diagram interface:
You can also start pgsql directly from the command line after modifying the system environment variable path (adding the Postgresql\bin directory).
At this point, PostgreSQL is installed under Windows.
-->