| PostgreSQL 7.4 文檔 | ||||
|---|---|---|---|---|
| Prev | Fast Backward | Appendix E. 版本信息 | Fast Forward | Next |
發布日期: 1996-02-23
1996-02-23
下面信息是給那些希望將數據庫從 postgres95 1.0 向 postgres95 1.01 遷移的用戶的一些有用信息.
如果你是剛剛安裝完成 postgres95 1.01 並且沒有需要遷移的舊數據庫, 那麼你不需要閱讀下面部分.
如果要把postgres95 版本 1.0 的數據庫向 postgres95 版本 1.01 遷移, 需要進行下面的步驟:
把文件 src/Makefile.global 裡的變量 NAMEDATALEN 定義為16, OIDNAMELEN 定義為 20.
決定自己是否需要以主機為基礎的認證(HBA).
如果你需要這麼做, 你必須在頂級數據目錄(通常是你的環境變量$PGDATA的值)裡創建一個名為 "pg_hba" 的文件.我們在例子語法裡用 src/libpq/pg_hba 代表.
如果你不需要這樣以主機為基礎的認證, 你可以把 src/Makefile.global 裡的下面這行注釋掉
HBA = 1
要注意缺省時以主機為基礎的認證(HBA)是打開的, 而且如果你不做上面所說的步驟A或B中的其 中一步,其他主機上(out-of-the-box)的1.01版本將不允許你與1.0的數據庫聯接.
編譯和安裝 1.01,但是不要執行 initdb 步驟.
在進行下一步之前,宕掉1.0的postmaster進程,然後備份你現有的 $PGDATA 目錄.
把你的 PGDATA 環境變量設置為你的 1.0 的庫(的位置), 但是把路徑設置成1.01的可執行文件路徑.
把文件 $PGDATA/PG_VERSION 從5.0修改成5.1
運行新的1.01的postmaster.
把1.01的新的內建的函數和操作符追加到1.0的數據庫中去. 這一步是通過在你的1.0的庫上運行1.01的服務 器,並且對之運行下面的查詢來實現的. 假如我們把下面查詢拷貝到一個文件 1.0_to_1.01.sql 裡去,那麼我 們可以通過psql很容易完整升級工作.假設你的1.0數據庫名為"testdb":
% psql testdb -f 1.0_to_1.01.sql
然後執行下面命令(可以從下面剪切和拷貝):
-- add builtin functions that are new to 1.01 create function int4eqoid (int4, oid) returns bool as 'foo' language 'internal'; create function oideqint4 (oid, int4) returns bool as 'foo' language 'internal'; create function char2icregexeq (char2, text) returns bool as 'foo' language 'internal'; create function char2icregexne (char2, text) returns bool as 'foo' language 'internal'; create function char4icregexeq (char4, text) returns bool as 'foo' language 'internal'; create function char4icregexne (char4, text) returns bool as 'foo' language 'internal'; create function char8icregexeq (char8, text) returns bool as 'foo' language 'internal'; create function char8icregexne (char8, text) returns bool as 'foo' language 'internal'; create function char16icregexeq (char16, text) returns bool as 'foo' language 'internal'; create function char16icregexne (char16, text) returns bool as 'foo' language 'internal'; create function texticregexeq (text, text) returns bool as 'foo' language 'internal'; create function texticregexne (text, text) returns bool as 'foo' language 'internal'; -- add builtin functions that are new to 1.01 create operator = (leftarg = int4, rightarg = oid, procedure = int4eqoid); create operator = (leftarg = oid, rightarg = int4, procedure = oideqint4); create operator ~* (leftarg = char2, rightarg = text, procedure = char2icregexeq); create operator !~* (leftarg = char2, rightarg = text, procedure = char2icregexne); create operator ~* (leftarg = char4, rightarg = text, procedure = char4icregexeq); create operator !~* (leftarg = char4, rightarg = text, procedure = char4icregexne); create operator ~* (leftarg = char8, rightarg = text, procedure = char8icregexeq); create operator !~* (leftarg = char8, rightarg = text, procedure = char8icregexne); create operator ~* (leftarg = char16, rightarg = text, procedure = char16icregexeq); create operator !~* (leftarg = char16, rightarg = text, procedure = char16icregexne); create operator ~* (leftarg = text, rightarg = text, procedure = texticregexeq); create operator !~* (leftarg = text, rightarg = text, procedure = texticregexne);
不兼容性: * 1.01 is backwards compatible with 1.0 database provided the user follow the steps outlined in the MIGRATION_from_1.0_to_1.01 file. If those steps are not taken, 1.01 is not compatible with 1.0 database. 增強: * added PQdisplayTuples() to libpq and changed monitor and psql to use it * added NeXT port (requires SysVIPC implementation) * added CAST .. AS ... syntax * added ASC and DESC keywords * added 'internal' as a possible language for CREATE FUNCTION internal functions are C functions which have been statically linked into the postgres backend. * a new type "name" has been added for system identifiers (table names, attribute names, etc.) This replaces the old char16 type. The of name is set by the NAMEDATALEN #define in src/Makefile.global * a readable reference manual that describes the query language. * added host-based access control. A configuration file ($PGDATA/pg_hba) is used to hold the configuration data. If host-based access control is not desired, comment out HBA=1 in src/Makefile.global. * changed regex handling to be uniform use of Henry Spencer's regex code regardless of platform. The regex code is included in the distribution * added functions and operators for case-insensitive regular expressions. The operators are ~* and !~*. * pg_dump uses COPY instead of SELECT loop for better performance 臭蟲修補︰ * fixed an optimizer bug that was causing core dumps when functions calls were used in comparisons in the WHERE clause * changed all uses of getuid to geteuid so that effective uids are used * psql now returns non-zero status on errors when using -c * applied public patches 1-14