CentOS 7 Installation PostgreSQL

1 Yum Install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm 2yuminstall postgresql94-server postgresql94-contrib3 /usr/ pgsql-9.4/bin/postgresql94-setup InitdbBoot up1 systemctl enable postgresql-9.4.

PostgreSQL Flow Account (fourth day): DDL restriction constraint

CREATE TABLE Products (Product_no Integer,Name text,Price numeric CONSTRAINT positive_price CHECK (Price > 0));CHECK returns a bool value.Foreign key referential integrity, referential integrityA FOREIGN KEY constraint specifies that the values in a

PostgreSQL Partition Table creation

Pgsql partition Table:--Main Table CREATE TABLE test (ID integer, name varchar); CREATE index idx_test_id on test using btree (ID);--Table Create Table Test_b (like test including constraints including defaults including indexes) inherits (test);

PostgreSQL table Space

postgres=# \h Create TablespaceCommand:create tablespaceDescription:define a new tablespaceSyntax:CREATE tablespace Tablespace_name[OWNER User_name]Location ' directory '[With (tablespace_option = value [, ...])]postgres=# Create tablespace tbs_data

Initial practice of PostgreSQL array type

Practical environmentDatabase: PostgreSQL 9.4; operating system: Windows To create a database that contains an array typeNote that when setting the default value (you can of course not specify a default value), declare the type of the array,

Django Settings PostgreSQL

This assumes that the PostgreSQL database is already installed.Install the dependent packages first$ sudo yum install python-devel postgresql-develIf using virtualenv, first source a bit under virtualenv. Bin/activate ", and then run$ pip install

Use of the PostgreSQL table space

First, IntroductionThe purpose of a tablespace is to allow a database administrator to define a location where other non-data directories store database objects. One of the usage scenarios is that if the machine is newly added SSD, but not enough

PostgreSQL User Operation permissions

For PostgreSQL, the Super User Postgres, which is created by default when the database is installed, is similar to the root user on Linux and has新建数据库用户:CREATE USER新建数据库:CREATE DATABASE删除数据库:DROP DATABASE删除用户:DROP USER撤销权限:REVOKE赋权:GRANTAnd so on

Issues that are applied when stored procedures (functions) are called in PostgreSQL

In PostgreSQL we tend to use select stored procedures in executing stored procedures, but if the stored procedure is called again, it cannot be used, and the perform stored procedure should be used to see the description of the official

PostgreSQL Common functions

| | string concatenationGrammarstring | | StringExample' Post ' | | ' Gresql '--Return to PostgreSQLlength () stringGrammarLength (String)ExampleLength (' Odoo ')--return 4Like pattern matchingGrammarString like patternExample' abc ' LIKE ' abc

Common commands for POSTGRESQL Getting Started

1. Command line logon DatabasePsql-u username-d dbname-h hostip-p Port2. List all databases3. Switching the database\c dbname4. List all tables in the current database5. View all fields of the specified table\d TableName6. View the basic situation

PostgreSQL Installation and configuration detailed

Installation:sudo apt-get install PostgreSQLSet PasswordSudo-u Postgres Psqlpostgres=# ALTER USER postgres with PASSWORD ' postgres ';postgres=# \qsudo passwd-d postgresSudo-u Postgres passwdChange the configuration filesudo

CentOS Installation PostgreSQL 9.4

1. Installing the PostgreSQL source# yum Install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpmThere is not much difference in the step of adding the source, mainly the source address has a certain changeExecute

PostgreSQL Foundation Finishing (i)

1. Create a database:1) Login Bin directory, createdb.exe-u Postgres-e mydb;-U indicates the login user name of this operation, if not write will take Windows login account, such as Administrator, will prompt no creation permission;2. Log in to the

Django Paper link PostgreSQL database

1. Original address: http://my.oschina.net/slhong/blog/96159Basic description before configuration: Win7 +python2.7.3+postgresql9.22+ Django1.4.3 Psycopg2-2.4.6.win32-py2.7-pg9.2.2-release Steps to use: Install Python

PostgreSQL Stored Procedures

1 stored procedures that return result sets--Drop FUNCTION getall ();CREATE or REPLACE FUNCTION getall ()RETURNS Setof users as$BODY $SELECT * from users;$BODY $Language SQL; --The SQL used here2 stored procedures that return a single value--Drop

"Subtotal" PostgreSQL implements three-dimensional expression function

Create or Replace function decode (p_condition boolean, p_fist_val text, p_last_val text) returns text as$ $declare V_ret_val Text;begin/* Function Description: Analog ternary expression (condition-value1:value2); * Parameter Description:

PostgreSQL mode creation, modification, deletion

A database contains one or more schemas, and the schema contains tables, sequences, functions, and so on, and different schemas can contain tables, sequences, functions, and so on with the same name. A pattern is essentially a namespace, just like a

PostgreSQL Remote Connection Configuration

md5

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 value in the file to "*", which is already "*"

The PostgreSQL function gets the numeric size value of multiple fields

1,Greatest (n1,n2,n3,..........) Get maximum valueTestdb= #SELECT Greatest (3,5,1,8, -, About, the, -, the, +); +---------------------------------------------------------+ | Greatest (3,5,1,8, -, About, the, -, the, +) | +--------

Total Pages: 77 1 .... 73 74 75 76 77 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.