BackgroundPostgreSQL cold backup, refers to the database shutdown state of the database data files are backed up.
This backup is not practical in production, the general production environment needs to ensure that the database 7*24 hours.
A cold
First, Pg_tables:
This view provides access to useful information about each table in the database.
Name
Type
Reference
Describe
SchemaName
Name
Pg_namespace.nspname
The schema name that contains
Due to the use of the PostgreSQL database, there is no data. Had to do Google.
Finally found a solution in an English forum.
As follows:
1. Retrieves the ID of the deadlock process
Copy Code code as follows:
SELECT * from
Backgroundin my job. An automated system is required on a project using the PostgreSQL database to perform backups on a daily basis. After some research, it is decided to create a Windows batch file and add it to the Windows Planning task.The
--Timestamp to UNIX timestampSelect Now (), EXTRACT (epoch from TIMESTAMP with time ZONE ' Now "):: int as ext, EXTRACT (epoch from now ()):: int, Current_ti Mestamp,date_part (' epoch ', current_timestamp):: int--Unix timestamp to timestampSELECT
--goal: Dynamically update data in a table--the usual code.-----------------------------tablename Table Name--feildname Field an array group--feildvalue field Value Array--returnvalue return valueCreate or Replace functionf_update (tablenametext,
Lab Environment:DB is PostgreSQL version 8.2.15JDK1.8Test AQuery a SQL using JDBC: Public Static voidtest1 (string url, Properties props) {String SQL= "Select L.src_ip, l.location_id," + "sum (l.us_bytes) as Up_usage," + "sum (l.ds_bytes) as
PostgreSQL configuration file optimizationConfiguration fileThe default configuration profile is the postgresql.conf file that is saved in the/etc/postgresql/version/main directoryIf you want to see if the parameter modification takes effect, you
Turn from PostgreSQL to add various constraint syntaxes1. Add a PRIMARY keyALTER TABLE goods add primary key (SID);2. Add a foreign keyALTER TABLE orders add foreign key (goods_id) references goods (SID) on the update cascade on DELETE cascade;On
I. Tool BACKUP DataOpen a command window under Windows: Start the directory with the->cmd-> installation database and enter the bin directory;Export command: pg_dump–h localhost–u postgres–p 5432–d postgres–f "D:/test.dmp"-H: Server address;-P: Port
Because of the project, some of the information in Ubuntu needs to be recorded in the PostgreSQL database in Windows, viewing the information on the web, and finally succeeding, specifically documenting the following, which requires the following
PostgreSQL Compilation InstallationI. Introduction of PostgreSQLPostgreSQL is currently the most powerful open source database, supporting rich data types and custom types, and it provides a rich interface to easily extend its
Create a read-only account1.1 Log in with an initial account[Email protected] ~]# psql-u Postgres1.2 Creating a userpostgres=# Create role develop with login password ' 123456 ';CREATE ROLEpostgres=# select Usename from
First, download the driverHttps://jdbc.postgresql.org/download.htmlView the version of the native JDK in cmd, and then download the corresponding jar in the page aboveSecond, set environment variablesJava_home, PATH, CLASSPATHSystem
Import the entire databasePsql-u postgres (user name) database name (default is the same as user name)
Export the entire databasePg_dump-h localhost-u postgres (user name) database name (default is the same as user name) >/data/dum.sql
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
PostgreSql database artifact FDWIntroduction to FDW of PGHttps://wiki.postgresql.org/wiki/Foreign_data_wrappersThis article briefly introduces the "transparent gateway" from PG to Mysql and PG to Hive ^_^First, install PGInstall the PostgreSQL
JDBC-ODBC configuration or use DataSource to configure sqlserver although it is convenient from the link layer, but the processing of the result set is difficult to really implement the JDBC2 standard, so you want to be a little "professional, still
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