Time of Update: 2015-06-30
標籤:1.問題現象:下載連結:http://www.postgresql.org/ftp/source/解壓後編譯安裝(需要root許可權)1 [email protected]:/opt/postgresql-9.3.4# tar -zxvf postgresql-9.3.4.tar.gz2 [email protected]:/opt/postgresql-9.3.4# cd postgresql-9.3.4/3
Time of Update: 2015-06-25
標籤:postgresql主從Ubuntu下搭建postgresql主從伺服器(方法1)安裝略postgresql主伺服器:$ vi /etc/postgresql/9.1/main/postgresql.conf按a或i進入編輯模式listen_addresses = ‘*’ (預設為注釋的,此處不改從postgresql同步時會報串連拒絕)wal_level = hot_standby (預設為注釋的)max_wal_senders = 5
Time of Update: 2015-06-16
標籤:stream linux postgres 複製 650) this.width=650;" alt="postgresql-9.2.1.tar.bz2" class="editor-attachment" src="/e/u261/themes/default/images/spacer.gif" style="background:url("
Time of Update: 2015-05-31
標籤:java web 目前時間 timestamp postgresql 方式1 常用插入方式Timestamp currentTime= new Timestamp(System.currentTimeMillis()); String sql = "INSERT INTO message(date_create)
Time of Update: 2015-05-17
標籤:-------------------------------------------------------------------------------------------------------目錄:--1. 資料庫----1.1 建立資料庫----1.2 刪除資料庫--2. 架構----2.1 建立架構----2.2 刪除架構--3. 表----3.1 建立表------3.1.1 多個欄位的聯合唯一性------3.1.2 主鍵和外鍵----3.2 刪除表----3.3
Time of Update: 2015-05-12
標籤:背景介紹: PostgreSQL服務端執行在RedHat Linux上,IP為:192.168.230.128 client安裝在Windows XP上, IP為:192.168.230.1配置方法: 1. 改動服務端/opt/postgresql/data/postgresql.conf檔案,將#listen_address=‘localhost‘改成listen_address=‘*‘ 2.
Time of Update: 2015-05-06
標籤:在java和一些常用的資料中(mysql/sqlsever)中進行年月日分秒轉換的時候,都是用 SELECT to_char(CURRENT_DATE,‘yyyy-MM-dd hh:MM:ss‘) 但是在Postgresql中這樣用就會出現問題,在pg中執行上面的語句返回的結果為 2015-05-06 12:05:00 看到了,這並不是我們想要的,那怎麼處理呢?在pg中要用下面的方法
Time of Update: 2015-03-10
標籤:如: 解決步驟:1 . select * from pg_stat_activity where datname =‘lnarterydb‘ //查詢該庫有哪些會話查詢結果會有兩個pid 2. SELECT pg_terminate_backend(pid) ; //中斷該會話,復原未提交事物關於 pg_terminate_backend(pid)
Time of Update: 2015-03-11
標籤:--啟動資料庫./bin/aty_ctl -D data -l arterydb.log start--串連資料庫./bin/atysql -d artery--設定環境變數export LD_LIBRARY_PATH=‘/home/arterydb/lib‘--刪除表DROP TABLE table_name;--查詢表是否存在select count(*) into FYDM from information_schema.tables where
Time of Update: 2015-03-13
標籤:在閱讀的過程中有任何問題,歡迎一起交流郵箱:[email protected] QQ:1494713801 一、PostgreSQL時間類型轉換--時間類型轉成字元類型select to_char(current_date, ‘YYYY/MM/DD‘);select to_char(current_date,‘YYYY-MM-DD‘);select to_char(now(),‘YYYY-MM-DD‘);select
Time of Update: 2015-03-12
標籤: 函數傳回型別描述例子結果string || stringtext字串聯接‘Post‘ || ‘greSQL‘PostgreSQLbit_length(string)int字串裡二進位位的個數bit_length(‘jose‘)32char_length(string)int字串中的字元個數char_length(‘jose‘)4convert(string using conversion_name)text使用指定的轉換名字改變編碼。convert(‘PostgreSQL‘
Time of Update: 2015-03-05
標籤: 2013-05-06 08:39:20| 分類: PgSQL Develop|舉報|字型大小 訂閱 PostgreSQL 9.3 引入的一個格式化輸出函數, 有點類似C的sprintf用法. 文法如下 : format(formatstr text [, formatarg "any" [, ...] ])
Time of Update: 2015-02-26
標籤:Psycopg 是 Python 語言的 PostgreSQL 資料庫介面。 它的主要優勢在於完全支援Python DB API 2.0,以及安全的多線程支援。它適用於隨時建立、銷毀大量遊標的、和產生大量並發INSERT、UPDATE操作的多線程資料庫應用。Psycopg包內含 ZPsycopgDA,一個Zope資料庫介面。--摘自好搜百科在使用這個之前,需要從官網下載該安裝包,使用過psycopg2-2.5.4.win32-py2.7-pg9.3.
Time of Update: 2015-02-05
標籤:經常遇到一種應用情境,將部分行的內容進行匯總、比較、排序。比如資料表名稱test.test2select num,province from test.test2得到結果:1828;"黑龍江"137;"黑龍江"184;"黑龍江"183;"福建"125;"福建"143;"福建"119;"海南"109;"海南"132;"海南"那麼我希望將內容按照省份來排序,那麼需要:select province, num, sum(num) over (partition by province
Time of Update: 2015-02-04
標籤:修改服務組態檔postgresql.conf中的監聽參數 預設設定檔在PGDATA目錄下(除了你是通過服務進程中的參數config_file來指定的) [[email protected] data]$ vi postgresql.conf ......listen_addresses = ‘*‘ # what IP address(es) to listen on;...... 修改pg_hba.conf檔案,添加一行host認證
Time of Update: 2015-01-13
標籤:postgresql function 預存程序 什麼是預存程序, 百度百科是這麼定義的:儲存過程(Stored Procedure)是在大型資料庫系統中,一組為了完成特定功能的SQL
Time of Update: 2015-01-15
標籤:postgresql主從Ubuntu下搭建postgresql主從伺服器安裝略postgresql主伺服器:$ vi /home/postgresql/data/postgresql.conf按a或i進入編輯模式listen_addresses = ‘*’wal_level = hot_standby (預設為注釋的)max_wal_senders = 5
Time of Update: 2015-01-12
標籤:首先,安裝相關的依賴庫:1)GNU make要求有GNU make,版本要大於等於3.76.1,檢查gmake的方法下:gmake --version安裝命令:yum -y install make2)zlibPostgreSQL預設使用zlib壓縮庫安裝命令:yum -y install zlib-devel3)gcc由於編譯器要求是相容ISO/ANSI C的編譯器,遵從C89標準。安裝命令:yum -y install gcc4)GNU
Time of Update: 2015-01-13
標籤: 今天工作時寫了一個sql,但是PostgreSQL總是提示有語法錯誤,簡單的做個記錄: 問題1、‘‘ 和“”單引號和雙引號 舉個例子: 1 #1、select id, delivery_date, sal_plan_date from zaiko_shop where id="";2 #2、select id, delivery_date, sal_plan_date from
Time of Update: 2014-12-14
標籤:des style blog http ar color os 使用 sp 突然發現公司Tableau伺服器的資料庫大小急劇增加,因此決定直接連上資料庫排查.過程記錄如下:最後發現有個ht