Time of Update: 2015-04-24
標籤:資料庫連接:dbconn.php<?php$conn = pg_connect("host=localhost port=5432 dbname=myd user=postgres password=postgres");if($conn){ print "has connected" . "<br>";}else{ print "connect failure" . "<br>";}?&
Time of Update: 2015-04-22
標籤:postgresql 資料庫 psql 遠端資料庫 匯入匯出 匯出遠端資料庫1.從遠端資料庫IP上的資料庫monitor匯出threshold表結構和資料到檔案threshold.sql:pg_dump -t threshold -h 135.32.94.142 monitor -U monitor -p 5432
Time of Update: 2015-04-19
標籤:PostgreSQL 中文資料匯總 目前 PostgreSQL 中文資料非常缺乏,有很多網友苦於上手的中文資料少,這裡收集如下,方便有需要的朋友,降低 PostgreSQL 的上手門檻。 --1 中文社區網站 PostgreSQL 中文社區官網: http://postgres.cn/ PostgreSQL中國論壇:http://bbs.pgsqldb.com --2
Time of Update: 2015-04-19
標籤: DataError: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)HINT: Use the same encoding as in the template database, or use template0 as template. [email protected]:~# su
Time of Update: 2015-04-20
標籤:工 具:postgresql 運行環境:ubantu 14.0資料來源:TPC-H dbgen TASK1:1.下載postgresql(sudo install postgresql
Time of Update: 2015-04-12
標籤:database leetcode sql postgresql 如果只是簡單地從1開始,遞增值為1,可以這樣寫,serail是一種特殊的類型:往Employee中添加值及其結果:如果想設定更加詳細的項,比如起始、遞增值、最大值、最小值,可以定義一個sequence。在sequence中
Time of Update: 2015-04-12
標籤:英文版官網地址:http://www.postgresql.org/ 上面顯示的最新版本資訊是PostgreSQL 9.4.1, 9.3.6, 9.2.10, 9.1.15 & 9.0.19 Released!中文版社區地址:http://www.postgres.cn/home 顯示2014/12/18: 全球開發組宣布業界領先的開源關聯式資料庫PostgreSQL9.4版發布,這個版本新增了許多的功能,來適應不同的資料庫使用者靈活性、延展性和效能提升的要求,包括對JSON
Time of Update: 2015-03-28
標籤:nodejs postgresql 驅動 PostgresQL效能上不輸Mysql,而且支援很多進階特性,於是我寫了這個項目,根據libpg的c驅動,封裝了這個nodejs驅動。項目地址:git clone
Time of Update: 2015-03-19
標籤:因為CDH上需要用它來建HIVE的元庫。。。參考:http://www.cnblogs.com/mchina/archive/2012/06/06/2539003.html一、簡介PostgreSQL 是一種非常複雜的對象-關係型資料庫管理系統(ORDBMS),也是目前功能最強大,特性最豐富和最複雜的自由軟體資料庫系統。有些特性甚至連商務資料庫都不具備。這個起源於伯克利(BSD)的資料庫研究計劃目前已經衍產生一項國際開發項目,並且有非常廣泛的使用者。二、系統內容系統平台:CentOS
Time of Update: 2015-03-12
標籤:基於postgresQL的API設計 本文檔設計思想主要是用於簡化API一些重複驗證工作,同時固定API入口, 在入口中做請求分發, 以便在入口做一些統計工作以及請求次數限制.-- functionapi_interface(in jsonb, out jsonb); --入口函數(預存程序)api_interface_error(code); -- 統一錯誤處理函數api_interface_lines(user_id, params, team_id);
Time of Update: 2015-03-13
標籤:PG的設定檔是資料庫目錄下的postgresql.conf檔案,8.0以後的版本可支援K,M,G這樣的參數,只要修改相應參數後重新啟動PG服務就OK了。 shared_buffers:這是最重要的參數,postgresql通過shared_buffers和核心和磁碟打交道,因此應該盡量大,讓更多的資料緩衝在shared_buffers中。通常設定為實際RAM的10%是合理的,比如50000(400M) &nbs
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-05
標籤: 在PostgreSQL中,雙冒號(::)的作用是類型轉換,而在Hibernate中,SQL中冒號的作用是具名引數,用於SQL中具名引數的匹配,這時,當在PostgreSQL資料庫環境中,正常的SQL本身包括雙冒號時,通過Hibernate進行查詢就會報錯,這個應該是Hibernate的一個Bug,怎麼解決呢,本文將給出方案。
Time of Update: 2015-02-28
標籤:CentOS7 PostgreSQL安裝CentOS7 PostgreSQL安裝Install安裝使用yum安裝yum install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpmyum install postgresql94-server postgresql94-contrib設定開機啟動systemctl enable
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-19
標籤:這裡只是部分筆記,主的掛了,切到備庫而已 主:192.168.1.111從:192.168.1.222 主伺服器sudo apt-get install rsync 從伺服器sudo apt-get install rsyncsudo apt-get install openssh-server 主db建立使用者sudo -u postgres psqlcreate user repuser replication login password ‘1
Time of Update: 2015-02-11
標籤:整理了一下PostgreSQL匯入匯出相關schema的方法。 一、匯出: 匯出his庫裡crm的schema表結構和資料(-n參數):pg_dump -h 192.168.2.154 -p 5432 -d his -n crm -f test.sql只匯出his庫裡crm的schema表結構(-s參數):pg_dump -h 192.168.2.154 -p 5432 -d his -n crm -s -f test2.sql 二、匯入不同schema中
Time of Update: 2015-02-06
標籤:在網路上串連遠程伺服器postgresql時,不啟用時間稍長就會自動中斷連線,不利於操作。琢磨了一下,伺服器上使用以下網路設定時,解決了這個問題。 #man 7 tcp net.ipv4.tcp_keepalive_time = 600net.ipv4.tcp_keepalive_probes = 3net.ipv4.tcp_keepalive_intvl =
Time of Update: 2015-02-07
標籤:service postgresql start[....] Starting PostgreSQL 9.1 database server: main[....] The PostgreSQL server failed to start. Please check the log output: 2015-02-07 18:52:12 CST LOG: could not translate host name "localhost", service "5432" to
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