Time of Update: 2015-12-14
標籤:postgres=# create type complex as(postgres(# r double precision,postgres(# i double precisionpostgres(# );CREATE TYPEpostgres=# create type inventory_item as(postgres(# name text,postgres(# supplier_id integer,postgres(# price numeric);CREATE
Time of Update: 2015-12-14
標籤:There are several ways to determine the effect of a command. The first method is to use the GETDIAGNOSTICS command, which has the form:GET [ CURRENT ] DIAGNOSTICS variable { = | := } item [ , ... ];This command allows retrieval of system status
Time of Update: 2015-12-06
標籤: Checkpoints can be a major drag on write-heavy PostgreSQL installations. The first step toward identifying issues in this area is to monitor how often they happen, which just got an easier to use interface added to the database
Time of Update: 2015-12-06
標籤:python可以通過第三方模組串連postgresql. 比較有名的有psycopg2 和python3-postgresql(一)psycopg2ubuntu下安裝sudo apt-get install python3-psycopg2建立一個test.py檔案import psycopg2# 資料庫連接參數conn = psycopg2.connect(database="test1", user="jm", password="123", host="127.0.0.1
Time of Update: 2015-12-07
標籤:postgres=# \h create tablespace Command: CREATE TABLESPACEDescription: define a new tablespaceSyntax:CREATE TABLESPACE tablespace_name [ OWNER user_name ] LOCATION ‘directory‘ [ WITH ( tablespace_option = value [, ... ] ) ]postgres=#
Time of Update: 2015-12-06
標籤:centos postgresql 本文記錄PostgreSQL在CentOS 6.7上安裝、配置、使用等方面的資料以及操作過程。一、準備工作1、CentOS
Time of Update: 2015-11-30
標籤:剛熟悉PG的開發人員接觸PG時,或多或少會碰到一些問題.常見的表現是碰到一些慢SQL.這時候別急著吐槽.絕大多數並不是問題,稍微的文法調整或進行一些簡單的最佳化就能解決問題.下面具體分析幾個案例.一: 中文字串的索引掃描慢test =# \d testidx
Time of Update: 2015-11-30
標籤:pgbench –help初始化選項:-i 調用初始化模式-F NUM 填滿因數-s NUM 規模因子(與產生資料量大小有關)Benchmarking選項:-c NUM 資料庫用戶端並發數(預設:1)-C (為每個事務建立新的串連)-D VARNAME=VALUE
Time of Update: 2015-11-28
標籤:本文解決了原始碼安裝都需要先檢查系統上是否安裝了應用程式所依賴的軟體包的煩惱,對原始碼開發人員也有一定的協助。可以在該基礎上進行適當的修改,以滿足自己的要求。RedHat5 or CentOS5已經提供了製作RPM包的目錄,可以直接把需要製作的RPM包的應用程式的原始碼包放系統指定的目錄,而不需要像在RedHat6(7)or CentOS6(7)上自己建立製作RPM包的目錄。1 添加普通使用者useradd redhatpasswd redhatredhatredhat2
Time of Update: 2015-11-19
標籤:postgresql pid 鎖 block查詢表中存在的鎖select a.locktype,a.database,a.pid,a.mode,a.relation,b.relnamefrom pg_locks ajoin pg_class b on a.relation = b.oidwhere upper(b.relname) = ‘TABLE_NAME‘;以上為查詢某表上是否存在鎖的SQL語句。查到後發現確實存在鎖,如下: locktype | database |
Time of Update: 2015-11-17
標籤: 首先,必須在編譯前指定 --enable-nls="語言名",否則不會產生多語言支援,比如 --enable-nls="zh_CN" 當然禁用nls會帶來一點微不足道的效能提升 啟用之後我們在 Makefile.global 中會看到: enable_nls= yes...ifeq ($(enable_nls), yes)ifneq (,$(wildcard $(srcdir)/nls.mk))include $(
Time of Update: 2015-11-18
標籤:Mysql 使用太廣泛了,以至於我不得不將一些應用從mysql 遷移到postgresql, 很多開源軟體都是以Mysql 作為資料庫標準,並且以Mysql 作為抽象基礎的,但是具體使用過程中,發現Mysql 有很多問題,所以都遷移到postgresql上了,轉一個Mysql 和Postgresql 對比的文章: PostgreSQL由於是類似Oracle的多進程架構,所以能支援高並發的應用情境,這點與Oracle資料庫很像,所以把Oracle
Time of Update: 2015-11-11
標籤:一、環境 $ psql --versionpsql (PostgreSQL) 9.4.4 我們都知道,超級使用者的許可權太大了,為了資料庫的安全,對於非管理員帳號,需要建立普通使用者。 二、文法
Time of Update: 2015-11-09
標籤:原文連結: Linux怎麼設定PostgreSQL遠端存取 安裝PostgreSQL資料庫之後,預設是只接受本地訪問串連。如果想在其他主機上訪問PostgreSQL資料庫伺服器,就需要進行相應的配置。 配置遠
Time of Update: 2015-11-04
標籤:原文地址:http://blog.chinaunix.net/uid-20684384-id-1895247.html1. 設定遠端存取認證機制編輯 $POSTGRES/data/pg_hba.conf 檔案,# TYPE DATABASE USER CIDR-ADDRESS METHOD# IPv4 local connections:host all all 127.0.0.1/32 md5
Time of Update: 2015-10-30
標籤:資料庫 中文 pgsql postgresql 表 當時遇到這個問題,各種百度也沒找到解決方案。如今解決了,現在把方法分享給大家: 表格格式必須為 csv格式650) this.width=650;" title="eeeee.png"
Time of Update: 2015-10-26
標籤:前段時間,公司更換新的PostgreSQL資料集市的系統過程中,自己下載了postgresqlAPI的pdf檔案研究了一下PostgreSQL資料集市。發現使用PostgreSQL過程語言可以大大加快自己處理資料的效率,下面就舉個例子吧!相信大家看了後,也會喜歡上PostgreSQL過程語言的....... 首先給出一段SQL指令碼,該SQL查詢2015年9月10日的欠費資料:?123456789SELECT DISTINCTA.DAY_ID
Time of Update: 2015-10-19
標籤: 系統資料表顯示的都是當前操作資料庫下的資訊,對象都來自當前資料庫。因為不同的系統資料表都用不同名的欄位來記錄不同對象的oid,這個表引用那個表,那個表又引用另一個表,所以這些欄位名不太好記。 pg_class (系統資料表:對象)是一個對象表,表的每個欄位都是‘rel’開頭,分明就是 ‘relation’這個單詞的縮寫,意思就是‘關係’。表中relkind欄位決定物件類型:r = 普通表,i = 索引,S =
Time of Update: 2015-10-20
標籤:PostgreSQL資料的匯出匯入匯出PostgreSQL資料庫中的資料:$ pg_dump -U postgres -f mydatabase.sql mydatabase匯入資料時首先建立資料庫再用psql匯入:$ createdb newdatabase$ psql -d newdatabase -U postgres -f mydatabase.sql 建立資料庫 CREATE DATABASE test
Time of Update: 2015-10-19
標籤: warehouse_db=# create table student(number int primary key,name varchar(20),age int);CREATE TABLEwarehouse_db=# insert into student values (1,‘David‘,20);INSERT 0 1warehouse_db=# insert into student values (2,‘Luna‘,21);INSERT 0