Statement:Postgres-version 9.2.5* Specific installation methods refer to the following link:1. http://blog.scimpr.com/2014/08/11/ubuntu12-04%E3%81%A7postgresql%E3%81%AE%E5%85%A8%E6%96%87%E6%A4%9C%E7%B4% a2%e3%80%9ctextsearch_ja/* Summary of problems encountered during installation:1. The "Make use_pgxs=1" Command error occurred when the link operation was performedTip: "Pgxs.mk File not found" error, reason, missing reference rpm package.Execution: Yum Install
process them separately according to the various commands of the client.The client initiates the request, and the PG server initiates a postgres access process for that request, which establishes a connection for that client through access. This postgres access process enters an infinite loop, waits for the client to request and pass the service for it until the process terminates, connecting the fracture.
Label:Recently the company requested to back up the database, so we looked up the comparative information. Don't say much nonsense, into the subject. Objective: To regularly back up the Postgres database under Ubuntu, and to pack and upload to the designated FTP server. After finding the information, the workaround: ① Write a backup database, package compression, upload the specified FTP script. ② adds the script to the Ubuntu scheduled Tasks crontab.
Label:1. Switch to Postgres user;2. Enter: Psql, enter the client psql of PostgreSQL;3.\l View all the current databases;4.psql Database1 connected to database1 this database;5. \dt View all the tables of the currently connected database (DATABASE1);6. \d Table1 View the table structure of table table1;Also: Modify a user's password in ubuntu:1. Switch to the root account;2. passwd account name;3. Follow the instructions, enter a new password, complet
Label:Excerpt from: http://www.cnblogs.com/yjf512/p/4402096.html The view in Postgres scans the sub-table when it is queried, while materialized views actually save the data in a single table. Materialized views are something that is only after 9.3. Create a View CREATE OR REPLACE VIEW student_view asselect *from
student
left JOIN teacher
on= teacher.id; Create a materialized view CREATE VIEW student_view_m asselect *from
stud
1. Save Excel as a CSV2. Open CSV format with TXT3. Encoded in UTF-8 format, save as Blacklist20141231.csv4. Create a tableCreate table backlist_20141231 (date varchar (20), mobile number nvarchar (20), channel nvarchar (50));5. Using the Copy command, copy backlist_20141231 from ' D:/blacklist20141231.csv ' delimiter as ', ' csv quote as ';This error, is not carefully caused, from ' D:/blacklist20141231.cs ' should be from ' d:/blacklist20141231.csv '; change it.6. Now the encoding format or GB
Tags: Linux shell postgresIn the work often to develop and test import and export some test database, so wrote a script for easy operation.The company is currently using the postgres9.3 database.#!/bin/bash #定义一些变量和操作命令 dbs= "DB1NBSP;DB2NBSP;DB3NBSP;DB4" Expdb_cmd=/usr/pgsql-9.3/bin/pg_dump DBCMD=/usr/ Pgsql-9.3/bin/psql dbuser=postgres dbsvr=mydbhost1 #导出数据库 functionexportdb () {read-p " inputdatabaseusernametoexport: "srcdb read-p" inputexportpath:
After postgres8.3, the default transitions between field data are canceled. If a data transformation is required, in the Postgres database, we can use "::" To convert the field data into a type. The actual "::" is called by the cast function. exactly what fields can be converted between data? This problem can be answered only by studying the cast function. The information of the cast function is managed in the System Pg_cast table. through the query
Data conversion in the S database and postgres Data Conversion
After s8.3, the default conversion between field data is canceled. If you need to perform data transformation, you can use ":" in the S database to convert the field data type. Actually, ":" is called.CAST function.Which fields can be converted into one another?
You only need to study the cast function to obtain the answer to this question. The cast function information is managed in the
with SQL commands
\? For help with Psql commands
\g or terminate with semicolon to execute query
\q to quit
Zwcdb=>
Create a table[Plain]View Plaincopyprint?
[Email protected] data]$ psql-u zhongwc-d zwcdb-h 192.168.1.203-p 1521
Password for user zhongwc:
Psql (9.2.2)
Type ' help ' for help.
Zwcdb=> CREATE TABLE T_ZHONGWC (PID integer,pname varchar (+), constraint ZHONGWC_PID_PK primary key (PID));
Notice:create table/primary KEY would CREATE implicit index "ZHONGWC_PI
CREATE USER backup_user with ENCRYPTED PASSWORD ' qux94874 '; GRANT CONNECT on DATABASE foo_db to Backup_user; GRANT CONNECT on the DATABASE bar_db to backup_user;\c foogrant USAGE on the SCHEMA public to Backup_user; GRANT SELECT on all sequences in the SCHEMA public to Backup_user; GRANT SELECT on all TABLES the schema public to backup_user;\c Bargrant USAGE on the schema public to Backup_user; GRANT SELECT on all sequences in the SCHEMA public to Backup_user; GRANT SELECT on all TABLES in the
Aggregate functions do not need to appear in group. However, for a direct select field, Postgres requires the group by field. Some databases do not need this field, such as SQL lite.
2. Postgres's replacement for the decode function in Oracle: case when .....
3. Type values such as flag are directly stored as int in dB, and the bitwise AND operator of S can be directly calculated.
4. Count (expr) If expr is a Boolean value, count will be misused.
Inc
Mysql, sqlsever, oracle, redis, mongo, postgres and other database backup and recovery commands, sqlseverredis
The following is a simple example of how to back up and restore each database. For more detailed parameters and configurations, refer to relevant information.
I. mysql:
Parameter description:
$ User
$ Password
$ Targethost
$ Port
$ Charset
$ Dbname
$ Table
$ Filename
User Name
Password
Ip (localho
In Linux, JSP construction (Tomcat4 + jdk + S) -- Linux general technology-Linux programming and kernel information. The following is a detailed description. Environment: RedHat as3
Jdk installation path:/usr/java/jdk
Tomcat installation path:/
Function
Return type
Description
Example
To_char(Timestamp,Text)
Text
Converts a timestamp to a string.
To_char (current_timestamp, 'hh12: MI: ss ')
To_char(Interval,Text)
Text
Convert the time interval
Actually, ":" Calls the CAST function. Which fields can be converted into one another?You only need to study the cast function to obtain the answer to this question. The cast function information is managed in the pg_cast table of the system.The
I. Type conversionPostgres type conversion: Usually: used for type conversion, timestamp to date is used moreSelect now (): DateSelect now (): varcharExample 1: varchar of a date is calculated as date.Select '2017-11-15 16:15:56. 2012 + 08':
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.