OK, can someone confirm which items still need to be done to update the
documentation?

I can't imagine they are all done, and I don't think we can release 7.0
without them all being done.

---------------------------------------------------------------------------


Remove ':' and ';' operators
Add TRUNCATE command to quickly truncate relation (Mike Mascari)
Add SET FSYNC and SHOW PG_OPTIONS commands(Massimo)
Improve CREATE FUNCTION to allow type conversion specification
        (Bernie Frankpitt)
Add CmdTuples() to libpq++(Vince)
New CREATE CONSTRAINT TRIGGER and SET CONSTRAINTS commands(Jan)
Allow CREATE FUNCTION WITH clause to be used for all language types
configure --enable-debug adds -g (Peter E)
configure --disable-debug removes -g (Peter E)
First real FOREIGN KEY constraint trigger functionality (Jan)
Add FOREIGN KEY ... MATCH FULL ... ON DELETE CASCADE (Jan)
Add FOREIGN KEY ... MATCH  referential actions (Don Baccus)
Allow WHERE restriction on ctid (physical heap location) (Hiroshi)
Move pginterface from contrib to interface directory, rename to pgeasy (Bruce)
Add Oracle's COMMENT ON command (Mike Mascari yahoo.
libpq's PQsetNoticeProcessor function now returns previous hook(Peter E)
Prevent PQsetNoticeProcessor from being set to NULL (Peter E)
Added psql LastOid variable to return last inserted oid (Peter E)
New libpq functions to allow asynchronous connections: PQconnectStart(),
   PQconnectPoll(), PQresetStart(), PQresetPoll(), PQsetenvStart(),
   PQsetenvPoll(), PQsetenvAbort (Ewan Mellor)
New libpq PQsetenv() function (Ewan Mellor)
create/alter user extension (Peter E)
New postmaster.pid and postmaster.opts under $PGDATA (Tatsuo)
New scripts for create/drop user/db (Peter E)
Major psql overhaul(Peter E)
Add const to libpq interface(Peter E)
New libpq function PQoidValue (Peter E)
Add aggregate(DISTINCT ...) (Tom)
Allow flag to control COPY input/output of NULLs (Peter E)
Add CREATE/ALTER/DROP GROUP (Peter E)
All administration scripts now support --long options (Peter E, Karel)
Vacuumdb script now supports --alldb option (Peter E)
Add ecpg EXEC SQL IFDEF, EXEC SQL IFNDEF, EXEC SQL ELSE, EXEC SQL ELIF
        and EXEC SQL ENDIF directives
Add pg_ctl script to control backend startup (Tatsuo)
Add postmaster.opts.default file to store startup flags (Tatsuo)
Allow --with-mb=SQL_ASCII
Add initdb --enable-multibyte option (Peter E)
Updated user interfaces on initdb, initlocation, pg_dump, ipcclean
(Peter E)
New plperl internal programming language (Mark Hollomon)
Add Oracle's to_char(), to_date(), to_datetime(), to_timestamp(), to_number()
        conversion functions (Karel Zak zf.jcu.cz>)
Add SELECT DISTINCT ON (expr [, expr ...]) targetlist ... (Tom)
Add ALTER TABLE ... ADD FOREIGN KEY (Stephan Szabo)
Add SESSION_USER as SQL92 keyword, same as CURRENT_USER (Thomas)
Implement column aliases (aka correlation names) and more join syntax
(Thomas)
Allow queries like SELECT a FROM t1 tx (a) (Thomas)
Allow queries like SELECT * FROM t1 NATURAL JOIN t2 (Thomas)
Implement REINDEX command (Hiroshi)
Accept ALL in aggregate function SUM(ALL col) (Tom)
Allow PQrequestCancel() to terminate when in waiting-for-lock state (Hiroshi)
New libpq functions PQsetClientEncoding(), PQclientEncoding() (Tatsuo)
Make libpq's PQconndefaults() thread-safe (Tom)
New lztext data type for compressed text fields
New C-routines to implement a BIT and BIT VARYING type in /contrib
        (Adriaan Joubert)
