There are two methods of migrating:(1) Reinitialize the PostgreSQL database, specify a new data path at initialization---PGDATA, and then restore the original database backup in the new environment. But this method is a little cumbersome.(2) Copy
PostgreSQL is easy to install online, but in many cases the server is not networked and needs to be installed offline. Here are the steps to install offline:1. First enter the official website:https://www.postgresql.org/2. Click Download3. Select
The top level of its logical structure is the instance, where multiple databases can be created in the instance, and multiple schemas may be created in each database, and multiple objects can be created under each schema. Objects include tables,
Original: 77978316The first step is to create the sequence: The generic sequence name consists of the data table name + primary key field +SEQ (typically the primary key field is the self-increment field), as the following table is named
Import sql-w Specify the database namePsql- H 192.168.20.123-p 5432-w Warehouse Export a table sql-w specify the database nameSyntax: #-H Address-p Port-t specifies table-n specifies SCHEMA-FP output a plain text SQL file-e specified character
Create user and specify password:CREATE USER readonly with ENCRYPTED PASSWORD ' Ropass ';Set user default transaction read-only:Alter user readonly set Default_transaction_read_only=on;Give the user permission to view all tables in public mode:GRANT
PostgreSQL Learning Site
Create user
12345
Sudo-s-U postgresPsqlpostgres# CREATE USER xxxx1 with PASSWORD ' xxxx ';postgres# CREATE DATABASE xxxx2;postgres# GRANT all privileges on the DATABASE xxxx2 to xxxx1;
In MySQL, you only need to perform:TRUNCATE table_name;, the data will be the case, and the self-increment ID will be changed back to 0;But the PostgreSQL is slightly different, because the self-increment ID of PostgreSQL is done by sequence
Previously found in MySQL, when the number of columns is particularly high, under the Linux command line, the display is not very friendly,You can then do this by changing the ";" At the end of SQL to "\g".Better display of MySQL query results at
1. Environmental statementCentOS7.2postgresql10.42. Download the official address of PostgreSQL https://www.postgresql.org/ftp/source/In the download list, select version 10.4 as required, such as:After entering the subdirectory, you can see the
Recently the intern used the. Netcore to write the background app before using Java rewrite.Specifies that the PostgreSQL database be used with the Spring boot framework. has been accustomed to the XML-based spring app, also no use of PostgreSQL,
The previous distributed compilation and releaseProgramIt uses sbcl + clsql + MySQL and is basically normal. In this statistical back-end, the database switched to ipvs and continued to use clsql to connect. The result was a very crazy problem:
Vacuum full locks the table and is very inefficient. In practice, vacuum cannot be used to narrow down the pg_class, resulting in a long downtime.In fact, the simplest way to implement vacuum full is to copy a table again, Create Table B as select *
Call dbpermission to determine permissions:
First, the program will call getdenyrule and getacceptrule of permission to obtain blocked or accepted rules.
Then, you can determine whether you have permissions one by one.
Currently, dbpermission
C Language Interface
C is a common language for connecting to databases. Many databases are written in C. This language is efficient and flexible, so if you want to write a client interface, whether it only contains the console or GUI, and do not
In the previous article, I talked about the xlog header. Today I will explain the record part in detail. I hope these two articles will help the xlog Study of postgresql:
From: http://blog.csdn.net/lengzijian/article/details/7840332
First, let's
Pgpool-II (http://pgpool.projects.postgresql.org/) Is an intermediateWork in multiple PostgreSQL serversServicesAnd PostgreSQL dataLibraryCustomerUserTerminal.
We can look at pgpool as an intermediary.It provides the following functions:
Name
PREPARE -- create a prepared Query
Synopsis
PREPARE plan_name [ (datatype [, ...] ) ] AS statementDescription
PREPARECreate a prepared query. A Prepared query is a server-side object that can be used to optimize performance. In
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.