Features of Postgres95
This page describes some features of Postgres95. For more details, refer
to the user manual
(html,
postscript,
text)
and reference manual
(postscript,
text)
we distribute with release 1.01.
You will find the following topics below:
Relationship to Postgres V4.2
Postgres95 is a derivation of postgres V4.2. Postgres95 retains
essentially all the salient features of postgres. Thus, Postgres95
is
- Relational. One of original research goals of the postgres
project was to show that an essentially relational DBMS can be
extended to handle complex objects, rules, and be highly extensible.
Postgres95 includes features found in most full fledged relational
DBMS's such as declarative queries in SQL, query optimization,
concurrency control, transactions, and multi-user support.
- Highly Extensible. Postgres95 allows user-defined
operators, types, functions, and access methods.
- Object-relational. Some have used the term
"object-relational" to describe Postgres95 because it supports some
object-oriented features such as inheritance.
Postgres95 retains a number of other interesting features from
the original postgres research project. For more details, please
see the many research papers published about Postgres.
General Architecture
In database jargon, Postgres95 uses a simple process-per-user
client/server model. In each session, three cooperating UNIX processes
are involved:
- the postmaster is a supervisory daemon process. It manages
the communication between frontend and backend processes, as well as
allocating the shared buffer pool (in shared memory) and performing other
initialization during start-up.
- the postgres backend database server process. This is the
process that does the real work (ie. executes the queries). The postmaster
starts a new backend process for each frontend connection. (The postgres
backend always run on the server machine.)
- the frontend application (e.g. psql), possibly running on another
machine (e.g. a client workstation), requests a connection to a
postgres backend through the postmaster.
API's
Query Language (SQL)
Postgres95 implements an extended subset of ANSI SQL.
Here's a laundry list of the available statements (more details when
I have time to typeset the syntax):
ABORT TRANSACTION,
ALTER TABLE,
BEGIN TRANSACTION,
CHANGE ACL,
CLOSE,
COPY,
CREATE AGGREGATE,
CREATE DATABASE,
CREATE FUNCTION,
CREATE INDEX,
CREATE OPERATOR,
CREATE RULE,
CREATE TABLE,
CREATE TYPE,
CREATE VERSION,
CREATE VIEW,
DECLARE,
DELETE,
DROP AGGREGATE,
DROP DATABASE,
DROP FUNCTION,
DROP INDEX,
DROP OPERATOR,
DROP RULE,
DROP TABLE,
DROP TYPE,
DROP VIEW,
END TRANSACTION,
EXTEND INDEX,
FETCH,
GRANT,
INSERT,
LOAD,
PURGE,
REVOKE,
SELECT,
UPDATE,
VACUUM.
Expressions (eg. in SELECT) can be any arbitrary arithmetic, logical or
functional expressions or aggrgates.
Click here for the POSTQUEL to SQL translation
quick reference.
C API
libpq is the C programmer's interface to Postgres95. It is a
set of library routines that allow queries to be passed to the postgres
backend and results to be examined.
Below is a simple example of the interface. (It creates a table
foo in database mydb.)
main()
{
PGconn* conn;
conn = PQsetdb(NULL, NULL, NULL, NULL, "mydb");
PQexec(conn, "create table foo (bar int4);");
}
Tcl API
libpgtcl is a Tcl-based library interface to Postgres95.
Libpgtcl is a set of library routines that can be used to create a new
tcl interpreter with commands for building Tcl-based clients.
Below is a simple example of the interface. (It creates a table foo.)
set conn [pg_connect $dbname -host $host -port $port]
pq_exec $conn "create table foo (bar int4);"
Perl API
pg95perl is a Perl interface to Postgres95. The current version is
for Perl 4.036 and can be ftp'ed from s2k-ftp.cs.berkeley.edu
as pub/postgres95/pg95perl.tar.gz.
Below is a simple example of the interface. (It creates a table foo.)
&PQexec ("create table foo (bar int4)");
Thanks to Edmund Mergl (mergl@nadia.s.bawue.de),
a Perl5 interface, pg95perl5 is also available
(pub/postgres95/pg95perl5-1.1.tar.gz).
Python API
PyGres95 is a python interface for the Postgres95.
It encapsulates all the API through the python object oriented interface.
This extension have been tested on a Linux system (1.3.32/ELF, libc5.2.9)
with Python 1.2 and Python 1.3 (final release).
It is available from: ftp.via.ecp.fr:/pub/python/contrib/PyGres95.tgz
PyGres95 is contributed by Pascal ANDRE (andre@zen.via.ecp.fr).
Miscellaneous Packages
Wdb-p95
Doug Dunlop modified the code from the WDB package developed by Bo Frese
Rasmussen to provide a gateway between Postgres95 and the WWW.
It requires postgres95, perl4 and pgperl4 for postgres95. More info
can be obtained here.
Japanese Kanji Code with Postgres95
Mr. Tatsuo Ishii(SRA) wrote an article about his
library searching system with Postgres and HTML in the
"Computer Today" magazine(May/1995) in Japan.
A patch that lets you search strings with regular expresson in Japanese
is available in "ftp://ftp.sra.co.jp/pub/cmd/postgres/".
(from Jun Kuwamura <juk@rccm.co.jp>)
Last modified: Mon Feb 26 10:56:29 PST 1996
Go back to Postgres95 ...