Original address: http://www.2cto.com/database/201312/267218.html
Pgadmin III Introduction
To open a connection to a service, select the desired service in the tree, double-click it, or use the Connect on the Tools menu.
A Main form
In the main window, the structure of the database is displayed. You can create new objects, delete and edit existing objects, and if you are using permissions that are currently connected to a database user, display all servers on the left side of the main window and the tree of objects they contain.
The top right shows the details of the object currently selected in the tree. The bottom right contains a SQL script.
two. Navigation Menu Function
1. File menu
In the File menu, you can change the connection password when you click a node under the server root node.
Click the options (O) button You can adjust some properties, such as: User interface language, preferences, SQL syntax highlighting color and so on. The postgresql.conf, pg_hba.conf, pgpass.conf files can also be edited in the menu. To optimize the performance of PostgreSQL. Add the server you want, and use "Add Server" in the menu. You can select a group when the new server is registered. When the OK button is pressed, a new group appears and the server is included. This folder-like feature can be used to group servers by type or purpose.
As shown in the following:
2. Edit Menu
Click on the Edit menu to perform the appropriate operations on the database and objects. (Right-click the object that corresponds to all relevant features in the edit)
Start the Psql console and connect to the database selected in Pgadmin. You can enter the appropriate command.
Used to adjust the display of the page view. For example: Open and close the SQL window.
In the object tree at the left of the main form, click the highlight of the menu in the different nodes tool to do the corresponding action. (The right-click action for the selected object can be the same effect, but the tool opens the query tool).
can view Help documents
three. Introduction to Toolbars
1 2 3 4 5 6 7 8 9 10 11 12
Icon 1. Create a new server
Icon 2. Refreshes the selected object (the right-click refresh of the selected object can also be implemented)
Icon 3. Displays the properties of the selected object (the right-click refresh of the selected object can also be implemented)
Icon 4. Create and select objects of the same type as objects. For example: Select a database table click on the icon to create a new database table, select the function click on the icon to create a new function.
Icon 5. Deletes the currently selected object.
Icon 6. This icon is one of the most important tools of PGADMINIII (detailed later).
Icon 7. View the selected object data. For example, selecting a database table clicking on the icon displays the data in the table.
Icon 8. The input criteria filters the data for the selected object.
Icon 9. The database and data tables can be maintained.
Icon 10. Execute the last used plug-in. such as the plugin psql in the navigation bar.
Icon 11. Displays guidance suggestions for the current object.
Icon 12. Displays help for SQL instructions.
Detailed description of the function of icon 6 is opened as shown in
Enter the appropriate SQL statement in the SQL editor, click the green arrow to execute the SQL statement, or you can select partial execution. (Execute SQL statement shortcut key F5). You can view the corresponding results in the output window below. Click menu Query Interpretation (shortcut key Shift+f7) analysis will appear corresponding to the explanatory diagram similar to graphical query. You can also save the data.
Graphical query constructors allow you to build queries with your mouse: Drag data tables and views from the navigator into the graphics panel, add connections between them, click the check box to add fields, append conditions, and set the order of results.
(3). You can drag a file from the desktop to the query text box and then release it, and the query tool will open the file automatically. In the top right, in the connection drop-down box, display the server color in a box click the drop-down menu to create a new server connection.
Query statement history is automatically saved in a file, the content of this file is displayed in the drop-down box above the query text box, and also has the ability to delete the selected query or all queries in the file.
If you want to replace the current query with a previously saved query, you can select it in the drop-down box.
Four. Database and table creation
1. Creation of the database. Select Database + Right button = new database
Generally choose the default is possible.
In the tree directory, the system objects and system tables are stored.
The system default mode is public and can be built in other modes. Only the appropriate permissions can see the contents of the mode.
2. The creation of the table. Select data table and right-click-New database table (especially note that table names and field names are lowercase when you create a new table, because it is case sensitive.) Uppercase or lowercase mixed with double quotes).
3. Changes to the table
Right-click on the table you want to work with select New object to do a corresponding error on the table. For example: New fields and so on.
Right-click the table you want to manipulate to see all the rows of data, you can view the table's data, and you can make the appropriate modifications. (Note: To modify this table in a tabular format, the table must have a primary key).
Right-click the field in the table to filter, sort, and so on. Make the operation more quick and convenient.
Allows you to edit the SQL tab when modifying a table, for example: When appending a new field with default values and non-null constraints, Pgadmin cannot be completed in an action because the field needs to be added first, then the values of all existing records are modified, and then the non-null constraints are set. Now, you can use the UI once to complete. You can use a statement like this:
Next, click on the "Read Only" check box to enter the direct edit mode, update the statement and execute.
Five Backup and recovery of the database.
Right-Select the database you want to back up. Pgadmin can be used to back up the postgres into three formats, Compress,tar,plain. Compress the smallest, is compressed, but inside garbled. The file ends in. Backup tar is large, a few lines are garbled, the next part is the data, the format does not look very neat. The file ends with. backup. Plain is also very large, but not garbled, inside the content is very neat, divided into two parts, the upper part is related to the property and data table information. The next section is full of data. Fields are delimited by a tab.
However, only compress and tar files can be recovered when recovering. End With. Backup!
It's better to delete the library when it recovers! Then create a new empty library to recover from! Do not restore on the basis of the original library! There will be data loss! New tables will be added, but new data from the old table won't be added.
This is a record of my installation process, for the sake of simplicity, only the necessary steps are listed. As the Phppgadmin installation is relatively simple, here is not said, only the installation of pgadmin3. These software can be downloaded on the official website (http://www.postgresql.org/download/)
Download PostgreSQL8.1.4 (currently the latest stable version)
User name can be easily
Initializing the database
Start the database
$/usr/local/pgsql/bin/postmaster-d/usr/local/pgsql/data >logfile 2>&1 &
Install the Administrative tools.
Download wxwidgets-2.6.3.tar.gz (based on pgadmin version select pgadmin3-1.4.3 Support wxwidgets-2.6.x only)
Note that when installing wxwidgets, you need to install GTK +, which is available on the system disk and requires 1.2 or more versions (Centos4.3 default is 1.2.10-33)
#tar ZVXF wxwidgets-2.6.3.tar.gz
#sudo make Install
Installing the Contrib module
#sudo make Install
After loading the wxwidget, download the latest pgadmin3-1.4.3.tar.gz
You can use the./configure--help View Help
#sudo make Install
Join in the/etc/profile
Export Pglib PGDATA PATH MANPATH
Exportld_library_path= $LD _library_path:/usr/local/pgsql/lib:/usr/local/lib
Where/usr/local/pgsql/lib is the Postgres installed directory Lib,/usr/local/lib is the wxwidgets Lib library directory (this is installed by default, can be specified during installation)
The next step is to execute the pgadmin.
This is my installation record today, organized a delegation up for later reference.
The following are references:
If you want to access the PostgreSQL database remotely via TCP/IP, you need to do both of these steps:
1. Modify the database configuration file pg_hba.conf
# "Local" is for Unix domain socketconnections only
Local all All trust
# IPV4 Local connections:
Host All 127.0.0.1/32 Trust
Host All 192.168.2.0/24 Trust
Host All 192.168.23.53/32 Trust
2. When you start PostgreSQL, add "-i" to this parameter
This allows the PostgreSQL database to be accessed via TCP/IP. The default communication port for PostgreSQL is 5432.
PGADMINIII using plots