Skip to content
Snippets Groups Projects
HISTORY 199 KiB
Newer Older
     _________________________________________________________________
   
               Migration from version 1.02 to version 1.02.1
                                      
   Here is a new migration file for 1.02.1. It includes the 'copy' change
   and a script to convert old ASCII files.
     Note: The following notes are for the benefit of users who want to
     migrate databases from Postgres95 1.01 and 1.02 to Postgres95
     1.02.1.
     If you are starting afresh with Postgres95 1.02.1 and do not need
     to migrate old databases, you do not need to read any further.
   In order to upgrade older Postgres95 version 1.01 or 1.02 databases to
   version 1.02.1, the following steps are required:
    1. Start up a new 1.02.1 postmaster
    2. Add the new built-in functions and operators of 1.02.1 to 1.01 or
       1.02 databases. This is done by running the new 1.02.1 server
       against your own 1.01 or 1.02 database and applying the queries
       attached at the end of the file. This can be done easily through
       "psql". If your 1.01 or 1.02 database is named testdb and you have
       cut the commands from the end of this file and saved them in
       "addfunc.sql":
        % psql testdb -f addfunc.sql
       Those upgrading 1.02 databases will get a warning when executing
       the last two statements in the file because they are already
       present in 1.02. This is not a cause for concern.
     _________________________________________________________________
   If you are trying to reload a pg_dump or text-mode, copy tablename to
   stdout generated with a previous version, you will need to run the
   attached "sed" script on the ASCII file before loading it into the
   database. The old format used '.' as end-of-data, while '\.' is now
   the end-of-data marker. Also, empty strings are now loaded in as ''
   rather than NULL. See the copy manual page for full details.
        sed 's/^\.$/\\./g' <in_file >out_file

   If you are loading an older binary copy or non-stdout copy, there is
   no end-of-data character, and hence no conversion necessary.
-- following lines added by agc to reflect the case-insensitive
-- regexp searching for varchar (in 1.02), and bpchar (in 1.02.1)
create operator ~* (leftarg = bpchar, rightarg = text, procedure = texticregexe
q);
create operator !~* (leftarg = bpchar, rightarg = text, procedure = texticregex
ne);
create operator ~* (leftarg = varchar, rightarg = text, procedure = texticregex
eq);
create operator !~* (leftarg = varchar, rightarg = text, procedure = texticrege
xne);
     _________________________________________________________________
Source code maintenance and development
 * worldwide team of volunteers
 * the source tree now in CVS at ftp.ki.net

Enhancements
 * psql (and underlying libpq library) now has many more options for
   formatting output, including HTML
 * pg_dump now output the schema and/or the data, with many fixes to
   enhance completeness.
 * psql used in place of monitor in administration shell scripts.
   monitor to be deprecated in next release.
 * date/time functions enhanced
 * NULL insert/update/comparison fixed/enhanced
 * TCL/TK lib and shell fixed to work with both tck7.4/tk4.0 and tcl7.5/tk4.1

Bug Fixes (almost too numerous to mention)
 * indexes
 * storage management
 * check for NULL pointer before dereferencing
 * Makefile fixes

New Ports
 * added SolarisX86 port
 * added BSD/OS 2.1 port
 * added DG/UX port
     _________________________________________________________________
     _________________________________________________________________
   The following notes are for the benefit of users who want to migrate
   databases from Postgres95 1.0 to Postgres95 1.01.
   If you are starting afresh with Postgres95 1.01 and do not need to
   migrate old databases, you do not need to read any further.
   In order to Postgres95 version 1.01 with databases created with
   Postgres95 version 1.0, the following steps are required:
    1. Set the definition of NAMEDATALEN in "src/Makefile.global" to 16
       and OIDNAMELEN to 20.
    2. Decide whether you want to use Host based authentication.
         a. If you do, you must create a file name pg_hba in your
            top-level data directory (typically the value of your
            $PGDATA). "src/libpq/pg_hba" shows an example syntax.
         b. If you do not want host-based authentication, you can comment
            out the line
        HBA = 1
            Note that host-based authentication is turned on by default,
            and if you do not take steps A or B above, the out-of-the-box
            1.01 will not allow you to connect to 1.0 databases.
    3. Compile and install 1.01, but DO NOT do the "initdb" step.
    4. Before doing anything else, terminate your 1.0 postmaster, and
       backup your existing $PGDATA directory.
    5. Set your PGDATA environment variable to your 1.0 databases, but
       set up path up so that 1.01 binaries are being used.
    6. Modify the file "$PGDATA/PG_VERSION" from 5.0 to 5.1
    7. Start up a new 1.01 postmaster
    8. Add the new built-in functions and operators of 1.01 to 1.0
       databases. This is done by running the new 1.01 server against
       your own 1.0 database and applying the queries attached and saving
       in the file 1.0_to_1.01.sql. This can be done easily through
       "psql". If your 1.0 database is name testdb:
        % psql testdb -f 1.0_to_1.01.sql
       and then execute the following commands (cut and paste from here):
