Service startup mode
# For example, if you are want to change the server's port number to 5433,# Create a file named "/etc/systemd/system/postgresql.service" containing:#. Include/lib/systemd/system/postgresql.service# [Service]# environment=pgport=
The level of separation in the SQL standard is divided into the following four categories:1. Read not submitted (READ UNCOMMITTED)2. Read submitted (committed)3. Repeatable READ (REPEATABLE Read)4. Serializable (Serializable)However, PostgreSQL was
PostgreSQL is a powerful open source relational database, this article uses Python to achieve the open source database PostgreSQL Common operations, the development process is as follows:
I. Environmental information:
1. Operating system:
RedHat
5.ModifyTable nodeLet's look at an example of a modifytable node:postgres=# explain update test_01 set id = 5 where name = 'xxx'; QUERY PLAN--------------------------------------------------------------- Update on test_01
Use PSYCOPG2 to connect PostgreSQL download Psycopg2wgethttp://initd.org/psycopg/tarballs/PSYCOPG-2-7/psycopg2-2.7.1.tar.gzunzip the installation, or use PIP to installpip install psycopg2-2.7.1.tar.gz Error:Complete output from command python setup.
The introduction recently collated some of the most common commands for PostgreSQL, for reference 1 only. Common commands:# time Word Fu timestampSelectExtract (Epoch fromDate'2018-04-11 23:59:59')); #1523404800# Timestamp to time stringSelectDate
PostgreSQL Basic Command operation:Login database:[Email protected] ~]$ psql-utestwjw-h 127.0.0.1-dpostgres-p 36985Password for user testwjw:Psql.bin (9.5.9)Type ' help ' for help.Postgres=>To switch databases:Postgres=> \c TESTDB1Connected to
MAC Installationhttp://postgresapp.com/Create and delete database usersThe corresponding commands are as follows (in the postgres=# environment):1. View the list of database users:\du2. Create a database User:create user user1 with password ‘123456‘;
This article provides a total of two methods:1. Use the Create extension commandcreate extension "uuid-OSSP" After the installation extension is successful, you can query by UUID_GENERATE_V4 () or UUID_GENERATE_V1 ()Select uuid_generate_v4 ()2. If
PostgreSQL Cheat sheetcreate DATABASEDbName;CREATE TABLE (with auto numbering integer ID)TableName (ID serial PRIMARY KEY, name varchar () UNIQUE not NULL, dateCreated timestamp DEFAULT current_timestamp);ADD a primary keyTableName ADD PRIMARY KEY
The old version is here
PHP 5.4.10 + nginx1.0.12 + PostgreSQL 9.1.3 source code compilation automated deployment Second Edition
Http://blog.csdn.net/qzier_go/article/details/7316510
This time, we added the startup script. php added GD, mbstring,
Create the same test table and data in MySQL (5.5.8) and PostgreSQL (9.0:Create Table test_gbk_char (
Id int,
Username varchar (64)
);
Insert into test_gbk_char values (1, 'qingxia '), (2, 'Man Yu'), (3, 'chu hong ');
After completing the
MySQL has a clustering function group_concat, which can concatenate fields by group ID, such
Table:ID name---------------12 B1 B
Select ID, group_concat (name) from XXX group by IDThe result is
Id group_concat (name)---------------------------1 A, B2
Installation environment: Ubuntu 8.10
1. Enter the following command
$ Sudo apt-get install postgresql
Will prompt you whether to install the latest PostgreSQL database, enter Y, the system will automatically complete the installation
In this
1. Configure the YUM Repository
Modify the original yum repository Configuration:
Vim/etc/yum. repos. d/CentOS-Base.repo
Insert a row at the end of the [base] and [updates] sections (sections:
Exclude = postgresql *
Used to cancel the installation
In the past two days, due to project reasons, I had a little bit of confidence and learned how to embed SQL into PostgreSQL in C. I wrote a small example, including connecting to the database and creating tables, for more information, see PostgreSQL8
Simple descriptionPath The code is as follows:Copy code /Var/lib/postgresql/9.3/View versionPsql -- version Create UserExample: create a yy user with the password yy, create a blogbase database, and grant all permissions to the yy user 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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service