Open 6.4 items

Started by Bruce Momjianover 27 years ago39 messageshackers
Jump to latest
#1Bruce Momjian
bruce@momjian.us

Additions
---------
CREATE TABLE test (x text, s serial) fails if no database creation permission
regression test all platforms

Serious Items
------------
change pg args for platforms that don't support argv changes
(setproctitle()?, sendmail hack?)

Docs
----
generate html/postscript documentation
(User's Guide, Administrator's Guide, Programmer's Guide) (Thomas)
make sure all changes are documented properly
markup and merge JDBC docs from Peter (Thomas, others??)
merge the release notes into doc/src/sgml/release.sgml (Bruce, Thomas)
generate new text-format INSTALL and README from sgml sources (Thomas)
markup of Jan's PL docs

Minor items
-----------
cnf-ify still can exhaust memory, make SET KSQO more generic
permissions on indexes: what do they do? should it be prevented?
allow multiple generic operators in expressions without the use of parentheses
document/trigger/rule so changes to pg_shadow create pg_pwd
large objects orphanage
improve group handling
improve PRIMARY KEY handling
generate postmaster pid file and remove flock/fcntl lock code
add ability to specifiy location of lock/socket files

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@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
#2Jan Wieck
JanWieck@Yahoo.com
In reply to: Bruce Momjian (#1)
Re: [HACKERS] Open 6.4 items

Bruce Momjian wrote:

Additions
---------
CREATE TABLE test (x text, s serial) fails if no database creation permission
regression test all platforms

The patch below arranges that the sequence(s) get created
first. Unprivileged user now can create table with serial
columns.

Regression tested.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#======================================== jwieck@debis.com (Jan Wieck) #

*** analyze.c.orig	Wed Oct 28 14:50:47 1998
--- analyze.c	Wed Oct 28 14:59:12 1998
***************
*** 42,48 ****
  static Query *transformCursorStmt(ParseState *pstate, SelectStmt *stmt);
  static Query *transformCreateStmt(ParseState *pstate, CreateStmt *stmt);

! List *extras = NIL;

  /*
   * parse_analyze -
--- 42,49 ----
  static Query *transformCursorStmt(ParseState *pstate, SelectStmt *stmt);
  static Query *transformCreateStmt(ParseState *pstate, CreateStmt *stmt);

! List *extras_before = NIL;
! List *extras_after = NIL;

  /*
   * parse_analyze -
***************
*** 57,62 ****
--- 58,64 ----
  {
  	QueryTreeList *result;
  	ParseState *pstate;
+ 	Query *parsetree;
  	int			i = 0;

result = malloc(sizeof(QueryTreeList));
***************
*** 66,88 ****
while (pl != NIL)
{
pstate = make_parsestate(parentParseState);
! result->qtrees[i++] = transformStmt(pstate, lfirst(pl));
if (pstate->p_target_relation != NULL)
heap_close(pstate->p_target_relation);

! 		if (extras != NIL)
  		{
! 			result->len += length(extras);
  			result->qtrees = (Query **) realloc(result->qtrees, result->len * sizeof(Query *));
! 			while (extras != NIL)
  			{
! 				result->qtrees[i++] = transformStmt(pstate, lfirst(extras));
  				if (pstate->p_target_relation != NULL)
  					heap_close(pstate->p_target_relation);
! 				extras = lnext(extras);
  			}
  		}
! 		extras = NIL;
  		pl = lnext(pl);
  		pfree(pstate);
  	}
--- 68,107 ----
  	while (pl != NIL)
  	{
  		pstate = make_parsestate(parentParseState);
! 		parsetree = transformStmt(pstate, lfirst(pl));
  		if (pstate->p_target_relation != NULL)
  			heap_close(pstate->p_target_relation);
! 		if (extras_before != NIL)
  		{
! 			result->len += length(extras_before);
  			result->qtrees = (Query **) realloc(result->qtrees, result->len * sizeof(Query *));
! 			while (extras_before != NIL)
  			{
! 				result->qtrees[i++] = transformStmt(pstate, lfirst(extras_before));
  				if (pstate->p_target_relation != NULL)
  					heap_close(pstate->p_target_relation);
! 				extras_before = lnext(extras_before);
  			}
  		}
! 		extras_before = NIL;
! 
! 		result->qtrees[i++] = parsetree;
! 
! 		if (extras_after != NIL)
! 		{
! 			result->len += length(extras_after);
! 			result->qtrees = (Query **) realloc(result->qtrees, result->len * sizeof(Query *));
! 			while (extras_after != NIL)
! 			{
! 				result->qtrees[i++] = transformStmt(pstate, lfirst(extras_after));
! 				if (pstate->p_target_relation != NULL)
! 					heap_close(pstate->p_target_relation);
! 				extras_after = lnext(extras_after);
! 			}
! 		}
! 		extras_after = NIL;
! 
  		pl = lnext(pl);
  		pfree(pstate);
  	}
***************
*** 487,492 ****
--- 506,512 ----
  	Constraint *constraint;
  	List	   *keys;
  	Ident	   *key;
+ 	List	   *blist = NIL;
  	List	   *ilist = NIL;
  	IndexStmt  *index;
  	IndexElem  *iparam;
***************
*** 553,559 ****
  					elog(NOTICE, "CREATE TABLE will create implicit sequence %s for SERIAL column %s.%s",
  					  sequence->seqname, stmt->relname, column->colname);

! ilist = lcons(sequence, NIL);
}

  				if (column->constraints != NIL)
--- 573,579 ----
  					elog(NOTICE, "CREATE TABLE will create implicit sequence %s for SERIAL column %s.%s",
  					  sequence->seqname, stmt->relname, column->colname);

! blist = lcons(sequence, NIL);
}

if (column->constraints != NIL)
***************
*** 745,751 ****
}

q->utilityStmt = (Node *) stmt;
! extras = ilist;

  	return q;
  }
--- 765,772 ----
  	}

q->utilityStmt = (Node *) stmt;
! extras_before = blist;
! extras_after = ilist;

return q;
}

#3The Hermit Hacker
scrappy@hub.org
In reply to: Jan Wieck (#2)
Re: [HACKERS] Open 6.4 items

On Wed, 28 Oct 1998, Jan Wieck wrote:

Bruce Momjian wrote:

Additions
---------
CREATE TABLE test (x text, s serial) fails if no database creation permission
regression test all platforms

The patch below arranges that the sequence(s) get created
first. Unprivileged user now can create table with serial
columns.

Is this safe to leave until post-v6.4 released?

Regression tested.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#======================================== jwieck@debis.com (Jan Wieck) #

*** analyze.c.orig	Wed Oct 28 14:50:47 1998
--- analyze.c	Wed Oct 28 14:59:12 1998
***************
*** 42,48 ****
static Query *transformCursorStmt(ParseState *pstate, SelectStmt *stmt);
static Query *transformCreateStmt(ParseState *pstate, CreateStmt *stmt);

! List *extras = NIL;

/*
* parse_analyze -
--- 42,49 ----
static Query *transformCursorStmt(ParseState *pstate, SelectStmt *stmt);
static Query *transformCreateStmt(ParseState *pstate, CreateStmt *stmt);

! List *extras_before = NIL;
! List *extras_after = NIL;

/*
* parse_analyze -
***************
*** 57,62 ****
--- 58,64 ----
{
QueryTreeList *result;
ParseState *pstate;
+ 	Query *parsetree;
int			i = 0;

result = malloc(sizeof(QueryTreeList));
***************
*** 66,88 ****
while (pl != NIL)
{
pstate = make_parsestate(parentParseState);
! result->qtrees[i++] = transformStmt(pstate, lfirst(pl));
if (pstate->p_target_relation != NULL)
heap_close(pstate->p_target_relation);

! 		if (extras != NIL)
{
! 			result->len += length(extras);
result->qtrees = (Query **) realloc(result->qtrees, result->len * sizeof(Query *));
! 			while (extras != NIL)
{
! 				result->qtrees[i++] = transformStmt(pstate, lfirst(extras));
if (pstate->p_target_relation != NULL)
heap_close(pstate->p_target_relation);
! 				extras = lnext(extras);
}
}
! 		extras = NIL;
pl = lnext(pl);
pfree(pstate);
}
--- 68,107 ----
while (pl != NIL)
{
pstate = make_parsestate(parentParseState);
! 		parsetree = transformStmt(pstate, lfirst(pl));
if (pstate->p_target_relation != NULL)
heap_close(pstate->p_target_relation);
! 		if (extras_before != NIL)
{
! 			result->len += length(extras_before);
result->qtrees = (Query **) realloc(result->qtrees, result->len * sizeof(Query *));
! 			while (extras_before != NIL)
{
! 				result->qtrees[i++] = transformStmt(pstate, lfirst(extras_before));
if (pstate->p_target_relation != NULL)
heap_close(pstate->p_target_relation);
! 				extras_before = lnext(extras_before);
}
}
! 		extras_before = NIL;
! 
! 		result->qtrees[i++] = parsetree;
! 
! 		if (extras_after != NIL)
! 		{
! 			result->len += length(extras_after);
! 			result->qtrees = (Query **) realloc(result->qtrees, result->len * sizeof(Query *));
! 			while (extras_after != NIL)
! 			{
! 				result->qtrees[i++] = transformStmt(pstate, lfirst(extras_after));
! 				if (pstate->p_target_relation != NULL)
! 					heap_close(pstate->p_target_relation);
! 				extras_after = lnext(extras_after);
! 			}
! 		}
! 		extras_after = NIL;
! 
pl = lnext(pl);
pfree(pstate);
}
***************
*** 487,492 ****
--- 506,512 ----
Constraint *constraint;
List	   *keys;
Ident	   *key;
+ 	List	   *blist = NIL;
List	   *ilist = NIL;
IndexStmt  *index;
IndexElem  *iparam;
***************
*** 553,559 ****
elog(NOTICE, "CREATE TABLE will create implicit sequence %s for SERIAL column %s.%s",
sequence->seqname, stmt->relname, column->colname);

! ilist = lcons(sequence, NIL);
}

if (column->constraints != NIL)
--- 573,579 ----
elog(NOTICE, "CREATE TABLE will create implicit sequence %s for SERIAL column %s.%s",
sequence->seqname, stmt->relname, column->colname);

! blist = lcons(sequence, NIL);
}

if (column->constraints != NIL)
***************
*** 745,751 ****
}

q->utilityStmt = (Node *) stmt;
! extras = ilist;

return q;
}
--- 765,772 ----
}

q->utilityStmt = (Node *) stmt;
! extras_before = blist;
! extras_after = ilist;

return q;
}

Marc G. Fournier
Systems Administrator @ hub.org
primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org

#4Bruce Momjian
bruce@momjian.us
In reply to: Jan Wieck (#2)
Re: [HACKERS] Open 6.4 items

Thanks. Applied.

Bruce Momjian wrote:

Additions
---------
CREATE TABLE test (x text, s serial) fails if no database creation permission
regression test all platforms

The patch below arranges that the sequence(s) get created
first. Unprivileged user now can create table with serial
columns.

Regression tested.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#======================================== jwieck@debis.com (Jan Wieck) #

*** analyze.c.orig	Wed Oct 28 14:50:47 1998
--- analyze.c	Wed Oct 28 14:59:12 1998
***************
*** 42,48 ****
static Query *transformCursorStmt(ParseState *pstate, SelectStmt *stmt);
static Query *transformCreateStmt(ParseState *pstate, CreateStmt *stmt);

! List *extras = NIL;

/*
* parse_analyze -
--- 42,49 ----
static Query *transformCursorStmt(ParseState *pstate, SelectStmt *stmt);
static Query *transformCreateStmt(ParseState *pstate, CreateStmt *stmt);

! List *extras_before = NIL;
! List *extras_after = NIL;

/*
* parse_analyze -
***************
*** 57,62 ****
--- 58,64 ----
{
QueryTreeList *result;
ParseState *pstate;
+ 	Query *parsetree;
int			i = 0;

result = malloc(sizeof(QueryTreeList));
***************
*** 66,88 ****
while (pl != NIL)
{
pstate = make_parsestate(parentParseState);
! result->qtrees[i++] = transformStmt(pstate, lfirst(pl));
if (pstate->p_target_relation != NULL)
heap_close(pstate->p_target_relation);

! 		if (extras != NIL)
{
! 			result->len += length(extras);
result->qtrees = (Query **) realloc(result->qtrees, result->len * sizeof(Query *));
! 			while (extras != NIL)
{
! 				result->qtrees[i++] = transformStmt(pstate, lfirst(extras));
if (pstate->p_target_relation != NULL)
heap_close(pstate->p_target_relation);
! 				extras = lnext(extras);
}
}
! 		extras = NIL;
pl = lnext(pl);
pfree(pstate);
}
--- 68,107 ----
while (pl != NIL)
{
pstate = make_parsestate(parentParseState);
! 		parsetree = transformStmt(pstate, lfirst(pl));
if (pstate->p_target_relation != NULL)
heap_close(pstate->p_target_relation);
! 		if (extras_before != NIL)
{
! 			result->len += length(extras_before);
result->qtrees = (Query **) realloc(result->qtrees, result->len * sizeof(Query *));
! 			while (extras_before != NIL)
{
! 				result->qtrees[i++] = transformStmt(pstate, lfirst(extras_before));
if (pstate->p_target_relation != NULL)
heap_close(pstate->p_target_relation);
! 				extras_before = lnext(extras_before);
}
}
! 		extras_before = NIL;
! 
! 		result->qtrees[i++] = parsetree;
! 
! 		if (extras_after != NIL)
! 		{
! 			result->len += length(extras_after);
! 			result->qtrees = (Query **) realloc(result->qtrees, result->len * sizeof(Query *));
! 			while (extras_after != NIL)
! 			{
! 				result->qtrees[i++] = transformStmt(pstate, lfirst(extras_after));
! 				if (pstate->p_target_relation != NULL)
! 					heap_close(pstate->p_target_relation);
! 				extras_after = lnext(extras_after);
! 			}
! 		}
! 		extras_after = NIL;
! 
pl = lnext(pl);
pfree(pstate);
}
***************
*** 487,492 ****
--- 506,512 ----
Constraint *constraint;
List	   *keys;
Ident	   *key;
+ 	List	   *blist = NIL;
List	   *ilist = NIL;
IndexStmt  *index;
IndexElem  *iparam;
***************
*** 553,559 ****
elog(NOTICE, "CREATE TABLE will create implicit sequence %s for SERIAL column %s.%s",
sequence->seqname, stmt->relname, column->colname);

! ilist = lcons(sequence, NIL);
}

if (column->constraints != NIL)
--- 573,579 ----
elog(NOTICE, "CREATE TABLE will create implicit sequence %s for SERIAL column %s.%s",
sequence->seqname, stmt->relname, column->colname);

! blist = lcons(sequence, NIL);
}

if (column->constraints != NIL)
***************
*** 745,751 ****
}

q->utilityStmt = (Node *) stmt;
! extras = ilist;

return q;
}
--- 765,772 ----
}

q->utilityStmt = (Node *) stmt;
! extras_before = blist;
! extras_after = ilist;

return q;
}

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@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
#5Bruce Momjian
bruce@momjian.us
In reply to: Bruce Momjian (#4)
Re: [HACKERS] Open 6.4 items

Marc wrote:

On Wed, 28 Oct 1998, Jan Wieck wrote:

Bruce Momjian wrote:

Additions
---------
CREATE TABLE test (x text, s serial) fails if no database creation permission
regression test all platforms

The patch below arranges that the sequence(s) get created
first. Unprivileged user now can create table with serial
columns.

Is this safe to leave until post-v6.4 released?

I just did it now to let Bruce get rid of the open item. If
it shouldn't be in 6.4, why is it on it's open item list
then?

It has been on the open items. In fact, it is the only hot item, except
for the 'pg args' thing, which is not as hot.

It is serious breakage, in the sense that if we don't fix it, we must
remove reference to the new SERIAL type.

As to why no one fixed it earlier, ...? Must be the same reason 'ps
args' is not fixed. :-)

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@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
#6Jan Wieck
JanWieck@Yahoo.com
In reply to: The Hermit Hacker (#3)
Re: [HACKERS] Open 6.4 items

Marc wrote:

On Wed, 28 Oct 1998, Jan Wieck wrote:

Bruce Momjian wrote:

Additions
---------
CREATE TABLE test (x text, s serial) fails if no database creation permission
regression test all platforms

The patch below arranges that the sequence(s) get created
first. Unprivileged user now can create table with serial
columns.

Is this safe to leave until post-v6.4 released?

I just did it now to let Bruce get rid of the open item. If
it shouldn't be in 6.4, why is it on it's open item list
then?

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#======================================== jwieck@debis.com (Jan Wieck) #

#7Jan Wieck
JanWieck@Yahoo.com
In reply to: Bruce Momjian (#4)
Re: [HACKERS] Open 6.4 items

Thanks. Applied.

Bruce Momjian wrote:

Additions
---------
CREATE TABLE test (x text, s serial) fails if no database creation permission
regression test all platforms

The patch below arranges that the sequence(s) get created
first. Unprivileged user now can create table with serial
columns.

Regression tested.

So Marc's assumption that his BETA3 is what we release was
false. We really know how to trigger his hot buttons - eh?
:-)

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#======================================== jwieck@debis.com (Jan Wieck) #

#8Thomas Lockhart
lockhart@alumni.caltech.edu
In reply to: Bruce Momjian (#5)
Re: [HACKERS] Open 6.4 items

It is serious breakage, in the sense that if we don't fix it, we must
remove reference to the new SERIAL type.
As to why no one fixed it earlier, ...? Must be the same reason 'ps
args' is not fixed. :-)

I'm comfortable with Jan's patches, and it's my code he's mucking with
:) For the transformation from serial to int4 with index and sequence,
the only time that code gets traversed is for the serial type. So it
shouldn't have hidden side effects (yeah, sure...)

'Course, I see Bruce has already committed it anyway...

- Tom

#9Bruce Momjian
bruce@momjian.us
In reply to: Thomas Lockhart (#8)
Re: [HACKERS] Open 6.4 items

Here are the open items. Thanks to Jan, the only 'hot' item left is the
ps args issue. People on non-BSD platforms will see all their backends
called 'postmaster', because argv[0] changes do not reflect in ps arg
displays.

I have asked that at least we get set_proctitle() working for Linux, but
no one wants to do it, and we can't remove the it because we would have
to add the exec() back into backend creation, which is impossible at
this point.

I'm running Linux 2.1.88 and get

15572 p2 S 0:01 /usr/local/pgsql/bin/postmaster -o -F
16121 p2 S 0:01 /usr/local/pgsql/bin/postgres localhost twieck twieck idle

from ps. So what isn't working?

Whoh, this is a shock. I thought this trick did not work under Linux.
If it does, and no one has complained, we can consider the issue closed.

Massimo did a nice job of moving my ps status stuff into pg_status.h,
but it looks like the same code that modifies argv[0]. Perhaps it is
the Linux version you are using.

It give us a cheap 'db monitor' capability, wrapped into the 'ps'
command.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@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
#10Andreas Zeugswetter
andreas.zeugswetter@telecom.at
In reply to: Bruce Momjian (#9)
AW: [HACKERS] Open 6.4 items

I'm running Linux 2.1.88 and get

15572 p2 S 0:01 /usr/local/pgsql/bin/postmaster -o -F
16121 p2 S 0:01 /usr/local/pgsql/bin/postgres localhost twieck twieck idle

from ps. So what isn't working?

Also works on AIX :-)

#11Brook Milligan
brook@trillium.NMSU.Edu
In reply to: Bruce Momjian (#9)
Re: [HACKERS] Open 6.4 items

I'm running Linux 2.1.88 and get

15572 p2 S 0:01 /usr/local/pgsql/bin/postmaster -o -F
16121 p2 S 0:01 /usr/local/pgsql/bin/postgres localhost twieck twieck idle

from ps. So what isn't working?

Whoh, this is a shock. I thought this trick did not work under Linux.
If it does, and no one has complained, we can consider the issue closed.

For whatever it's worth, I see the same status stuff changing under
NetBSD 1.3.2. Seems to work fine.

Cheers,
Brook

#12Thomas Lockhart
lockhart@alumni.caltech.edu
In reply to: Jan Wieck (#7)
Re: [HACKERS] Open 6.4 items

So Marc's assumption that his BETA3 is what we release was
false. We really know how to trigger his hot buttons - eh?
:-)

Good point. I just committed a _very_ small bit of code in the ODBC
interface which is non-essential, but potentially useful.

Also, he will have to rebuild a tarball one more time anyway to get the
new docs, which won't be finished until the last minute.

Just to get his blood pressure up, I'll mention that there is a chance
I'll ask for a couple of extra days to finish docs, but I'm hoping to
have them done on time :)

- Tom

#13The Hermit Hacker
scrappy@hub.org
In reply to: Jan Wieck (#7)
Re: [HACKERS] Open 6.4 items

On Wed, 28 Oct 1998, Jan Wieck wrote:

Thanks. Applied.

Bruce Momjian wrote:

Additions
---------
CREATE TABLE test (x text, s serial) fails if no database creation permission
regression test all platforms

The patch below arranges that the sequence(s) get created
first. Unprivileged user now can create table with serial
columns.

Regression tested.

So Marc's assumption that his BETA3 is what we release was
false. We really know how to trigger his hot buttons - eh?
:-)

If it was 'the release', it wouldn't have been named BETA :) I'll
build a BETA4 tomorrow...release set for Monday...

Marc G. Fournier
Systems Administrator @ hub.org
primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org

#14The Hermit Hacker
scrappy@hub.org
In reply to: Brook Milligan (#11)
Re: [HACKERS] Open 6.4 items

Doesn't work under Solaris, but, then again, neither does sendamil's, so
that isn't a shock :)

On Wed, 28 Oct 1998, Brook Milligan wrote:

I'm running Linux 2.1.88 and get

15572 p2 S 0:01 /usr/local/pgsql/bin/postmaster -o -F
16121 p2 S 0:01 /usr/local/pgsql/bin/postgres localhost twieck twieck idle

from ps. So what isn't working?

Whoh, this is a shock. I thought this trick did not work under Linux.
If it does, and no one has complained, we can consider the issue closed.

For whatever it's worth, I see the same status stuff changing under
NetBSD 1.3.2. Seems to work fine.

Cheers,
Brook

Marc G. Fournier
Systems Administrator @ hub.org
primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org

#15Bruce Momjian
bruce@momjian.us
In reply to: The Hermit Hacker (#14)
Re: [HACKERS] Open 6.4 items

Doesn't work under Solaris, but, then again, neither does sendamil's, so
that isn't a shock :)

Man, if sendmail's doesn't work, that is really broken.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@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
#16The Hermit Hacker
scrappy@hub.org
In reply to: Bruce Momjian (#15)
Re: [HACKERS] Open 6.4 items

On Wed, 28 Oct 1998, Bruce Momjian wrote:

Doesn't work under Solaris, but, then again, neither does sendamil's, so
that isn't a shock :)

Man, if sendmail's doesn't work, that is really broken.

Solaris just doesn't have any mechanisms to work around the
limitation, I guess *shrug* It really sucks when you want to SIGHUP the
"parent process", which, under FreeBSD at least, is the one that states:
-accepting connections, but under Solaris they are *all* the same :)

Marc G. Fournier
Systems Administrator @ hub.org
primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org

#17Billy G. Allie
Bill.Allie@mug.org
In reply to: The Hermit Hacker (#14)
Re: [HACKERS] Open 6.4 items

Doesn't work under UnixWare, either.

The Hermit Hacker wrote:

Doesn't work under Solaris, but, then again, neither does sendamil's, so
that isn't a shock :)

On Wed, 28 Oct 1998, Brook Milligan wrote:

I'm running Linux 2.1.88 and get

15572 p2 S 0:01 /usr/local/pgsql/bin/postmaster -o -F
16121 p2 S 0:01 /usr/local/pgsql/bin/postgres localhost twieck twieck idle

from ps. So what isn't working?

Whoh, this is a shock. I thought this trick did not work under Linux.
If it does, and no one has complained, we can consider the issue closed.

For whatever it's worth, I see the same status stuff changing under
NetBSD 1.3.2. Seems to work fine.

Cheers,
Brook

Marc G. Fournier
Systems Administrator @ hub.org
primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org

--
____ | Billy G. Allie | Domain....: Bill.Allie@mug.org
| /| | 7436 Hartwell | Compuserve: 76337,2061
|-/-|----- | Dearborn, MI 48126| MSN.......: B_G_Allie@email.msn.com
|/ |LLIE | (313) 582-1540 |

#18Billy G. Allie
Bill.Allie@mug.org
In reply to: Bruce Momjian (#15)
Re: [HACKERS] Open 6.4 items

Bruce Momjian wrote:

Doesn't work under Solaris, but, then again, neither does sendamil's, so
that isn't a shock :)

Man, if sendmail's doesn't work, that is really broken.

If you want strange, here is the output from the UnixWare 7 ps command with
some different options:

$ ps -ef | fgrep post
pgsql 10775 1 TS 80 0 01:34:12 ? 0:00 postmaster -S -i -o -F
pgsql 10869 10775 TS 80 0 01:45:30 ? 0:00 postmaster -S -i -o -F

$ ps -e | fgrep post
10775 TS 80 ? 0:00 postgres
10869 TS 80 ? 0:00 postgres

Notice that the PIDs are the same even if the program name is different
depending on the use of the 'f' option.
--
____ | Billy G. Allie | Domain....: Bill.Allie@mug.org
| /| | 7436 Hartwell | Compuserve: 76337,2061
|-/-|----- | Dearborn, MI 48126| MSN.......: B_G_Allie@email.msn.com
|/ |LLIE | (313) 582-1540 |

#19Bruce Momjian
bruce@momjian.us
In reply to: Billy G. Allie (#18)
Re: [HACKERS] Open 6.4 items

Bruce Momjian wrote:

Doesn't work under Solaris, but, then again, neither does sendamil's, so
that isn't a shock :)

Man, if sendmail's doesn't work, that is really broken.

If you want strange, here is the output from the UnixWare 7 ps command with
some different options:

$ ps -ef | fgrep post
pgsql 10775 1 TS 80 0 01:34:12 ? 0:00 postmaster -S -i -o -F
pgsql 10869 10775 TS 80 0 01:45:30 ? 0:00 postmaster -S -i -o -F

$ ps -e | fgrep post
10775 TS 80 ? 0:00 postgres
10869 TS 80 ? 0:00 postgres

Notice that the PIDs are the same even if the program name is different
depending on the use of the 'f' option.

Wow, that really is strange. Seems like with the -f, it looks in one
place, as though it knows the child did not exec, so they params must be
the same, while with no -f, it looks in the proper area. The really
weird thing is that even the postmaster is called postgres. That is
bizarre.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@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
#20Bruce Momjian
bruce@momjian.us
In reply to: Billy G. Allie (#18)
Re: [HACKERS] Open 6.4 items

Bruce Momjian wrote:

Doesn't work under Solaris, but, then again, neither does sendamil's, so
that isn't a shock :)

Man, if sendmail's doesn't work, that is really broken.

If you want strange, here is the output from the UnixWare 7 ps command with
some different options:

$ ps -ef | fgrep post
pgsql 10775 1 TS 80 0 01:34:12 ? 0:00 postmaster -S -i -o -F
pgsql 10869 10775 TS 80 0 01:45:30 ? 0:00 postmaster -S -i -o -F

$ ps -e | fgrep post
10775 TS 80 ? 0:00 postgres
10869 TS 80 ? 0:00 postgres

Notice that the PIDs are the same even if the program name is different
depending on the use of the 'f' option.

That is really bizarre. The postmaster name is changed to postgres too!

Ah, I now know why things work on Linux. Massimo did more than just
parameterize my argv code. In include/utils/ps_status.h, he put in
Linux-specific code to handle the ps args. Seems under Linux, only
argv[0] can be modified for ps display, for some reason. He erases the
other args, and puts everything in argv[0].

Under non-linux, he uses the argv[0-4] for various displays, like my
orignal code. The major issue is that for Linux, he writes directly
into argv[0] memory. He sets the normal i/o static parameters in the
start of the string, then marks the next position, and writes status
information into there.

In non-Linux, we don't write into argv[0], but change argv[0..4] to
point to our own alloc'ed strings, where the memory sits in our own
address space, not in the proc 'environment' address space. Getting
'ps' to display process address space strings is a real trick, so it is
not surprising some O/S's don't support it.

He may have done it all in argv[0] because he is expanding the size of
argv[0], and if they are layed out sequentially in environment memory,
the changes would over-write each other. What I don't understand is why
ps when it goes to look at argv[1], does not see garbage because it may
be pointing into the middle of the argv[0] string.) Can a Linux user
use ps to display all the params, like 'ps -ef' and see if it is showing
argv[1] as part of the argv[0] string? You may have to get a wide
display to see it all.

The great news is that it seems it is working to write directly into the
environment address space under Linux, so we don't need set_proctitle,
and it is very fast.

Non-linux platforms are not writing directly to environment memory, but
are using the argv[0..4] trick.

FYI, I have re-exec'ed the postmaster in postmaster.h so it has 4 args.
argc is passed as a value to the program, so you can't change it, and if
you don't do the re-exec, ps only looks at the argv[0], and under
non-linux, that is bad because we use argv[0...4].

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@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
#21Matthew N. Dodd
winter@jurai.net
In reply to: The Hermit Hacker (#16)
#22Jan Wieck
JanWieck@Yahoo.com
In reply to: Matthew N. Dodd (#21)
#23Matthew N. Dodd
winter@jurai.net
In reply to: Jan Wieck (#22)
#24Taral
taral@mail.utexas.edu
In reply to: Bruce Momjian (#19)
#25The Hermit Hacker
scrappy@hub.org
In reply to: Billy G. Allie (#17)
#26The Hermit Hacker
scrappy@hub.org
In reply to: Matthew N. Dodd (#21)
#27The Hermit Hacker
scrappy@hub.org
In reply to: Jan Wieck (#22)
#28Bruce Momjian
bruce@momjian.us
In reply to: Billy G. Allie (#18)
#29Taral
taral@mail.utexas.edu
In reply to: The Hermit Hacker (#26)
#30Matthew N. Dodd
winter@jurai.net
In reply to: The Hermit Hacker (#26)
#31Matthew N. Dodd
winter@jurai.net
In reply to: Taral (#29)
#32Thomas Lockhart
lockhart@alumni.caltech.edu
In reply to: Matthew N. Dodd (#23)
#33The Hermit Hacker
scrappy@hub.org
In reply to: Taral (#29)
#34The Hermit Hacker
scrappy@hub.org
In reply to: Matthew N. Dodd (#30)
#35Hannu Krosing
hannu@tm.ee
In reply to: Jan Wieck (#22)
#36Bruce Momjian
bruce@momjian.us
In reply to: Hannu Krosing (#35)
#37Hannu Krosing
hannu@tm.ee
In reply to: Bruce Momjian (#36)
#38Jan Wieck
JanWieck@Yahoo.com
In reply to: Hannu Krosing (#35)
#39Jan Wieck
JanWieck@Yahoo.com
In reply to: Jan Wieck (#38)