Make ISO date style (2000-02-16 09:33) the default (Thomas)
Add NATIONAL CHAR [ VARYING ]
New TIME WITH TIME ZONE type (Thomas)
Add round(), sqrt(), cbrt(), pow()
Rename NUMERIC power() to pow()
Improved TRANSLATE() function
Add Linux ARM.
Update for QNX (Kardos, Dr. Andreas)
Internally change datetime and timespan into timestamp and interval (Thomas)
configure --with-mb now deprecated (Tatsuo)
NetBSD fixes Johnny C. Lam stat.cmu.edu>
Fixes for Alpha compiles
New multibyte encodings

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Wed, 5 Apr 2000 13:30:39 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Doc updates
> OK, can someone confirm which items still need to be done to update the
> documentation?
> 
> I can't imagine they are all done, and I don't think we can release 7.0
> without them all being done.

> Add pg_ctl script to control backend startup (Tatsuo)
> Add postmaster.opts.default file to store startup flags (Tatsuo)

I have written a man page for pg_ctl (see below). However, it's still
in a plain text, not marked up yet. I'm very busy right now, and
probably could start to make it into a SGML after 4/12. Is it too late
for the release schedule of 7.0?
--
Tatsuo Ishii
-------------------------------------------------------------------------
NAME

pg_ctl - starts/stops/restarts postmaster

SYNOPSIS

