Label:In the process of reading any questions, welcome to communicate togetherEmail:[email protected]qq:1494713801One, PostgreSQL time type conversion--The time type is converted into character type select To_char (current_date, ' yyyy/mm/dd '); select To_char (current_date, ' yyyy-mm-dd '); select To_char (now (), ' yyyy-mm-dd '); select To_char (Current_timestamp, ' HH:MI:SS '); select To_char (Current_timestamp, ' yyyy/ Mm/dd HH:MI:SS '); --The str
Label:Objective:Recently do data synchronization, need to get data from PostgreSQL, found that once the data is more, then the speed of reading is very slow, and memory consumption is very much GC not fall.Code Sample:In order to facilitate the explanation, the following writing the case code, from B2c_order to obtain data, this data table about 6G. Package Com.synchro;
Import java.sql.*;
/**
* Created by Qiu.li on 2015/10/16.
*
/public class Test
1. Download
To the website to download the latest PostgreSQL Studio, I downloaded pgstudio_1.2-bin. zip because there are no Tomcat in my computer.
If the computer has a good configuration of tomcat, you can download Pgstudio_1.2.zip, after decompression is a war package.
Download Address: http://www.postgresqlstudio.org/download/
2. Decompression
Unzip the compressed file to see the following directory:
3. Run
Run in Bin directory:
./catal
[Root@fnddb postgresql-9.4.0]# useradd Postgres [root@fnddb postgresql-9.4.0] # passwd postgres changing password for user postgres. New password:bad password: it is based on A dictionary word retype new Span class= "Hljs-attribute" >password: passwd:all authentication tokens updated successfully. Set up Database cluster target folder.[root@fnddb
Label:MySQL is so widely used that I have to migrate some applications from MySQL to PostgreSQL, many open source software is mysql as a database standard, and MySQL as the basis of the abstract, but the use of the process, found that MySQL has a lot of problems, So all migrated to PostgreSQL and turned to a MySQL vs. PostgreSQL article:
How to disable the deadlock process in PostgreSQL, postgresql Process
The PostgreSQL database used has no information. Google had to proceed.
Finally, a solution was found in an English forum.
As follows:
1. Retrieve the ID of the deadlock Process
Copy codeThe Code is as follows:SELECT * FROM pg_stat_activity WHERE datname = 'deadlock database id ';In the re
Processing Method for PostgreSQL database transactions in unknown state, postgresql Processing Method
Background
Database transactions are atomic operations, either successful or failed. However, from the client perspective, there may be a third State: unknown.
After the client submits a transaction (rollback, commit, prepare xact, rollback pxact, commit pxact) Request, the database receives the request and
PostgreSQL operations-Basic psql commands and postgresql operations-psql
1. Establish a database connection----------------Access PostgreSQL database: psql-h IP address-p port-U Database Name
Enter the Database Password.
2. Access the database
1. List databases: \ l2. Select Database: \ c Database Name3. view all tables in a database: \ dt4. Switch Database
Postgresql fatal error: Reserved connection locations are reserved for Super Users who execute non-replication requests, and postgresql Super Users
Recently, database monitoring of the monitoring system is always delayed. An error is reported when you view the log:
10:20:19, 534 ERROR Traceback (most recent call last): File "oracle_mon.py", line 306, in
Check that the number of active connections used by
Original article: rails access the PG DB
In rails and Ruby, when I find that I want to access PostgreSQL, I always find that the required libraries are: Gem install Postgres-PR, Gem install Postgres, that is to say, the Postgres library is used to exchange data with PG. When I use Ruby to directly use require 'postgres', I find that the latest Postgres version must be downgraded before Ruby can be called, the specific cause is not found, because the
Tags: blog http os using IO file AR data artTransferred from: http://blog.csdn.net/qpengyanting123/article/details/7497556(1) User utility program:Createdb Create a new PostgreSQL database (and the SQL statement: Create DATABASE is the same)CreateUser Create a new PostgreSQL user (and SQL statement: Create user is the same)DROPDB Deleting a databaseDropuser Deleting a userPg_dump to export the
.hortonworks.com/ARTIFACTS/jdk-7u67-linux-x64.tar.gz to/var/lib/ambari-server/resources/jdk-7u67-linux-x64.tar.gzChoose one of the following options:[1]-PostgreSQL (Embedded)[2]-Oracle[3]-MySQL[4]-PostgreSQL========================================================== ==============================================Enter choice (1 ):Input: 3Hostname (localhost ):Port (1, 3306 ):Database Name (ambari): ambariUser
Postgresql database import and export, postgresql Import and ExportExport a remote database
1. Export the threshold table structure and data to the file threshold. SQL from the database monitor on the remote database IP Address:
pg_dump -t threshold -h 135.32.94.142 monitor -U monitor -p 5432 -f threshold.sql
-T specifies the name of the table to be exported;
-H: Specifies the database address;
-U indicat
PostgreSQL usage notes (my company uses arterydb, sub-installed postgreSQL), postgresqlarterydb-- Start the database./Bin/aty_ctl-D data-l arterydb. log start-- Connect to the database./Bin/atysql-d artery-- Set Environment VariablesExport LD_LIBRARY_PATH = '/home/arterydb/lib'-- Delete a tableDrop table table_name;-- Query whether the table existsSelect count (*) into FYDM from information_schema.tables wh
the file, add the following configuration: #set PostgreSQL EnvironmentPg_home=/usr/local/sql/pgsqlPgdata=/usr/local/sql/pgdataPath= $PG _home/bin: $PATHExport Pg_home PGDATA PATH Restarting Linux makes the configuration effective. Execute command "Initdb" (because the environment variable is configured, do not need to hit the directory), error Initdb:cannot be run as rootPlease log on (using, e.g, "su") as the (unprivileged) user that wouldOwn the se
date, overdue account)Drop function wx_cmd_hdb (day_id numeric, acct_month numeric); -- delete a FUNCTIONSelect * from temp_wuxi_qf overdue account; -- Query tableDrop table temp_wuxi_qf overdue account; -- delete a table
PostgreSQL API File Download
------------------------------------------ Split line ------------------------------------------
Free in http://linux.bkjia.com/
The username and password are both www.bkjia.com
The specific download dir
Top Benefits of PostgreSQL:1. PostgreSQL is completely free and BSD, and it's important that if you change PostgreSQL and then sell it, and nobody cares, it means that the PostgreSQL database will not be manipulated by other companies. Oracle database does not have to be said, is a commercial database, not open. While
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.