PostgreSQL allows remote access to configuration modificationsPostgreSQL 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
--Query blocked SQL (deadlock, no SQL executed through) SELECT * from Pg_stat_activity AA, (select A.locktype,a.database,a.pid,a.mode,a.relation, B.relname from Pg_locks a joins Pg_class B on A.relation=b.oid where upper (b.relname) = '
To modify the listening parameters in the service configuration file postgresql.confThe default profile is in the Pgdata directory (except that you specify it through the parameter Config_file in the service process) [[email protected] data]$ vi
Add users other than the Postgres super user.CREATEUSER-DRSP TestUser
Create a dedicated database for usersCreatedb-o testuser TestDB
When you back up your data, you should take the Postgres super user to avoid some permission class
PostgreSQL is installed on the remote server and adding the server with Pgadmin is not always possible.Workaround:Add host all to pg_hba.conf on the remote PostgreSQL database 0.0.0.0/0 Trustand ensure that the postgresql.conf parameter is set to
I use the Postgres version of the source code for postgresql-9.3.5.The system is CentOS6.5, which is 64 bits.Read the README directly after downloadingThen read the install and follow the steps to do it.I was compiling, because there are two
Here I would like to demonstrate how to achieve the cross-table in PostgreSQL display, as to what is a cross-table, I will not say, the degree Niang go oh.The original table data is as follows:t_girl=# select * from score; Name | subject | score----
Project team to the table structure of the document, handwriting is too cumbersome to use the SLQ script to export a copy.--Queries All table field information (with table name)Select(Select Relname| | ' --' | | (select description from
Add: InsertINSERT into Products (product_no, name, price) VALUES(1, ' Cheese ', 9.99),(2, ' Bread ', 1.99),(3, ' Milk ', 2.99);You can insert more than one row of data at a time.INSERT into Products (product_no, name, Price) VALUES (1, ' Cheese ',
--For partition table constraint_exclusion This parameter needs to be configured as partition or onpostgres=# show constraint_exclusion; Constraint_exclusion----------------------Partition--Create a parent-child table for storing partition data
Quick upgrade of PostgreSQL versionWrite in frontThe PostgreSQL9.5 version supports the capability of data sharding, and for future distributed considerations, prepare to upgrade the 9.1 version of the production environment to 9.5. Data migration
Python can connect to PostgreSQL via a third-party module. More famous psycopg2 and Python3-postgresql.(a) PSYCOPG2Install under Ubuntusudo Install PYTHON3-PSYCOPG2Create a test.py fileImportPSYCOPG2#Database Connection Parametersconn =
Pgbench–helpInitialization options:-I call initialization mode-F NUM Fill factor-S NUM scale factor (related to the amount of data produced)Benchmarking Options:-C NUM Database client concurrency (default: 1)-C (Make a new connection for each
No more nonsense, rt~.First look at the data in the database:Here is the code for the Java Test class:Package Com.wl.test;import Java.sql.connection;import Java.sql.drivermanager;import java.sql.resultset;import Java.sql.resultsetmetadata;import
get table primary key name in PostgreSQL databaseFirst, to obtain the primary key information for the teacher table, as follows:SelectPg_constraint.conname asPk_name,pg_attribute.attname asColname,pg_type.typname asTypeName fromPg_constraintInner
The "Timeline" (Timeline) is a very distinctive concept for PG, which appears in the documentation of backup recovery. But the detailed explanations for this concept are very few and not very well understood, so let's take a closer look at
One: Connectors in individual dataConnector for SQL Server: + (plus)SQLite's connector:. (dot)Connector for PostgreSQL: | | OrTwo:Today, when PostgreSQL calculates the date, I turn over some information, rarely, record it!The functions and variables
Basic functions and parsing can be consulted:http://blog.csdn.net/snn1410/article/details/7741283PostgreSQL comes with to_date (text, text), To_timestamp (text, text); to_time function is not presentDemand:08:30-20:30→a20:30-08:30→bScript:SELECT(
If you simply start with 1, and the value of the increment is 1, you can write this, Serail is a special type:Add values and their results to the employee:If you want to set more detailed items, such as Start, increment, maximum, minimum, you can
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.