pg_ctl [-w][-D database_dir][-p path_to_postmaster][-o "postmaster_opts"] start
pg_ctl [-w][-D database_dir][-m [s[mart]|f[ast]|i[mmediate]]] stop
pg_ctl [-w][-D database_dir][-m [s[mart]|f[ast]|i[mmediate]][-o "postmaster_opts"] restart
pg_ctl [-D database_dir] status

DESCRIPTION

pg_ctl is a utility for starting, stopping or restarting postmaster.

Starting postmaster

To start postmaster:

pg_ctl start

If -w is supplied, pg_ctl waits for the database server comes up, by
watching for creation of the pid file (PGDATA/postmaster.pid), for up
to 60 seconds.

Parameters to invoke postmaster are taken from following sources:

Path to postmaster: found in the command search path
Database directory: PGDATA environment variable
Other parameters: PGDATA/postmaster.opts.default

postmaster.opts.default contains parameters for postmaster. With a
default installation, the "-S" option is enabled. So "pg_ctl start"
implies:

postmaster -S

Note that postmaster.opts.default is installed by initdb from
lib/postmaster.opts.default.sample under the PostgreSQL installation
directory (lib/postmaster.opts.default.sample is copied from
src/bin/pg_ctl/postmaster.opts.default.sample while installing
PostgreSQL).

To override default parameters you can use -D, -p and -o options.

-D database_dir
	specifies the database directory

-p path_to_postmaster
	specifies the path to postmaster

-o "postmaster_opts"
	specifies any parameters for postmaster

Examples:

# blocks until postmaster comes up
pg_ctl -w start

# specifies postmaster path
pg_ctl -p /usr/local/pgsq/bin/postmaster start

# uses port 5433 and disables fsync
pg_ctl -o "-o -F -p 5433" start

Stopping postmaster

pg_ctl stop

stops postmaster.

There are several options for the stopping mode.

-w
	waits for postmaster to shut down

-m [s[mart]|f[ast]|i[mmediate]]
       specifies the shutdown mode. smart mode waits for all
       the clients to logout. This is the default.
       fast mode sends SIGTERM to the backends, that means
       active transactions get rolled back. immediate mode sends SIGUSR1
       to the backends and lets them abort. In this case, database recovery
       will be neccessary on the next startup.


Restarting postmaster

This is almost equivalent to stopping postmaster then starting it
again except that the parameters for postmaster used before stopping
it would be used too. This is done by saving them in
PGDATA/postmaster.opts file. -w, -D, -m, -fast, -immediate and -o
can also be used in the restarting mode and they have same meanings as
described above.

Examples:

# restarts postmaster in the simplest form
pg_ctl restart

# restarts postmaster, waiting for it to shut down and to come up
pg_ctl -w restart

# uses port 5433 and disables fsync next time
pg_ctl -o "-o -F -p 5433" restart

Getting status from postmaster

To get status information from postmaster:

pg_ctl status

Following is sample outputs from pg_ctl.

pg_ctl: postmaster is running (pid: 13718)
options are:
/usr/local/src/pgsql/current/bin/postmaster
-p 5433
-D /usr/local/src/pgsql/current/data
-B 64
-b /usr/local/src/pgsql/current/bin/postgres
-N 32
-o '-F'


************

************

************

Thu, 06 Apr 2000 10:58:06 +0900
Tatsuo Ishii <t-ishii@sra.co.jp>
Re: [HACKERS] Doc updates
> I have written a man page for pg_ctl (see below). However, it's still
> in a plain text, not marked up yet. I'm very busy right now, and
> probably could start to make it into a SGML after 4/12. Is it too late
> for the release schedule of 7.0?

I'll be happy to mark up what is available. Can I use what you
included in the email? If so, I'll go ahead and put it in...

                     - Thomas

-- 
Thomas Lockhart				lockhart@alumni.caltech.edu
South Pasadena, California

Thu, 06 Apr 2000 04:03:19 +0000
Thomas Lockhart <lockhart@alumni.caltech.edu>
Re: [HACKERS] Doc updates
> > I have written a man page for pg_ctl (see below). However, it's still
> > in a plain text, not marked up yet. I'm very busy right now, and
> > probably could start to make it into a SGML after 4/12. Is it too late
> > for the release schedule of 7.0?
> 
> I'll be happy to mark up what is available. Can I use what you
> included in the email? If so, I'll go ahead and put it in...

Thank you very much. Please do it. Also, please feel free to
modify/change what I wrote to correct grammatical errors..
--
Tatsuo Ishii

Thu, 06 Apr 2000 14:06:24 +0900
Tatsuo Ishii <t-ishii@sra.co.jp>
Re: [HACKERS] Doc updates
> -----Original Message-----
> From: pgsql-hackers-owner@hub.org [mailto:pgsql-hackers-owner@hub.org]On
> Behalf Of Bruce Momjian
> 
> OK, can someone confirm which items still need to be done to update the
> documentation?
> 
> Implement REINDEX command (Hiroshi)

I commited doc/src/sgml/ref/reindex.sgml to CVS last weekend.
However I couldn't confirm that it's written in right sgml format.
I'm happy if someone would check it together with grammatical errors.

> Allow WHERE restriction on ctid (physical heap location) (Hiroshi)
> Allow PQrequestCancel() to terminate when in waiting-for-lock 
> state (Hiroshi)

What kind of documentation must I write for above 2 items ?

Regards.

Hiroshi Inoue
Inoue@tpf.co.jp

Fri, 7 Apr 2000 09:33:37 +0900
"Hiroshi Inoue" <Inoue@tpf.co.jp>
RE: [HACKERS] Doc updates
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> OK, can someone confirm which items still need to be done to update the
> documentation?

> Remove ':' and ';' operators

They're not actually removed yet, just deprecated, so if you have
"removed" in the history file please change it.  Otherwise, the
docs are updated.

> Add TRUNCATE command to quickly truncate relation (Mike Mascari)

Documented.

> Add SET FSYNC and SHOW PG_OPTIONS commands(Massimo)

Not documented.

> Improve CREATE FUNCTION to allow type conversion specification
>         (Bernie Frankpitt)

Huh?  I'm not sure what that is.

> Add CmdTuples() to libpq++(Vince)

Not documented.

> New CREATE CONSTRAINT TRIGGER and SET CONSTRAINTS commands(Jan)

Not documented.

> Allow CREATE FUNCTION WITH clause to be used for all language types

Documented.

> configure --enable-debug adds -g (Peter E)
> configure --disable-debug removes -g (Peter E)

Documented.

> First real FOREIGN KEY constraint trigger functionality (Jan)
> Add FOREIGN KEY ... MATCH FULL ... ON DELETE CASCADE (Jan)
> Add FOREIGN KEY ... MATCH  referential actions (Don Baccus)

Not adequately documented AFAICS.

> Allow WHERE restriction on ctid (physical heap location) (Hiroshi)

Not documented; not quite sure where to put it, either.

> Move pginterface from contrib to interface directory, rename to pgeasy (Bruce)

Documented.

> Add Oracle's COMMENT ON command (Mike Mascari yahoo.

Not documented.

> libpq's PQsetNoticeProcessor function now returns previous hook(Peter E)
> Prevent PQsetNoticeProcessor from being set to NULL (Peter E)

Documented.

> Added psql LastOid variable to return last inserted oid (Peter E)

Documented.

> New libpq functions to allow asynchronous connections: PQconnectStart(),
>    PQconnectPoll(), PQresetStart(), PQresetPoll(), PQsetenvStart(),
>    PQsetenvPoll(), PQsetenvAbort (Ewan Mellor)
> New libpq PQsetenv() function (Ewan Mellor)

The first four are documented.  The other four have been removed from
the API and so do not need documentation.

> create/alter user extension (Peter E)

Documented.

> New postmaster.pid and postmaster.opts under $PGDATA (Tatsuo)

Not documented.

> New scripts for create/drop user/db (Peter E)

Documented.

> Major psql overhaul(Peter E)

psql man page seems up-to-date, do we need more?

> Add const to libpq interface(Peter E)

Not sure we need to do more than mention it in the revision history.

> New libpq function PQoidValue (Peter E)

Documented.

> Add aggregate(DISTINCT ...) (Tom)

Documented.

> Allow flag to control COPY input/output of NULLs (Peter E)

Documented.

> Add CREATE/ALTER/DROP GROUP (Peter E)

Documented.

> All administration scripts now support --long options (Peter E, Karel)

Documented.

> Vacuumdb script now supports --alldb option (Peter E)

Documented.

> Add ecpg EXEC SQL IFDEF, EXEC SQL IFNDEF, EXEC SQL ELSE, EXEC SQL ELIF
>         and EXEC SQL ENDIF directives

Not documented.

> Add pg_ctl script to control backend startup (Tatsuo)

Not documented.

> Add postmaster.opts.default file to store startup flags (Tatsuo)

Not documented.

> Allow --with-mb=SQL_ASCII

I see it in README.mb ... but not in the SGML docs ...

> Add initdb --enable-multibyte option (Peter E)

Documented.

> Updated user interfaces on initdb, initlocation, pg_dump, ipcclean
> (Peter E)

initlocation and pg_dump man pages still need to be updated; not sure
about ipcclean.

> New plperl internal programming language (Mark Hollomon)

Documented.

> Add Oracle's to_char(), to_date(), to_datetime(), to_timestamp(), to_number()
>         conversion functions (Karel Zak zf.jcu.cz>)

Documented.

> Add SELECT DISTINCT ON (expr [, expr ...]) targetlist ... (Tom)

Documented.

> Add ALTER TABLE ... ADD FOREIGN KEY (Stephan Szabo)

Not documented.

> Add SESSION_USER as SQL92 keyword, same as CURRENT_USER (Thomas)

There is a ref page for this, but it's not linked into the documents
as far as I can tell!  The only readily-visible reference in the docs
is some obsolete info in the CREATE TABLE page's DEFAULT clause (and
why are function definitions present there anyway?)

