home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre2.z / postgre2 / doc / release.4.0.me < prev    next >
Encoding:
Text File  |  1992-08-27  |  15.2 KB  |  570 lines

  1. .\".he '\*(dA'DRAFT'\*(tI'        \" comment out in production version
  2. .\"========================================================
  3. .de cW                    \" arg3arg1arg2, constant-width arg1
  4. \&\\$3\\fC\\$1\\fP\\$2
  5. .\"\&\\$3\\fC\\s-1\\$1\\s0\\fP\\$2
  6. ..
  7. .\"------------------------------------
  8. .de (P                    \" prologue for constant-width block
  9. .ft C
  10. .ps -1
  11. .vs -1
  12. ..
  13. .\"-----------------
  14. .de )P                    \" epilogue for constant-width block
  15. .vs +1
  16. .ps +1
  17. .ft P
  18. ..
  19. .\"------------------------------------
  20. .de (T                    \" prologue for constant-width table
  21. .(P
  22. .in +\\n(biu
  23. ..
  24. .\"-----------------
  25. .de )T                    \" epilogue for constant-width table
  26. .in -\\n(biu
  27. .)P
  28. ..
  29. .\"------------------------------------
  30. .de (C                    \" begin constant-width list
  31. .(l
  32. .(P
  33. ..
  34. .\"-----------------
  35. .de )C                    \" end constant-width list
  36. .)P
  37. .)l
  38. ..
  39. .\"---------------------------------------------------------------------------
  40. .ds rM Reference Manual
  41. .ds uM User Manual
  42. .ds uX \s-2UNIX\s0
  43. .ds vC Version 4.0
  44. .ds vP Version 3.1
  45. .\"---------------------------------------------------------------------------
  46. .\"
  47. .\"    release4.0.me:  postgres version 4.0 release notes.  print using
  48. .\"            psroff -me.
  49. .\"
  50. .nr pi 3n
  51. .nr si 2n
  52. .nr pp 11
  53. .nr tp 11
  54. .nr sp 11
  55. .de RV
  56. .ie "\\$2"" \
  57. \{\
  58. .    ds VN "0.0
  59. .    ds VD "(No date)
  60. .    ds VT "UNAUDITED VERSION
  61. .\}
  62. .el \
  63. \{\
  64. .    ds VN \\$3
  65. .    ds VD \\$4
  66. .    ie "\\$7"Exp" \
  67. .        ds VT "DRAFT
  68. .    el \
  69. .        ds VT \\$7
  70. .\}
  71. ..
  72. .RV $Header: /private/postgres/doc/RCS/release.4.0.me,v 1.13 1992/07/14 23:24:14 mao Exp $
  73. .ds PG "\\s-2POSTGRES\\s0
  74. .ds PQ "\\s-2POSTQUEL\\s0
  75. .ce 99
  76. .ft B
  77. .ps 14
  78. \*(PG \*(vC
  79. .sp 0.5v
  80. Release Notes
  81. .sp
  82. .ps 11
  83. \*(VD
  84. .ce 0
  85. .he '\*(PG \*(vC Release Notes'%'\*(VD'
  86. .ft P
  87. .sp 2
  88. .sh 1 "Introduction"
  89. .pp
  90. These are the release notes for \*(vC
  91. of the \*(PG database system from UC Berkeley.
  92. The database system and its installation procedure
  93. are covered in detail in the setup document for this release,
  94. which can be found in the file
  95. .cW $POSTGRESHOME/doc/postgres-setup.me .
  96. Here, we cover only the most important differences from \*(vP
  97. and earlier versions of the system.
  98. .sh 1 "Aim"
  99. .pp
  100. This release provides improved functionality over \*(vP in many areas
  101. of the system.
  102. In particular, significant advances have been made in
  103. \*(PG functions and large objects.
  104. .sh 1 "Changes to \*(PQ"
  105. .sh 2 "define function"
  106. .pp
  107. The syntax for defining functions has been changed slightly.
  108. \*(PG now
  109. supports functions that can return sets of values.
  110. To declare
  111. such a function you use the keyword
  112. .cW setof
  113. before the actual type name when specifying the return type:
  114. .(C
  115. define function hobbies
  116.     (language = "postquel", returntype = setof hobbies_r)
  117.     arg is (emp)
  118.     as "retrieve (hobbies_r.all)
  119.         where hobbies_r.person = $1.name"
  120. .)C
  121. The function
  122. .cW hobbies
  123. is declared to return a set of instances from the
  124. class
  125. .cW hobbies_r .
  126. Had
  127. .cW setof
  128. been omitted, the
  129. .cW retrieve
  130. would be executed
  131. exactly one time and the first instance retrieved would be the only return
  132. value.
  133. The primary reason for forcing this distinction is that
  134. \*(PQ functions declared to return a single value can be used in a much
  135. more general fashion than functions returning a set of results.
  136. .lp
  137. \*(PG does
  138. not support functions or operators with sets as arguments.
  139. For example:
  140. .(C
  141. define function alwaysone
  142.     (language = "postquel", returntype = int4)
  143.     as "retrieve (x = 1)"
  144. .)C
  145. Calls to
  146. .cW alwaysone
  147. may be used as though they were constants.
  148. In contrast,
  149. if we had declared the return type to be
  150. .cW "setof int4" ,
  151. .cW alwaysone
  152. would be
  153. forbidden as an argument to functions and/or operators.
  154. .pp
  155. \*(PG now provides much better optimization of
  156. expensive functions.
  157. To aid the optimizer, the author of a C function can
  158. now
  159. choose to specify parameters which will be used to determine the function's
  160. .q cost
  161. in the query under consideration.
  162. For complete details see the \*(rM
  163. page on functions.
  164. .sh 2 "NULL Detection"
  165. .pp
  166. \*(PG now recognizes the keywords
  167. .cW ISNULL
  168. and
  169. .cW NOTNULL
  170. and allows qualifications based on whether or not an attribute is
  171. null.
  172. The general syntax in qualifications is:
  173. .(C
  174. where \f2expression\fP ISNULL
  175. where \f2expression\fP NOTNULL
  176. .)C
  177. .sh 2 "Unified Syntax for Functions and Attributes"
  178. .pp
  179. If a \*(PQ function is declared that takes instances of a class
  180. as its only argument,
  181. it may be invoked in two different ways.
  182. For example,
  183. assume that the function
  184. .cW overpaid
  185. has been declared in \*(PQ to take an instance of the
  186. .cW emp
  187. class and return a boolean value.
  188. Then the two queries
  189. .(C
  190. retrieve (emp.overpaid)
  191. retrieve (overpaid = overpaid(emp))
  192. .)C
  193. are exactly equivalent.
  194. Similarly,
  195. attributes may be referenced in the same ways.
  196. If
  197. .cW emp
  198. has an attribute
  199. .cW salary ,
  200. then
  201. .(C
  202. retrieve (emp.salary)
  203. retrieve (salary = salary(emp))
  204. .)C
  205. are equivalent.
  206. Both of these may be considered parameterless method calls on
  207. instances of the
  208. .cW emp
  209. class.
  210. .sh 2 "Binary Portals"
  211. .pp
  212. It is now possible to get data out of \*(PG in binary format.
  213. The query syntax is
  214. .(C
  215. retrieve iportal \f2portal name\fP (\f2target list\fP) \f2qualifiers\fP
  216. .)C
  217. Taking advantage of this feature should speed up
  218. .cW libpq
  219. application programs
  220. considerably.
  221. See the \*(rM for all of the details.
  222. .sh 2 "Arrays"
  223. .pp
  224. In previous releases array indirection values were required to be integer
  225. constants.  In \*(vC they can be any expression as long as the expression is
  226. of type int4.  For example the following queries are now legal
  227. .(C
  228. retrieve (foo.a[1+2], foo[arrayind.i], foo.a)
  229. retrieve (foo.a[arrayind.i]) where arrayind.i <= 3
  230. .)C
  231. .sh 1 "General System Changes"
  232. .sh 2 "Functions"
  233. .pp
  234. The big story of the \*(vC release is improved \*(PQ functions.
  235. \*(PQ function support in previous releases suffered from the following
  236. limitations:
  237. .ip \0\0\(bu
  238. They could take only a single argument,
  239. which had to be an instance of some class.
  240. .ip \0\0\(bu
  241. They had to return a set of instances of some class.
  242. .ip \0\0\(bu
  243. No run-time or declaration-time type checking was performed
  244. to verify that the arguments or return value of the function
  245. were correctly typed.
  246. .pp
  247. \*(PQ functions in \*(vP of \*(PG were implemented using
  248. the rewrite rules system.
  249. \*(vC supports query language functions as first-class citizens,
  250. and no longer relies on the rules system to implement them.
  251. As a result,
  252. the shortcomings listed above have been eliminated.
  253. .pp
  254. There are no special restrictions on the types or the number of arguments,
  255. nor is there any restriction on the type of the result.
  256. As outlined above,
  257. the syntax for defining a \*(PQ function is
  258. analogous to defining a C function.
  259. The biggest difference is that the
  260. .cW as
  261. clause must contain a quoted list of \*(PQ queries.
  262. Within the body of the function, $\f2number\fP refers to the
  263. .i number th
  264. parameter passed
  265. in by the caller.
  266. See the \*(rM for details.
  267. .pp
  268. C functions have also been improved.
  269. In previous releases C functions were
  270. restricted to taking at most one
  271. .q tuple
  272. argument, that is, an argument whose
  273. type is an instance of some class.
  274. In \*(vC, C functions can take
  275. up to eight tuple arguments.\**
  276. .(f
  277. The 8-argument limit applies to
  278. .b all
  279. \*(PG functions.
  280. .)f
  281. .pp
  282. Finally, \*(PG provides enhanced optimization of both C and \*(PQ
  283. functions.
  284. In the case of C functions,
  285. the optimizer takes user-specified
  286. parameters on cost into account when deciding how to execute a query.
  287. .pp
  288. \*(PQ functions have one important limitation:
  289. system attributes
  290. (for example,
  291. .cW tmin ,
  292. .cW tmax ,
  293. and
  294. .cW oid )
  295. of function return values and parameters cannot be referenced.
  296. The \*(PG parser checks this condition when a function is
  297. defined and invoked,
  298. and prints a descriptive error message if the condition
  299. is violated.
  300. This limitation will be removed in a future release of the system.
  301. .sh 2 "Revised Support for Nested Relations"
  302. .pp
  303. \*(vP of \*(PG supported nested relations using
  304. tuple-valued attributes and rewrite rules.
  305. For example,
  306. given the declarations:
  307. .(C
  308. create person (name = char16, child = char16)
  309.  
  310. addattr (parent = person) to person
  311.  
  312. define rewrite rule find_parent
  313.     on retrieve to person.parent do instead
  314.     retrieve (person.all)
  315.         where person.child = current.name
  316. .)C
  317. it was possible to refer to
  318. .(C
  319. person.parent.name
  320. .)C
  321. and have the correct name fetched by \*(PG.
  322. .lp
  323. In \*(vC of \*(PG,
  324. rewrite rules are no longer used to support nested relations.
  325. Instead,
  326. a function should be declared that returns tuples of the
  327. appropriate type.
  328. For example,
  329. in \*(vC,
  330. .(C
  331. create person (name = char16, child = char16)
  332.  
  333. define function parent
  334.     (language = "postquel", returntype = person)
  335.     arg is (person)
  336.     as "retrieve (person.all) where person.child = $1.name"
  337. .)C
  338. are equivalent to the rule and attribute additions shown above.
  339. The same nested-dot notation is supported for functions
  340. as was supported for rewrite rules.
  341. .pp
  342. As a side effect of the improved support for functions,
  343. it is not possible in \*(vC to create a relation which has
  344. an attribute that is of a complex (tuple) type.
  345. For example,
  346. the
  347. .cW addattr
  348. command shown above is illegal in this release of \*(PG,
  349. since the type of the attribute being added is
  350. .cW person ,
  351. and
  352. .cW person
  353. is a class.
  354. Support for attributes of complex types will be reintroduced
  355. in a future release of \*(PG.
  356. .sh 2 "Sets"
  357. .pp
  358. \*(PG now provides limited support for sets.
  359. Currently this comes via
  360. results of \*(PQ functions (C functions should also be able to return a
  361. set of values; this will be available in a future release).
  362. The key
  363. design choice to point out is that when two set-valued \*(PQ functions
  364. appear in the target list of a
  365. .cW retrieve
  366. query, the result will be a set
  367. of
  368. .q flattened
  369. tuples.
  370. This set of tuples is the cross product of all
  371. the sets appearing the target list.
  372. For example, if you have two
  373. functions,
  374. .cW f
  375. and
  376. .cW g ,
  377. where
  378. .cW f
  379. returns 3 results and
  380. .cW g
  381. returns 2, \*(PG
  382. will return 6 tuples which make up all combinations of
  383. .cW f
  384. and
  385. .cW g .
  386. If either
  387. .cW f
  388. or
  389. .cW g
  390. retuns no results (i.e. the empty set) then we consider it to
  391. be a set of 1 element whose value is NULL.
  392. This choice was made primarily
  393. to avoid returning no results when a function in the target list returns
  394. nothing.
  395. .sh 2 "Large Objects and the Inversion File System"
  396. .pp
  397. Support for large objects in \*(PG has been improved.
  398. \*(vP supported large objects stored in \*(uX files.
  399. User applications could open, seek,
  400. read, and write these large objects,
  401. but only inside dynamically-loaded functions.
  402. In addition,
  403. changes to large objects were not transaction-protected,
  404. and no support for historical access was available.
  405. .pp
  406. In \*(vC,
  407. another large object implementation is provided.
  408. This implementation breaks large objects into
  409. .q chunks,
  410. and stores each chunk in a tuple in the database.
  411. Updates are transaction-protected and time travel is available.
  412. \*(vP
  413. large objects (\c
  414. .q "\*(uX large objects" )
  415. are still supported.
  416. The new implementation (\c
  417. .q "Inversion large objects" )
  418. is available by specifying the proper flags when an object
  419. is created.
  420. Details are provided in the \*(rM.
  421. .pp
  422. In addition,
  423. a rudimentary file system has been built on top of the \*(PG
  424. Inversion large object implementation.
  425. The Inversion file system provides transaction-protected access
  426. to user files,
  427. time travel on file system state,
  428. and the ability to do attribute- or content-based searches
  429. for file data.
  430. .pp
  431. At present,
  432. no kernel interface to Inversion is available,
  433. so the Inversion file system cannot be mounted and used
  434. in the same way as the native file system.
  435. Instead,
  436. a suite of library routines and utility programs
  437. give users access to the Inversion file system.
  438. Again,
  439. see the \*(rM for details.
  440. .sh 2 "Indices on System Catalogs"
  441. .pp
  442. \*(PG now has secondary indices defined on the system catalogs.
  443. Initially, we have indexed
  444. .cW pg_proc ,
  445. .cW pg_attribute ,
  446. and
  447. .cW pg_type .
  448. We expect that, after profiling \*(PG performance on large databases,
  449. additional indices will be added in future releases.
  450. .sh 1 "Miscellaneous"
  451. .sh 2 "Big Bug Fixes"
  452. .pp
  453. We have found and fixed a number of serious bugs with multi-user
  454. operation that were present in release 3.1.
  455. One bug sometimes caused
  456. a backend to read end-of-file from the socket on start up.
  457. Another much more destructive bug caused data from one
  458. database to be written to another database in certain circumstances.
  459. If the database being written to was
  460. .cW template1 ,
  461. then the corruption would be passed on to whoever
  462. ran a subsequent
  463. .cW createdb .
  464. Often
  465. .cW createdb
  466. would just fail.
  467. .sh 2 "\*(rM and \*(uM"
  468. .pp
  469. A serious effort was made to improve the
  470. dilapidated condition of both the \*(rM and \*(uM.
  471. The main focus was to root out all of the lies they contained,
  472. as well as documenting all of the new features.
  473. We will be paying much closer attention to bugs in these two documents.
  474. If you find something wrong in them,
  475. or something you can't understand,
  476. let us know about it
  477. .cW bug-postgres@postgres.Berkeley.EDU ). (
  478. .sh 2 "\*(PG User Ids and Unix UIDs"
  479. .pp
  480. The user ID of a \*(PG registered user
  481. .b must
  482. match the user's \*(uX user ID.
  483. In the new release, the user ID of the \*(PG
  484. user in
  485. .cW /etc/passwd is
  486. .b not
  487. presumed to be anything.
  488. We now adjust
  489. the system catalog entry for the user ID at installation time.
  490. It will
  491. happen automatically; there is no longer any need to edit
  492. .cW pg_user.h .
  493. .sh 2 "Security"
  494. .pp
  495. Security in \*(PG is pretty much non-existent.
  496. We are working on providing it for a future release.
  497. For now the only check \*(PG performs is at initialization
  498. time.
  499. The backend will lookup the front-end user to make sure s/he is a
  500. registered \*(PG user before allowing the user to run any queries.
  501. Just so you are aware,
  502. it is not at all difficult for someone to circumvent this
  503. poor excuse for a lock-out mechanism.
  504. If you really care about your data,
  505. you should make backups of your
  506. .cW $POSTGRESHOME/data
  507. directory regularly.
  508. .lp
  509. In previous
  510. releases,
  511. .cW pg_user
  512. contained entries for each of the \*(PG implementors.
  513. In \*(vC,
  514. the only entry is for the user named
  515. .cW postgres .
  516. .sh 2 "Append Returns an Object Id"
  517. .pp
  518. When you run the \*(PQ
  519. .cW append
  520. command from
  521. .cW pqexec ,
  522. the command tag that you
  523. receive has the
  524. .cW oid
  525. of the appended tuple in it.
  526. When you run
  527. .cW append
  528. queries
  529. from the monitor you get output something like:
  530. .(C
  531. APPEND 206557
  532. .)C
  533. When two or more tuples are appended by the same command \*(PG returns the
  534. invalid object ID zero.
  535. .sh 1 "Known Bugs"
  536. .pp
  537. There are a few known bugs that we did not fix in the current
  538. release.
  539. .sh 2 "Indices and the Instance Level Rule System"
  540. .pp
  541. The instance-level rule system essentially ignores indices, so if you are
  542. defining a rule on an indexed attribute, you should use the query rewrite
  543. rule system.
  544. .sh 2 "Retrieve Into and failed backends"
  545. .pp
  546. If a backend fails while in the course of executing a
  547. .cW "retrieve into"
  548. query,
  549. a spurious file, with the same name as the target class of the
  550. .cW "retrieve into" ,
  551. will be left in the database directory.
  552. This file can be safely deleted by the
  553. database administrator.
  554. .sh 2 "Known bugs list"
  555. .pp
  556. A list of known bugs and suggested work-arounds can be anonymously
  557. FTP'd from
  558. .cW postgres.Berkeley.EDU
  559. (128.32.149.1).
  560. This list is kept in the file
  561. .cW pub/postgres-v4r0.bugs .
  562. We will make every attempt to keep this list up to date.
  563. .sh 1 "Machine-dependent Problems"
  564. .sh 2 "SPARCstations running SunOS 4.0.3"
  565. .pp
  566. \*(PG has been known to crash SunOS 4.0.3 on SPARCstations, due to a SunOS
  567. bug in shared memory.
  568. This bug has not been observed on SunOS 4.1 and higher,
  569. so any reports of crashes on SunOS 4.1 and higher are especially appreciated.
  570.