PostgreSQL has a very useful function, partition table, or partitioning. When the record of a table is very much, or even more, we actually need to split him into a child table. A huge table, like a fruit warehouse stacked with countless apple
It has been a long time and has been reinitialized several times.
When installed, command: Pkg search PostgreSQL. A lot of bags, select the latest 9.4 installation server, will install the client together. There will be a lot of text prompts after
1. Use of explainThe explain command can view the execution plan, as already described in the previous blog. This method is our most important debugging tool.2. Update the statistics used in the execution plan in a timely manner Since statistics are
Because of a project requirement, you need to install PostgreSQL, and the installation files for. exe are downloaded to run.
It was a smooth start. Install to the end, initialize the database when there is a bloody dialog box (here to draw a circle
Fedora
User
To the operation of the database, first transfer to Postgres user
The first time you want to set a password
sudo passwd postgres
Switch to this user
Su-postgres
Database initialization
The first time to do
The view log finds the following error message:%t log:could not receive the data from Client:an operation were attempted on something this is not a socket.According to the error, found the answer on HP's official website (should be win's question,
1.int Pack StringSelect CAST (1234 as text)Select to_char (1234, '9 ')2.string Turn intCast (asNUMERIC)--5 attached: PostgreSQL type conversion function
Function
Return Type
Description
Example
Gao Zhangyuan Visions (hiloves)Blog: http://www.cnblogs.com/hiloves/Reprint please retain this information Recently tried PostgreSQL 9.04 to share some of the pg_hba.conf configuration tips. Pg_hba.conf is a client authentication profile that
pg>9.2postgres=# SELECT Blocked_locks.pid as Blocked_pid,postgres-# Blocked_activity.usename as Blocked_user,postgres-# Blocking_locks.pid as Blocking_pid,postgres-# Blocking_activity.usename as Blocking_user,postgres-# Blocked_activity.query as
--The following description does not remember where it was copied?!Table partitioning is the logical separation of a large table into physical multiple small chunks, table partitioning provides several benefits:1. Some types of query performance can
1. Useful LinksPostgreSQL Common small functionssome string manipulation functions of the PostgreSQL databasefunction called in PostgreSQL functionPostgreSQL Learning Manual (Functions and Operators )A simple way to get started with PostgreSQL
CREATE AGGREGATE Rbitmap_union2 (rbitmap) ( sfunc = myfunction, stype = MyType, finalfunc = myfunction_final );When you write an aggregate function, the same function is called repeatedly for each row, and if the data to be processed is
Today, the interception function is needed to deal with the redundancy of database field content that was generated by a bug.I looked through the Internet and found this string function position.POSITION (substr in str)POSITION (substr in str) are a
Index expansion, mainly for B-treeSeveral sources of index bloat:After a large number of deletions, the index pages are sparse, which reduces the efficiency of indexing;PG9.0 the previous version, vacuum full will also cause the index page
When the PostgreSQL server process down is detected, the running state is no action# more Pg_server_check.sh#!/bin/shExport Path=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/binPrefix=/etc/init.ddaemon= "$prefix/postgresql"Runn_str=
1, resolve cannot connect remote PostgreSQL:PostgreSQL by default, remote Access does not succeed, and if you need to allow remote access, you need to modify two configuration files, as described below:1.postgresql.confSet the Listen_addresses key
Import the entire databasePsql-u postgres (user name) database name (default is the same as user name)
Export the entire databasePg_dump-h localhost-u postgres (user name) database name (default is the same as user name) >/data/dum.sql
PostgreSQL region settingsPostgreSQL region settings
For Chinese users, we recommend that you set the encoding to UTF8 unconditionally in PostgreSQL. for simplified and unified regions (loacle), we recommend that you set the encoding to C, however,
1. Use EXPLAIN:PostgreSQL generates a query plan for each query, because selecting the correct query path has a critical impact on performance. PostgreSQL itself contains a scheduler for optimal planning. We can use the EXPLAIN command to view the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.