> Implement column aliases (aka correlation names) and more join syntax
> (Thomas)
> Allow queries like SELECT a FROM t1 tx (a) (Thomas)
> Allow queries like SELECT * FROM t1 NATURAL JOIN t2 (Thomas)

Not documented.

> Implement REINDEX command (Hiroshi)

There is a ref page for this, but it's not linked into the documentation...

> Accept ALL in aggregate function SUM(ALL col) (Tom)

Documented.

> Allow PQrequestCancel() to terminate when in waiting-for-lock state (Hiroshi)

Not documented, but I'm not sure it needs to be mentioned anywhere but
the history file.

> New libpq functions PQsetClientEncoding(), PQclientEncoding() (Tatsuo)

Documented, but only in README.mb.

> Make libpq's PQconndefaults() thread-safe (Tom)

Documented.

> New lztext data type for compressed text fields

Not documented, but do we want to document it?

> New C-routines to implement a BIT and BIT VARYING type in /contrib
>         (Adriaan Joubert)

Not documented, but on the other hand it's not done yet.

> Make ISO date style (2000-02-16 09:33) the default (Thomas)

Couldn't find this stated in the likely spots.  SET ref page says the
wrong thing.

> Add NATIONAL CHAR [ VARYING ]

Not documented.

> New TIME WITH TIME ZONE type (Thomas)