-- 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 = char2icregexe
q);
create operator !~* (leftarg = char2, rightarg = text, procedure = char2icregex
ne);
create operator ~* (leftarg = char4, rightarg = text, procedure = char4icregexe
q);
create operator !~* (leftarg = char4, rightarg = text, procedure = char4icregex
ne);
create operator ~* (leftarg = char8, rightarg = text, procedure = char8icregexe
q);
create operator !~* (leftarg = char8, rightarg = text, procedure = char8icregex
ne);
create operator ~* (leftarg = char16, rightarg = text, procedure = char16icrege
xeq);
create operator !~* (leftarg = char16, rightarg = text, procedure = char16icreg
exne);
create operator ~* (leftarg = text, rightarg = text, procedure = texticregexeq)
;
create operator !~* (leftarg = text, rightarg = text, procedure = texticregexne
);
     _________________________________________________________________
Incompatibilities:
 * 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.

Enhancements:
 * 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

Bug fixes:
 * 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
     _________________________________________________________________
     _________________________________________________________________
Copyright change:
 * The copyright of Postgres 1.0 has been loosened to be freely modifiable
   and modifiable for any purpose.  Please read the COPYRIGHT file.
   Thanks to Professor Michael Stonebraker for making this possible.

Incompatibilities:
 *  date formats have to be MM-DD-YYYY (or DD-MM-YYYY if you're using
   EUROPEAN STYLE).  This follows SQL-92 specs.
 *  "delimiters" is now a keyword

Enhancements:
 *  sql LIKE syntax has been added
 *  copy command now takes an optional USING DELIMITER specification.
   delimiters can be any single-character string.
 *  IRIX 5.3 port has been added.
   Thanks to Paul Walmsley and others.
 *  updated pg_dump to work with new libpq
 *  \d has been added psql
   Thanks to Keith Parks
 *  regexp performance for architectures that use POSIX regex has been
   improved due to caching of precompiled patterns.
   Thanks to Alistair Crooks
 *  a new version of libpq++
   Thanks to William Wanders

Bug fixes:
 *  arbitrary userids can be specified in the createuser script
 *  \c to connect to other databases in psql now works.
 *  bad pg_proc entry for float4inc() is fixed
 *  users with usecreatedb field set can now create databases without
   having to be usesuper
 *  remove access control entries when the entry no longer has any
   permissions
 *  fixed non-portable datetimes implementation
 *  added kerberos flags to the src/backend/Makefile
 *  libpq now works with kerberos
 *  typographic errors in the user manual have been corrected.
 *  btrees with multiple index never worked, now we tell you they don't
   work when you try to use them
     _________________________________________________________________
                          Postgres95 Release 0.03
     _________________________________________________________________