Documented.

> Add round(), sqrt(), cbrt(), pow()
> Rename NUMERIC power() to pow()

Documented.

> Improved TRANSLATE() function

Only mentioned in Table 5-4, which hardly gives room to explain...

> Add Linux ARM.
> Update for QNX (Kardos, Dr. Andreas)

Documented.

> Internally change datetime and timespan into timestamp and interval (Thomas)

Documented.

> configure --with-mb now deprecated (Tatsuo)

It's not mentioned in the docs, which is probably documentation enough.

> NetBSD fixes Johnny C. Lam stat.cmu.edu>
> Fixes for Alpha compiles

Do these need to be mentioned?

> New multibyte encodings

I assume README.mb talks about these.



Bottom line: Peter gets an A, the rest of us have work to do...

			regards, tom lane

Fri, 07 Apr 2000 23:48:30 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Doc updates 
> Do these need to be mentioned?
> 
> > New multibyte encodings
> 
> I assume README.mb talks about these.
> 
> 
> 
> Bottom line: Peter gets an A, the rest of us have work to do...

Totally agree about Peter.  

We were much better this time about getting doc updates with patches. 
However, we do clearly have work to do.  If we let it slide, we will
never come back to it later, I fear.

OK, people, you have Tom Lane's hard work here.  Get cracking.  I will
apply doc fixes as fast as I get them.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Sat, 8 Apr 2000 00:16:31 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: [HACKERS] Doc updates
Tom Lane wrote:
> 
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > OK, can someone confirm which items still need to be done to update the
> > documentation?
>
> > Add Oracle's COMMENT ON command (Mike Mascari).
> 
> Not documented.

I see Bruce added a comment.sgml back in October. Is there
something more that's necessary? I'd be more that happy to write
something up, if so.

Mike Mascari

Sat, 08 Apr 2000 00:47:25 -0400
Mike Mascari <mascarm@mascari.com>
Re: [HACKERS] Doc updates
> Tom Lane wrote:
> > 
> > Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > > OK, can someone confirm which items still need to be done to update the
> > > documentation?
> >
> > > Add Oracle's COMMENT ON command (Mike Mascari).
> > 
> > Not documented.
> 
> I see Bruce added a comment.sgml back in October. Is there
> something more that's necessary? I'd be more that happy to write
> something up, if so.
> 

No.  I don't understand how to merge into the main docs, or it is merged
in but not packaged yet.  Not sure.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Sat, 8 Apr 2000 01:10:42 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: [HACKERS] Doc updates
Mike Mascari <mascarm@mascari.com> writes:
> Tom Lane wrote:
>>>> Add Oracle's COMMENT ON command (Mike Mascari).
>> 
>> Not documented.

> I see Bruce added a comment.sgml back in October.

Hmm, you're right.  Looks like that's still another file that hasn't
been linked into the main documentation.

[ time passes ]

OK, I think I found where to fix that --- COMMENT ON and REINDEX
should be visible in the HTML documentation after the next nightly
run, unless their markup is bad enough to break the build.

I'll throw this back in Thomas' lap now...

			regards, tom lane

Sat, 08 Apr 2000 01:12:47 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Doc updates 
Bruce Momjian <pgman@candle.pha.pa.us> writes:
>> I see Bruce added a comment.sgml back in October. Is there
>> something more that's necessary? I'd be more that happy to write
>> something up, if so.

> No.  I don't understand how to merge into the main docs, or it is merged
> in but not packaged yet.  Not sure.

It looks like you have to add an "entity" line to ref/allfiles.sgml
and then refer to that entity in ref/commands.sgml.  We'll find out
tomorrow morning whether that works or not ;-)

			regards, tom lane

Sat, 08 Apr 2000 01:20:26 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Doc updates 
* Bruce Momjian <pgman@candle.pha.pa.us> [000407 22:35] wrote:
> > Do these need to be mentioned?
> > 
> > > New multibyte encodings
> > 
> > I assume README.mb talks about these.
> > 
> > 
> > 
> > Bottom line: Peter gets an A, the rest of us have work to do...
> 
> Totally agree about Peter.  
> 
> We were much better this time about getting doc updates with patches. 
> However, we do clearly have work to do.  If we let it slide, we will
> never come back to it later, I fear.
> 
> OK, people, you have Tom Lane's hard work here.  Get cracking.  I will
> apply doc fixes as fast as I get them.

Has any progress been made regarding splitting the online docs based
on release so there's a snapshot of the docs made at the time of
the 7.0 release and a seperate space for upcoming versions clearly
marked so users are aware of what's actually in the release versus
what's in development?

thanks,
-- 
-Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org]
"I have the heart of a child; I keep it in a jar on my desk."

Fri, 7 Apr 2000 23:33:06 -0700
Alfred Perlstein <bright@wintelcom.net>
Re: [HACKERS] Doc updates
> > New postmaster.pid and postmaster.opts under $PGDATA (Tatsuo)
> 
> Not documented.

Will appear in the pg_ctl man page (Thomas is kindly making markups
for it).
--
Tatsuo Ishii

Sat, 08 Apr 2000 17:07:29 +0900
Tatsuo Ishii <t-ishii@sra.co.jp>
Re: [HACKERS] Doc updates 
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > OK, can someone confirm which items still need to be done to update the
> > documentation?
> 
> > Remove ':' and ';' operators
> 
> They're not actually removed yet, just deprecated, so if you have
> "removed" in the history file please change it.  Otherwise, the
> docs are updated.

Deprecated.  Sorry. Never updated this list.

> > Improve CREATE FUNCTION to allow type conversion specification
> >         (Bernie Frankpitt)
> 
> Huh?  I'm not sure what that is.

OK.  Here is the info.  Not sure if it is in the man page or not. 
Attached is the CVS log, and the actual diff of gram.y for that patch.

Seems the major change is:

!                        RETURNS func_return opt_with AS Sconst LANGUAGE Sconst

!                        RETURNS func_return opt_with AS func_as LANGUAGE Sconst
                                                         ^^^^^^^

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026


RCS file: /usr/local/cvsroot/pgsql/src/backend/parser/gram.y,v
Working file: gram.y
head: 2.167
branch:
locks: strict
access list:
symbolic names:
	REL6_5_PATCHES: 2.88.0.2
	REL6_5: 2.88
	REL6_4: 2.37.0.2
	release-6-3: 2.5
	REL2_0B: 1.20.0.2
	REL2_0: 1.20
	Release_2_0_0: 1.7
	Release_1_0_3: 1.2.0.2
	Release_2_0: 1.6
	Release_1_0_2: 1.2
	PG95-1_01: 1.1.1.1
	PG95_DIST: 1.1.1