Incompatible changes:
 * BETA-0.3 IS INCOMPATIBLE WITH DATABASES CREATED WITH PREVIOUS VERSIONS
   (due to system catalog changes and indexing structure changes).
 * double-quote (") is deprecated as a quoting character for string literals;
   you need to convert them to single quotes (').
 * name of aggregates (eg. int4sum) are renamed in accordance with the
   SQL standard (eg. sum).
 * CHANGE ACL syntax is replaced by GRANT/REVOKE syntax.
 * float literals (eg. 3.14) are now of type float4 (instead of float8 in
   previous releases); you might have to do typecasting if you depend on it
   being of type float8.  If you neglect to do the typecasting and you assign
   a float literal to a field of type float8, you may get incorrect values
   stored!
 * LIBPQ has been totally revamped so that frontend applications
   can connect to multiple backends
 * the usesysid field in pg_user has been changed from int2 to int4 to
   allow wider range of Unix user ids.
 * the netbsd/freebsd/bsd o/s ports have been consolidated into a
   single BSD44_derived port.  (thanks to Alistair Crooks)

SQL standard-compliance (the following details changes that makes postgres95
more compliant to the SQL-92 standard):
 * the following SQL types are now built-in: smallint, int(eger), float, real,
   char(N), varchar(N), date and time.

   The following are aliases to existing postgres types:
                smallint -> int2
                integer, int -> int4
                float, real  -> float4
   char(N) and varchar(N) are implemented as truncated text types. In
   addition, char(N) does blank-padding.
 * single-quote (') is used for quoting string literals; '' (in addition to
   \') is supported as means of inserting a single quote in a string
 * SQL standard aggregate names (MAX, MIN, AVG, SUM, COUNT) are used
   (Also, aggregates can now be overloaded, i.e. you can define your
   own MAX aggregate to take in a user-defined type.)
 * CHANGE ACL removed. GRANT/REVOKE syntax added.
   - Privileges can be given to a group using the "GROUP" keyword.
        For example:
                GRANT SELECT ON foobar TO GROUP my_group;
        The keyword 'PUBLIC' is also supported to mean all users.

        Privileges can only be granted or revoked to one user or group
        at a time.

        "WITH GRANT OPTION" is not supported.  Only class owners can change
        access control
   - The default access control is to to grant users readonly access.
     You must explicitly grant insert/update access to users.  To change
     this, modify the line in
                src/backend/utils/acl.h
     that defines ACL_WORLD_DEFAULT

Bug fixes:
 * the bug where aggregates of empty tables were not run has been fixed. Now,
   aggregates run on empty tables will return the initial conditions of the
   aggregates. Thus, COUNT of an empty  table will now properly return 0.
   MAX/MIN of an empty table will return a tuple of value NULL.
 * allow the use of \; inside the monitor
 * the LISTEN/NOTIFY asynchronous notification mechanism now work
 * NOTIFY in rule action bodies now work
 * hash indexes work, and access methods in general should perform better.
   creation of large btree indexes should be much faster.  (thanks to Paul
   Aoki)

Other changes and enhancements:
 * addition of an EXPLAIN statement used for explaining the query execution
   plan (eg. "EXPLAIN SELECT * FROM EMP" prints out the execution plan for
   the query).
 * WARN and NOTICE messages no longer have timestamps on them. To turn on
   timestamps of error messages, uncomment the line in
   src/backend/utils/elog.h:
        /* define ELOG_TIMESTAMPS */
 * On an access control violation, the message
        "Either no such class or insufficient privilege"
   will be given.  This is the same message that is returned when
   a class is not found.  This dissuades non-privileged users from
   guessing the existence of privileged classes.
 * some additional system catalog changes have been made that are not
   visible to the user.

libpgtcl changes:
 * The -oid option has been added to the "pg_result" tcl command.
   pg_result -oid returns oid of the last tuple inserted.   If the
   last command was not an INSERT, then pg_result -oid returns "".
 * the large object interface is available as pg_lo* tcl commands:
   pg_lo_open, pg_lo_close, pg_lo_creat, etc.

Portability enhancements and New Ports:
 * flex/lex problems have been cleared up.  Now, you should be able to use
   flex instead of lex on any platforms.  We no longer make assumptions of
   what lexer you use based on the platform you use.
 * The Linux-ELF port is now supported.  Various configuration have been
   tested:  The following configuration is known to work:
        kernel 1.2.10, gcc 2.6.3, libc 4.7.2, flex 2.5.2, bison 1.24
   with everything in ELF format,

New utilities:
 * ipcclean added to the distribution
   ipcclean usually does not need to be run, but if your backend crashes
   and leaves shared memory segments hanging around, ipcclean will
   clean them up for you.

New documentation:
 * the user manual has been revised and libpq documentation added.
     _________________________________________________________________
                          Postgres95 Release 0.02
     _________________________________________________________________
Incompatible changes:
 * The SQL statement for creating a database is 'CREATE DATABASE' instead
   of 'CREATEDB'. Similarly, dropping a database is 'DROP DATABASE' instead
   of 'DESTROYDB'. However, the names of the executables 'createdb' and
   'destroydb' remain the same.

New tools:
 * pgperl - a Perl (4.036) interface to Postgres95
 * pg_dump - a utility for dumping out a postgres database into a
        script file containing query commands. The script files are in a ASCII
        format and can be used to reconstruct the database, even on other
        machines and other architectures. (Also good for converting
        a Postgres 4.2 database to Postgres95 database.)

The following ports have been incorporated into postgres95-beta-0.02:
 * the NetBSD port by Alistair Crooks
 * the AIX port by Mike Tung
 * the Windows NT port by Jon Forrest (more stuff but not done yet)
 * the Linux ELF port by Brian Gallew

The following bugs have been fixed in postgres95-beta-0.02:
 * new lines not escaped in COPY OUT and problem with COPY OUT when first
   attribute is a '.'
 * cannot type return to use the default user id in createuser
 * SELECT DISTINCT on big tables crashes
 * Linux installation problems
 * monitor doesn't allow use of 'localhost' as PGHOST
 * psql core dumps when doing \c or \l
 * the "pgtclsh" target missing from src/bin/pgtclsh/Makefile
 * libpgtcl has a hard-wired default port number
 * SELECT DISTINCT INTO TABLE hangs
 * CREATE TYPE doesn't accept 'variable' as the internallength
 * wrong result using more than 1 aggregate in a SELECT
     _________________________________________________________________
                          Postgres95 Release 0.01