keyword substitution: kv
total revisions: 283;	selected revisions: 1
description:
----------------------------
revision 2.100
date: 1999/09/28 04:34:44;  author: momjian;  state: Exp;  lines: +9 -3
   I have been working with user defined types and user defined c
functions.  One problem that I have encountered with the function
manager is that it does not allow the user to define type conversion
functions that convert between user types. For instance if mytype1,
mytype2, and mytype3 are three Postgresql user types, and if I wish to
define Postgresql conversion functions like

I run into problems, because the Postgresql dynamic loader would look
for a single link symbol, mytype3, for both pieces of object code.  If
I just change the name of one of the Postgresql functions (to make the
symbols distinct), the automatic type conversion that Postgresql uses,
for example, when matching operators to arguments no longer finds the
type conversion function.

The solution that I propose, and have implemented in the attatched
patch extends the CREATE FUNCTION syntax as follows. In the first case
above I use the link symbol mytype2_to_mytype3 for the link object
that implements the first conversion function, and define the
Postgresql operator with the following syntax

The patch includes changes to the parser to include the altered
syntax, changes to the ProcedureStmt node in nodes/parsenodes.h,
changes to commands/define.c to handle the extra information in the AS
clause, and changes to utils/fmgr/dfmgr.c that alter the way that the
dynamic loader figures out what link symbol to use.  I store the
string for the link symbol in the prosrc text attribute of the pg_proc
table which is currently unused in rows that reference dynamically
loaded
functions.


Bernie Frankpitt
=============================================================================

Index: gram.y
===================================================================
RCS file: /usr/local/cvsroot/pgsql/src/backend/parser/gram.y,v
retrieving revision 2.99
retrieving revision 2.100
diff -c -r2.99 -r2.100
*** gram.y	1999/09/23 17:02:46	2.99
--- gram.y	1999/09/28 04:34:44	2.100
***************
*** 10,16 ****
   *
   *
   * IDENTIFICATION
!  *	  $Header: /usr/local/cvsroot/pgsql/src/backend/parser/gram.y,v 2.99 1999/09/23 17:02:46 momjian Exp $
   *
   * HISTORY
   *	  AUTHOR			DATE			MAJOR EVENT
--- 10,16 ----
   *
   *
   * IDENTIFICATION
!  *	  $Header: /usr/local/cvsroot/pgsql/src/backend/parser/gram.y,v 2.100 1999/09/28 04:34:44 momjian Exp $
   *
   * HISTORY
   *	  AUTHOR			DATE			MAJOR EVENT
***************
*** 163,169 ****
  %type <list>	stmtblock, stmtmulti,
  		result, relation_name_list, OptTableElementList,
  		OptInherit, definition,
! 		opt_with, func_args, func_args_list,
  		oper_argtypes, RuleActionList, RuleActionBlock, RuleActionMulti,
  		opt_column_list, columnList, opt_va_list, va_list,
  		sort_clause, sortby_list, index_params, index_list, name_list,
--- 163,169 ----
  %type <list>	stmtblock, stmtmulti,
  		result, relation_name_list, OptTableElementList,
  		OptInherit, definition,
! 		opt_with, func_args, func_args_list, func_as,
  		oper_argtypes, RuleActionList, RuleActionBlock, RuleActionMulti,
  		opt_column_list, columnList, opt_va_list, va_list,
  		sort_clause, sortby_list, index_params, index_list, name_list,
***************
*** 1923,1929 ****
   *****************************************************************************/
  
  ProcedureStmt:	CREATE FUNCTION func_name func_args
! 			 RETURNS func_return opt_with AS Sconst LANGUAGE Sconst
  				{
  					ProcedureStmt *n = makeNode(ProcedureStmt);
  					n->funcname = $3;
--- 1923,1929 ----
   *****************************************************************************/
  
  ProcedureStmt:	CREATE FUNCTION func_name func_args
! 			 RETURNS func_return opt_with AS func_as LANGUAGE Sconst
  				{
  					ProcedureStmt *n = makeNode(ProcedureStmt);
  					n->funcname = $3;
***************
*** 1947,1952 ****
--- 1947,1958 ----
  				{	$$ = lcons(makeString($1),NIL); }
  		| func_args_list ',' TypeId
  				{	$$ = lappend($1,makeString($3)); }
+ 		;
+ 
+ func_as: Sconst	
+ 				{   $$ = lcons(makeString($1),NIL); }
+ 		| Sconst ',' Sconst
+ 				{ 	$$ = lappend(lcons(makeString($1),NIL), makeString($3)); }
  		;
  
  func_return:  set_opt TypeId
Sat, 8 Apr 2000 17:42:56 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: [HACKERS] Doc updates
Bruce Momjian <pgman@candle.pha.pa.us> writes:
>>>> Improve CREATE FUNCTION to allow type conversion specification
>>>> (Bernie Frankpitt)
>> 
>> Huh?  I'm not sure what that is.

> OK.  Here is the info.  Not sure if it is in the man page or not. 
> Attached is the CVS log, and the actual diff of gram.y for that patch.

OK, now I remember.  The summary line is pretty misleading.  Perhaps
a better one is

* Function name overloading for dynamically-loaded C functions (Frankpitt)

The docs seem to be up to date on this.

			regards, tom lane

Sat, 08 Apr 2000 18:05:31 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Doc updates 
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> >>>> Improve CREATE FUNCTION to allow type conversion specification
> >>>> (Bernie Frankpitt)
> >> 
> >> Huh?  I'm not sure what that is.
> 
> > OK.  Here is the info.  Not sure if it is in the man page or not. 
> > Attached is the CVS log, and the actual diff of gram.y for that patch.
> 
> OK, now I remember.  The summary line is pretty misleading.  Perhaps
> a better one is
> 
> * Function name overloading for dynamically-loaded C functions (Frankpitt)
> 
> The docs seem to be up to date on this.

release.sgml updated.  Thanks.  I will generate a new HISTORY just
before final release.  I need to go over the cvs logs since last run
again as we continue to add things.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Sat, 8 Apr 2000 18:10:40 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: [HACKERS] Doc updates
Hi all,

This is documented in two places, both in the CREATE FUNCTION
documentation page of the user guide, and in the Developers guide 
under the section on extending postgres by writing dynamically loaded
functions.  Is there a man page that needs updating too?

Maybe a topic index to the documentation would make it easier to find
all the documentation for a particular topic. Is it easy to do that in
sgml?

Bernie Frankpitt

Bruce Momjian wrote:

> > > Improve CREATE FUNCTION to allow type conversion specification
> > >         (Bernie Frankpitt)
> >
> > Huh?  I'm not sure what that is.
> 
> OK.  Here is the info.  Not sure if it is in the man page or not.
> Attached is the CVS log, and the actual diff of gram.y for that patch.
> 
> Seems the major change is:
> 
> !                        RETURNS func_return opt_with AS Sconst LANGUAGE Sconst
> 
> !                        RETURNS func_return opt_with AS func_as LANGUAGE Sconst
>                                                          ^^^^^^^
> 
> --
>   Bruce Momjian                        |  http://www.op.net/~candle
>   pgman@candle.pha.pa.us               |  (610) 853-3000
>   +  If your life is a hard drive,     |  830 Blythe Avenue
>   +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
> 
>

Sat, 08 Apr 2000 18:20:19 -0400
Bernard Frankpitt <frankpit@erols.com>
Re: [HACKERS] Doc updates