threads
listlengths 1
2.99k
|
---|
[
{
"msg_contents": ">\n> >> > * Allow views to specify column names outside SELECT statement\n> >>\n> >> ??? what is meant by that?\n> >\n> >I have no idea. I am removing it. Does anyone else know what it means?\n>\n> It probably means:\n> create view myview (name, salary, hours) as select lname, currsal, whours from wages;\n>\n> Andreas\n\n But that doesn't have to do anything with the rewrite system.\n It has to do with the view creation step on setting up the\n instead rule for view selection. There the AS clauses have to\n be moved into the target list. The rewrite system doesn't\n know if this rule is something that builds up a view.\n\nYes, I think this is a parser issue.\nIt can be handled in the same way as the following syntax (only the above is the standard):\ncreate view myview as select lname as name, currsal as salary, whours as hours from wages;\n\nAndreas\n\n",
"msg_date": "Fri, 28 Aug 1998 11:07:12 +0200",
"msg_from": "Andreas Zeugswetter <[email protected]>",
"msg_from_op": true,
"msg_subject": "AW: AW: TODO (was: Re: [HACKERS] Problem with parser)"
}
] |
[
{
"msg_contents": "My AIX box only accepts %lld as the long long int printf format.\n\nIf this format also works on other platforms, I think it would be nice to use this instead of %Ld\nWhat is the standard ?\n\nAndreas\n\n",
"msg_date": "Fri, 28 Aug 1998 12:27:59 +0200",
"msg_from": "Andreas Zeugswetter <[email protected]>",
"msg_from_op": true,
"msg_subject": "long long int and printf format for int8.c"
},
{
"msg_contents": "Andreas Zeugswetter wrote:\n> \n> My AIX box only accepts %lld as the long long int printf format.\n> \n> If this format also works on other platforms, I think it would be nice to use this instead of %Ld\n> What is the standard ?\n\nI believe that this falls outside the standards as compiler-specific\nextensions (for 32-bit machines anyway).\n\ngcc and glibc uses the \"%Ld\" and the Alpha box has 64-bit long ints\nanyway so would use \"%ld\". This is at least a machine- and\narchitecture-specific item.\n\nOoh, I just found in my (gnu) man page for scanf:\n\n Specifying two l flags is equivalent to the L flag.\n\nso at least for my libc both forms are supported...\n\n - Tom\n",
"msg_date": "Fri, 28 Aug 1998 14:28:27 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] long long int and printf format for int8.c"
}
] |
[
{
"msg_contents": "Hi,\n\nI have this small patch which fixes a typo in my previous lock patches.\nFortunately the bug affects only user locks.\n\n------------------------------------------------------------------------------\n*** src/backend/storage/lmgr/lock.c~\tWed Aug 26 09:00:55 1998\n--- src/backend/storage/lmgr/lock.c\tThu Aug 27 22:57:56 1998\n***************\n*** 668,674 ****\n \t\t\t{\n \t\t\t\tSHMQueueDelete(&result->queue);\n \t\t\t\tresult = (XIDLookupEnt *) hash_search(xidTable,\n! \t\t\t\t\t\t\t\t\t\t\t\t\t (Pointer) &result,\n \t\t\t\t\t\t\t\t\t\t\t\t\t HASH_REMOVE, &found);\n \t\t\t\tif (!result || !found) {\n \t\t\t\t\telog(NOTICE, \"LockAcquire: remove xid, table corrupted\");\n--- 668,674 ----\n \t\t\t{\n \t\t\t\tSHMQueueDelete(&result->queue);\n \t\t\t\tresult = (XIDLookupEnt *) hash_search(xidTable,\n! \t\t\t\t\t\t\t\t\t\t\t\t\t (Pointer) result,\n \t\t\t\t\t\t\t\t\t\t\t\t\t HASH_REMOVE, &found);\n \t\t\t\tif (!result || !found) {\n \t\t\t\t\telog(NOTICE, \"LockAcquire: remove xid, table corrupted\");\n------------------------------------------------------------------------------\n\nMassimo Dal Zotto\n\n+----------------------------------------------------------------------+\n| Massimo Dal Zotto email: [email protected] |\n| Via Marconi, 141 phone: ++39-461-534251 |\n| 38057 Pergine Valsugana (TN) www: http://www.cs.unitn.it/~dz/ |\n| Italy pgp: finger [email protected] |\n+----------------------------------------------------------------------+\n",
"msg_date": "Fri, 28 Aug 1998 13:13:39 +0200 (MET DST)",
"msg_from": "Massimo Dal Zotto <[email protected]>",
"msg_from_op": true,
"msg_subject": "minor patch"
},
{
"msg_contents": "Applied.\n\n[Charset iso-8859-1 unsupported, filtering to ASCII...]\n> Hi,\n> \n> I have this small patch which fixes a typo in my previous lock patches.\n> Fortunately the bug affects only user locks.\n> \n> ------------------------------------------------------------------------------\n> *** src/backend/storage/lmgr/lock.c~\tWed Aug 26 09:00:55 1998\n> --- src/backend/storage/lmgr/lock.c\tThu Aug 27 22:57:56 1998\n> ***************\n> *** 668,674 ****\n> \t\t\t{\n> \t\t\t\tSHMQueueDelete(&result->queue);\n> \t\t\t\tresult = (XIDLookupEnt *) hash_search(xidTable,\n> ! \t\t\t\t\t\t\t\t\t\t\t\t\t (Pointer) &result,\n> \t\t\t\t\t\t\t\t\t\t\t\t\t HASH_REMOVE, &found);\n> \t\t\t\tif (!result || !found) {\n> \t\t\t\t\telog(NOTICE, \"LockAcquire: remove xid, table corrupted\");\n> --- 668,674 ----\n> \t\t\t{\n> \t\t\t\tSHMQueueDelete(&result->queue);\n> \t\t\t\tresult = (XIDLookupEnt *) hash_search(xidTable,\n> ! \t\t\t\t\t\t\t\t\t\t\t\t\t (Pointer) result,\n> \t\t\t\t\t\t\t\t\t\t\t\t\t HASH_REMOVE, &found);\n> \t\t\t\tif (!result || !found) {\n> \t\t\t\t\telog(NOTICE, \"LockAcquire: remove xid, table corrupted\");\n> ------------------------------------------------------------------------------\n> \n> Massimo Dal Zotto\n> \n> +----------------------------------------------------------------------+\n> | Massimo Dal Zotto email: [email protected] |\n> | Via Marconi, 141 phone: ++39-461-534251 |\n> | 38057 Pergine Valsugana (TN) www: http://www.cs.unitn.it/~dz/ |\n> | Italy pgp: finger [email protected] |\n> +----------------------------------------------------------------------+\n> \n> \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Fri, 28 Aug 1998 09:49:18 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [PATCHES] minor patch"
},
{
"msg_contents": "Oops, Marc did it already. Too fast for me.\n[Charset iso-8859-1 unsupported, filtering to ASCII...]\n> Hi,\n> \n> I have this small patch which fixes a typo in my previous lock patches.\n> Fortunately the bug affects only user locks.\n> \n> ------------------------------------------------------------------------------\n> *** src/backend/storage/lmgr/lock.c~\tWed Aug 26 09:00:55 1998\n> --- src/backend/storage/lmgr/lock.c\tThu Aug 27 22:57:56 1998\n> ***************\n> *** 668,674 ****\n> \t\t\t{\n> \t\t\t\tSHMQueueDelete(&result->queue);\n> \t\t\t\tresult = (XIDLookupEnt *) hash_search(xidTable,\n> ! \t\t\t\t\t\t\t\t\t\t\t\t\t (Pointer) &result,\n> \t\t\t\t\t\t\t\t\t\t\t\t\t HASH_REMOVE, &found);\n> \t\t\t\tif (!result || !found) {\n> \t\t\t\t\telog(NOTICE, \"LockAcquire: remove xid, table corrupted\");\n> --- 668,674 ----\n> \t\t\t{\n> \t\t\t\tSHMQueueDelete(&result->queue);\n> \t\t\t\tresult = (XIDLookupEnt *) hash_search(xidTable,\n> ! \t\t\t\t\t\t\t\t\t\t\t\t\t (Pointer) result,\n> \t\t\t\t\t\t\t\t\t\t\t\t\t HASH_REMOVE, &found);\n> \t\t\t\tif (!result || !found) {\n> \t\t\t\t\telog(NOTICE, \"LockAcquire: remove xid, table corrupted\");\n> ------------------------------------------------------------------------------\n> \n> Massimo Dal Zotto\n> \n> +----------------------------------------------------------------------+\n> | Massimo Dal Zotto email: [email protected] |\n> | Via Marconi, 141 phone: ++39-461-534251 |\n> | 38057 Pergine Valsugana (TN) www: http://www.cs.unitn.it/~dz/ |\n> | Italy pgp: finger [email protected] |\n> +----------------------------------------------------------------------+\n> \n> \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Fri, 28 Aug 1998 09:49:53 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] minor patch"
}
] |
[
{
"msg_contents": "This one is against the current archive (so it contains the one I send the\nother day). It should fix the AIX problems. Andreas, could you please try\nit? Thanks.\n\nMichael\n\ndiff -rcN ecpg/ChangeLog ecpg.mm/ChangeLog\n*** ecpg/ChangeLog\tTue Aug 25 19:11:36 1998\n--- ecpg.mm/ChangeLog\tFri Aug 28 15:37:46 1998\n***************\n*** 297,299 ****\n--- 297,313 ----\n \t- Cleaned up memory allocation in ecpglib.c\n \t- Set library version to 2.6\n \n+ Wed Aug 26 16:17:39 CEST 1998\n+ \n+ \t- Sync preproc.y with gram.y\n+ \n+ Thu Aug 27 15:32:23 CEST 1998\n+ \n+ \t- Fix some minor glitches that the AIX compiler complains about\n+ \t- Added patchlevel to library\n+ \n+ Fri Aug 28 15:36:58 CEST 1998\n+ \n+ \t- Removed one line of code that AIX complains about since it was not\n+ \t needed anyway\n+ \t- Set library version to 2.6.1\ndiff -rcN ecpg/lib/Makefile.in ecpg.mm/lib/Makefile.in\n*** ecpg/lib/Makefile.in\tTue Aug 25 19:11:37 1998\n--- ecpg.mm/lib/Makefile.in\tThu Aug 27 15:34:39 1998\n***************\n*** 5,10 ****\n--- 5,11 ----\n \n SO_MAJOR_VERSION=2\n SO_MINOR_VERSION=6\n+ SO_PATCHLEVEL=1\n \n PORTNAME=@PORTNAME@\n \n***************\n*** 19,39 ****\n LINUX_ELF=@LINUX_ELF@\n ifdef LINUX_ELF\n install-shlib-dep := install-shlib\n! shlib := libecpg.so.$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)\n LDFLAGS_SL = -shared -soname libecpg.so.$(SO_MAJOR_VERSION)\n endif\n endif\n ifeq ($(PORTNAME), bsd)\n ifdef BSD_SHLIB\n install-shlib-dep := install-shlib\n! shlib := libecpg.so.$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)\n LDFLAGS_SL = -x -Bshareable -Bforcearchive\n CFLAGS += $(CFLAGS_SL)\n endif\n endif\n #ifeq ($(PORTNAME), solaris)\n # install-shlib-dep := install-shlib\n! # shlib := libecpg.so.$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)\n # LDFLAGS_SL = -G -z text\n # CFLAGS += $(CFLAGS_SL)\n #endif\n--- 20,40 ----\n LINUX_ELF=@LINUX_ELF@\n ifdef LINUX_ELF\n install-shlib-dep := install-shlib\n! shlib := libecpg.so.$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION).$(SO_PATCHLEVEL)\n LDFLAGS_SL = -shared -soname libecpg.so.$(SO_MAJOR_VERSION)\n endif\n endif\n ifeq ($(PORTNAME), bsd)\n ifdef BSD_SHLIB\n install-shlib-dep := install-shlib\n! shlib := libecpg.so.$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION).$(SO_PATCHLEVEL)\n LDFLAGS_SL = -x -Bshareable -Bforcearchive\n CFLAGS += $(CFLAGS_SL)\n endif\n endif\n #ifeq ($(PORTNAME), solaris)\n # install-shlib-dep := install-shlib\n! # shlib := libecpg.so.$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION).$(SO_PATCHLEVEL)\n # LDFLAGS_SL = -G -z text\n # CFLAGS += $(CFLAGS_SL)\n #endif\ndiff -rcN ecpg/lib/ecpglib.c ecpg.mm/lib/ecpglib.c\n*** ecpg/lib/ecpglib.c\tTue Aug 25 19:11:38 1998\n--- ecpg.mm/lib/ecpglib.c\tFri Aug 28 14:45:59 1998\n***************\n*** 701,707 ****\n }\n else\n {\n! strncpy((char *) (var->value + var->offset * act_tuple), pval, var->varcharsize);\n if (var->varcharsize < strlen(pval))\n {\n /* truncation */\n--- 701,707 ----\n }\n else\n {\n! strncpy((char *) ((long)var->value + var->offset * act_tuple), pval, var->varcharsize);\n if (var->varcharsize < strlen(pval))\n {\n /* truncation */\n***************\n*** 731,737 ****\n case ECPGt_varchar:\n {\n struct ECPGgeneric_varchar *variable =\n! \t\t\t\t\t\t\t\t (struct ECPGgeneric_varchar *) (var->value + var->offset * act_tuple);\n \n \t\t\t\t\t\t\t\t if (var->varcharsize == 0)\n \t\t\t\t\t\t\t\t strncpy(variable->arr, pval, strlen(pval));\n--- 731,737 ----\n case ECPGt_varchar:\n {\n struct ECPGgeneric_varchar *variable =\n! \t\t\t\t\t\t\t\t (struct ECPGgeneric_varchar *) ((long)var->value + var->offset * act_tuple);\n \n \t\t\t\t\t\t\t\t if (var->varcharsize == 0)\n \t\t\t\t\t\t\t\t strncpy(variable->arr, pval, strlen(pval));\n***************\n*** 828,834 ****\n \t\tfree(notify);\n \t}\n \n- \tva_end(ap);\n \treturn status;\n }\n \n--- 828,833 ----\ndiff -rcN ecpg/preproc/preproc.y ecpg.mm/preproc/preproc.y\n*** ecpg/preproc/preproc.y\tWed Aug 26 20:19:42 1998\n--- ecpg.mm/preproc/preproc.y\tWed Aug 26 16:17:29 1998\n***************\n*** 566,572 ****\n LANCOMPILER, LISTEN, UNLISTEN, LOAD, LOCK_P, LOCATION, MAXVALUE, MINVALUE, MOVE,\n NEW, NONE, NOTHING, NOTNULL, OIDS, OPERATOR, PROCEDURAL,\n RECIPE, RENAME, RESET, RETURNS, ROW, RULE,\n! SEQUENCE, SETOF, SHOW, START, STATEMENT, STDIN, STDOUT, TRUSTED,\n VACUUM, VERBOSE, VERSION, ENCODING\n \n /* Keywords (obsolete; retain through next version for parser - thomas 1997-12-0 4) */\n--- 566,572 ----\n LANCOMPILER, LISTEN, UNLISTEN, LOAD, LOCK_P, LOCATION, MAXVALUE, MINVALUE, MOVE,\n NEW, NONE, NOTHING, NOTNULL, OIDS, OPERATOR, PROCEDURAL,\n RECIPE, RENAME, RESET, RETURNS, ROW, RULE,\n! SERIAL, SEQUENCE, SETOF, SHOW, START, STATEMENT, STDIN, STDOUT, TRUSTED,\n VACUUM, VERBOSE, VERSION, ENCODING\n \n /* Keywords (obsolete; retain through next version for parser - thomas 1997-12-0 4) */\n***************\n*** 1083,1088 ****\n--- 1083,1092 ----\n \t\t\t\t{\n \t\t\t\t\t$$ = cat3_str($1, $2, $3);\n \t\t\t\t}\n+ \t| ColId SERIAL\n+ \t\t{\n+ \t\t\t$$ = make2_str($1, make1_str(\" serial\"));\n+ \t\t}\n \t\t;\n \n ColQualifier: ColQualList\t{ $$ = $1; }\n***************\n*** 3795,3800 ****\n--- 3799,3805 ----\n \t\t| PRIVILEGES\t\t\t\t\t{ $$ = make1_str(\"privileges\"); }\n \t\t| RECIPE\t\t\t\t\t\t{ $$ = make1_str(\"recipe\"); }\n \t\t| ROW\t\t\t\t\t\t\t{ $$ = make1_str(\"row\"); }\n+ \t\t| SERIAL\t\t\t\t\t\t{ $$ = make1_str(\"serial\"); }\n \t\t| START\t\t\t\t\t\t\t{ $$ = make1_str(\"start\"); }\n \t\t| STATEMENT\t\t\t\t\t\t{ $$ = make1_str(\"statement\"); }\n \t\t| TIME\t\t\t\t\t\t\t{ $$ = make1_str(\"time\"); }\n\n-- \nMichael Meskes\t\t\[email protected], [email protected]\nGo SF49ers! Go Rhein Fire!\tUse Debian GNU/Linux! \n",
"msg_date": "Fri, 28 Aug 1998 15:40:16 +0200",
"msg_from": "Michael Meskes <[email protected]>",
"msg_from_op": true,
"msg_subject": "ecpg patches"
},
{
"msg_contents": "\nApplied\n\n\nOn Fri, 28 Aug 1998, Michael Meskes wrote:\n\n> This one is against the current archive (so it contains the one I send the\n> other day). It should fix the AIX problems. Andreas, could you please try\n> it? Thanks.\n> \n> Michael\n> \n> diff -rcN ecpg/ChangeLog ecpg.mm/ChangeLog\n> *** ecpg/ChangeLog\tTue Aug 25 19:11:36 1998\n> --- ecpg.mm/ChangeLog\tFri Aug 28 15:37:46 1998\n> ***************\n> *** 297,299 ****\n> --- 297,313 ----\n> \t- Cleaned up memory allocation in ecpglib.c\n> \t- Set library version to 2.6\n> \n> + Wed Aug 26 16:17:39 CEST 1998\n> + \n> + \t- Sync preproc.y with gram.y\n> + \n> + Thu Aug 27 15:32:23 CEST 1998\n> + \n> + \t- Fix some minor glitches that the AIX compiler complains about\n> + \t- Added patchlevel to library\n> + \n> + Fri Aug 28 15:36:58 CEST 1998\n> + \n> + \t- Removed one line of code that AIX complains about since it was not\n> + \t needed anyway\n> + \t- Set library version to 2.6.1\n> diff -rcN ecpg/lib/Makefile.in ecpg.mm/lib/Makefile.in\n> *** ecpg/lib/Makefile.in\tTue Aug 25 19:11:37 1998\n> --- ecpg.mm/lib/Makefile.in\tThu Aug 27 15:34:39 1998\n> ***************\n> *** 5,10 ****\n> --- 5,11 ----\n> \n> SO_MAJOR_VERSION=2\n> SO_MINOR_VERSION=6\n> + SO_PATCHLEVEL=1\n> \n> PORTNAME=@PORTNAME@\n> \n> ***************\n> *** 19,39 ****\n> LINUX_ELF=@LINUX_ELF@\n> ifdef LINUX_ELF\n> install-shlib-dep := install-shlib\n> ! shlib := libecpg.so.$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)\n> LDFLAGS_SL = -shared -soname libecpg.so.$(SO_MAJOR_VERSION)\n> endif\n> endif\n> ifeq ($(PORTNAME), bsd)\n> ifdef BSD_SHLIB\n> install-shlib-dep := install-shlib\n> ! shlib := libecpg.so.$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)\n> LDFLAGS_SL = -x -Bshareable -Bforcearchive\n> CFLAGS += $(CFLAGS_SL)\n> endif\n> endif\n> #ifeq ($(PORTNAME), solaris)\n> # install-shlib-dep := install-shlib\n> ! # shlib := libecpg.so.$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)\n> # LDFLAGS_SL = -G -z text\n> # CFLAGS += $(CFLAGS_SL)\n> #endif\n> --- 20,40 ----\n> LINUX_ELF=@LINUX_ELF@\n> ifdef LINUX_ELF\n> install-shlib-dep := install-shlib\n> ! shlib := libecpg.so.$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION).$(SO_PATCHLEVEL)\n> LDFLAGS_SL = -shared -soname libecpg.so.$(SO_MAJOR_VERSION)\n> endif\n> endif\n> ifeq ($(PORTNAME), bsd)\n> ifdef BSD_SHLIB\n> install-shlib-dep := install-shlib\n> ! shlib := libecpg.so.$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION).$(SO_PATCHLEVEL)\n> LDFLAGS_SL = -x -Bshareable -Bforcearchive\n> CFLAGS += $(CFLAGS_SL)\n> endif\n> endif\n> #ifeq ($(PORTNAME), solaris)\n> # install-shlib-dep := install-shlib\n> ! # shlib := libecpg.so.$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION).$(SO_PATCHLEVEL)\n> # LDFLAGS_SL = -G -z text\n> # CFLAGS += $(CFLAGS_SL)\n> #endif\n> diff -rcN ecpg/lib/ecpglib.c ecpg.mm/lib/ecpglib.c\n> *** ecpg/lib/ecpglib.c\tTue Aug 25 19:11:38 1998\n> --- ecpg.mm/lib/ecpglib.c\tFri Aug 28 14:45:59 1998\n> ***************\n> *** 701,707 ****\n> }\n> else\n> {\n> ! strncpy((char *) (var->value + var->offset * act_tuple), pval, var->varcharsize);\n> if (var->varcharsize < strlen(pval))\n> {\n> /* truncation */\n> --- 701,707 ----\n> }\n> else\n> {\n> ! strncpy((char *) ((long)var->value + var->offset * act_tuple), pval, var->varcharsize);\n> if (var->varcharsize < strlen(pval))\n> {\n> /* truncation */\n> ***************\n> *** 731,737 ****\n> case ECPGt_varchar:\n> {\n> struct ECPGgeneric_varchar *variable =\n> ! \t\t\t\t\t\t\t\t (struct ECPGgeneric_varchar *) (var->value + var->offset * act_tuple);\n> \n> \t\t\t\t\t\t\t\t if (var->varcharsize == 0)\n> \t\t\t\t\t\t\t\t strncpy(variable->arr, pval, strlen(pval));\n> --- 731,737 ----\n> case ECPGt_varchar:\n> {\n> struct ECPGgeneric_varchar *variable =\n> ! \t\t\t\t\t\t\t\t (struct ECPGgeneric_varchar *) ((long)var->value + var->offset * act_tuple);\n> \n> \t\t\t\t\t\t\t\t if (var->varcharsize == 0)\n> \t\t\t\t\t\t\t\t strncpy(variable->arr, pval, strlen(pval));\n> ***************\n> *** 828,834 ****\n> \t\tfree(notify);\n> \t}\n> \n> - \tva_end(ap);\n> \treturn status;\n> }\n> \n> --- 828,833 ----\n> diff -rcN ecpg/preproc/preproc.y ecpg.mm/preproc/preproc.y\n> *** ecpg/preproc/preproc.y\tWed Aug 26 20:19:42 1998\n> --- ecpg.mm/preproc/preproc.y\tWed Aug 26 16:17:29 1998\n> ***************\n> *** 566,572 ****\n> LANCOMPILER, LISTEN, UNLISTEN, LOAD, LOCK_P, LOCATION, MAXVALUE, MINVALUE, MOVE,\n> NEW, NONE, NOTHING, NOTNULL, OIDS, OPERATOR, PROCEDURAL,\n> RECIPE, RENAME, RESET, RETURNS, ROW, RULE,\n> ! SEQUENCE, SETOF, SHOW, START, STATEMENT, STDIN, STDOUT, TRUSTED,\n> VACUUM, VERBOSE, VERSION, ENCODING\n> \n> /* Keywords (obsolete; retain through next version for parser - thomas 1997-12-0 4) */\n> --- 566,572 ----\n> LANCOMPILER, LISTEN, UNLISTEN, LOAD, LOCK_P, LOCATION, MAXVALUE, MINVALUE, MOVE,\n> NEW, NONE, NOTHING, NOTNULL, OIDS, OPERATOR, PROCEDURAL,\n> RECIPE, RENAME, RESET, RETURNS, ROW, RULE,\n> ! SERIAL, SEQUENCE, SETOF, SHOW, START, STATEMENT, STDIN, STDOUT, TRUSTED,\n> VACUUM, VERBOSE, VERSION, ENCODING\n> \n> /* Keywords (obsolete; retain through next version for parser - thomas 1997-12-0 4) */\n> ***************\n> *** 1083,1088 ****\n> --- 1083,1092 ----\n> \t\t\t\t{\n> \t\t\t\t\t$$ = cat3_str($1, $2, $3);\n> \t\t\t\t}\n> + \t| ColId SERIAL\n> + \t\t{\n> + \t\t\t$$ = make2_str($1, make1_str(\" serial\"));\n> + \t\t}\n> \t\t;\n> \n> ColQualifier: ColQualList\t{ $$ = $1; }\n> ***************\n> *** 3795,3800 ****\n> --- 3799,3805 ----\n> \t\t| PRIVILEGES\t\t\t\t\t{ $$ = make1_str(\"privileges\"); }\n> \t\t| RECIPE\t\t\t\t\t\t{ $$ = make1_str(\"recipe\"); }\n> \t\t| ROW\t\t\t\t\t\t\t{ $$ = make1_str(\"row\"); }\n> + \t\t| SERIAL\t\t\t\t\t\t{ $$ = make1_str(\"serial\"); }\n> \t\t| START\t\t\t\t\t\t\t{ $$ = make1_str(\"start\"); }\n> \t\t| STATEMENT\t\t\t\t\t\t{ $$ = make1_str(\"statement\"); }\n> \t\t| TIME\t\t\t\t\t\t\t{ $$ = make1_str(\"time\"); }\n> \n> -- \n> Michael Meskes\t\t\[email protected], [email protected]\n> Go SF49ers! Go Rhein Fire!\tUse Debian GNU/Linux! \n> \n\n",
"msg_date": "Fri, 28 Aug 1998 13:47:47 -0400 (EDT)",
"msg_from": "The Hermit Hacker <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] ecpg patches"
}
] |
[
{
"msg_contents": "Horak Daniel <[email protected]> writes:\n> [I wrote]\n>> Say, do you know whether the 6.3.2 Postgres release worked OK with\n>> Tcl 8? If so, it might just be that pgtclId.h needs to set\n>> HAVE_TCL_GETFILEPROC to 0 for Tcl 8.\n> I have tried this, but doesn't work. In current libpgtcl there are used\n> functions Tcl_GetFile, Tcl_WatchFile, Tcl_FileReady. These aren't\n> defined in Tcl 8.0 C interface.\n\nGrumble. So they redid the I/O interfaces (again).\n\nThis means that the current libpgtcl is broken under Tcl 8, which is not\ngood ... especially since 6.3.2's wasn't; it didn't use these functions,\nbecause it didn't support asynchronous NOTIFY.\n\nI will put this on my TODO list --- it won't get done before 1 Sept, but\nhopefully this qualifies as a bug fix that I can sneak in before 6.4\nrelease ;-)\n\nAs a short-term workaround you should be able to run under Tcl 8 by\ndoing the following:\n 1. Fix pgtclId.h so that HAVE_TCL_GETFILEPROC is set to 0 for Tcl 8.\n 2. In pgtclId.c, make Pg_Notify_SetupProc be an empty function\n (just delete all the contents);\n 3. and in Pg_Notify_CheckProc, delete the calls to Tcl_GetFile and\n Tcl_FileReady (make the call to PQconsumeInput unconditional).\n\nThis should more or less work, except that Tcl won't notice an\nasynchronous NOTIFY message until something else happens (like\na keystroke or mouse movement).\n\n\t\t\tregards, tom lane\n",
"msg_date": "Fri, 28 Aug 1998 10:05:06 -0400",
"msg_from": "Tom Lane <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] libpgtcl and Tcl 8.0 "
}
] |
[
{
"msg_contents": "I am having problems with libpgtcl from the current snapshot and\ntcl-8.0p2. I gather this is because of a changing API in tcl, because\nlibpgtcl used to compile fine.\n\nWhat is the solution to these ongoing problems? Do we have a bunch of\ncompatability macros in some header file? Do we have a bunch of\n#ifdef code segments in the main files? Do we need to have stuff in\nthe configure script to record the tcl version in order to activate\nthe appropriate parts of the library?\n\nCheers,\nBrook\n",
"msg_date": "Fri, 28 Aug 1998 08:54:44 -0600 (MDT)",
"msg_from": "Brook Milligan <[email protected]>",
"msg_from_op": true,
"msg_subject": "tcl incompatabilities"
}
] |
[
{
"msg_contents": "\nBruce Momjian <[email protected]>\n\n> Are you compiling with optimization. Thay may do it.\n\nYes, and it does :-(\n\nCompiled with -O0 everything works fine (well almost).\nWith -O2, the default, I get the SIGSEGV as before.\n\nI seem to remember I had this optimisation problem some while\nago and someone, Thomas?, fixed it by rewriting some code.\n\nSo, for now I'm reasonably happy and can get on with some\ntesting.\n\nThanks,\nKeith.\n\nBTW: this is tested after Jan's fix for indexes. (Thanks Jan)\n\n> > Keith Parks\n> > \n> > The latest changes do not seem to have fixed my problems\n> > (assumed to be alignment)\n> > \n> > What I find really strange is the path taken through the\n> > code when stepping upto the SIGSEGV.\n> > \n> > ie. how do we get to line 208 in heaptuple.c (the other half of\n> > the if/else statement) without passing through line 203??\n> > \n> > Remembering that we should never touch line 208 if the\n> > attalign is 'd'\n> > \n> > Puzzled,\n> > Keith.\n> > \n> > 163 switch (att[i]->attlen)\n> > (gdb)\n> > 195 if (att[i]->attlen < sizeof(int32))\n> > (gdb)\n> > 198 if (att[i]->attalign == 'd')\n> > (gdb)\n> > 200 data = (char *) \n> > DOUBLEALIGN(data);\n> > (gdb)\n> > 201 memmove(data, \n> > DatumGetPointer(value[i]),\n> > (gdb)\n> > 204 }\n> > (gdb)\n> > 208 memmove(data, \n> > DatumGetPointer(value[i]),\n> > (gdb)\n> > \n> > Program received signal SIGSEGV, Segmentation fault. \n> > \n> > \n> \n> \n> -- \n> Bruce Momjian | 830 Blythe Avenue\n> [email protected] | Drexel Hill, Pennsylvania 19026\n> + If your life is a hard drive, | (610) 353-9879(w)\n> + Christ can be your backup. | (610) 853-3000(h)\n\n",
"msg_date": "Fri, 28 Aug 1998 22:11:32 +0100 (BST)",
"msg_from": "Keith Parks <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: strange path through code (initdb problem)"
},
{
"msg_contents": "> \n> Bruce Momjian <[email protected]>\n> \n> > Are you compiling with optimization. Thay may do it.\n> \n> Yes, and it does :-(\n> \n> Compiled with -O0 everything works fine (well almost).\n> With -O2, the default, I get the SIGSEGV as before.\n> \n> I seem to remember I had this optimisation problem some while\n> ago and someone, Thomas?, fixed it by rewriting some code.\n> \n> So, for now I'm reasonably happy and can get on with some\n> testing.\n\nIf you can find out which file is the problem, we can probably fix it\nwithout access to the machine.\n\nYou can compile everything with -O2, then change your optimization in\nMakefile.custom to -O0. Go to psql/src/backend and 'cd' to a directory,\ndo a 'make clean', then a make,make install and test initdb. As soon as\nit starts working, you have your directory. Or you could compile\neverything with -O0 and start doing -O2 compiles until it breaks.\n\nWhen you find the directory, find the file by recompiling one at a time.\nOnce you find the file, I think I can figure out what is wrong with the\nfile. I can go through the diff since 6.3.2, and see what has changed.\n\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Fri, 28 Aug 1998 19:25:28 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: strange path through code (initdb problem)"
}
] |
[
{
"msg_contents": "Where is it? Who is working on it? We should have it for 6.4.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sat, 29 Aug 1998 00:37:24 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "IP data type"
},
{
"msg_contents": "Thus spake Bruce Momjian\n> Where is it? Who is working on it? We should have it for 6.4.\n\nDid we ever come to a consensus on the form and functions for the type?\n\n-- \nD'Arcy J.M. Cain <darcy@{druid|vex}.net> | Democracy is three wolves\nhttp://www.druid.net/darcy/ | and a sheep voting on\n+1 416 424 2871 (DoD#0082) (eNTP) | what's for dinner.\n",
"msg_date": "Sat, 29 Aug 1998 06:36:19 -0400 (EDT)",
"msg_from": "[email protected] (D'Arcy J.M. Cain)",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] IP data type"
},
{
"msg_contents": "> Thus spake Bruce Momjian\n> > Where is it? Who is working on it? We should have it for 6.4.\n> \n> Did we ever come to a consensus on the form and functions for the type?\n\nTom/tih was going to merge the two, and we were going to make changes.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sat, 29 Aug 1998 13:37:49 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] IP data type"
}
] |
[
{
"msg_contents": "Here they are. I know people want the 6.4 feature list.\n\n---------------------------------------------------------------------------\n\ncidr/IP address type\nchange pg args for platforms that don't support argv changes\n\t(setproctitle()?, sendmail hack?)\nfix problem when DEFAULT string for CHAR() is not same as column\nhave psql dump out rules text with new function\ncnf-ify still can exhaust memory\npermissions on indexes: what do they do? should it be prevented?\nman pages/sgml synchronization (dump out man pages as postscript?)\nremove PARSEDEBUG defines if not longer needed\nlow level locking - status?\nimprove reporting of syntax errors by showing location of error in query\nuse index with constants on functions\nallow chainging of pages to allow >8k tuples\nSELECT oid @ oid @ oid FROM pg_user fails with parser error, not function error\ndocument/trigger/rule so changes to pg_shadow create pg_pwd\nlarge objects orphanage\nimprove group handling\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sat, 29 Aug 1998 00:40:50 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Open 6.4 items"
},
{
"msg_contents": "On Sat, 29 Aug 1998, Bruce Momjian wrote:\n\n> Here they are. I know people want the 6.4 feature list.\n> \n> ---------------------------------------------------------------------------\n> \n> cidr/IP address type\n> change pg args for platforms that don't support argv changes\n> \t(setproctitle()?, sendmail hack?)\n> fix problem when DEFAULT string for CHAR() is not same as column\n> have psql dump out rules text with new function\n> cnf-ify still can exhaust memory\n> permissions on indexes: what do they do? should it be prevented?\n> man pages/sgml synchronization (dump out man pages as postscript?)\n> remove PARSEDEBUG defines if not longer needed\n> low level locking - status?\n> improve reporting of syntax errors by showing location of error in query\n> use index with constants on functions\n> allow chainging of pages to allow >8k tuples\n> SELECT oid @ oid @ oid FROM pg_user fails with parser error, not function error\n> document/trigger/rule so changes to pg_shadow create pg_pwd\n\n> large objects orphanage\n\nI'm working on orphans at the moment, should have something to commit\nlater today...\n\n> improve group handling\n> \n> -- \n> Bruce Momjian | 830 Blythe Avenue\n> [email protected] | Drexel Hill, Pennsylvania 19026\n> + If your life is a hard drive, | (610) 353-9879(w)\n> + Christ can be your backup. | (610) 853-3000(h)\n> \n\n-- \n Peter T Mount [email protected]\n Main Homepage: http://www.retep.org.uk\nPostgreSQL JDBC Faq: http://www.retep.org.uk/postgres\n Java PDF Generator: http://www.retep.org.uk/pdf\n\n",
"msg_date": "Sun, 30 Aug 1998 11:53:02 +0100 (GMT)",
"msg_from": "Peter T Mount <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Open 6.4 items"
},
{
"msg_contents": "Vadim Mikheev wrote:\n\n> >\n> > example:\n> > select upper(usename), count(usename) from pg_shadow group by 1;\n> > OK\n> > select upper(usename), count(oid) from pg_shadow group by 1;\n> > CRASH\n> >\n> > It did work in 6.3.\n>\n> As I remember, someone re-implemented GroupBy node in 6.4...\n\nYou may be referring to me. I made some changes to the SortGroupBy parse\nnode to allow espressions. I didn't touch the GroupClause node. Also,\nI think this bug arrived before I made my changes in 6.4\n\n",
"msg_date": "Thu, 03 Sep 1998 20:53:28 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Open 6.4 items"
},
{
"msg_contents": "\n\nVadim Mikheev wrote:\n\n> Bruce Momjian wrote:\n> >\n> > low level locking - status?\n>\n> Work in progress -:))\n> This is 6.5 item...\n>\n> But this is 6.4 item from TODO:\n> * select upper(usename), count(usesysid) from pg_shadow group by 1;\n> --> CRASH\n>\n> - group by function is BROKEN!!!\n>\n> Is anybody working on fix ?\n>\n\nNot I, but I can give you some background. The crash seems to only\noccur when the argument of the GROUPed by function is not used elsewhere\nin the target list.\n\nexample:\n select upper(usename), count(usename) from pg_shadow group by 1;\n OK\n select upper(usename), count(oid) from pg_shadow group by 1;\n CRASH\n\nIt did work in 6.3.\n\n",
"msg_date": "Thu, 03 Sep 1998 23:40:49 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Open 6.4 items"
},
{
"msg_contents": "Bruce Momjian wrote:\n> \n> low level locking - status?\n\nWork in progress -:))\nThis is 6.5 item...\n\nBut this is 6.4 item from TODO:\n* select upper(usename), count(usesysid) from pg_shadow group by 1;\n--> CRASH\n\n- group by function is BROKEN!!!\n\nIs anybody working on fix ?\n\nVadim\n",
"msg_date": "Fri, 04 Sep 1998 11:42:19 +0800",
"msg_from": "Vadim Mikheev <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Open 6.4 items"
},
{
"msg_contents": "David Hartwig wrote:\n> \n> >\n> > Is anybody working on fix ?\n> >\n> \n> Not I, but I can give you some background. The crash seems to only\n> occur when the argument of the GROUPed by function is not used elsewhere\n> in the target list.\n\nYes, I see that it comes from replace_agg_clause() after\nmatch_varid() call: for some reasons varoattno of\ntarget list var is changed and so var is not matched...\n\n> \n> example:\n> select upper(usename), count(usename) from pg_shadow group by 1;\n> OK\n> select upper(usename), count(oid) from pg_shadow group by 1;\n> CRASH\n> \n> It did work in 6.3.\n\nAs I remember, someone re-implemented GroupBy node in 6.4...\n\nVadim\n",
"msg_date": "Fri, 04 Sep 1998 12:19:49 +0800",
"msg_from": "Vadim Mikheev <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Open 6.4 items"
},
{
"msg_contents": "> > \n> > It did work in 6.3.\n> \n> As I remember, someone re-implemented GroupBy node in 6.4...\n\nI don't think I did.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Fri, 4 Sep 1998 00:54:41 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] Open 6.4 items"
},
{
"msg_contents": "David Hartwig wrote:\n> \n> Vadim Mikheev wrote:\n> \n> > >\n> > > example:\n> > > select upper(usename), count(usename) from pg_shadow group by 1;\n> > > OK\n> > > select upper(usename), count(oid) from pg_shadow group by 1;\n> > > CRASH\n> > >\n> > > It did work in 6.3.\n> >\n> > As I remember, someone re-implemented GroupBy node in 6.4...\n> \n> You may be referring to me. I made some changes to the SortGroupBy parse\n> node to allow espressions. I didn't touch the GroupClause node. Also,\n> I think this bug arrived before I made my changes in 6.4\n\nOk, I'll take care...\n\nVadim\n",
"msg_date": "Fri, 04 Sep 1998 13:21:07 +0800",
"msg_from": "Vadim Mikheev <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Open 6.4 items"
}
] |
[
{
"msg_contents": "Tom Ivar Helbekkmo, how is the new IP type going? I have this message\nfrom July 20th saying you were going to try and merge the Vixie code and\nthe ip_and_mac code. We would all like to have this as part of 6.4, if\npossible. I would like to move it out of contrib, and put into the main\nbackend. I can help merge it into the main backend tree.\n\nIf it can't make the beta of September 1, perhaps we can slip it in\nsometime soon after that.\n\nI think the inclusion of this data type is very important for our users\nand for increasing the usefulness of PostgreSQL. Basically, this would\nbe a nice HOT item for 6.4.\n\n---------------------------------------------------------------------------\n\n From: Tom Ivar Helbekkmo <[email protected]> \n To: Paul A Vixie <[email protected]> \n Subject: Re: [HACKERS] cidr \n Date: 20 Jul 1998 22:25:32 +0200 \n\n\n\nPaul A Vixie <[email protected]> writes:\n\n> i didn't realize that anybody else was working on an IP address\n> data type or i'd've posted this six months ago when i first wrote\n> it. it lacks only the stuff needed to make it usable as a UNIQUE\n> KEY. it depends on BIND-8's libraries.\n\nInteresting -- looks nice at first glance, and does some things that\nneither Aleksei nor I had thought of. I guess a merge of the three\nvariations is in order. At least I'll be doing that locally, and will\nmake the result available.\n\n-tih\n-- \nPopularity is the hallmark of mediocrity. --Niles Crane, \"Frasier\"\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sat, 29 Aug 1998 01:00:54 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "IP data type/ip_and_mac/cidr"
}
] |
[
{
"msg_contents": "I have added more to the last item.\n\n---------------------------------------------------------------------------\n\n 9) How do I efficiently access information in tables from the backend code?\n \n You first need to find the tuples(rows) you are interested in. There\n are two ways. First, SearchSysCacheTuple() and related functions allow\n you to query the system catalogs. This is the preferred way to access\n system tables, because the first call to the cache loads the needed\n rows, and future requests can return the results without accessing the\n base table. Some of the caches use system table indexes to look up\n tuples. A list of available caches is located in\n src/backend/utils/cache/syscache.c.\n src/backend/utils/cache/lsyscache.c contains many column-specific\n cache lookup functions.\n \n The rows returned are cached-owned versions of the heap rows. They are\n invalidated when the base table changes. Because the cache is local to\n each backend, you may use the pointer returned from the cache for\n short periods without making a copy of the tuple. If you send the\n pointer into a large function that will be doing its own cache\n lookups, it is possible the cache entry may be flushed, so you should\n use SearchSysCacheTupleCopy() in these cases, and pfree() the tuple\n when you are done.\n \n If you can't use the system cache, you will need to retrieve the data\n directly from the heap table, using the buffer cache that is shared by\n all backends. The backend automatically takes care of loading the rows\n into the buffer cache.\n \n Open the table with heap_open(). You can then start a table scan with\n heap_beginscan(), then use heap_getnext() and continue as long as\n HeapTupleIsValid() returns true. Then do a heap_endscan(). Keys can be\n assigned to the scan. No indexes are used, so all rows are going to be\n compared to the keys, and only the valid rows returned.\n \n You can also use heap_fetch() to fetch rows by block number/offset.\n While scans automatically lock/unlock rows from the buffer cache, with\n heap_fetch(), you must pass a Buffer pointer, and ReleaseBuffer() it\n when completed. Once you have the row, you can get data that is common\n to all tuples, like t_ctid and t_oid, by mererly accessing the\n HeapTuple structure entries. If you need a table-specific column, you\n should take the HeapTuple pointer, and use the GETSTRUCT() macro to\n access the table-specific start of the tuple. You then cast the\n pointer as a Form_pg_proc pointer if you are accessing the pg_proc\n table, or TypeTupleForm if you are accessing pg_type. You can then\n access the columns by using a structure pointer:\n\n ((Form_pg_class) GETSTRUCT(tuple))->relnatts\n\n You should not directly change live tuples in this way. The best way\n is to use heap_tuplemodify() and pass it your palloc'ed tuple, and the\n values you want changed. It returns another palloc'ed tuple, which you\n pass to heap_replace(). You can delete tuples by passing the tuple's\n t_ctid to heap_destroy(). Remember, tuples can be either system cache\n versions, which may go away soon after you get them, buffer cache\n version, which will go away when you heap_getnext(), heap_endscan, or\n ReleaseBuffer(), in the heap_fetch() case. Or it may be a palloc'ed\n tuple, that you must pfree() when finished.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sat, 29 Aug 1998 01:55:58 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "New DEV FAQ item"
}
] |
[
{
"msg_contents": "If anyone has been watching my trials and tribulations building\nand running the latest CVS snapshot under S/Linux on a SUN\nSPARCstation IPX.\n\nThe latest position is:-\n\nIf I compile with optimization turned off (-O0 instead of -O2)\nI get an almost clean run of the regressin tests. Only the\n\"create_function\" tests fail unexpectedly.\n\n[postgres@sparclinux regress]$ psql regression\nWelcome to the POSTGRESQL interactive sql monitor:\n Please read the file COPYRIGHT for copyright terms of POSTGRESQL\n\n type \\? for help on slash commands\n type \\q to quit\n type \\g or terminate with semicolon to execute query\n You are currently connected to the database: regression\n\nregression=> CREATE FUNCTION widget_in(opaque)\nregression-> RETURNS widget\nregression-> AS '/usr/local/pgsql/src/test/regress/input/../regress.so'\nregression-> LANGUAGE 'c';\nNOTICE: ProcedureCreate: type 'widget' is not yet defined\npqReadData() -- backend closed the channel unexpectedly.\n This probably means the backend terminated abnormally before or while \nprocessing the request.\nWe have lost the connection to the backend, so further processing is impossible. \n Terminating.\n[postgres@sparclinux regress]$ \n\nThe backtrace shows:-\n\nProgram received signal SIGSEGV, Segmentation fault.\n0x44744 in GetIndexValue (tuple=0x25e210, hTupDesc=0x25e26c, attOff=0, \nattrNums=0x261944, fInfo=0x0,\n attNull=0xefffcbcf \"\") at indexam.c:404\n404 returnVal = heap_getattr(tuple, attrNums[attOff],\n(gdb) bt\n#0 0x44744 in GetIndexValue (tuple=0x25e210, hTupDesc=0x25e26c, attOff=0, \nattrNums=0x261944, fInfo=0x0,\n attNull=0xefffcbcf \"\") at indexam.c:404\n#1 0x68e9c in FormIndexDatum (numberOfAttributes=1, attributeNumber=0x261944, \nheapTuple=0x25e210,\n heapDescriptor=0x25e26c, datum=0xefffccb8, nullv=0xefffcc58 \" \", \nfInfo=0x0) at index.c:1284\n#2 0x69c38 in CatalogIndexInsert (idescs=0xefffcd30, nIndices=3, \nheapRelation=0x213b90, heapTuple=0x25e210)\n at indexing.c:154\n#3 0x6f344 in ProcedureCreate (procedureName=0x208bb0 \"widget_in\", returnsSet=0 \n'\\000',\n returnTypeName=0x208b30 \"widget\", languageName=0xefffcec8 \"C\", \nprosrc=0x18d7f8 \"-\",\n probin=0x251b10 \"/usr/local/pgsql/src/test/regress/input/../regress.so\", \ncanCache=24 '\\030',\n trusted=1 '\\001', byte_pct=100, perbyte_cpu=0, percall_cpu=0, \noutin_ratio=100, argList=0x208b50,\n dest=Remote) at pg_proc.c:275\n#4 0x786c8 in CreateFunction (stmt=0x207650, dest=Remote) at define.c:329\n#5 0x131694 in ProcessUtility (parsetree=0x207650, dest=Remote) at \nutility.c:392\n#6 0x12db18 in pg_exec_query_dest (\n query_string=0xefffd130 \" CREATE FUNCTION widget_in(opaque)\\n RETURNS \nwidget\\n AS '/usr/local/pgsql/src/test/regress/input/../regress.so'\\n \nLANGUAGE 'c';\", dest=Remote, aclOverride=0 '\\000') at postgres.c:720\n#7 0x12d98c in pg_exec_query (\n query_string=0xefffd130 \" CREATE FUNCTION widget_in(opaque)\\n RETURNS \nwidget\\n AS '/usr/local/pgsql/src/test/regress/input/../regress.so'\\n \nLANGUAGE 'c';\") at postgres.c:658\n#8 0x12f81c in PostgresMain (argc=9, argv=0xeffff210, real_argc=10, \nreal_argv=0xeffffd84) at postgres.c:1578\n#9 0x10183c in DoBackend (port=0x209000) at postmaster.c:1519\n#10 0x100ffc in BackendStartup (port=0x209000) at postmaster.c:1291\n#11 0xffed8 in ServerLoop () at postmaster.c:750\n#12 0xff860 in PostmasterMain (argc=10, argv=0xeffffd84) at postmaster.c:556\n#13 0xb02c0 in main (argc=10, argv=0xeffffd84) at main.c:93\n(gdb)\n\nHas anyone else seen anything similar?\n\nKeith.\n\nPS: Bruce, I still need to find which file breaks an -O2 compile but\n will spend some time playing over this long weekend.\n \n\n",
"msg_date": "Sat, 29 Aug 1998 19:29:04 +0100 (BST)",
"msg_from": "Keith Parks <[email protected]>",
"msg_from_op": true,
"msg_subject": "Core dump in regression tests."
},
{
"msg_contents": "\nHi, yes, I'm having trouble as well. \n\nI'm crashing anytime I create a table, (-O2). I just tried the 8/29 snapshot.\nI've got an environment set up now to try a few things. \n\nWithout -O2 it seem to be better. I see the same problem with \ncreate function as you. Also many failures seem to the result\nof some type not defined. Is that expected?\n\nSorry to jump in so late here. \n\n\nTom Szybist\[email protected]\n\n\nIn message <[email protected]>, Keith Parks writes:\n> If anyone has been watching my trials and tribulations building\n> and running the latest CVS snapshot under S/Linux on a SUN\n> SPARCstation IPX.\n> \n> The latest position is:-\n> \n> If I compile with optimization turned off (-O0 instead of -O2)\n> I get an almost clean run of the regressin tests. Only the\n> \"create_function\" tests fail unexpectedly.\n> \n> [postgres@sparclinux regress]$ psql regression\n> Welcome to the POSTGRESQL interactive sql monitor:\n> Please read the file COPYRIGHT for copyright terms of POSTGRESQL\n> \n> type \\? for help on slash commands\n> type \\q to quit\n> type \\g or terminate with semicolon to execute query\n> You are currently connected to the database: regression\n> \n> regression=> CREATE FUNCTION widget_in(opaque)\n> regression-> RETURNS widget\n> regression-> AS '/usr/local/pgsql/src/test/regress/input/../regress.so'\n> regression-> LANGUAGE 'c';\n> NOTICE: ProcedureCreate: type 'widget' is not yet defined\n> pqReadData() -- backend closed the channel unexpectedly.\n> This probably means the backend terminated abnormally before or while \n> processing the request.\n> We have lost the connection to the backend, so further processing is impossible. \n> Terminating.\n> [postgres@sparclinux regress]$ \n> \n> The backtrace shows:-\n> \n> Program received signal SIGSEGV, Segmentation fault.\n> 0x44744 in GetIndexValue (tuple=0x25e210, hTupDesc=0x25e26c, attOff=0, \n> attrNums=0x261944, fInfo=0x0,\n> attNull=0xefffcbcf \"\") at indexam.c:404\n> 404 returnVal = heap_getattr(tuple, attrNums[attOff],\n> (gdb) bt\n> #0 0x44744 in GetIndexValue (tuple=0x25e210, hTupDesc=0x25e26c, attOff=0, \n> attrNums=0x261944, fInfo=0x0,\n> attNull=0xefffcbcf \"\") at indexam.c:404\n> #1 0x68e9c in FormIndexDatum (numberOfAttributes=1, attributeNumber=0x261944, \n> heapTuple=0x25e210,\n> heapDescriptor=0x25e26c, datum=0xefffccb8, nullv=0xefffcc58 \" \", \n> fInfo=0x0) at index.c:1284\n> #2 0x69c38 in CatalogIndexInsert (idescs=0xefffcd30, nIndices=3, \n> heapRelation=0x213b90, heapTuple=0x25e210)\n> at indexing.c:154\n> #3 0x6f344 in ProcedureCreate (procedureName=0x208bb0 \"widget_in\", returnsSet=0 \n> '\\000',\n> returnTypeName=0x208b30 \"widget\", languageName=0xefffcec8 \"C\", \n> prosrc=0x18d7f8 \"-\",\n> probin=0x251b10 \"/usr/local/pgsql/src/test/regress/input/../regress.so\", \n> canCache=24 '\\030',\n> trusted=1 '\\001', byte_pct=100, perbyte_cpu=0, percall_cpu=0, \n> outin_ratio=100, argList=0x208b50,\n> dest=Remote) at pg_proc.c:275\n> #4 0x786c8 in CreateFunction (stmt=0x207650, dest=Remote) at define.c:329\n> #5 0x131694 in ProcessUtility (parsetree=0x207650, dest=Remote) at \n> utility.c:392\n> #6 0x12db18 in pg_exec_query_dest (\n> query_string=0xefffd130 \" CREATE FUNCTION widget_in(opaque)\\n RETURNS \n> widget\\n AS '/usr/local/pgsql/src/test/regress/input/../regress.so'\\n \n> LANGUAGE 'c';\", dest=Remote, aclOverride=0 '\\000') at postgres.c:720\n> #7 0x12d98c in pg_exec_query (\n> query_string=0xefffd130 \" CREATE FUNCTION widget_in(opaque)\\n RETURNS \n> widget\\n AS '/usr/local/pgsql/src/test/regress/input/../regress.so'\\n \n> LANGUAGE 'c';\") at postgres.c:658\n> #8 0x12f81c in PostgresMain (argc=9, argv=0xeffff210, real_argc=10, \n> real_argv=0xeffffd84) at postgres.c:1578\n> #9 0x10183c in DoBackend (port=0x209000) at postmaster.c:1519\n> #10 0x100ffc in BackendStartup (port=0x209000) at postmaster.c:1291\n> #11 0xffed8 in ServerLoop () at postmaster.c:750\n> #12 0xff860 in PostmasterMain (argc=10, argv=0xeffffd84) at postmaster.c:556\n> #13 0xb02c0 in main (argc=10, argv=0xeffffd84) at main.c:93\n> (gdb)\n> \n> Has anyone else seen anything similar?\n> \n> Keith.\n> \n> PS: Bruce, I still need to find which file breaks an -O2 compile but\n> will spend some time playing over this long weekend.\n> \n> \n> \n",
"msg_date": "Sat, 29 Aug 1998 17:09:07 -0400",
"msg_from": "\"Thomas A. Szybist\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests. "
}
] |
[
{
"msg_contents": "New item.\n\n---------------------------------------------------------------------------\n\n\n 10) What is elog()?\n \n elog() is used to send messages to the front-end, and optionally\n terminate the current query being processed. The first parameter is an\n elog level of NOTICE, DEBUG, ERROR, or FATAL. NOTICE prints on the\n user's terminal and the postmaster logs. DEBUG prints only in the\n postmaster logs. ERROR prints in both places, and terminates the\n current query, never returning from the call. FATAL terminates the\n backend process. The remaining parameters of elog are a printf-style\n set of parameters to print.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sat, 29 Aug 1998 14:40:19 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "new DEV FAQ item"
}
] |
[
{
"msg_contents": "If a COPY failed, the file was never closed. The new code closes any\nopen file descriptors when copy is called after a failure.\n\nI made the file descriptor 'static' and set a flag to remember if I\nclosed the one I used previously.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sat, 29 Aug 1998 14:41:28 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "COPY file descriptor leak"
}
] |
[
{
"msg_contents": "Peter, Michael has started a ChangeLog file for ecpg that lists the\nchanges and dates he makes the changes. Can you do this for 6.4? I am\nnot sure I am getting all the jdbc stuff. I could just point them to\nthat file.\n\nWhat I am doing with the HISTORY file is to tell them to look in the\necpg/ChangeLog file for changes to ecpg. We could do the same for jdbc.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sat, 29 Aug 1998 15:45:06 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "jdbc changes in 6.4"
},
{
"msg_contents": "On Sat, 29 Aug 1998, Bruce Momjian wrote:\n\n> Peter, Michael has started a ChangeLog file for ecpg that lists the\n> changes and dates he makes the changes. Can you do this for 6.4? I am\n> not sure I am getting all the jdbc stuff. I could just point them to\n> that file.\n> \n> What I am doing with the HISTORY file is to tell them to look in the\n> ecpg/ChangeLog file for changes to ecpg. We could do the same for jdbc.\n\nThat shouldn't be too difficult, as since 6.3.2, I have kept a log of what\nchanges I've made.\n\nSaying that, there's not been much done in the last 6 weeks because of\nworkload, illness etc, so there isn't much to include yet.\n\nI'll create the file now, using the ecpg one as a template.\n\n> \n> -- \n> Bruce Momjian | 830 Blythe Avenue\n> [email protected] | Drexel Hill, Pennsylvania 19026\n> + If your life is a hard drive, | (610) 353-9879(w)\n> + Christ can be your backup. | (610) 853-3000(h)\n> \n\n-- \n Peter T Mount [email protected]\n Main Homepage: http://www.retep.org.uk\nPostgreSQL JDBC Faq: http://www.retep.org.uk/postgres\n Java PDF Generator: http://www.retep.org.uk/pdf\n\n",
"msg_date": "Sun, 30 Aug 1998 10:56:05 +0100 (GMT)",
"msg_from": "Peter T Mount <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: jdbc changes in 6.4"
}
] |
[
{
"msg_contents": "> Peter, Michael has started a ChangeLog file for ecpg that lists the\n> changes and dates he makes the changes. Can you do this for 6.4? I am\n> not sure I am getting all the jdbc stuff. I could just point them to\n> that file.\n> \n> What I am doing with the HISTORY file is to tell them to look in the\n> ecpg/ChangeLog file for changes to ecpg. We could do the same for jdbc.\n\nCan we do the same for ODBC? We have no real info on what has changed\nin 6.4.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sat, 29 Aug 1998 15:48:18 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: jdbc changes in 6.4"
}
] |
[
{
"msg_contents": "\nThomas A. Szybist <[email protected]>\n> \n> Hi, yes, I'm having trouble as well. \n\nSorry to hear that but I don't feel quite so alone now ;-)\n\n> \n> I'm crashing anytime I create a table, (-O2). I just tried the 8/29 snapshot.\n> I've got an environment set up now to try a few things. \n\nSame thing here with -O2, I think some of the other pg_user, pg_view etc.\nproblems all boil down to table creation as those are created as\ntables after bootstrapping and subsequently converted to views.\n\n> \n> Without -O2 it seem to be better. I see the same problem with \n> create function as you. Also many failures seem to the result\n> of some type not defined. Is that expected?\n\nYes, there are many problems in the regression tests due to some\ntype removal, I think, by Bruce. We're just waiting for the\nregression test \"expected\" results to catch up.\n\n> \n> Sorry to jump in so late here. \n> \n\nBetter late than never <grin>\n\nJust out of interest, what platform are you running on?\n(S/Linux on an SUN IPX here)\n\nKeith.\n\n",
"msg_date": "Sat, 29 Aug 1998 22:19:23 +0100 (BST)",
"msg_from": "Keith Parks <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] Core dump in regression tests. "
},
{
"msg_contents": "In message <[email protected]>, Keith Parks writes:\n> \n> Thomas A. Szybist <[email protected]>\n> > \n> > Hi, yes, I'm having trouble as well. \n> \n> Sorry to hear that but I don't feel quite so alone now ;-)\n\nMisery loves company :).\n\n> \n> > \n> > I'm crashing anytime I create a table, (-O2). I just tried the 8/29 snapshot.\n> > I've got an environment set up now to try a few things. \n> \n> Same thing here with -O2, I think some of the other pg_user, pg_view etc.\n> problems all boil down to table creation as those are created as\n> tables after bootstrapping and subsequently converted to views.\n> \n> > \n> > Without -O2 it seem to be better. I see the same problem with \n> > create function as you. Also many failures seem to the result\n> > of some type not defined. Is that expected?\n> \n> Yes, there are many problems in the regression tests due to some\n> type removal, I think, by Bruce. We're just waiting for the\n> regression test \"expected\" results to catch up.\n> \n> > \n> > Sorry to jump in so late here. \n> > \n> \n> Better late than never <grin>\n> \n> Just out of interest, what platform are you running on?\n> (S/Linux on an SUN IPX here)\n> \n> Keith.\n> \n\nThis is on a Red Hat 4.1 (Yes 4.1) system. Thing is, it's a production\nsystem, and I haven't reason to upgrade.\n\nKernel is 2.0.29 gcc 2.7.2.1. Sparc 20.\n\nI was toying with the idea of tossing Red Had 5.1 on a sparc classic,\nto see if glibc on S/Linux hoses anything.\n\n\nTom Szybist\[email protected]\n",
"msg_date": "Sat, 29 Aug 1998 18:27:15 -0400",
"msg_from": "\"Thomas A. Szybist\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests. "
},
{
"msg_contents": "> In message <[email protected]>, Keith Parks writes:\n> > \n> > Thomas A. Szybist <[email protected]>\n> > > \n> > > Hi, yes, I'm having trouble as well. \n> > \n> > Sorry to hear that but I don't feel quite so alone now ;-)\n> \n> Misery loves company :).\n> \n> > \n> > > \n> > > I'm crashing anytime I create a table, (-O2). I just tried the 8/29 snapshot.\n> > > I've got an environment set up now to try a few things. \n> > \n> > Same thing here with -O2, I think some of the other pg_user, pg_view etc.\n> > problems all boil down to table creation as those are created as\n> > tables after bootstrapping and subsequently converted to views.\n> > \n> > > \n> > > Without -O2 it seem to be better. I see the same problem with \n> > > create function as you. Also many failures seem to the result\n> > > of some type not defined. Is that expected?\n> > \n> > Yes, there are many problems in the regression tests due to some\n> > type removal, I think, by Bruce. We're just waiting for the\n> > regression test \"expected\" results to catch up.\n> > \n> > > \n> > > Sorry to jump in so late here. \n> > > \n> > \n> > Better late than never <grin>\n> > \n> > Just out of interest, what platform are you running on?\n> > (S/Linux on an SUN IPX here)\n> > \n> > Keith.\n> > \n> \n> This is on a Red Hat 4.1 (Yes 4.1) system. Thing is, it's a production\n> system, and I haven't reason to upgrade.\n> \n> Kernel is 2.0.29 gcc 2.7.2.1. Sparc 20.\n> \n> I was toying with the idea of tossing Red Had 5.1 on a sparc classic,\n> to see if glibc on S/Linux hoses anything.\n\nAgain, if someone wants to conditionally compile the directories to find\nthe offending file, I am sure we can get a fix for it.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sat, 29 Aug 1998 20:08:01 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "In message <[email protected]>, Bruce Momjian writes:\n> > In message <[email protected]>, Keith Parks writes:\n> > > \n> > > Thomas A. Szybist <[email protected]>\n> > > > \n> > > > Hi, yes, I'm having trouble as well. \n> > > \n> > > Sorry to hear that but I don't feel quite so alone now ;-)\n> > \n> > Misery loves company :).\n> > \n> > > \n> > > > \n> > > > I'm crashing anytime I create a table, (-O2). I just tried the 8/29 snapshot.\n> > > > I've got an environment set up now to try a few things. \n> > > \n> > > Same thing here with -O2, I think some of the other pg_user, pg_view etc.\n> > > problems all boil down to table creation as those are created as\n> > > tables after bootstrapping and subsequently converted to views.\n> > > \n> > > > \n> > > > Without -O2 it seem to be better. I see the same problem with \n> > > > create function as you. Also many failures seem to the result\n> > > > of some type not defined. Is that expected?\n> > > \n> > > Yes, there are many problems in the regression tests due to some\n> > > type removal, I think, by Bruce. We're just waiting for the\n> > > regression test \"expected\" results to catch up.\n> > > \n> > > > \n> > > > Sorry to jump in so late here. \n> > > > \n> > > \n> > > Better late than never <grin>\n> > > \n> > > Just out of interest, what platform are you running on?\n> > > (S/Linux on an SUN IPX here)\n> > > \n> > > Keith.\n> > > \n> > \n> > This is on a Red Hat 4.1 (Yes 4.1) system. Thing is, it's a production\n> > system, and I haven't reason to upgrade.\n> > \n> > Kernel is 2.0.29 gcc 2.7.2.1. Sparc 20.\n> > \n> > I was toying with the idea of tossing Red Had 5.1 on a sparc classic,\n> > to see if glibc on S/Linux hoses anything.\n> \n> Again, if someone wants to conditionally compile the directories to find\n> the offending file, I am sure we can get a fix for it.\n> \n> -- \n> Bruce Momjian | 830 Blythe Avenue\n> [email protected] | Drexel Hill, Pennsylvania 19026\n> + If your life is a hard drive, | (610) 353-9879(w)\n> + Christ can be your backup. | (610) 853-3000(h)\n> \n\nAt first look it seems to be: backend/catalog/indexing.c.\nMaybe Keith can confirm? \n\nThanks,\n\nTom Szybist\[email protected]\n\n",
"msg_date": "Sun, 30 Aug 1998 15:59:35 -0400",
"msg_from": "\"Thomas A. Szybist\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests. "
},
{
"msg_contents": "I built and run the regression tests from a clean cvs tree this morning\n(1998-08-30 20:00UTC). I have removed the oidint2, oidint4, and oidname\ntests since the types no longer exist, and have updated alter_table to\nremove mention of these types. I've committed these changes to the cvs\ntree.\n\nThere are some failures (itemized below). The only failure I saw before\nthe big OID patch-fest was select_views. \n\nSo, the current status on my system (i686, Linux 2.0.30, RedHat 4.2, -O2\noptimization enabled) is that all tests pass except the following:\n\n- constraints .. failed\nCore dump.\n\n- create_index .. failed\nFails on all create index statements after the first one with the\nmessage:\nQUERY: CREATE INDEX onek_unique2 ON onek USING btree(unique2 int4_ops);\nERROR: DefineIndex: onek relation not found\nbut, this statement executes just fine after the regression tests have\ncompleted and I connect in from another process:\nregression=> CREATE INDEX onek_unique2 ON onek USING btree(unique2\nint4_ops);\nCREATE\nIs it a cache problem somewhere??\n\nsanity_check .. failed\n> NOTICE: Index pg_class_relname_index: NUMBER OF INDEX' TUPLES (144) IS NOT THE SAME AS HEAP' (135)\n> NOTICE: Index pg_class_oid_index: NUMBER OF INDEX' TUPLES (144) IS NOT THE SAME AS HEAP' (135)\nThese warnings weren't present before. Also sensitive to missing table\nfrom constraints test failure.\n\nselect_having .. failed\nCore dump.\n\nselect_views .. failed\nCore dump. afaik this has been present for a month or two, and is a\nfailure on the last query in the test. EXPLAIN shows a valid result, so\nthe crash happens farther back.\n\nrun_ruletest .. failed\nApparently not critical; the test depends on the name of the dba being\n\"pgsql\" and my system has a dba named \"postgres\". The test should be\nfixed for v6.4.\n\n - Tom\n",
"msg_date": "Sun, 30 Aug 1998 20:31:31 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "\n\nThomas G. Lockhart wrote:\n\n> select_having .. failed\n> Core dump.\n>\n\nMy bad. It is caused by a known bug having to do with GROUP BY. It ain't a good bug, but it has\nnothing to do with HAVING. For some reason the bug went away for a while, while I was building the test\nscript. It must have, because that is how I created the expected file. :(\n\nA patch to the regression will be forthcoming.\n\n",
"msg_date": "Sun, 30 Aug 1998 19:50:05 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "Thomas, I have just run the regression test here with my indexing.c\npatch, and the only serious errors I see are the cases that have already\nbeen mentioned like the having core dump, and the postgres/pgsql rule\ndifference.\n\nDo you still see other differences? Let me know.\n\nI am putting the two spaces after an elog message back in because I\ndon't think we want to change that format for no good reason.\n\nI can see people expecting the string to look a certain way.\n\n> I built and run the regression tests from a clean cvs tree this morning\n> (1998-08-30 20:00UTC). I have removed the oidint2, oidint4, and oidname\n> tests since the types no longer exist, and have updated alter_table to\n> remove mention of these types. I've committed these changes to the cvs\n> tree.\n> \n> There are some failures (itemized below). The only failure I saw before\n> the big OID patch-fest was select_views. \n> \n> So, the current status on my system (i686, Linux 2.0.30, RedHat 4.2, -O2\n> optimization enabled) is that all tests pass except the following:\n> \n> - constraints .. failed\n> Core dump.\n> \n> - create_index .. failed\n> Fails on all create index statements after the first one with the\n> message:\n> QUERY: CREATE INDEX onek_unique2 ON onek USING btree(unique2 int4_ops);\n> ERROR: DefineIndex: onek relation not found\n> but, this statement executes just fine after the regression tests have\n> completed and I connect in from another process:\n> regression=> CREATE INDEX onek_unique2 ON onek USING btree(unique2\n> int4_ops);\n> CREATE\n> Is it a cache problem somewhere??\n> \n> sanity_check .. failed\n> > NOTICE: Index pg_class_relname_index: NUMBER OF INDEX' TUPLES (144) IS NOT THE SAME AS HEAP' (135)\n> > NOTICE: Index pg_class_oid_index: NUMBER OF INDEX' TUPLES (144) IS NOT THE SAME AS HEAP' (135)\n> These warnings weren't present before. Also sensitive to missing table\n> from constraints test failure.\n> \n> select_having .. failed\n> Core dump.\n> \n> select_views .. failed\n> Core dump. afaik this has been present for a month or two, and is a\n> failure on the last query in the test. EXPLAIN shows a valid result, so\n> the crash happens farther back.\n> \n> run_ruletest .. failed\n> Apparently not critical; the test depends on the name of the dba being\n> \"pgsql\" and my system has a dba named \"postgres\". The test should be\n> fixed for v6.4.\n> \n> - Tom\n> \n> \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Mon, 31 Aug 1998 00:50:00 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
}
] |
[
{
"msg_contents": "OK, here is the HISTORY file for 6.4. New items will be added to the\nend as they are done. This is now on the web site at the end of the\nTODO list.\n\nLooking over the list, this is clearly an enhancement release, many new\nfeatures. Any performance measurements compared to 6.3.2 would be\ninteresting. I do not expect any major speedups, but I may be wrong.\n\nWe need people to add manual pages changes for new features. Anyone who\nhas added flags to commands has to document them so people can use them.\n\nPlease let me know of omissions/changes.\n\n---------------------------------------------------------------------------\n\n\n\nCHANGES IN THE 6.4 RELEASE\n--------------------------\n\nBug Fixes\n---------\nFix for a tiny memory leak in PQsetdb/PQfinish(Bryan)\nRemove char2-16 data types, use char/varchar(Darren)\nPqfn not handles a NOTICE message(Anders)\nShort-term locks now retry locking at random times(David)\nFix up \"ISO-style\" timespan decoding and encoding(Thomas)\nFix problem with table drop after rollback of transaction(Vadim)\nChange error message and remove non-functional update message(Vadim)\nFix for COPY array checking\nFix for SELECT 1 UNION SELECT NULL\nFix for buffer leaks in large object calls(Pascal)\nChange owner from oid to int4 type(Bruce)\nFix a bug in the oracle compatibility functions btrim() ltrim() and rtrim()\nFix for usernames longer than eight characters(Tom)\nFix for shared invalidation cache overflow(Massimo)\nPrevent file descriptor leaks in failed COPY's(Bruce)\n\nEnhancements\n------------\nUpgrade ECPG to 2.0, see src/interfaces/ecpc/ChangeLog(Michael)\nShow the index used in an explain(Zeugswetter)\nMulti-byte awareness of many data data types and functions(Tatsuo)\nNew configure --with-mb option(Tatsuo)\nNew initdb --pgencoding option(Tatsuo)\nNew createdb -E multibyte option(Tatsuo)\nSelect version(); now returns PostgreSQL version(Jeroen)\nLibpq now allows asynchronous clients(Tom)\nAllow cancel from client of backend query(Tom)\nPsql now cancels query with Control-C(Tom)\nDefine \"tz_hour\" and \"tz_minute\" arguments to date_part()(Thomas)\nAdd routines to convert between varchar and bpchar(Thomas)\nAdd routines to allow sizing of varchar and bpchar into target columns(Thomas)\nAdd bit flags to support timezonehour and minute in data retrieval(Thomas)\nAllow more variations on valid floating point numbers (e.g. \".1\", \"1e6\")(Thomas)\nFixes for unary minus parsing with leading spaces(Thomas)\nImplement TIMEZONE_HOUR, TIMEZONE_MINUTE per SQL92 specs(Thomas)\nCheck for and properly ignore FOREIGN KEY column constraints(Thomas)\nDefine USER as synonym for CURRENT_USER per SQL92 specs(Thomas)\nEnable HAVING clause but no fixes elsewhere yet.\nMake \"char\" type a synonym for \"char(1)\" (actually implemented as bpchar)(Thomas)\nSave string type if specified for DEFAULT clause handling(Thomas)\nCoerce operations involving different data types(Thomas)\nAllow some index use for columns of different types(Thomas)\nAdd capabilities for automatic type conversion(Thomas)\nCleanups for large objects, so file is truncated on open(Peter)\nReadline cleanups(Tom)\nAllow psql \\f \\ to make spaces as delimiter(Bruce)\nPass pg_attribute.atttypmod to the frontend for column field lengths(Tom,Bruce)\nMsql compatibility library in /contrib(Aldrin)\nRemove the requirement that ORDER/GROUP BY clause identifiers be \n\tincluded in the target list(David)\nConvert columns to match columns in UNION clauses(Thomas)\nRemove fork()/exec() and only do fork()(Bruce)\nJdbc cleanups(Peter)\nShow backend status on ps command line(only works on some platforms)(Bruce)\nPg_hba.conf now has a sameuser option in the database field\nMake lo_unlink take oid param, not int4\nNew DISABLE_COMPLEX_MACRO for compilers that can't handle our macros(Bruce)\nLibpgtcl now gets async notifies from libpq(Tom)\nNew locale patch, see docs/README/locale(Oleg)\nFix for pg_dump so CONSTRAINT and CHECK syntax is correct(ccb)\nNew contrib/lo code for large object orphan removal(Peter)\nNew psql command \"SET CLIENT_ENCODING TO 'encoding'\" for multi-bytes\n\tfeature, see /doc/README.mb(Tatsuo)\n/contrib/noupdate code to revoke update permission on a column\nLibpq can now be compiled on win32(Magnus)\nAdd PQsetdbLogin() in libpq\nTwo styles we agreed upon for database descriptors(Thomas)\nNew 8-byte integer type, checked by configure for OS support(Thomas)\nSurround table and column names with double-quotes(Thomas) in generated \n\tsql code to preserve case (SQL92 syntax)(Thomas)\nNew libpqrequestCancel(Tom)\nPQreset() now works with passwords(Tom)\nHandle case of GROUP BY target list column number out of range(David)\nAllow UNION in subselects\nAdd auto-size to screen to \\d? commands(Bruce)\nUse UNION to show all \\d? results in one query(Bruce)\nAdd \\d? field search feature(Bruce)\nPg_dump issues fewer \\connect requests(Tom)\nDocument pg_dump -z flag in manual page(Tom)\nAdd HAVING clause with full support for subselects and unions(Stephan)\nFull text indexing routines in contrib/fulltextindex(Marteen)\nTransaction ids now stored in shared memory(Vadim)\nNew PGCLIENTENCODING when issuing COPY command(Tatsuo)\nSupport for SQL92 syntax \"SET NAMES\"(Tatsuo)\nSupport for LATIN2-5(Tatsuo)\nAdd UNICODE regression test case(Tatsuo)\nLock manager cleanup, new locking modes for LLL(Vadim)\nAllow index use with OR clauses(Bruce)\nAllows \"SELECT NULL ORDER BY 1;\"\nExplain VERBOSE prints the plan, and now pretty-prints the plan to\n\tthe postmaster log file(Bruce)\nAdd Indices display to \\d command(Bruce)\nAllow GROUP BY on functions(David)\nNew pg_class.relkind for large objects(Bruce)\nNew way to send libpq NOTICE messages to a different location(Tom)\nNew \\w write command to psql(Bruce)\nNew /contrib/findoidjoins scans oid columns to find join relationships(Bruce)\nAllow binary-compatible indices to be considered when checking for valid\n\tindices for restriction clauses containing a constant(Thomas)\nNew ISBN/ISSN code in /contrib/isbn_issn\nAllow NOT LIKE, IN, NOT IN, BETWEEN, and NOT BETWEEN constraint(Thomas)\nNew rewrite system fixes many problems with rules and views(Jan)\n\tRules on relations work\n\tEvent qualifications on insert/update/delete work\n\tNew OLD variable to reference CURRENT, CURRENT will be remove in future\n\tUpdate rules can reference NEW and OLD in rule qualifications/actions\n\tInsert/update/delete rules on views work\n\tMultiple rule actions are now supported, surrounded by parentheses\n\tRegular users can create views/rules on tables they have RULE permits\n\tRules and views inherit the permissions on the creator\n\tNo rules at the column level\n\tNo UPDATE NEW/OLD rules\n\tNew pg_rule and pg_view system views\n\tOnly a single action on SELECT rules\n\tTotal rewrite overhaul, perhaps for 6.5\nSystem indexes are now multi-key(Bruce)\nOidint2, oidint4, and oidname types are removed(Bruce)\nUse system cache for more system table lookups(Bruce)\nNew backend programming language PL/pgSQL in backend/pl(Jan)\nNew SERIAL data type, auto-creates sequence/index(Thomas)\nEnable assert checking without a recompile(Massimo)\nUser lock enhancements(Massimo)\nNew setval() command to set sequence value(Massimo)\nAuto-remove unix socket file on startup if no postmaster running(Massimo)\nConditional trace package(Massimo)\nNew UNLISTEN command(Massimo)\nPsql now compiles under win32 using win32.mak(Magnus)\nLo_read no longer stores trailing NULL(Bruce)\nIdentifiers are now truncated to 31 characters internally(Bruce)\n\nSource Tree Changes\n-------------------\n/contrib cleanup(Jun)\nInline some small functions called for every row(Bruce)\nAlpha/linux fixes\nHp/UX cleanups(Tom)\nMulti-byte regression tests(Soonmyung.)\nRemove --disabled options from configure\nDefine PGDOC to use POSTGRESDIR by default\nMake regression optional\nRemove extra braces code to pgindent(Bruce)\nAdd bsdi shared library support(Bruce)\nNew --without-CXX support configure option(Brook)\nNew FAQ_CVS\nUpdate backend flowchart in tools/backend(Bruce)\nChange atttypmod from int16 to int32(Bruce, Tom)\nGetrusage() fix for platforms that do not have it(Tom)\nAdd PGUSER to libpq man page\nNs32k platform fixes(Phil Nelson)\nSco 7/UnixWare 2.x fixes(Billy,others)\nSparc/Solaris 2.5 fixes(Ryan)\nPgbuiltin.3 is obsolete, move to doc files(Thomas)\nEven more documention(Thomas)\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sat, 29 Aug 1998 18:03:04 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "6.4 HISTORY file"
},
{
"msg_contents": "On Sat, Aug 29, 1998 at 06:03:04PM -0400, Bruce Momjian wrote:\n> Upgrade ECPG to 2.0, see src/interfaces/ecpc/ChangeLog(Michael)\n\nMake that 2.* please as we are at 2.4.1 for ecpg and 2.6.1 for ecpglib.\n\nMichael\n\n-- \nMichael Meskes\t\t\[email protected], [email protected]\nGo SF49ers! Go Rhein Fire!\tUse Debian GNU/Linux! \n",
"msg_date": "Sun, 30 Aug 1998 13:53:00 +0200",
"msg_from": "Michael Meskes <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] 6.4 HISTORY file"
},
{
"msg_contents": "> On Sat, Aug 29, 1998 at 06:03:04PM -0400, Bruce Momjian wrote:\n> > Upgrade ECPG to 2.0, see src/interfaces/ecpc/ChangeLog(Michael)\n> \n> Make that 2.* please as we are at 2.4.1 for ecpg and 2.6.1 for ecpglib.\n> \n> Michael\n> \n> -- \n> Michael Meskes\t\t\[email protected], [email protected]\n> Go SF49ers! Go Rhein Fire!\tUse Debian GNU/Linux! \n> \n> \n\nDone.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Wed, 2 Sep 1998 19:28:09 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] 6.4 HISTORY file"
}
] |
[
{
"msg_contents": "I mentioned that people should send it documenation updates for the new\n6.4 features.\n\nLet me list the places that often have to be updated:\n\n\tcommand-line arg printout from inside the program\n\tpsql help in psqlHelp.c\n\tman pages\n\tsgml docs\n\nI am not suggesting you have to learn troff or sgml. If you just want\nto give us some text describing the changes, Thomas or I can merge them\nin.\n\nThomas, I am not totally aware of all the items in the sgml docs, so you\nwill have to be on the lookout for areas needing updating.\n\nIn the old days, we were not on top of this, and had many embarassing\nproblem reports of people looking for features that were undocumented.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sat, 29 Aug 1998 20:15:54 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Documentation updates for 6.4"
}
] |
[
{
"msg_contents": "As far as I am concerned, we are ready to go.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sat, 29 Aug 1998 21:44:12 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Release 6.4"
},
{
"msg_contents": "On Sat, 29 Aug 1998, Bruce Momjian wrote:\n\n> As far as I am concerned, we are ready to go.\n\n\tI've already started up the nightly snapshots for\ndebugging...anyone else has any \"new features\" they want to slide in\nbefore the BETA freeze, they have until tomorrow (Monday)...after that,\nits purely a bug fix period.\n\n\tFirst v6.4beta1 to be put out on Friday, final release to be put\nout on October 1st...\n\nMarc G. Fournier \nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n",
"msg_date": "Sun, 30 Aug 1998 16:15:15 -0300 (ADT)",
"msg_from": "The Hermit Hacker <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Release 6.4"
},
{
"msg_contents": "Thus spake The Hermit Hacker\n> \tI've already started up the nightly snapshots for\n> debugging...anyone else has any \"new features\" they want to slide in\n> before the BETA freeze, they have until tomorrow (Monday)...after that,\n> its purely a bug fix period.\n\nI'll make one last appeal for a field in pg_class to list the primary\nkey. Really, we throw this information away and we shouldn't.\n\nI have a pile of helper functions for PyGreSQL that I can't distribute\nbecause I don't have a clean way of getting the key. Being able to grab\nthis information from the schema would be really useful. As it happens\nI am getting ready to package up the next release right now so the\ntiming is perfect.\n\n-- \nD'Arcy J.M. Cain <darcy@{druid|vex}.net> | Democracy is three wolves\nhttp://www.druid.net/darcy/ | and a sheep voting on\n+1 416 424 2871 (DoD#0082) (eNTP) | what's for dinner.\n",
"msg_date": "Sun, 30 Aug 1998 19:01:01 -0400 (EDT)",
"msg_from": "[email protected] (D'Arcy J.M. Cain)",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Release 6.4"
},
{
"msg_contents": "On Sun, 30 Aug 1998, D'Arcy J.M. Cain wrote:\n\n> Thus spake The Hermit Hacker\n> > \tI've already started up the nightly snapshots for\n> > debugging...anyone else has any \"new features\" they want to slide in\n> > before the BETA freeze, they have until tomorrow (Monday)...after that,\n> > its purely a bug fix period.\n> \n> I'll make one last appeal for a field in pg_class to list the primary\n> key. Really, we throw this information away and we shouldn't.\n\n\tSounds reasonable to me..anyone able to do a patch up for this\nquickly, though?\n\nMarc G. Fournier \nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n",
"msg_date": "Sun, 30 Aug 1998 22:00:12 -0300 (ADT)",
"msg_from": "The Hermit Hacker <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Release 6.4"
},
{
"msg_contents": ">\n> On Sat, 29 Aug 1998, Bruce Momjian wrote:\n>\n> > As far as I am concerned, we are ready to go.\n>\n> I've already started up the nightly snapshots for\n> debugging...anyone else has any \"new features\" they want to slide in\n> before the BETA freeze, they have until tomorrow (Monday)...after that,\n> its purely a bug fix period.\n>\n> First v6.4beta1 to be put out on Friday, final release to be put\n> out on October 1st...\n>\n> Marc G. Fournier\n\n Back from a training this week.\n\n I had really trouble on the attempt to fix more things in the\n rewrite system. Thus I decided to give a new rewrite handler\n a try and up to now I got the view rewrite stuff working (can\n handle most cases of RIR rules including aggregate columns\n that are rewritten into subselects when used in the\n qualification). Must now adapt the insert/update/delete stuff\n into it.\n\n What's the target for 6.4 release?\n\n Another question on aggregate columns:\n\n I can define a view\n\n CREATE VIEW v1 AS SELECT x.a, x.b, count(y.a)\n FROM t1 x, t2 y WHERE x.a = y.a GROUP BY x.a, x.b;\n\n But it's impossible to omit the group by and another side\n effect is that it would never return any row where count(y.a)\n would be zero.\n\n Is that the correct behaviour? What does standard say?\n\n The zero counting rows could also show up and the group by\n clause can be optional if we create a new type of func node\n that contains a parsetree instead of a reference to the\n pg_proc entry. The rewrite handler could build them and I\n know how. And it would enhance the view capabilities\n extremely since using that technique a qualification could\n compare two aggregate columns of a view. This is still\n missing in the new rewrite handler because the planner cannot\n handle sublinks with an aggregate in the lefthand.\n\n Can we agree that this is still bug fixing instead of new\n feature? How much time would I have to make it working?\n\n\nJan\n\n--\n\n#======================================================================#\n# It's easier to get forgiveness for being wrong than for being right. #\n# Let's break this rule - forgive me. #\n#======================================== [email protected] (Jan Wieck) #\n\n\n",
"msg_date": "Fri, 4 Sep 1998 16:33:17 +0200 (MET DST)",
"msg_from": "[email protected] (Jan Wieck)",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Release 6.4"
},
{
"msg_contents": "\n\nJan Wieck wrote:\n\n> >\n> > On Sat, 29 Aug 1998, Bruce Momjian wrote:\n> >\n> > > As far as I am concerned, we are ready to go.\n> >\n> > I've already started up the nightly snapshots for\n> > debugging...anyone else has any \"new features\" they want to slide in\n> > before the BETA freeze, they have until tomorrow (Monday)...after that,\n> > its purely a bug fix period.\n> >\n> > First v6.4beta1 to be put out on Friday, final release to be put\n> > out on October 1st...\n> >\n> > Marc G. Fournier\n>\n> Back from a training this week.\n>\n> I had really trouble on the attempt to fix more things in the\n> rewrite system. Thus I decided to give a new rewrite handler\n> a try and up to now I got the view rewrite stuff working (can\n> handle most cases of RIR rules including aggregate columns\n> that are rewritten into subselects when used in the\n> qualification). Must now adapt the insert/update/delete stuff\n> into it.\n>\n> What's the target for 6.4 release?\n>\n> Another question on aggregate columns:\n>\n> I can define a view\n>\n> CREATE VIEW v1 AS\n>\n> But it's impossible to omit the group by and another side\n> effect is that it would never return any row where count(y.a)\n> would be zero.\n>\n> Is that the correct behaviour? What does standard say?\n>\n\nI believe it is correct. I have never seen any statements or documents to\nthe contrary. Every item in the target list must be either an aggregate\nfunction, matched with a GROUP BY item, or a literal. I'm not sure if we\nsupport the literal.\n\nI am a little confused by the counting zero rows issue.\n SELECT count(*) FROM foo -- zero is possible\n\n SELECT bar, count(*) FROM foo GROUP BY bar\nZero counts are impossible in this trivial case because you cannot know what\ntuples are missing.\n\nIn your example:\n\n SELECT x.a, x.b, count(y.a) FROM t1 x, t2 y\n WHERE x.a = y.a GROUP BY x.a, x.b;\n\nAre you suggesting that if there are rows in t1 that are not in t2, that the\ncount could/should be zero?\n\n\n",
"msg_date": "Fri, 04 Sep 1998 11:49:26 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Release 6.4"
},
{
"msg_contents": "> >\n> > On Sat, 29 Aug 1998, Bruce Momjian wrote:\n> >\n> > > As far as I am concerned, we are ready to go.\n> >\n> > I've already started up the nightly snapshots for\n> > debugging...anyone else has any \"new features\" they want to slide in\n> > before the BETA freeze, they have until tomorrow (Monday)...after that,\n> > its purely a bug fix period.\n> >\n> > First v6.4beta1 to be put out on Friday, final release to be put\n> > out on October 1st...\n> >\n> > Marc G. Fournier\n> \n> Back from a training this week.\n> \n> I had really trouble on the attempt to fix more things in the\n> rewrite system. Thus I decided to give a new rewrite handler\n> a try and up to now I got the view rewrite stuff working (can\n> handle most cases of RIR rules including aggregate columns\n> that are rewritten into subselects when used in the\n> qualification). Must now adapt the insert/update/delete stuff\n> into it.\n> \n> What's the target for 6.4 release?\n> \n> Another question on aggregate columns:\n> \n> I can define a view\n> \n> CREATE VIEW v1 AS SELECT x.a, x.b, count(y.a)\n> FROM t1 x, t2 y WHERE x.a = y.a GROUP BY x.a, x.b;\n> \n> But it's impossible to omit the group by and another side\n> effect is that it would never return any row where count(y.a)\n> would be zero.\n> \n> Is that the correct behaviour? What does standard say?\n> \n> The zero counting rows could also show up and the group by\n> clause can be optional if we create a new type of func node\n> that contains a parsetree instead of a reference to the\n> pg_proc entry. The rewrite handler could build them and I\n> know how. And it would enhance the view capabilities\n> extremely since using that technique a qualification could\n> compare two aggregate columns of a view. This is still\n> missing in the new rewrite handler because the planner cannot\n> handle sublinks with an aggregate in the lefthand.\n> \n> Can we agree that this is still bug fixing instead of new\n> feature? How much time would I have to make it working?\n\nOK, Jan, keep going. We still have one big bug to fix, and are going to\ntry to get another item completed. I would say you have a good 7-10\ndays to keep adding stuff.\n\nThe fact that your rewrite fixes MANY long-standing bugs in the view\nsystem means you can contininue adding things in that area well into the\nbeta period.\n\nNot sure what the cut-off would be because we need to get to a point\nwhere no more bugs are being reported, but we clearly are a long ways\nfrom that right now.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Fri, 4 Sep 1998 14:18:36 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] Release 6.4"
},
{
"msg_contents": "> > Can we agree that this is still bug fixing instead of new\n> > feature? How much time would I have to make it working?\n> \n> OK, Jan, keep going. We still have one big bug to fix, and are going\n> to try to get another item completed. I would say you have a good \n> 7-10 days to keep adding stuff.\n\nAlso Jan, if you find that you need more time to work, we can make the\nrewritten rewrite the centerpiece of v6.5. So you can decide over the\nnext week which you would prefer...\n\nGood luck!\n\n - Tom\n",
"msg_date": "Sat, 05 Sep 1998 01:06:10 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Release 6.4"
}
] |
[
{
"msg_contents": "I haven't been examining the 6.4 cvs or snapshots, so this may or may not\nbe relevant. \n\nIn 6.3.2 and prior versions, the man page for psql incorrectly\nindicated that -T as a command line option turned off the printing\nof column names in the output. Actually, the lower case option, -t\nperforms this function.\n\nIf the man page is still in error, you may wish to fix it.\n\n\n\nMarc Zuckman\[email protected]\n\n_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\n_ Visit The Home and Condo MarketPlace\t\t _\n_ http://www.ClassyAd.com\t\t\t _\n_\t\t\t\t\t\t\t _\n_ FREE basic property listings/advertisements and searches. _\n_\t\t\t\t\t\t\t _\n_ Try our premium, yet inexpensive services for a real\t _\n_ selling or buying edge!\t\t\t\t _\n_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\\_\n\n",
"msg_date": "Sat, 29 Aug 1998 22:20:43 -0400 (EDT)",
"msg_from": "Marc Howard Zuckman <[email protected]>",
"msg_from_op": true,
"msg_subject": "Documentation fix"
},
{
"msg_contents": "> I haven't been examining the 6.4 cvs or snapshots, so this may or may not\n> be relevant. \n> \n> In 6.3.2 and prior versions, the man page for psql incorrectly\n> indicated that -T as a command line option turned off the printing\n> of column names in the output. Actually, the lower case option, -t\n> performs this function.\n> \n> If the man page is still in error, you may wish to fix it.\n\nLooks good in 6.4.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sat, 29 Aug 1998 23:13:32 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Documentation fix"
}
] |
[
{
"msg_contents": "Here is the last thing I think I promised for 6.4. It is a script that\nwill allow 6.3.* users to upgrade to 6.4 without reloading all their\ndata.\n\nIt works by copying the user tables/index files to a backup directory,\ndestroying and recreating the database, then using the\npg_dump/pg_dumpall output to re-create the tables and indexes, without\nthe COPY commands. It then moves the table/index files back into the\ndirectory.\n\nIf it works and people like it, I will write up a manual page, and\nmention it so people can use it.\n\nI am not sure how to preserve the database owner because I need to\ndrop/recreate the database. Any ideas?\n\n\nVadim, I assume you did not change anything in the table or index\nstructure. You mentioned an index change, but I do not think you made\nit, did you?\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n\n:\n\ntrap \"rm -f /tmp/$$\" 0 1 2 3 15\nif [ \"$#\" -eq 0 ]\nthen\techo \"Usage: $0 [-f inputfile] database\" 1>&2\n\texit 1\nfi\n\nif [ \"X$1\" = \"X-f\" ]\nthen\tINPUT=\"$2\"\n\tshift 2\nelse\ttrap \"rm -f /tmp/$$ /tmp/$$a\" 0 1 2 3 15\n\tINPUT=\"/tmp/$$a\"\n\tcat >/tmp/$$a\nfi\n\nif [ \"$#\" -ne 1 ]\nthen\techo \"Usage: $0 [-f input_file] database\" 1>&2\n\texit 1\nfi\n\nDATABASE=\"$1\"\n\n# check things\n\nif [ ! -d \"./data\" ]\nthen\techo \"$0 must be run from the top of the postgres directory tree.\" 1>&2\n\texit 1\nfi\nif [ ! -d \"./data/base/template1\" ]\nthen\techo \"$0 must be run as the postgres superuser.\" 1>&2\n\texit 1\nfi\n\n# move user tables out of the way\n\ncd data/base\n\nmkdir pg_upgrade\n\nfor DIR in *\ndo\n\tif [ -d \"$DIR\" -a \\\n\t\t\\( \"$DATABASE\" = \"$DIR\" -o \"$DATABASE\" = \"template1\" \\) ]\n\tthen\trm -rf pg_upgrade/\"$DIR\"\n\t\tmkdir pg_upgrade/\"$DIR\"\n\t\tcd $DIR\n\t\tfor FILE in *\n\t\tdo\n\t\t\tif [ `expr \"$FILE\" : \"pg_\"` -ne 3 -a \\\n\t\t\t\t\"$FILE\" != \"PG_VERSION\" ]\n\t\t\tthen\tmv $FILE ../pg_upgrade/$DIR/$FILE\n\t\t\tfi\n\t\tdone\n\t\tcd ..\n\t\techo \"Dropping and recreating database $DIR\"\n\t\tdestroydb \"$DIR\"\n\t\tcreatedb \"$DIR\"\n\tfi\ndone\n\n# remove COPY statements\n\ncat \"$INPUT\" | awk '\t{\n\t\t\t\tif (toupper($0) ~ /^COPY /)\n\t\t\t\t\twhile (getline $0 > 0 && $0 != \"\\\\.\")\n\t\t\t\t\t\t;\n\t\t\t\telse\tprint $0;\n\t\t\t}' >/tmp/$$\n \n#create empty tables/indexes\n\npsql \"$DATABASE\" <\"/tmp/$$\"\n\nfor DIR in *\ndo\n\tif [ -d \"$DIR\" -a \\\n\t\t\\( \"$DATABASE\" = \"$DIR\" -o \"$DATABASE\" = \"template1\" \\) ]\n\tthen\tcd $DIR\n\t\tmv ../pg_upgrade/$DIR/* . && rmdir ../pg_upgrade/$DIR\n\t\trmdir ../pg_upgrade/$DIR 2>/dev/null # if empty, remove it\n\t\tcd ..\n\tfi\ndone\n\nrmdir pg_upgrade\n\nif [ \"$?\" -ne 0 ]\nthen\techo \"There is something left in data/base/pg_upgrade.\" 1>&2\n\texit 1\nfi",
"msg_date": "Sat, 29 Aug 1998 23:11:27 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "upgrading to 6.4 from 6.3"
},
{
"msg_contents": "Bruce Momjian wrote:\n> \n> Here is the last thing I think I promised for 6.4. It is a script that\n> will allow 6.3.* users to upgrade to 6.4 without reloading all their\n> data.\n> \n> It works by copying the user tables/index files to a backup directory,\n> destroying and recreating the database, then using the\n> pg_dump/pg_dumpall output to re-create the tables and indexes, without\n> the COPY commands. It then moves the table/index files back into the\n> directory.\n\nBut how about pg_log & pg_variable ?\nShouldn't nextOid, nextXid and transaction commit/abort infos\nbe restored ?\n\n> \n> If it works and people like it, I will write up a manual page, and\n> mention it so people can use it.\n> \n> I am not sure how to preserve the database owner because I need to\n> drop/recreate the database. Any ideas?\n> \n> Vadim, I assume you did not change anything in the table or index\n> structure. You mentioned an index change, but I do not think you made\n> it, did you?\n\nNo, I didn't.\n\nVadim\n",
"msg_date": "Mon, 31 Aug 1998 09:08:03 +0800",
"msg_from": "Vadim Mikheev <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] upgrading to 6.4 from 6.3"
},
{
"msg_contents": "> Bruce Momjian wrote:\n> > \n> > Here is the last thing I think I promised for 6.4. It is a script that\n> > will allow 6.3.* users to upgrade to 6.4 without reloading all their\n> > data.\n> > \n> > It works by copying the user tables/index files to a backup directory,\n> > destroying and recreating the database, then using the\n> > pg_dump/pg_dumpall output to re-create the tables and indexes, without\n> > the COPY commands. It then moves the table/index files back into the\n> > directory.\n> \n> But how about pg_log & pg_variable ?\n> Shouldn't nextOid, nextXid and transaction commit/abort infos\n> be restored ?\n\nOK, I have added an 'mv' of pg_log and pg_variable from the old\ninstance. The only problem I see is that the postmaster is running\nduring the script, so shared memory is enabled. If I copy them during\nthat time, do they get preseved, or does the next backend overwrite\npg_variable?\n\nI wonder if I have to stop the postmaster before I do this, and tell the\nuser to restart it. The new pid lock file would help in this case.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Mon, 31 Aug 1998 00:41:16 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] upgrading to 6.4 from 6.3"
}
] |
[
{
"msg_contents": "> Applied. Autoconf done.\n> \n> Wow, Bruce! That was fast. You're on the ball tonight.\n\nI have been doing my pre-release marathon to get things ready. There is\nno other way to do it. It has to be done.\n\nI have finally finished after doing nothing else except sleep for the\npast 24 hours.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sat, 29 Aug 1998 23:40:45 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [PATCHES] with tcl/perl patch"
}
] |
[
{
"msg_contents": "I have installed pg_upgrade in the pg_dump directory, so it now gets\ninstalled as part of the system. I have added a manual page with\ninstructions on its use, and have mentioned the command in the INSTALL\nfile.\n\nPlease let me know how it works. My testing on a small data sample\nworked well.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sun, 30 Aug 1998 01:11:10 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "new pg_upgrade command"
}
] |
[
{
"msg_contents": "backend/libpq/pgcomm.c no longer compiles on my system. The cvs log sez\n\nMassimo Dal Zotto <[email protected]>\n> socket-flock.patch\n> use advisory locks to check if the unix socket can be deleted.\n> A running postmaster keeps a lock on that file. A starting\n> postmaster exits if the file exists and is locked, otherwise\n> it deletes the sockets and proceeds.\n> This avoid the need to remove manually the file after a postmaster\n> or system crash.\n> I don't know if flock is available on any system. If not we could\n> define a HAVE_FLOCK set by configure.\n\nflock is *VERY* far from portable. I am aware of three or four\ndifferent, mutually incompatible file locking syscalls on different\nUnix flavors. flock is just one of the contestants. Even if the\ncall syntax were uniform, the semantics are not portable enough to\nbe safe (advisory locks don't work on NFS-mounted files, for example).\n\nMassimo has a good idea in the long run, but I have strong doubts that\nwe want to start working the bugs out two days before a beta release\ncycle. Portable file locking in Unix is a very nasty can of worms,\nand I recommend not opening it at this particular point.\n\nIn short: I'd like to see this patch backed out until after 6.4.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Sun, 30 Aug 1998 01:42:03 -0400",
"msg_from": "Tom Lane <[email protected]>",
"msg_from_op": true,
"msg_subject": "flock patch breaks things here"
},
{
"msg_contents": "\nOn Sun, 30 Aug 1998, Tom Lane wrote:\n\n> Massimo Dal Zotto <[email protected]>\n> > socket-flock.patch\n> > use advisory locks to check if the unix socket can be deleted.\n> > A running postmaster keeps a lock on that file. A starting\n> > postmaster exits if the file exists and is locked, otherwise\n> > it deletes the sockets and proceeds.\n> > This avoid the need to remove manually the file after a postmaster\n> > or system crash.\n> > I don't know if flock is available on any system. If not we could\n> > define a HAVE_FLOCK set by configure.\n> \n> flock is *VERY* far from portable. I am aware of three or four\n> different, mutually incompatible file locking syscalls on different\n> Unix flavors. flock is just one of the contestants. Even if the\n> call syntax were uniform, the semantics are not portable enough to\n> be safe (advisory locks don't work on NFS-mounted files, for example).\n\n You can't create unix domain sockets on NFS files systems (well, you\nmight be allowed to, it just might not be very useful).\n\n The flock() call syntax is very consistant. The only other option is\nfcntl() which is very consistant too, and is described in POSIX.1\n\n The only other option is lockf(). No one uses this anymore. It was\nonly ever supported on SVR2,3,4 anyhow. It also is just a subset of\nfcntl()\n\n> Massimo has a good idea in the long run, but I have strong doubts that\n> we want to start working the bugs out two days before a beta release\n> cycle. Portable file locking in Unix is a very nasty can of worms,\n> and I recommend not opening it at this particular point.\n\n Not really. The biggest problem is NFS issues, which don't need to be\nconsidered for unix domain sockets. The various sematics issues don't\nreally apply for locking is being used for.\n\n> In short: I'd like to see this patch backed out until after 6.4.\n> \n> \t\t\tregards, tom lane\n\nTom\n\n",
"msg_date": "Sat, 29 Aug 1998 22:51:42 -0700 (PDT)",
"msg_from": "Tom <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] flock patch breaks things here"
},
{
"msg_contents": "> \n> backend/libpq/pgcomm.c no longer compiles on my system. The cvs log sez\n> \n> Massimo Dal Zotto <[email protected]>\n> > socket-flock.patch\n> > use advisory locks to check if the unix socket can be deleted.\n> > A running postmaster keeps a lock on that file. A starting\n> > postmaster exits if the file exists and is locked, otherwise\n> > it deletes the sockets and proceeds.\n> > This avoid the need to remove manually the file after a postmaster\n> > or system crash.\n> > I don't know if flock is available on any system. If not we could\n> > define a HAVE_FLOCK set by configure.\n> \n> flock is *VERY* far from portable. I am aware of three or four\n> different, mutually incompatible file locking syscalls on different\n> Unix flavors. flock is just one of the contestants. Even if the\n> call syntax were uniform, the semantics are not portable enough to\n> be safe (advisory locks don't work on NFS-mounted files, for example).\n> \n> Massimo has a good idea in the long run, but I have strong doubts that\n> we want to start working the bugs out two days before a beta release\n> cycle. Portable file locking in Unix is a very nasty can of worms,\n> and I recommend not opening it at this particular point.\n> \n> In short: I'd like to see this patch backed out until after 6.4.\n> \n\nYes, I'm aware of this. For the moment I suggest we put a #ifdef linux\naround the code until a more portable solution is found.\n\n-- \nMassimo Dal Zotto\n\n+----------------------------------------------------------------------+\n| Massimo Dal Zotto email: [email protected] |\n| Via Marconi, 141 phone: ++39-461-534251 |\n| 38057 Pergine Valsugana (TN) www: http://www.cs.unitn.it/~dz/ |\n| Italy pgp: finger [email protected] |\n+----------------------------------------------------------------------+\n",
"msg_date": "Sun, 30 Aug 1998 13:04:43 +0200 (MET DST)",
"msg_from": "Massimo Dal Zotto <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] flock patch breaks things here"
},
{
"msg_contents": "[Charset iso-8859-1 unsupported, filtering to ASCII...]\n> > \n> > backend/libpq/pgcomm.c no longer compiles on my system. The cvs log sez\n> > \n> > Massimo Dal Zotto <[email protected]>\n> > > socket-flock.patch\n> > > use advisory locks to check if the unix socket can be deleted.\n> > > A running postmaster keeps a lock on that file. A starting\n> > > postmaster exits if the file exists and is locked, otherwise\n> > > it deletes the sockets and proceeds.\n> > > This avoid the need to remove manually the file after a postmaster\n> > > or system crash.\n> > > I don't know if flock is available on any system. If not we could\n> > > define a HAVE_FLOCK set by configure.\n> > \n> > flock is *VERY* far from portable. I am aware of three or four\n> > different, mutually incompatible file locking syscalls on different\n> > Unix flavors. flock is just one of the contestants. Even if the\n> > call syntax were uniform, the semantics are not portable enough to\n> > be safe (advisory locks don't work on NFS-mounted files, for example).\n> > \n> > Massimo has a good idea in the long run, but I have strong doubts that\n> > we want to start working the bugs out two days before a beta release\n> > cycle. Portable file locking in Unix is a very nasty can of worms,\n> > and I recommend not opening it at this particular point.\n> > \n> > In short: I'd like to see this patch backed out until after 6.4.\n> > \n> \n> Yes, I'm aware of this. For the moment I suggest we put a #ifdef linux\n> around the code until a more portable solution is found.\n\n\nCan't we just have configure check for flock(). Another idea is to\ncreate a 'pid' file in the pgsql/data/base directory, and do a kill -0\nto see if it is stil running before removing the lock.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sun, 30 Aug 1998 08:19:52 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] flock patch breaks things here"
},
{
"msg_contents": "Bruce Momjian <[email protected]> writes:\n> Can't we just have configure check for flock(). Another idea is to\n> create a 'pid' file in the pgsql/data/base directory, and do a kill -0\n> to see if it is stil running before removing the lock.\n\nThe latter approach is what I was going to suggest. Writing a pid file\nwould be a fine idea anyway --- for one thing, it makes it a lot easier\nto write a \"kill the postmaster\" script. Given that the postmaster\nshould write a pid file, a new postmaster should look for an existing\npid file, and try to do a kill(pid, 0) on the number contained therein.\nIf this doesn't return an error, then you figure there is already a\npostmaster running, complain, and exit. Otherwise you figure you is it,\n(re)write the pid file and away you go. Then pqcomm.c can just\nunconditionally delete any old file that's in the way of making the\npipe.\n\nThe pidfile checking and creation probably ought to go in postmaster.c,\nnot down inside pqcomm.c. I never liked the fact that a critical\ninterlock function was being done by a low-level library that one might\nnot even want to invoke (if all your clients are using TCP, opening up\nthe Unix-domain socket is a waste of time, no?).\n\nBTW, there is another problem with relying on flock on the socket file\nfor this purpose: it opens up a hole for a denial-of-service attack.\nAnyone who can write the file can flock it. (We already had a problem\nwith DOS via creating a dummy file at /tmp/.s.PGSQL.5432, but it would\nbe harder to spot the culprit with an flock-based interference.)\n\n\t\t\tregards, tom lane\n",
"msg_date": "Sun, 30 Aug 1998 11:23:38 -0400",
"msg_from": "Tom Lane <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] flock patch breaks things here "
},
{
"msg_contents": "> \n> Bruce Momjian <[email protected]> writes:\n> > Can't we just have configure check for flock(). Another idea is to\n> > create a 'pid' file in the pgsql/data/base directory, and do a kill -0\n> > to see if it is stil running before removing the lock.\n> \n> The latter approach is what I was going to suggest. Writing a pid file\n> would be a fine idea anyway --- for one thing, it makes it a lot easier\n> to write a \"kill the postmaster\" script. Given that the postmaster\n> should write a pid file, a new postmaster should look for an existing\n> pid file, and try to do a kill(pid, 0) on the number contained therein.\n> If this doesn't return an error, then you figure there is already a\n> postmaster running, complain, and exit. Otherwise you figure you is it,\n> (re)write the pid file and away you go. Then pqcomm.c can just\n> unconditionally delete any old file that's in the way of making the\n> pipe.\n> \n> The pidfile checking and creation probably ought to go in postmaster.c,\n> not down inside pqcomm.c. I never liked the fact that a critical\n> interlock function was being done by a low-level library that one might\n> not even want to invoke (if all your clients are using TCP, opening up\n> the Unix-domain socket is a waste of time, no?).\n> \n> BTW, there is another problem with relying on flock on the socket file\n> for this purpose: it opens up a hole for a denial-of-service attack.\n> Anyone who can write the file can flock it. (We already had a problem\n> with DOS via creating a dummy file at /tmp/.s.PGSQL.5432, but it would\n> be harder to spot the culprit with an flock-based interference.)\n\nThis came to my mind, but I didn't think this would have happened so\nquickly. In my opinion the socket and the pidfile should be created in a\ndirectory owned by postgres, for example /tmp/.Pgsql-unix, like does X.\n\n-- \nMassimo Dal Zotto\n\n+----------------------------------------------------------------------+\n| Massimo Dal Zotto email: [email protected] |\n| Via Marconi, 141 phone: ++39-461-534251 |\n| 38057 Pergine Valsugana (TN) www: http://www.cs.unitn.it/~dz/ |\n| Italy pgp: finger [email protected] |\n+----------------------------------------------------------------------+\n",
"msg_date": "Sun, 30 Aug 1998 18:21:41 +0200 (MET DST)",
"msg_from": "Massimo Dal Zotto <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] flock patch breaks things here"
},
{
"msg_contents": "Massimo Dal Zotto <[email protected]> writes:\n> In my opinion the socket and the pidfile should be created in a\n> directory owned by postgres, for example /tmp/.Pgsql-unix, like does X.\n\nThe pidfile belongs at the top level of the database directory (eg,\n/usr/local/pgsql/data/postmaster.pid), because what it actually\nrepresents is that there is a postmaster running *for that database\ngroup*.\n\nIf you want to support multiple database sets on one machine (which I\ndo), then the interlock has to be per database directory. Putting the\npidfile into a common directory would mean we'd have to invent some\nkind of pidfile naming convention to keep multiple postmasters from\ntromping on each other. This is unnecessarily complex.\n\nI agree with you that putting the socket file into a less easily munged\ndirectory than /tmp would be a good idea for security. But that's a\nseparate issue. On machines that understand stickybits for directories,\nthe security hole is not really very big.\n\nAt this point, the fact that /tmp/.s.PGSQL.port# is the socket path is\neffectively a version-independent aspect of the FE/BE protocol, and so\nwe can't change it without breaking old applications. I'm not sure that\nthat's worth the security improvement.\n\nWhat I'd like to see someday is a postmaster command line switch to tell\nit to use *only* TCP connections and not create a Unix socket at all.\nThat hasn't been possible so far, because we were relying on the socket\nfile to provide a safety interlock against starting multiple\npostmasters. But an interlock using a pidfile would be much better.\n(Look around; *every* other Unix daemon I know of that wants to ensure\nthat there's only one of it uses a pidfile interlock. Not file locking.\nThere's a reason why that's the well-trodden path.)\n\n\t\t\tregards, tom lane\n",
"msg_date": "Sun, 30 Aug 1998 12:50:55 -0400",
"msg_from": "Tom Lane <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] flock patch breaks things here "
},
{
"msg_contents": "On Sun, 30 Aug 1998, Tom Lane wrote:\n\n> Massimo Dal Zotto <[email protected]> writes:\n> > In my opinion the socket and the pidfile should be created in a\n> > directory owned by postgres, for example /tmp/.Pgsql-unix, like does X.\n> \n> The pidfile belongs at the top level of the database directory (eg,\n> /usr/local/pgsql/data/postmaster.pid), because what it actually\n> represents is that there is a postmaster running *for that database\n> group*.\n\n\tI have to agree with this one...but then it also negates the\nargument about the flock() DoS...*grin*\n\n\tBTW...I like the kill(pid,0) solution myself, primarily because it\nis, i think, the most portable solution. \n\n\tI would not consider a patch to remove the flock() solution and\nreplace it with the kill(pid,0) solution a new feature, just an\nimprovement of an existing one...either way, moving the pid file (or\nsocket, for that matter) from /tmp should be listed as a security related\nrequirement for v6.4 :)\n\nMarc G. Fournier \nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n",
"msg_date": "Sun, 30 Aug 1998 16:21:28 -0300 (ADT)",
"msg_from": "The Hermit Hacker <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] flock patch breaks things here "
},
{
"msg_contents": "The Hermit Hacker <[email protected]> writes:\n> either way, moving the pid file (or\n> socket, for that matter) from /tmp should be listed as a security related\n> requirement for v6.4 :)\n\nHuh? There is no pid file being generated in /tmp (or anywhere else)\nat the moment. If we do add one, it should not go into /tmp for the\nreasons I gave before.\n\nWhere the Unix-domain socket file lives is an entirely separate issue.\n\nIf we move the socket out of /tmp then we have just kicked away all the\nwork we did to preserve backwards compatibility of the FE/BE protocol\nwith existing clients. Being able to talk to a 1.0 client isn't much\ngood if you aren't listening where he's going to try to contact you.\nSo I think I have to vote in favor of leaving the socket where it is.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Sun, 30 Aug 1998 22:34:40 -0400",
"msg_from": "Tom Lane <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] flock patch breaks things here "
},
{
"msg_contents": "> The Hermit Hacker <[email protected]> writes:\n> > either way, moving the pid file (or\n> > socket, for that matter) from /tmp should be listed as a security related\n> > requirement for v6.4 :)\n> \n> Huh? There is no pid file being generated in /tmp (or anywhere else)\n> at the moment. If we do add one, it should not go into /tmp for the\n> reasons I gave before.\n> \n> Where the Unix-domain socket file lives is an entirely separate issue.\n> \n> If we move the socket out of /tmp then we have just kicked away all the\n> work we did to preserve backwards compatibility of the FE/BE protocol\n> with existing clients. Being able to talk to a 1.0 client isn't much\n> good if you aren't listening where he's going to try to contact you.\n> So I think I have to vote in favor of leaving the socket where it is.\n\nI have been thinking about this. First, we can easily use fopen(r+) to\ncheck to see if the file exists, and if it does read the pid and do a\nkill -0 to see if it is running. If no one else does it, I will take it\non.\n\nSecond, where to put the pid file. There is reason to put in /tmp,\nbecause it will get cleared in a reboot, and because it is locking the\nport number 5432. There is also reason to put it in /data because you\ncan't have more than one postmaster running on a single data directory.\n\nSo, we really want to lock both places. If this is going to make it\neasier for people to run more than one postmaster, because it will\nprevent/warn administrators when they try and put two postmasters in the\nsame data dir or port, I say create the pid lock files both places, and\ngive the admin a clear description of what he is doing wrong in each\ncase.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Mon, 31 Aug 1998 00:36:34 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] flock patch breaks things here"
},
{
"msg_contents": "> \n> > The Hermit Hacker <[email protected]> writes:\n> > > either way, moving the pid file (or\n> > > socket, for that matter) from /tmp should be listed as a security related\n> > > requirement for v6.4 :)\n> > \n> > Huh? There is no pid file being generated in /tmp (or anywhere else)\n> > at the moment. If we do add one, it should not go into /tmp for the\n> > reasons I gave before.\n> > \n> > Where the Unix-domain socket file lives is an entirely separate issue.\n> > \n> > If we move the socket out of /tmp then we have just kicked away all the\n> > work we did to preserve backwards compatibility of the FE/BE protocol\n> > with existing clients. Being able to talk to a 1.0 client isn't much\n> > good if you aren't listening where he's going to try to contact you.\n> > So I think I have to vote in favor of leaving the socket where it is.\n> \n> I have been thinking about this. First, we can easily use fopen(r+) to\n> check to see if the file exists, and if it does read the pid and do a\n> kill -0 to see if it is running. If no one else does it, I will take it\n> on.\n> \n> Second, where to put the pid file. There is reason to put in /tmp,\n> because it will get cleared in a reboot, and because it is locking the\n> port number 5432. There is also reason to put it in /data because you\n> can't have more than one postmaster running on a single data directory.\n> \n> So, we really want to lock both places. If this is going to make it\n> easier for people to run more than one postmaster, because it will\n> prevent/warn administrators when they try and put two postmasters in the\n> same data dir or port, I say create the pid lock files both places, and\n> give the admin a clear description of what he is doing wrong in each\n> case.\n> \n\n\nIf the traffic on bugtraq is any indication, writing in /tmp is a\nsecurity exposure for daemons. Typical attack is:\n\n ln -s /etc/passwd /tmp/dumbrootprog.tmpfile\n\nwhen dumprootprog runs it writes on /etc/passwd. Cool huh? Not so serious\nin our case, as only pgsql owned files are at risk, but why take a chance.\nThis argues for the private pid file.\n\nAlso, before sprinkling files all over it is good to try to conform\nto the FHS (File Hierarchy Standard) (see http://www.pathname.com/fhs/)\nwhich is pretty easy to do and likely to make life easier later.\n\n-dg\n\nDavid Gould [email protected] 510.628.3783 or 510.305.9468 \nInformix Software (No, really) 300 Lakeside Drive Oakland, CA 94612\n - If simplicity worked, the world would be overrun with insects. -\n\n\n",
"msg_date": "Mon, 31 Aug 1998 01:23:02 -0700 (PDT)",
"msg_from": "[email protected] (David Gould)",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] flock patch breaks things here"
},
{
"msg_contents": "On Mon, 31 Aug 1998, David Gould wrote:\n\n> Also, before sprinkling files all over it is good to try to conform\n> to the FHS (File Hierarchy Standard) (see http://www.pathname.com/fhs/)\n> which is pretty easy to do and likely to make life easier later.\n\n\tI just downloaded and skim'd the fhs notes, and it looks\nreasonable...but, other then the current socket in /tmp, we don't\n\"splinkle files all over\"...do we? *raised eyebrow*\n\n\n",
"msg_date": "Mon, 31 Aug 1998 08:24:46 -0400 (EDT)",
"msg_from": "The Hermit Hacker <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] flock patch breaks things here"
},
{
"msg_contents": "[email protected] (David Gould) writes:\n> If the traffic on bugtraq is any indication, writing in /tmp is a\n> security exposure for daemons. Typical attack is:\n> ln -s /etc/passwd /tmp/dumbrootprog.tmpfile\n\nA partial answer to this is to unlink /tmp/pidfile before trying to\ncreate/write it. There's still a window for the attack, but it's\nmighty tiny. (You do have to check that the unlink either succeeds\nor fails with ENOENT --- in particular, an EPERM failure is trouble\nfor obvious reasons.)\n\nI finally understand where Bruce is coming from on this point: he wants\npid lock files in *both* the data dir (to lock the database) and /tmp\n(to lock the Unix-socket port number). This makes sense to me, and I\nagree that it'd become a lot safer to run multiple postmasters/databases\nthat way. The data and the port are independent resources and each one\nneeds a lock.\n\nI just came up with an idea that might help alleviate the /tmp security\nexposure without creating a backwards-compatibility problem. It works\nlike this:\n\n1. During installation, create a subdirectory of /tmp to hold Postgres'\nsocket files and associated pid lockfiles. This subdirectory should be\nowned by the Postgres superuser and have permissions 755\n(world-readable, writable only by Postgres superuser). Maybe call it\n/tmp/.pgsql --- the name should start with a dot to keep it out of the\nway. (Bruce points out that some systems clear /tmp during reboot, so\nit might be that a postmaster will have to be prepared to recreate this\ndirectory at startup --- anyone know if subdirectories of /tmp are\nzapped too? My system doesn't do that...)\n\n2. When a postmaster fires up, it checks for/creates a pid lockfile in\nthe subdirectory, and also creates the socket file in the subdirectory.\n\n3. For backwards compatibility with 1.0 clients, the socket file is also\nhard-linked to /tmp/.s.PGSQL.port# (use an unlink() and link()).\n\nThis way, there's no security risk of overwriting someone else's file,\nsince we never create or write on a file in a directory we don't own, we\nonly try to link an already-existing socket file into /tmp.\n\nI'd suggest that the pid and socket files be given names in /tmp/.pgsql\nthat don't start with dots --- no need to make them hard to see in that\ndirectory.\n\nWe can change libpq to find the socket at /tmp/.pgsql/whatever, and\neventually we could perhaps drop the backwards-compatibility feature\nof creating a link in /tmp.\n\n> Also, before sprinkling files all over it is good to try to conform\n> to the FHS (File Hierarchy Standard) (see http://www.pathname.com/fhs/)\n> which is pretty easy to do and likely to make life easier later.\n\nI notice that on my system, the X11 socket files in /tmp/.X11-unix are\nactually symlinks to socket files in /usr/spool/sockets/X11. I dunno if\nit's worth our trouble to get into putting our sockets under /usr/spool\nor /var/spool or whatever --- seems like another configuration choice to\nmess up. It'd be nice if the socket directory lived somewhere where the\nparent dirs weren't world-writable, but this would mean one more thing\nthat you have to have root permissions for in order to install pgsql.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Mon, 31 Aug 1998 10:17:21 -0400",
"msg_from": "Tom Lane <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] flock patch breaks things here "
},
{
"msg_contents": " I just came up with an idea that might help alleviate the /tmp security\n exposure without creating a backwards-compatibility problem. It works\n like this:\n\n 1. During installation, create a subdirectory of /tmp to hold Postgres'\n socket files and associated pid lockfiles. This subdirectory should be\n owned by the Postgres superuser and have permissions 755\n (world-readable, writable only by Postgres superuser). Maybe call it\n /tmp/.pgsql --- the name should start with a dot to keep it out of the\n way. (Bruce points out that some systems clear /tmp during reboot, so\n it might be that a postmaster will have to be prepared to recreate this\n directory at startup --- anyone know if subdirectories of /tmp are\n zapped too? My system doesn't do that...)\n\n ...\n\n I notice that on my system, the X11 socket files in /tmp/.X11-unix are\n actually symlinks to socket files in /usr/spool/sockets/X11. I dunno if\n it's worth our trouble to get into putting our sockets under /usr/spool\n or /var/spool or whatever --- seems like another configuration choice to\n mess up. It'd be nice if the socket directory lived somewhere where the\n parent dirs weren't world-writable, but this would mean one more thing\n that you have to have root permissions for in order to install pgsql.\n\nIt seems like we need a directory for locks (= pid files) and one for\nsockets (perhaps the same one). I strongly suggest that the location\nfor these be configurable. By default, it might make sense to put\nthem in ~pgsql/locks and ~pgsql/sockets. It is easy (i.e., I'll be\nglad to do it) to modify configure.in to take options like\n\n\t --lock-dir=/var/spool/lock\n\t --socket-dir=/var/spool/sockets\n\nthat set cc defines and have the code respond accordingly. This way,\nthose who don't care (or don't have root access) can use the defaults,\nwhereas those with root access who like to keep locks and sockets in a\ncommon place can do so easily. Either way, multiple postmasters (all\ncompiled with the same options of course) can check the appropriate\nlocks in the well-known places. Finally, drop the link into /tmp for\nthe old socket and document that it will be disappearing at some\npoint, and all is fine. \n\nIf someone wants to give me some guidance on what preprocessor\nvariables should be set in response to the above options (or something\nlike them), I'll do the configure stuff.\n\nCheers,\nBrook\n",
"msg_date": "Mon, 31 Aug 1998 09:09:01 -0600 (MDT)",
"msg_from": "Brook Milligan <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] flock patch breaks things here"
},
{
"msg_contents": "> I just came up with an idea that might help alleviate the /tmp security\n> exposure without creating a backwards-compatibility problem. It works\n> like this:\n> \n> 1. During installation, create a subdirectory of /tmp to hold Postgres'\n> socket files and associated pid lockfiles. This subdirectory should be\n> owned by the Postgres superuser and have permissions 755\n> (world-readable, writable only by Postgres superuser). Maybe call it\n> /tmp/.pgsql --- the name should start with a dot to keep it out of the\n> way. (Bruce points out that some systems clear /tmp during reboot, so\n> it might be that a postmaster will have to be prepared to recreate this\n> directory at startup --- anyone know if subdirectories of /tmp are\n> zapped too? My system doesn't do that...)\n> \n> ...\n> \n> I notice that on my system, the X11 socket files in /tmp/.X11-unix are\n> actually symlinks to socket files in /usr/spool/sockets/X11. I dunno if\n> it's worth our trouble to get into putting our sockets under /usr/spool\n> or /var/spool or whatever --- seems like another configuration choice to\n> mess up. It'd be nice if the socket directory lived somewhere where the\n> parent dirs weren't world-writable, but this would mean one more thing\n> that you have to have root permissions for in order to install pgsql.\n> \n> It seems like we need a directory for locks (= pid files) and one for\n> sockets (perhaps the same one). I strongly suggest that the location\n> for these be configurable. By default, it might make sense to put\n> them in ~pgsql/locks and ~pgsql/sockets. It is easy (i.e., I'll be\n> glad to do it) to modify configure.in to take options like\n> \n> \t --lock-dir=/var/spool/lock\n> \t --socket-dir=/var/spool/sockets\n> \n> that set cc defines and have the code respond accordingly. This way,\n> those who don't care (or don't have root access) can use the defaults,\n> whereas those with root access who like to keep locks and sockets in a\n> common place can do so easily. Either way, multiple postmasters (all\n> compiled with the same options of course) can check the appropriate\n> locks in the well-known places. Finally, drop the link into /tmp for\n> the old socket and document that it will be disappearing at some\n> point, and all is fine. \n> \n> If someone wants to give me some guidance on what preprocessor\n> variables should be set in response to the above options (or something\n> like them), I'll do the configure stuff.\n\nI think we need to keep stuff in /tmp. No reason to add more\nconfiguration just for the sake of it.\n\nIf Tom says we can use symbolic links to sockets, why not just do that\nfor backward compatability.\n\nOn my system, all of /tmp is wiped out on reboot because it is a memory\nfile system.\n\nLet each postmaster start up and create it's own directory as\n/tmp/.pgsql.5432 or whatever port number they use. In the directory, it\ncan put its socket and pid file. We also put a pid file in the\npostmaster's data directory, and give admins errors if they try anything\nfunny.\n\nI don't think we can use a main /tmp/.pgsql directory because one system\ncan have multiple postmasters run by different users. If we start\nputting it in /usr/local/pgsql, we need the socket in a common place,\nbecause the actual pgsql directory can be anywhere, so we need /tmp\nanyway. We can't have clients being configured for different pgsql\nlocations.\n\nWe still have a denial of service attach if someone creates a\n.pgsql.5432 directory before we do, but the unix domain socket has to be\nin a common place, and we can't just kick people out common territory\nbecause we are not root.\n\nAgain, we could put it all in pgsql, but we still need that unix domain\nsocket, and that can't be configured into the client easily, so I think\nwe just have to live with /tmp.\n\nEven if we put all the sockets in /tmp/.pgsql, we have the problem of\nsomeone creating /tmp/.pgsql before we start, or after a reboot. No way\naround it that I can see.\n\nIn fact, I can't really see a reason for the separate directory in /tmp\nvs. what we do now, except that we assume /tmp has the sticky bit, while\ncreation of our own directory with our own permissions fixes that, which\nmay be a win, especially because X and others do it that way.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Mon, 31 Aug 1998 13:03:42 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] flock patch breaks things here"
},
{
"msg_contents": "> [email protected] (David Gould) writes:\n> > If the traffic on bugtraq is any indication, writing in /tmp is a\n> > security exposure for daemons. Typical attack is:\n> > ln -s /etc/passwd /tmp/dumbrootprog.tmpfile\n> \n> A partial answer to this is to unlink /tmp/pidfile before trying to\n> create/write it. There's still a window for the attack, but it's\n> mighty tiny. (You do have to check that the unlink either succeeds\n> or fails with ENOENT --- in particular, an EPERM failure is trouble\n> for obvious reasons.)\n\nThe real fix for this is to do an open(O_CREAT) to force creation at the\ntime of the open. If it fails, try removing it and try again.\n\nWith our own directory, it is even easier. If no pid locks,\nunconditionally drop the directory, and recreate it with our\npermissions, and if the create fails, try again. We don't continue with\nthe postmaster until we drop and create the file or directory. Can't\nsymlink hack around that because we force creation.\n\n\n> 1. During installation, create a subdirectory of /tmp to hold Postgres'\n> socket files and associated pid lockfiles. This subdirectory should be\n> owned by the Postgres superuser and have permissions 755\n> (world-readable, writable only by Postgres superuser). Maybe call it\n> /tmp/.pgsql --- the name should start with a dot to keep it out of the\n\nProblem is multiple postmasters with different users.\n\n> way. (Bruce points out that some systems clear /tmp during reboot, so\n> it might be that a postmaster will have to be prepared to recreate this\n> directory at startup --- anyone know if subdirectories of /tmp are\n> zapped too? My system doesn't do that...)\n\nGet's wiped out. Has to be done only by the postmaster. Assuming\ninitdb is going to create something that is going to stay around in /tmp\nis going to break.\n\n> \n> 2. When a postmaster fires up, it checks for/creates a pid lockfile in\n> the subdirectory, and also creates the socket file in the subdirectory.\n\nForces creation.\n\n> \n> 3. For backwards compatibility with 1.0 clients, the socket file is also\n> hard-linked to /tmp/.s.PGSQL.port# (use an unlink() and link()).\n\nGood idea.\n\n> \n> This way, there's no security risk of overwriting someone else's file,\n> since we never create or write on a file in a directory we don't own, we\n> only try to link an already-existing socket file into /tmp.\n> \n> I'd suggest that the pid and socket files be given names in /tmp/.pgsql\n> that don't start with dots --- no need to make them hard to see in that\n> directory.\n\nYes, stuff in the directory doesn't need dots.\n\n> We can change libpq to find the socket at /tmp/.pgsql/whatever, and\n> eventually we could perhaps drop the backwards-compatibility feature\n> of creating a link in /tmp.\n\nOK\n\n> \n> > Also, before sprinkling files all over it is good to try to conform\n> > to the FHS (File Hierarchy Standard) (see http://www.pathname.com/fhs/)\n> > which is pretty easy to do and likely to make life easier later.\n> \n> I notice that on my system, the X11 socket files in /tmp/.X11-unix are\n> actually symlinks to socket files in /usr/spool/sockets/X11. I dunno if\n> it's worth our trouble to get into putting our sockets under /usr/spool\n> or /var/spool or whatever --- seems like another configuration choice to\n> mess up. It'd be nice if the socket directory lived somewhere where the\n> parent dirs weren't world-writable, but this would mean one more thing\n> that you have to have root permissions for in order to install pgsql.\n\nYes, too compilicated.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Mon, 31 Aug 1998 13:09:09 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] flock patch breaks things here"
},
{
"msg_contents": "> \n> On Mon, 31 Aug 1998, David Gould wrote:\n> \n> > Also, before sprinkling files all over it is good to try to conform\n> > to the FHS (File Hierarchy Standard) (see http://www.pathname.com/fhs/)\n> > which is pretty easy to do and likely to make life easier later.\n> \n> \tI just downloaded and skim'd the fhs notes, and it looks\n> reasonable...but, other then the current socket in /tmp, we don't\n> \"splinkle files all over\"...do we? *raised eyebrow*\n> \n\nWell, perhaps not, thay might have been hyperbole, but I wanted to head it\noff before it happened.\n\nAlso, what about moving the socket to the PG_DATA dir and then creating a\nsymlink to it in /tmp for older clients. New installations could optionally\nnot create (or remove) the symlink...\n\n-dg\n\nDavid Gould [email protected] 510.628.3783 or 510.305.9468 \nInformix Software (No, really) 300 Lakeside Drive Oakland, CA 94612\n - If simplicity worked, the world would be overrun with insects. -\n",
"msg_date": "Mon, 31 Aug 1998 10:49:10 -0700 (PDT)",
"msg_from": "[email protected] (David Gould)",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] flock patch breaks things here"
},
{
"msg_contents": "> > \n> > On Mon, 31 Aug 1998, David Gould wrote:\n> > \n> > > Also, before sprinkling files all over it is good to try to conform\n> > > to the FHS (File Hierarchy Standard) (see http://www.pathname.com/fhs/)\n> > > which is pretty easy to do and likely to make life easier later.\n> > \n> > \tI just downloaded and skim'd the fhs notes, and it looks\n> > reasonable...but, other then the current socket in /tmp, we don't\n> > \"splinkle files all over\"...do we? *raised eyebrow*\n> > \n> \n> Well, perhaps not, thay might have been hyperbole, but I wanted to head it\n> off before it happened.\n> \n> Also, what about moving the socket to the PG_DATA dir and then creating a\n> symlink to it in /tmp for older clients. New installations could optionally\n> not create (or remove) the symlink...\n\nBut then we have to compile the data directory into the client, or add\nan option to specify the unix domain socket AND the data directory. Not\nworth it, I think.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Mon, 31 Aug 1998 14:06:48 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] flock patch breaks things here"
},
{
"msg_contents": "> \n> > \n> > On Mon, 31 Aug 1998, David Gould wrote:\n> > \n> > > Also, before sprinkling files all over it is good to try to conform\n> > > to the FHS (File Hierarchy Standard) (see http://www.pathname.com/fhs/)\n> > > which is pretty easy to do and likely to make life easier later.\n> > \n> > \tI just downloaded and skim'd the fhs notes, and it looks\n> > reasonable...but, other then the current socket in /tmp, we don't\n> > \"splinkle files all over\"...do we? *raised eyebrow*\n> > \n> \n> Well, perhaps not, thay might have been hyperbole, but I wanted to head it\n> off before it happened.\n> \n> Also, what about moving the socket to the PG_DATA dir and then creating a\n> symlink to it in /tmp for older clients. New installations could optionally\n> not create (or remove) the symlink...\n> \n> -dg\n> \n> David Gould [email protected] 510.628.3783 or 510.305.9468 \n> Informix Software (No, really) 300 Lakeside Drive Oakland, CA 94612\n> - If simplicity worked, the world would be overrun with insects. -\n\nIn the fhs notes I read:\n\n\n------------------------------------------------------------------------\n5.9 /var/run : Run-time variable files\n\nThis directory contains system information files describing the system\nsince it was booted. Files in this directory should be cleared (removed\nor truncated as appropriate) at the beginning of the boot process.\n\nProcess identifier (PID) files, which were originally placed in /etc,\nshould be placed in /var/run. The naming convention for PID files is\n<program-name>.pid. For example, the crond PID file is named\n/var/run/crond.pid.\n\nThe internal format of PID files remains unchanged. The file should\nconsist of the process identifier in ASCII-encoded decimal, followed by\na newline character. For example, if crond was process number 25,\n/var/run/crond.pid would contain three characters: two, five, and\nnewline.\n\nPrograms that read PID files should be somewhat flexible in what they\naccept; i.e., they should ignore extra whitespace, leading zeroes,\nabsence of the trailing newline, or additional lines in the PID file.\nPrograms that create PID files should use the simple specification\nlocated in the above paragraph.\n\nThe utmp file, which stores information about who is currently using the\nsystem, is located in this directory.\n\nPrograms that maintain transient UNIX-domain sockets should place them\nin this directory.\n------------------------------------------------------------------------\n\n\nIt seems that if we want to follow this document there is no much to\ndiscuss. But on my linux installation this directory is owned by root\nso I don't see how pgsql could create a socket in it. What standards\nare in use on other systems ?\n\n-- \nMassimo Dal Zotto\n\n+----------------------------------------------------------------------+\n| Massimo Dal Zotto email: [email protected] |\n| Via Marconi, 141 phone: ++39-461-534251 |\n| 38057 Pergine Valsugana (TN) www: http://www.cs.unitn.it/~dz/ |\n| Italy pgp: finger [email protected] |\n+----------------------------------------------------------------------+\n",
"msg_date": "Mon, 31 Aug 1998 23:02:51 +0200 (MET DST)",
"msg_from": "Massimo Dal Zotto <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] flock patch breaks things here"
},
{
"msg_contents": "> Also, what about moving the socket to the PG_DATA dir and then \n> creating a symlink to it in /tmp for older clients.\n\nClients don't have visibility into $PG_DATA, do they? Just ran into this\nworking on the ODBC interface, trying to find a place for a system-wide\nconfiguration file. Ended up putting it in $POSTGRESDIR by default.\n\nThe /var/run option (or something similar) seems to be a good way to\nhead, if we can get enough support on the different platforms. Actually,\nthis could be an autoconf test, couldn't it?\n\n - Thomas\n",
"msg_date": "Tue, 01 Sep 1998 01:38:19 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] flock patch breaks things here"
},
{
"msg_contents": "Bruce Momjian writes:\n\n> I have been thinking about this. First, we can easily use fopen(r+) to\n> check to see if the file exists, and if it does read the pid and do a\n> kill -0 to see if it is running. If no one else does it, I will take it\n> on.\n\nIt is better to use open with the O_CREAT and O_EXCL set. If the file does not\nexist it will be created and the PID can be written to it. If the file exists \nthen the call will fail, at which point it can be opened with fread, and the \nPID it contains can be checked to see if it still exists with kill. The open \ncall has the added advantage that 'The check for the existence of the file and \nthe creation of the file if it does not exist is atomic with respect to other \nprocesses executing open naming the same filename in the same directory with \nO_EXCL and O_CREAT set.' [from the UnixA\bWare 7 man page, open(2)].\n\nAlso, you can't just delete the file, create it and write the your PID to it \nand assume that you have the lock, you need to close the file, sleep some \nsmall amount of time and then open and read the file to see if you still have \nthe lock. If you like, I can take this task on.\n\nOh, the postmaster must clear the PID when it exits.\n\n> \n> Second, where to put the pid file. There is reason to put in /tmp,\n> because it will get cleared in a reboot, and because it is locking the\n> port number 5432. There is also reason to put it in /data because you\n> can't have more than one postmaster running on a single data directory.\n> \n> So, we really want to lock both places. If this is going to make it\n> easier for people to run more than one postmaster, because it will\n> prevent/warn administrators when they try and put two postmasters in the\n> same data dir or port, I say create the pid lock files both places, and\n> give the admin a clear description of what he is doing wrong in each\n> case.\n\nIHMO, the pid should be put in the data directory. The reasoning that it will get cleared in a reboot is not sufficent since the logic used to create the PID file will delete it if the PID it contains is not a running process. Besides, I have used systems where /tmp was not cleared out on a re-boot (for various reasons). Also, I would rather have a script that explicitly removes the PID locking file at system statup (if it exists), in which case, it doesn't matter where it resides.\n-- \n____ | Billy G. Allie | Domain....: [email protected]\n| /| | 7436 Hartwell | Compuserve: 76337,2061\n|-/-|----- | Dearborn, MI 48126| MSN.......: [email protected]\n|/ |LLIE | (313) 582-1540 | \n\n\n\n",
"msg_date": "Tue, 08 Sep 1998 03:31:26 -0400",
"msg_from": "\"Billy G. Allie\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] flock patch breaks things here "
},
{
"msg_contents": "Massimo, do we have all the documentation change for the new features\nyou added. I am thinking particularly about the new -d debug levels,\nbut there may be more.\n\n\n\n-- \n Bruce Momjian | http://www.op.net/~candle\n [email protected] | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n\n",
"msg_date": "Fri, 2 Oct 1998 14:31:53 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "documentation changes"
},
{
"msg_contents": "On Sun, 30 Aug 1998, Tom Lane wrote:\n\n> The Hermit Hacker <[email protected]> writes:\n> > either way, moving the pid file (or\n> > socket, for that matter) from /tmp should be listed as a security related\n> > requirement for v6.4 :)\n> \n> Huh? There is no pid file being generated in /tmp (or anywhere else)\n> at the moment. If we do add one, it should not go into /tmp for the\n> reasons I gave before.\n> \n> Where the Unix-domain socket file lives is an entirely separate issue.\n> \n> If we move the socket out of /tmp then we have just kicked away all the\n> work we did to preserve backwards compatibility of the FE/BE protocol\n> with existing clients. Being able to talk to a 1.0 client isn't much\n> good if you aren't listening where he's going to try to contact you.\n> So I think I have to vote in favor of leaving the socket where it is.\n\nLet me put my vote in...: $PGSQLHOME/run/{pgsql.pid,pgsql.pid.socket}\n\nScrew backwards compatibility...v6.5 becomes v7.0 *shrug*\n\nMarc G. Fournier \nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n",
"msg_date": "Thu, 29 Oct 1998 22:11:02 -0400 (AST)",
"msg_from": "The Hermit Hacker <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] flock patch breaks things here "
},
{
"msg_contents": "The Hermit Hacker <[email protected]> writes:\n> On Sun, 30 Aug 1998, Tom Lane wrote:\n>> So I think I have to vote in favor of leaving the socket where it is.\n\n> Let me put my vote in...: $PGSQLHOME/run/{pgsql.pid,pgsql.pid.socket}\n> Screw backwards compatibility...v6.5 becomes v7.0 *shrug*\n\nCatching up on back email, Marc?\n\nI think the end consensus of that thread was that we should move the\nsocket file to someplace safer than /tmp (exactly where being a\nconfigure-time choice), *and* optionally put a softlink to it in /tmp\nfor backwards compatibility with old clients. Use of the /tmp link\nwould be deprecated because of possible security risks, but it could\ncontinue to work for as long as a particular installation needed to\nkeep that option enabled.\n\nActually getting it done doesn't seem to have happened :-(. I think\nwe were all viewing this as part & parcel of fixing the lockfile issues,\nwhich no one got exercised enough to do. Too many higher-priority\ntasks...\n\n\t\t\tregards, tom lane\n",
"msg_date": "Thu, 29 Oct 1998 23:17:16 -0500",
"msg_from": "Tom Lane <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] flock patch breaks things here "
},
{
"msg_contents": "On Thu, 29 Oct 1998, Tom Lane wrote:\n\n> The Hermit Hacker <[email protected]> writes:\n> > On Sun, 30 Aug 1998, Tom Lane wrote:\n> >> So I think I have to vote in favor of leaving the socket where it is.\n> \n> > Let me put my vote in...: $PGSQLHOME/run/{pgsql.pid,pgsql.pid.socket}\n> > Screw backwards compatibility...v6.5 becomes v7.0 *shrug*\n> \n> Catching up on back email, Marc?\n\n\tI have a cold and am partially delirious? :) The cold part is\naccurate, at least :)\n\nMarc G. Fournier \nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n",
"msg_date": "Fri, 30 Oct 1998 00:21:28 -0400 (AST)",
"msg_from": "The Hermit Hacker <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] flock patch breaks things here "
},
{
"msg_contents": "> The Hermit Hacker <[email protected]> writes:\n> > On Sun, 30 Aug 1998, Tom Lane wrote:\n> >> So I think I have to vote in favor of leaving the socket where it is.\n> \n> > Let me put my vote in...: $PGSQLHOME/run/{pgsql.pid,pgsql.pid.socket}\n> > Screw backwards compatibility...v6.5 becomes v7.0 *shrug*\n> \n> Catching up on back email, Marc?\n> \n> I think the end consensus of that thread was that we should move the\n> socket file to someplace safer than /tmp (exactly where being a\n> configure-time choice), *and* optionally put a softlink to it in /tmp\n> for backwards compatibility with old clients. Use of the /tmp link\n> would be deprecated because of possible security risks, but it could\n> continue to work for as long as a particular installation needed to\n> keep that option enabled.\n\nJust a reminder that if you move it, all clients must know the new\nlocation, or somehow the location must be accessable by the clients.\n\n\n-- \n Bruce Momjian | http://www.op.net/~candle\n [email protected] | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n",
"msg_date": "Fri, 30 Oct 1998 11:03:52 -0500 (EST)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] flock patch breaks things here"
},
{
"msg_contents": "Bruce Momjian <[email protected]> writes:\n>> I think the end consensus of that thread was that we should move the\n>> socket file to someplace safer than /tmp (exactly where being a\n>> configure-time choice), *and* optionally put a softlink to it in /tmp\n>> for backwards compatibility with old clients.\n\n> Just a reminder that if you move it, all clients must know the new\n> location, or somehow the location must be accessable by the clients.\n\nThat's why I said *configure* time choice. The socket location has to\nbe compiled into both frontends and backends. But there's no reason\nwhy the location couldn't be set during site configure, rather than\nbeing hard-wired as /tmp/.s.PGSQL.####.\n\nSupporting a softlink in /tmp would be helpful if an installation\ndoesn't want to rebuild all their existing frontend apps right away\n(or at least all the ones that are on the server's local machine and use\nUnix-socket connections). Fortunately, cross-machine connections don't\nuse the socket file, or it wouldn't really be practical to make the\nsocket location site-dependent.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Fri, 30 Oct 1998 11:43:37 -0500",
"msg_from": "Tom Lane <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] flock patch breaks things here "
},
{
"msg_contents": "On Fri, 30 Oct 1998, Bruce Momjian wrote:\n\n> > The Hermit Hacker <[email protected]> writes:\n> > > On Sun, 30 Aug 1998, Tom Lane wrote:\n> > >> So I think I have to vote in favor of leaving the socket where it is.\n> > \n> > > Let me put my vote in...: $PGSQLHOME/run/{pgsql.pid,pgsql.pid.socket}\n> > > Screw backwards compatibility...v6.5 becomes v7.0 *shrug*\n> > \n> > Catching up on back email, Marc?\n> > \n> > I think the end consensus of that thread was that we should move the\n> > socket file to someplace safer than /tmp (exactly where being a\n> > configure-time choice), *and* optionally put a softlink to it in /tmp\n> > for backwards compatibility with old clients. Use of the /tmp link\n> > would be deprecated because of possible security risks, but it could\n> > continue to work for as long as a particular installation needed to\n> > keep that option enabled.\n> \n> Just a reminder that if you move it, all clients must know the new\n> location, or somehow the location must be accessable by the clients.\n\n\tWhich is only relevant if using Unix-domain sockets...\n\nMarc G. Fournier \nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n",
"msg_date": "Fri, 30 Oct 1998 16:16:43 -0400 (AST)",
"msg_from": "The Hermit Hacker <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] flock patch breaks things here"
}
] |
[
{
"msg_contents": "I am planning on running pgindent on Monday, in preparation for the next\nrelease.\n\nI assume no one will be sitting on any big patches. If you are, let me\nknow and I will wait.\n\nMarc, I assume we are on schedule for a Tuesday beta release.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sun, 30 Aug 1998 09:17:57 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "pgindent for Monday"
},
{
"msg_contents": "On Sun, 30 Aug 1998, Bruce Momjian wrote:\n\n> I am planning on running pgindent on Monday, in preparation for the next\n> release.\n> \n> I assume no one will be sitting on any big patches. If you are, let me\n> know and I will wait.\n\nJDBC has a lot, but that should be ready later today.\n\nI assume to run pgindent on the JDBC source?\n\n> Marc, I assume we are on schedule for a Tuesday beta release.\n> \n> -- \n> Bruce Momjian | 830 Blythe Avenue\n> [email protected] | Drexel Hill, Pennsylvania 19026\n> + If your life is a hard drive, | (610) 353-9879(w)\n> + Christ can be your backup. | (610) 853-3000(h)\n> \n\n-- \n Peter T Mount [email protected]\n Main Homepage: http://www.retep.org.uk\nPostgreSQL JDBC Faq: http://www.retep.org.uk/postgres\n Java PDF Generator: http://www.retep.org.uk/pdf\n\n",
"msg_date": "Sun, 30 Aug 1998 15:04:08 +0100 (GMT)",
"msg_from": "Peter T Mount <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] pgindent for Monday"
},
{
"msg_contents": "> On Sun, 30 Aug 1998, Bruce Momjian wrote:\n> \n> > I am planning on running pgindent on Monday, in preparation for the next\n> > release.\n> > \n> > I assume no one will be sitting on any big patches. If you are, let me\n> > know and I will wait.\n> \n> JDBC has a lot, but that should be ready later today.\n> \n> I assume to run pgindent on the JDBC source?\n\nYes. I skip anything with ++, and odbc. See tools/pgindent/README. I\ncan skip jdbc if you wish.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sun, 30 Aug 1998 12:32:44 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] pgindent for Monday"
},
{
"msg_contents": "On Sun, 30 Aug 1998, Bruce Momjian wrote:\n\n> > On Sun, 30 Aug 1998, Bruce Momjian wrote:\n> > \n> > > I am planning on running pgindent on Monday, in preparation for the next\n> > > release.\n> > > \n> > > I assume no one will be sitting on any big patches. If you are, let me\n> > > know and I will wait.\n> > \n> > JDBC has a lot, but that should be ready later today.\n> > \n> > I assume to run pgindent on the JDBC source?\n> \n> Yes. I skip anything with ++, and odbc. See tools/pgindent/README. I\n> can skip jdbc if you wish.\n\nRunning it shouldn't cause any problems. The only non-C type of entry is\nwhere // is used to start a single line comment.\n\n> \n> \n> -- \n> Bruce Momjian | 830 Blythe Avenue\n> [email protected] | Drexel Hill, Pennsylvania 19026\n> + If your life is a hard drive, | (610) 353-9879(w)\n> + Christ can be your backup. | (610) 853-3000(h)\n> \n\n-- \n Peter T Mount [email protected]\n Main Homepage: http://www.retep.org.uk\nPostgreSQL JDBC Faq: http://www.retep.org.uk/postgres\n Java PDF Generator: http://www.retep.org.uk/pdf\n\n",
"msg_date": "Sun, 30 Aug 1998 18:44:40 +0100 (GMT)",
"msg_from": "Peter T Mount <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] pgindent for Monday"
},
{
"msg_contents": "On Sun, 30 Aug 1998, Bruce Momjian wrote:\n\n> I am planning on running pgindent on Monday, in preparation for the next\n> release.\n> \n> I assume no one will be sitting on any big patches. If you are, let me\n> know and I will wait.\n> \n> Marc, I assume we are on schedule for a Tuesday beta release.\n\n\tEverything looks good from here...\n\nMarc G. Fournier \nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n",
"msg_date": "Sun, 30 Aug 1998 16:22:11 -0300 (ADT)",
"msg_from": "The Hermit Hacker <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] pgindent for Monday"
},
{
"msg_contents": "> \n> I am planning on running pgindent on Monday, in preparation for the next\n> release.\n> \n> I assume no one will be sitting on any big patches. If you are, let me\n> know and I will wait.\n\nI have still two old patches which I didn't find in latest snapshot.\nThey are included here, the async.patch seems important.\nAnd there is some stuff I posted today, a bug fix, new manpages and\nupdated contrib modules.\n\n-- \nMassimo Dal Zotto\n\n+----------------------------------------------------------------------+\n| Massimo Dal Zotto email: [email protected] |\n| Via Marconi, 141 phone: ++39-461-534251 |\n| 38057 Pergine Valsugana (TN) www: http://www.cs.unitn.it/~dz/ |\n| Italy pgp: finger [email protected] |\n+----------------------------------------------------------------------+",
"msg_date": "Sun, 30 Aug 1998 21:46:19 +0200 (MET DST)",
"msg_from": "Massimo Dal Zotto <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] pgindent for Monday"
}
] |
[
{
"msg_contents": "Hi Hackers,\n\nI am porting my old contrib modules to 6.4. While testing string_io I found\nthis strange bug:\n\ndz=> select textin(textout('a\\007b'));\ntextin\n------\nab \n(1 row)\n\ndz=> \\i /usr/local/pgsql/lib/sql/string_io.sql;\n...\ndz=> select textin(c_textout('a\\007b'));\ntextin\n------\na\\\\007b \n(1 row)\n\nOk, seems that my code is working, so I try to use it as typoutput for text:\n\ndz=> update pg_type set typoutput='c_textout' where typname='text';\nUPDATE 1\ndz=> select 'abc'::text;\n\nand at this point psql hangs forever. Hitting Ctrl-C sends cancel requests\nto the backend but these have no effect because it has already finished\nprocessing the query, while psql is still waiting for data.\nEvidently that some output has been lost.\n\nAfter some playing with gdb I found that in printtup() there is a non null\nattribute with typeinfo->attrs[i]->atttypid = 0 (invalid oid). Unfortunately\nattibutes with invalid type are neither printed nor marked as null, and this\nexplains why psql doesn't get all the expected data.\n\nSo I made this patch to printtup():\n\n*** src/backend/access/common/printtup.c.orig\tWed Aug 26 09:00:30 1998\n--- src/backend/access/common/printtup.c\tSun Aug 30 17:16:55 1998\n***************\n*** 123,131 ****\n \tfor (i = 0; i < tuple->t_natts; ++i)\n \t{\n \t\tattr = heap_getattr(tuple, i + 1, typeinfo, &isnull);\n! \t\ttypoutput = typtoout((Oid) typeinfo->attrs[i]->atttypid);\n \n! \t\tif (!isnull && OidIsValid(typoutput))\n \t\t{\n \t\t\toutputstr = fmgr(typoutput, attr,\n \t\t\t\t\t\t\t gettypelem(typeinfo->attrs[i]->atttypid),\n--- 123,133 ----\n \tfor (i = 0; i < tuple->t_natts; ++i)\n \t{\n \t\tattr = heap_getattr(tuple, i + 1, typeinfo, &isnull);\n! \t\tif (isnull)\n! \t\t\tcontinue;\n \n! \t\ttypoutput = typtoout((Oid) typeinfo->attrs[i]->atttypid);\n! \t\tif (OidIsValid(typoutput))\n \t\t{\n \t\t\toutputstr = fmgr(typoutput, attr,\n \t\t\t\t\t\t\t gettypelem(typeinfo->attrs[i]->atttypid),\n***************\n*** 140,145 ****\n--- 142,153 ----\n #endif\n \t\t\tpfree(outputstr);\n \t\t}\n+ \t\telse\n+ \t\t{\n+ \t\t\toutputstr = \"<unprintable>\";\n+ \t\t\tpq_putint(strlen(outputstr) + VARHDRSZ, VARHDRSZ);\n+ \t\t\tpq_putnchar(outputstr, strlen(outputstr));\n+ \t\t} \n \t}\n }\n \n\nNow the communication between the backend and psql is correct and I get:\n\ndz=> select 'abc'::text;\n?column? \n-------------\n<unprintable>\n(1 row)\n\nStill wrong but at least it doesn't hang and I can go on with investigation.\nSo I recreate a new db and try the following:\n\ndz=> select typname,typoutput from pg_type where typname='text';\ntypname|typoutput \n-------+-----------\ntext |47(textout)\n(1 row)\n\ndz=> update pg_type set typoutput = 'textout' where typname='text';\nUPDATE 1\ndz=> select typname,typoutput from pg_type where typname='text';\ntypname|typoutput\n-------+---------\ntext | -\n\ndz=> select 'abc'::text;\n?column? \n-------------\n<unprintable>\n(1 row)\n\ndz=> update pg_type set typoutput = 'textout'::regproc where typname='text';\nUPDATE 1\ndz=> select 'abc'::text;\n?column? \n-------------\n<unprintable>\n(1 row)\n\nSo the problem is not in my c_textout() but in the update of typoutput.\nAfter a few experiments I found that the only way to change this attribute\nis to specify the oid of the functions instead of the name:\n\ndz=> update pg_type set typoutput = 47::regproc where typname='text';\nUPDATE 1\ndz=> select 'abc'::text;\n?column?\n--------\nabc \n(1 row)\n\ndz=> select oid from pg_proc where proname='c_textout';\n oid\n-----\n18561\n(1 row)\n\ndz=> update pg_type set typoutput = 18561::regproc where typname='text';\nUPDATE 1\ndz=> select 'abc'::text;\n?column?\n--------\nabc \n(1 row)\n\nHowever supplying the proc name was ok in previous version of postgres, so\nwe must have broken something. Could please those who worked in this area\nhave a look at their changes? \n\n-- \nMassimo Dal Zotto\n\n+----------------------------------------------------------------------+\n| Massimo Dal Zotto email: [email protected] |\n| Via Marconi, 141 phone: ++39-461-534251 |\n| 38057 Pergine Valsugana (TN) www: http://www.cs.unitn.it/~dz/ |\n| Italy pgp: finger [email protected] |\n+----------------------------------------------------------------------+\n",
"msg_date": "Sun, 30 Aug 1998 17:24:36 +0200 (MET DST)",
"msg_from": "Massimo Dal Zotto <[email protected]>",
"msg_from_op": true,
"msg_subject": "bug + patch"
}
] |
[
{
"msg_contents": "Hi Hackers,\n\nI have ported my old contrib modules to the last pgsql snapshot.\n\nHere is a tar file the new directories, which substitute the old ones\nin contrib. Please remove the old directories array, datetime, miscutil,\nstring and userlock before unpacking the tar file in contrib.\nYou should also delete the directory sequence whose code has now been\nintegrated into the backend and apply the patch contrib.patch which\ndoes some small changes to the README.\n\nNote that as the modules are now installed in lib/modules I install all\nmy sql code in lib/sql. In my opinion also the other contributors should\nfollow these rules.\n\n-- \nMassimo Dal Zotto\n\n+----------------------------------------------------------------------+\n| Massimo Dal Zotto email: [email protected] |\n| Via Marconi, 141 phone: ++39-461-534251 |\n| 38057 Pergine Valsugana (TN) www: http://www.cs.unitn.it/~dz/ |\n| Italy pgp: finger [email protected] |\n+----------------------------------------------------------------------+",
"msg_date": "Sun, 30 Aug 1998 17:58:23 +0200 (MET DST)",
"msg_from": "Massimo Dal Zotto <[email protected]>",
"msg_from_op": true,
"msg_subject": "updated contrib modules"
}
] |
[
{
"msg_contents": "Hello,\n\nIs it 'lo_unlink' a secure function?.\nI've problems with it. I'm using a database with large objects (images) and\nI've problems\nwith that, this problems are:\n\n* Sometimes, when I tried to export a large object with SQL command:\n\n SELECT lo_export(oid '65570', '/tmp/myfile')\n\nthe backend says to me:\n\n ERROR: xinx65560 is a index relation.\n\nI see that the oids of 'xinv65570' and 'xinx65560' are the same. So, when I\nsay to postgres that I want to export the oid 65570, it thinks that I want\nthe index xinx65560.\nI fix this problem using the function 'heap_openr' in 'inv_open' instead of\n'heap_open'. With this change, I always open a 'xinvXXXX'. I've made this\nchange in 'inv_destroy', too.\n\n* The other problem is related the function 'lo_unlink'. I think that when I\ndestroy a large object, I destroy its index, then, if I do:\n\n SELECT lo_unlink( int4 '65560')\n\nI'm sure that I destroy the object 'xinv65560' (because I've changed the\n'heap_open' by 'heap_openr'), and if the backend attempts to destroy the\nindex (whose oid is 65570), and as it's the same oid that the large object\n'xinv65570' , it's possible the backend destroy that large object instead of\nthe index.\n\nWell, my questions are:\n\n* Is this true?, Is it like I think?.\n\n* Are there some solutions for these problems?\n\nThanks.\n\n(Please answer to me at: [email protected])\n\nCarlos J. Garcia Orellana.\nUniversidad de Extramadura - Badajoz\nSPAIN\n\n\n",
"msg_date": "Sun, 30 Aug 1998 19:15:29 +0200",
"msg_from": "\"Carlos J. Garcia Orellana\" <[email protected]>",
"msg_from_op": true,
"msg_subject": "Problems with lo_unlink"
}
] |
[
{
"msg_contents": "Hi,\n\nI have some patches to man pages (listen, unlisten and create_sequence).\n\n-- \nMassimo Dal Zotto\n\n+----------------------------------------------------------------------+\n| Massimo Dal Zotto email: [email protected] |\n| Via Marconi, 141 phone: ++39-461-534251 |\n| 38057 Pergine Valsugana (TN) www: http://www.cs.unitn.it/~dz/ |\n| Italy pgp: finger [email protected] |\n+----------------------------------------------------------------------+",
"msg_date": "Sun, 30 Aug 1998 21:35:55 +0200 (MET DST)",
"msg_from": "Massimo Dal Zotto <[email protected]>",
"msg_from_op": true,
"msg_subject": "manpages"
}
] |
[
{
"msg_contents": "> Thomas A. Szybist\" <[email protected]>\n> > Bruce Momjian <[email protected]>\n> > \n> > Again, if someone wants to conditionally compile the directories to find\n> > the offending file, I am sure we can get a fix for it.\n> > \n>\n> At first look it seems to be: backend/catalog/indexing.c.\n> Maybe Keith can confirm? \n> \n> Thanks,\n\nTom,\n\nI recompiled the latest cvs with -O2 and found that the crash on\ntable creation was NOT now failing so I'm a little confused :-(\n\nI'm just updating my cvs, and will do another build and see how\nthings go.\n\nIf only I had the same failures as before I'd be able to confirm\nyour suspicions on indexing.c\n\nTil Later,\nKeith.\n\n",
"msg_date": "Sun, 30 Aug 1998 23:33:50 +0100 (BST)",
"msg_from": "Keith Parks <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] Core dump in regression tests. "
},
{
"msg_contents": "> > Thomas A. Szybist\" <[email protected]>\n> > > Bruce Momjian <[email protected]>\n> > > \n> > > Again, if someone wants to conditionally compile the directories to find\n> > > the offending file, I am sure we can get a fix for it.\n> > > \n> >\n> > At first look it seems to be: backend/catalog/indexing.c.\n> > Maybe Keith can confirm? \n> > \n> > Thanks,\n> \n> Tom,\n> \n> I recompiled the latest cvs with -O2 and found that the crash on\n> table creation was NOT now failing so I'm a little confused :-(\n> \n> I'm just updating my cvs, and will do another build and see how\n> things go.\n> \n> If only I had the same failures as before I'd be able to confirm\n> your suspicions on indexing.c\n\nI have found a problem in indexing.c. In CatalogIndexFetchTuple(),\nthere is a particulary weird do..while loop, and in trying to clean it\nup as part of the megapatch, I broke it and thought I had it fixed.\n\nIt appears it may still be broken. The ReleaseBuffer(buffer) call could\nhappen even if no valid tuple is returned because buffer has a random\nvalue.\n\nI am running a test now, and will post the fix as soon as I am sure it\nworks.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sun, 30 Aug 1998 19:13:51 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "> I recompiled the latest cvs with -O2 and found that the crash on\n> table creation was NOT now failing so I'm a little confused :-(\n> \n> I'm just updating my cvs, and will do another build and see how\n> things go.\n> \n> If only I had the same failures as before I'd be able to confirm\n> your suspicions on indexing.c\n> \n> Til Later,\n> Keith.\n> \n> \n> \n\nOK, I am applying my patch now. I certainly fixes a potential problem,\nso I suspect it will fix the problems you are seeing.\n\nThomas, perhaps it will fix the regression problems too. No way to\nknow.\n\nHere is the new while loop. Much better.\n\n---------------------------------------------------------------------------\n\n\n sd = index_beginscan(idesc, false, num_keys, skey);\n while (indexRes = index_getnext(sd, ForwardScanDirection))\n {\n ItemPointer iptr;\n\n iptr = &indexRes->heap_iptr;\n tuple = heap_fetch(heapRelation, SnapshotNow, iptr, &buffer);\n pfree(indexRes);\n if (HeapTupleIsValid(tuple))\n break;\n }\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sun, 30 Aug 1998 19:24:55 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "In message <[email protected]>, Bruce Momjian writes:\n> > I recompiled the latest cvs with -O2 and found that the crash on\n> > table creation was NOT now failing so I'm a little confused :-(\n> > \n> > I'm just updating my cvs, and will do another build and see how\n> > things go.\n> > \n> > If only I had the same failures as before I'd be able to confirm\n> > your suspicions on indexing.c\n> > \n> > Til Later,\n> > Keith.\n> > \n> > \n> > \n> \n> OK, I am applying my patch now. I certainly fixes a potential problem,\n> so I suspect it will fix the problems you are seeing.\n> \n> Thomas, perhaps it will fix the regression problems too. No way to\n> know.\n> \n> Here is the new while loop. Much better.\n> \n> ---------------------------------------------------------------------------\n> \n> \n> sd = index_beginscan(idesc, false, num_keys, skey);\n> while (indexRes = index_getnext(sd, ForwardScanDirection))\n> {\n> ItemPointer iptr;\n> \n> iptr = &indexRes->heap_iptr;\n> tuple = heap_fetch(heapRelation, SnapshotNow, iptr, &buffer);\n> pfree(indexRes);\n> if (HeapTupleIsValid(tuple))\n> break;\n> }\n> \n> -- \n> Bruce Momjian | 830 Blythe Avenue\n> [email protected] | Drexel Hill, Pennsylvania 19026\n> + If your life is a hard drive, | (610) 353-9879(w)\n> + Christ can be your backup. | (610) 853-3000(h)\n> \n\nI tried patching indexing.c with this new loop--no luck. I just\nchecked out a fresh copy, still no luck. I don't understand why it now\nworks for Keith. \n\nYesterday I tried this on Solaris, but I was bitten by not having\nflock.\n\nTom Szybist\[email protected]\n",
"msg_date": "Mon, 31 Aug 1998 11:51:39 -0400",
"msg_from": "\"Thomas A. Szybist\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests. "
}
] |
[
{
"msg_contents": "I'm having a little trouble updating to the latest cvs tree, because\nI can't dump my existing database, neither with the latest pgdump source\nnor with that of two weeks ago. I've run out of steam to debug it\ntonight, but it looks like the failure is occuring while pgdump tries\nto locate the inheritance parent of a class.\n\nThe comments in the immediate vicinity of where the failure is occuring\nindicate that pgdump is relying on inheriting classes to have larger\nOID numbers than their parents. Offhand that doesn't seem too\nunreasonable, but is it possible that some recent change has broken\nthis assumption?\n\nIs anyone else seeing similar problems??\n\n\t\t\tregards, tom lane\n",
"msg_date": "Sun, 30 Aug 1998 22:46:14 -0400",
"msg_from": "Tom Lane <[email protected]>",
"msg_from_op": true,
"msg_subject": "Anyone else seeing coredumps in pgdump?"
}
] |
[
{
"msg_contents": "Looks like the changes to createdb and pg_dumpall are causing some\nproblems.\n\nIt expects createdb -help to work, and it doesn't.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Mon, 31 Aug 1998 00:12:50 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "encoding problem"
},
{
"msg_contents": ">Looks like the changes to createdb and pg_dumpall are causing some\n>problems.\n>\n>It expects createdb -help to work, and it doesn't.\n\nOops. I'll fix this.\n--\nTatsuo Ishii\[email protected]\n",
"msg_date": "Mon, 31 Aug 1998 14:04:13 +0900",
"msg_from": "Tatsuo Ishii <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] encoding problem "
}
] |
[
{
"msg_contents": "> Hi,\n> \n> I am having problems with the sub-select in PostgreSQL. As I have not\n> tried to use these before, I am not sure if the problem is with me, SQL\n> or PostgreSQL.\n> \n> I have two tables:\n> \n> CREATE TABLE tab1 (\n> locus char16,\n> shortname char8\n> -- lots of other data ...\n> );\n> \n> -- This table flags some loci in tab1 as having errors.\n> CREATE TABLE tab2 (\n> id oid, -- foreign key into TABLE tab1\n> errno int4 -- An error indicator\n> );\n> \n> If I say:\n> SELECT * FROM tab1 WHERE shortname='AciSPP';\n> I retrieve 36 rows out of ~100,000 in seconds. This is okay.\n> \n> If I say:\n> SELECT id, locus, errno\n> FROM tab1, tab2\n> WHERE tab1.oid=tab2.id\n> AND shortname='AciSPP';\n> \n> I retrieve 22 rows out of the 100,000 in tab1 and 80,000 in tab2 in much\n> less than a minute.\n> \n> Now, assume I wish to remove all traces of 'AciSPP' from my database.\n> I need to remove those from within TABLE tab2 first. I tried this:\n> DELETE FROM tab2\n> WHERE id in (SELECT oid FROM tab1 WHERE shortname='AciSPP');\n\nMark, there is a bug in 6.3.2 where you can not us oid in a subselect. \nThis is fixed in 6.4, and beta starts on September 1, or on Friday, we\nare not sure. Feel free to get the current snapshot from\nftp.postgresql.org and try it out.\n\nI know this particular bug was reported, with the same behaviour you\ndescribe, and a fix made.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Mon, 31 Aug 1998 00:39:23 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: Possible bug from 6.3.2t"
}
] |
[
{
"msg_contents": "Changes at the time of pgindent run:\n\n\tCInfo -> ClauseInfo\n\tJInfo -> JoinInfo\n\treturn (0) -> return 0\n\tRelationGetTupleDescriptor -> RelationGetTupleDesc\n\tx[] -> *x\n\trelrdesc -> rel\n\nAnyone have any problems with these changes?\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Mon, 31 Aug 1998 00:54:43 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "items for cleanup"
}
] |
[
{
"msg_contents": "Also, during the pgindent run, we have TypeTupleForm and\nAttributeTupleForm, while we also have Form_pg_class, etc.\n\nSeems they should be named similar. It will make the Developers FAQ\nitem 9 easier to understand if we have uniform way to cast a HeapTuple\npointer.\n\n\tTypeTupleForm -> Form_pg_type\n\nIn fact the comments in pg_type.h talk about Form_pg_type, but they then\ndefine TypeTupleForm.\n\nAny problems with changing this?\n\n---------------------------------------------------------------------------\n\n\n/* ----------------\n * Form_pg_type corresponds to a pointer to a row with\n * the format of pg_type relation.\n * ----------------\n */\ntypedef TypeTupleFormData *TypeTupleForm;\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Mon, 31 Aug 1998 00:58:37 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "other changes"
},
{
"msg_contents": "> \n> Also, during the pgindent run, we have TypeTupleForm and\n> AttributeTupleForm, while we also have Form_pg_class, etc.\n> \n> Seems they should be named similar. It will make the Developers FAQ\n> item 9 easier to understand if we have uniform way to cast a HeapTuple\n> pointer.\n> \n> \tTypeTupleForm -> Form_pg_type\n> \n> In fact the comments in pg_type.h talk about Form_pg_type, but they then\n> define TypeTupleForm.\n> \n> Any problems with changing this?\n> \n> ---------------------------------------------------------------------------\n> \n> \n> /* ----------------\n> * Form_pg_type corresponds to a pointer to a row with\n> * the format of pg_type relation.\n> * ----------------\n> */\n> typedef TypeTupleFormData *TypeTupleForm;\n> \n\nThere is a lot of 'ObjectVerb' naming in postgres. And some the other way too.\nPersonally, having looked at Illustra code a few years, I am quite comfortable\nwith the 'TypeTupleForm' flavor and would be badly confused by 'Form_pg_type'\nas I think of the result of the call as a 'TypeTuple', not as a 'pg_type'.\n\nAlso, I suspect the TypeTupleForm style usage is more common in the code.\n\n-dg\n\nDavid Gould [email protected] 510.628.3783 or 510.305.9468 \nInformix Software (No, really) 300 Lakeside Drive Oakland, CA 94612\n - If simplicity worked, the world would be overrun with insects. -\n",
"msg_date": "Mon, 31 Aug 1998 01:13:55 -0700 (PDT)",
"msg_from": "[email protected] (David Gould)",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] other changes"
},
{
"msg_contents": "> There is a lot of 'ObjectVerb' naming in postgres. And some the other way too.\n> Personally, having looked at Illustra code a few years, I am quite comfortable\n> with the 'TypeTupleForm' flavor and would be badly confused by 'Form_pg_type'\n> as I think of the result of the call as a 'TypeTuple', not as a 'pg_type'.\n> \n> Also, I suspect the TypeTupleForm style usage is more common in the code.\n\nThere are certainly more Form_pg_ in include/catalog/*.h.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Mon, 31 Aug 1998 12:07:57 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] other changes"
}
] |
[
{
"msg_contents": "> >Looks like the changes to createdb and pg_dumpall are causing some\n> >problems.\n> >\n> >It expects createdb -help to work, and it doesn't.\n> \n> Oops. I'll fix this.\n\nHere are patches for bin/createdb/createdb.sh.\n--\nTatsuo Ishii\[email protected]\n\n-----------------------------------------------------------------\nIndex: createdb.sh\n===================================================================\nRCS file: /usr/local/cvsroot/pgsql/src/bin/createdb/createdb.sh,v\nretrieving revision 1.10\ndiff -c -r1.10 createdb.sh\n*** createdb.sh\t1998/07/26 04:31:13\t1.10\n--- createdb.sh\t1998/08/31 06:34:10\n***************\n*** 67,75 ****\n if [ \"$usage\" ]; then\n \tif [ -z \"$MBENABLED\" ];then\n \t\techo \"Usage: $CMDNAME -a <authtype> -h <server> -p <portnumber> -D <location> [dbname]\"\n \telse\n \t\techo \"Usage: $CMDNAME -a <authtype> -h <server> -p <portnumber> -D <location> -E <encoding> [dbname]\"\n! \texit 1\n \tfi\n fi\n \n--- 67,76 ----\n if [ \"$usage\" ]; then\n \tif [ -z \"$MBENABLED\" ];then\n \t\techo \"Usage: $CMDNAME -a <authtype> -h <server> -p <portnumber> -D <location> [dbname]\"\n+ \t\texit 1\n \telse\n \t\techo \"Usage: $CMDNAME -a <authtype> -h <server> -p <portnumber> -D <location> -E <encoding> [dbname]\"\n! \t\texit 1\n \tfi\n fi\n \n",
"msg_date": "Mon, 31 Aug 1998 15:40:33 +0900",
"msg_from": "Tatsuo Ishii <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] encoding problem "
},
{
"msg_contents": "Patch applied.\n\n\n> > >Looks like the changes to createdb and pg_dumpall are causing some\n> > >problems.\n> > >\n> > >It expects createdb -help to work, and it doesn't.\n> > \n> > Oops. I'll fix this.\n> \n> Here are patches for bin/createdb/createdb.sh.\n> --\n> Tatsuo Ishii\n> [email protected]\n> \n> -----------------------------------------------------------------\n> Index: createdb.sh\n> ===================================================================\n> RCS file: /usr/local/cvsroot/pgsql/src/bin/createdb/createdb.sh,v\n> retrieving revision 1.10\n> diff -c -r1.10 createdb.sh\n> *** createdb.sh\t1998/07/26 04:31:13\t1.10\n> --- createdb.sh\t1998/08/31 06:34:10\n> ***************\n> *** 67,75 ****\n> if [ \"$usage\" ]; then\n> \tif [ -z \"$MBENABLED\" ];then\n> \t\techo \"Usage: $CMDNAME -a <authtype> -h <server> -p <portnumber> -D <location> [dbname]\"\n> \telse\n> \t\techo \"Usage: $CMDNAME -a <authtype> -h <server> -p <portnumber> -D <location> -E <encoding> [dbname]\"\n> ! \texit 1\n> \tfi\n> fi\n> \n> --- 67,76 ----\n> if [ \"$usage\" ]; then\n> \tif [ -z \"$MBENABLED\" ];then\n> \t\techo \"Usage: $CMDNAME -a <authtype> -h <server> -p <portnumber> -D <location> [dbname]\"\n> + \t\texit 1\n> \telse\n> \t\techo \"Usage: $CMDNAME -a <authtype> -h <server> -p <portnumber> -D <location> -E <encoding> [dbname]\"\n> ! \t\texit 1\n> \tfi\n> fi\n> \n> \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Wed, 2 Sep 1998 22:12:02 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] encoding problem"
}
] |
[
{
"msg_contents": "I'm just trying the three ecpg examples. Perftest gives me a stange NOTICE\nline on every statement:\n\nNOTICE: CAN't OPEN INDEX 18346 - SKIP IT\n\nI tried again after running initdb, but still get this notice, just with a\ndifferent number: 18314.\n\nAlso the last step gives an error:\n\nsql error Error: ERROR: index \"number1\" nonexistent\n line 118.\nNOTICE: (transaction aborted): all queries ignored until end of transaction\nblock\n\nThis happens when trying to drop index number1. Trying to drop it manually\nfrom psql I get: ERROR: index \"number1\" nonexistent\n\nEventually this leaves me with a DB that seems to have a relation number1\n(which also exists in the filesystem) but is not accessible at all from\npsql.\n\nMichael\n-- \nMichael Meskes\t\t\[email protected], [email protected]\nGo SF49ers! Go Rhein Fire!\tUse Debian GNU/Linux! \n",
"msg_date": "Mon, 31 Aug 1998 09:20:59 +0200",
"msg_from": "Michael Meskes <[email protected]>",
"msg_from_op": true,
"msg_subject": "Strange NOTICE"
}
] |
[
{
"msg_contents": "As I mentioned before, I did some trials on my LinuxPPC box last week\nend. First I compiled with -O0. To my surprise, things got worse than -\nO2. Seems tas() for PPC (storage/buffer/s_lock.c) never works if\ncompiled with -O0. Included are patches that should fix the problem\n(of course I have confirmed -O2 works with this patch).\n\nBTW, here is a platforms/regression test failure(serious one--backend\ndeath) matrix.\n\n\t\t\tFreeBSD\t\tLinuxPPC(-O0)\tLinuxPPC(-O2)\n\nconstraints\t\tGOOD\t\tNG\t\tNG\ncreate_function1\tGOOD\t\tGOOD\t\tNG\ncreate_function2\tGOOD\t\tGOOD\t\tNG\nselect_having\t\tNG\t\tNG\t\tNG\nselect_views\t\tGOOD\t\tNG\t\tNG\ntriggers\t\tGOOD\t\tNG\t\tNG\n\nI will look into LinuxPPC problems further.\n--\nTatsuo Ishii\[email protected]\n----------------------------------------------------------------------\n*** s_lock.c.orig\tMon Aug 31 16:39:24 1998\n--- s_lock.c\tMon Aug 31 17:38:34 1998\n***************\n*** 95,114 ****\n \n #if defined(PPC)\n /* Note: need a nice gcc constrained asm version so it can be inlined */\n! int\n! tas(volatile slock_t *lock)\n {\n! \t__asm__(\"lwarx\t5,0,3\t\\n\\\n! \t\t\tcmpwi\t5,0\t\t\\n\\\n! \t\t\tbne\t\tfail\t\\n\\\n! \t\t\taddi\t5,5,1\t\\n\\\n \tstwcx. 5,0,3\t\\n\\\n! \t\tbeq\t\tsuccess\t\\n\\\n! fail:\t\tli\t\t3,1\t\t\\n\\\n! \t\t\tblr\t\t\t\t\\n\\\n! success:\t\t\t\t\t\\n\\\n! \t\t\tli 3,0\t\t\t\\n\\\n! \tblr\t\t\t\t\\n\\\n \t\");\n }\n #endif /* PPC */\n--- 95,117 ----\n \n #if defined(PPC)\n /* Note: need a nice gcc constrained asm version so it can be inlined */\n! static void\n! tas_dummy()\n {\n! \t__asm__(\"\t\t\\n\\\n! .global\t\ttas\t\t\\n\\\n! tas:\t\t\t\t\\n\\\n! \t\tlwarx\t5,0,3\t\\n\\\n! \t\tcmpwi\t5,0\t\\n\\\n! \t\tbne\tfail\t\\n\\\n! \t\taddi\t5,5,1\t\\n\\\n \tstwcx. 5,0,3\t\\n\\\n! \t\tbeq\tsuccess\t\\n\\\n! fail:\t\tli\t3,1\t\\n\\\n! \t\tblr\t\t\\n\\\n! success:\t\t\t\\n\\\n! \t\tli 3,0\t\t\\n\\\n! \tblr\t\t\\n\\\n \t\");\n }\n #endif /* PPC */\n",
"msg_date": "Mon, 31 Aug 1998 18:15:29 +0900",
"msg_from": "Tatsuo Ishii <[email protected]>",
"msg_from_op": true,
"msg_subject": "LinuxPPC problems"
},
{
"msg_contents": "Patch applied.\n\n\n> As I mentioned before, I did some trials on my LinuxPPC box last week\n> end. First I compiled with -O0. To my surprise, things got worse than -\n> O2. Seems tas() for PPC (storage/buffer/s_lock.c) never works if\n> compiled with -O0. Included are patches that should fix the problem\n> (of course I have confirmed -O2 works with this patch).\n> \n> BTW, here is a platforms/regression test failure(serious one--backend\n> death) matrix.\n> \n> \t\t\tFreeBSD\t\tLinuxPPC(-O0)\tLinuxPPC(-O2)\n> \n> constraints\t\tGOOD\t\tNG\t\tNG\n> create_function1\tGOOD\t\tGOOD\t\tNG\n> create_function2\tGOOD\t\tGOOD\t\tNG\n> select_having\t\tNG\t\tNG\t\tNG\n> select_views\t\tGOOD\t\tNG\t\tNG\n> triggers\t\tGOOD\t\tNG\t\tNG\n> \n> I will look into LinuxPPC problems further.\n> --\n> Tatsuo Ishii\n> [email protected]\n> ----------------------------------------------------------------------\n> *** s_lock.c.orig\tMon Aug 31 16:39:24 1998\n> --- s_lock.c\tMon Aug 31 17:38:34 1998\n> ***************\n> *** 95,114 ****\n> \n> #if defined(PPC)\n> /* Note: need a nice gcc constrained asm version so it can be inlined */\n> ! int\n> ! tas(volatile slock_t *lock)\n> {\n> ! \t__asm__(\"lwarx\t5,0,3\t\\n\\\n> ! \t\t\tcmpwi\t5,0\t\t\\n\\\n> ! \t\t\tbne\t\tfail\t\\n\\\n> ! \t\t\taddi\t5,5,1\t\\n\\\n> \tstwcx. 5,0,3\t\\n\\\n> ! \t\tbeq\t\tsuccess\t\\n\\\n> ! fail:\t\tli\t\t3,1\t\t\\n\\\n> ! \t\t\tblr\t\t\t\t\\n\\\n> ! success:\t\t\t\t\t\\n\\\n> ! \t\t\tli 3,0\t\t\t\\n\\\n> ! \tblr\t\t\t\t\\n\\\n> \t\");\n> }\n> #endif /* PPC */\n> --- 95,117 ----\n> \n> #if defined(PPC)\n> /* Note: need a nice gcc constrained asm version so it can be inlined */\n> ! static void\n> ! tas_dummy()\n> {\n> ! \t__asm__(\"\t\t\\n\\\n> ! .global\t\ttas\t\t\\n\\\n> ! tas:\t\t\t\t\\n\\\n> ! \t\tlwarx\t5,0,3\t\\n\\\n> ! \t\tcmpwi\t5,0\t\\n\\\n> ! \t\tbne\tfail\t\\n\\\n> ! \t\taddi\t5,5,1\t\\n\\\n> \tstwcx. 5,0,3\t\\n\\\n> ! \t\tbeq\tsuccess\t\\n\\\n> ! fail:\t\tli\t3,1\t\\n\\\n> ! \t\tblr\t\t\\n\\\n> ! success:\t\t\t\\n\\\n> ! \t\tli 3,0\t\t\\n\\\n> ! \tblr\t\t\\n\\\n> \t\");\n> }\n> #endif /* PPC */\n> \n> \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Wed, 2 Sep 1998 22:14:41 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] LinuxPPC problems"
},
{
"msg_contents": "> BTW, here is a platforms/regression test failure(serious one--backend\n> death) matrix.\n> \n> \t\t\tFreeBSD\t\tLinuxPPC(-O0)\tLinuxPPC(-O2)\n> \n> constraints\t\tGOOD\t\tNG\t\tNG\n> create_function1\tGOOD\t\tGOOD\t\tNG\n> create_function2\tGOOD\t\tGOOD\t\tNG\n> select_having\t\tNG\t\tNG\t\tNG\n> select_views\t\tGOOD\t\tNG\t\tNG\n> triggers\t\tGOOD\t\tNG\t\tNG\n> \n> I will look into LinuxPPC problems further.\n\nHere is current status.\n\n \t\t\tFreeBSD\t\tLinuxPPC(-O0)\tLinuxPPC(-O2)\n \n constraints\t\tGOOD\t\tNG\t\tNG\n create_function1\tGOOD\t\tGOOD\t\tGOOD\n create_function2\tGOOD\t\tGOOD\t\tGOOD\n select_having\t\tGOOD\t\tGOOD\t\tGOOD\n select_views\t\tGOOD\t\tNG\t\tNG\n triggers\t\tGOOD\t\tGOOD\t\tGOOD\n\nAfter Bruce's, fix 4 NGs in LinuxPPC(-O2) turned to GOOD. Also, -O0\nand -O2 now show same results. Excellent! Thanks Bruce.\n--\nTatsuo Ishii\[email protected]\n",
"msg_date": "Thu, 03 Sep 1998 17:31:33 +0900",
"msg_from": "Tatsuo Ishii <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] LinuxPPC problems "
},
{
"msg_contents": "> Here is current status.\n> \n> FreeBSD LinuxPPC(-O0) LinuxPPC(-O2)\n> \n> constraints GOOD NG NG\n> create_function1 GOOD GOOD GOOD\n> create_function2 GOOD GOOD GOOD\n> select_having GOOD GOOD GOOD\n> select_views GOOD NG NG\n> triggers GOOD GOOD GOOD\n> \n> After Bruce's, fix 4 NGs in LinuxPPC(-O2) turned to GOOD. Also, -O0\n> and -O2 now show same results. Excellent! Thanks Bruce.\n\nAh, by Tatsuo's measures I'm getting similar results on Linux/i686 as he\nis getting on Linux/PPC. I have failures on constraints and\nselect_index, but neither are core dumps, and both involve not finding\ntables (probably index or index cache corruption on pg_class). The other\nregression tests which fail are due to tables or information missing\nfrom the tests listed by Tatsuo or myself.\n\nbtw, I'm pretty sure that the select_views problem pre-dates the OID and\nindex patches.\n\nDavid made the recent observation that my symptoms are likely due to a\ndamaged index, not a damaged pg_class table. So indices (or something\nrelated) are still suspect. Remember that at least one of my symptoms is\nfrom a table which had been destroyed and then recreated. Don't know if\nthat is relevant...\n\nThe only thing I haven't done yet to refresh source code is to pull a\n*completely new* cvs tree from postgresql.org. However, since I'm\ngetting the same results as Tatsuo I think CVSup is treating me OK, so\nwon't try that (yet).\n\nOff to work now.\n\n - Tom\n",
"msg_date": "Thu, 03 Sep 1998 16:01:40 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] LinuxPPC problems"
},
{
"msg_contents": "> > Here is current status.\n> > \n> > FreeBSD LinuxPPC(-O0) LinuxPPC(-O2)\n> > \n> > constraints GOOD NG NG\n> > create_function1 GOOD GOOD GOOD\n> > create_function2 GOOD GOOD GOOD\n> > select_having GOOD GOOD GOOD\n> > select_views GOOD NG NG\n> > triggers GOOD GOOD GOOD\n> > \n> > After Bruce's, fix 4 NGs in LinuxPPC(-O2) turned to GOOD. Also, -O0\n> > and -O2 now show same results. Excellent! Thanks Bruce.\n> \n> Ah, by Tatsuo's measures I'm getting similar results on Linux/i686 as he\n> is getting on Linux/PPC. I have failures on constraints and\n> select_index, but neither are core dumps, and both involve not finding\n> tables (probably index or index cache corruption on pg_class). The other\n> regression tests which fail are due to tables or information missing\n> from the tests listed by Tatsuo or myself.\n> \n> btw, I'm pretty sure that the select_views problem pre-dates the OID and\n> index patches.\n> \n> David made the recent observation that my symptoms are likely due to a\n> damaged index, not a damaged pg_class table. So indices (or something\n> related) are still suspect. Remember that at least one of my symptoms is\n> from a table which had been destroyed and then recreated. Don't know if\n> that is relevant...\n> \n> The only thing I haven't done yet to refresh source code is to pull a\n> *completely new* cvs tree from postgresql.org. However, since I'm\n> getting the same results as Tatsuo I think CVSup is treating me OK, so\n> won't try that (yet).\n\nI think downloading a new cvs is not worth it. It fixed a problem where\nsome people had fmgr.h in src/include because it must have been moved\nsince 6.3.2, and the first person to change the system catalogs(me)\ncaused the initdb problems.\n\nDon't think it is a problem anymore as the people who had the fmgr.h in\nthe old location have removed it.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Thu, 3 Sep 1998 12:50:18 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] LinuxPPC problems"
}
] |
[
{
"msg_contents": "\n>Another idea would be to do actual UNION queries:\n>\n>\tSELECT * FROM tab\n>\tWHERE (x=3 and y=4)\n>\tUNION\n>\tSELECT * FROM tab\n>\tWHERE (x=3 and y=5)\n>\tUNION\n>\tSELECT * FROM tab\n>\tWHERE (x=3 and y=6) ...\n>\n>This would work well for tables with indexes, but for a sequential scan,\n>you are doing a sequential scan for each UNION.\n\nThe most important Application for this syntax will be M$ Access\nbecause it uses this syntax to display x rows from a table in a particular\nsort order. In this case x and y will be the primary key and therefore have a\nunique index. So I think this special case should work good.\n\nThe strategy could be something like:\niff x, y is a unique index\n\tdo the union access path\nelse\n\tdo something else\ndone\n\nI think hand written SQL can always be rewritten if it is not fast enough\nusing this syntax.\n\nAndreas\n\n",
"msg_date": "Mon, 31 Aug 1998 12:22:05 +0200",
"msg_from": "Andreas Zeugswetter <[email protected]>",
"msg_from_op": true,
"msg_subject": "AW: [INTERFACES] Re: [HACKERS] changes in 6.4"
}
] |
[
{
"msg_contents": "Thomas A. Szybist\" <[email protected]>\n> > Bruce Momjian\n> > \n> > Again, if someone wants to conditionally compile the directories to find\n> > the offending file, I am sure we can get a fix for it.\n> > \n> \n> At first look it seems to be: backend/catalog/indexing.c.\n> Maybe Keith can confirm? \n> \n\nWith the latest from cvs the core dump on \"create table\" is back\nwhen compiled with -O2.\n\nIf I compile backend/catalog with -O2 then the table creation is\nOK. So it looks like it may be indexing.c, even with Bruce's\nrecent fixes.\n\nI'm still getting some regression test failures, the worst of which\nis a core when creating a function.\n\nHere's a bactrace from a \"create function\" immediately after an initdb\nand using the template1 database.\n\nKeith.\n\nProgram received signal SIGSEGV, Segmentation fault.\n0x34264 in GetIndexValue (tuple=0x1ba810, hTupDesc=0x1ba86c, attOff=0, \nattrNums=0x1bd544, fInfo=0x0,\n attNull=0xefffcc97 \"\") at indexam.c:404\n404 returnVal = heap_getattr(tuple, attrNums[attOff],\n(gdb) bt\n#0 0x34264 in GetIndexValue (tuple=0x1ba810, hTupDesc=0x1ba86c, attOff=0, \nattrNums=0x1bd544, fInfo=0x0,\n attNull=0xefffcc97 \"\") at indexam.c:404\n#1 0x4974c in FormIndexDatum (numberOfAttributes=1, attributeNumber=0x1bd544, \nheapTuple=0x1ba810,\n heapDescriptor=0x1ba86c, datum=0xefffcd80, nullv=0xefffcd20 \" \\230\", \nfInfo=0x0) at index.c:1284\n#2 0x4a4e8 in CatalogIndexInsert (idescs=0xefffcdf8, nIndices=3, \nheapRelation=0x171b90, heapTuple=0x1ba810)\n at indexing.c:154\n#3 0x4fb2c in ProcedureCreate (procedureName=0x166bf0 \"widget_in\", returnsSet=0 \n'\\000',\n returnTypeName=0x166bb0 \"widget\", languageName=0xefffcf98 \"C\", \nprosrc=0xeb800 \"-\",\n probin=0x1aeb10 \"/usr/local/pgsql/src/test/regress/input/../regress.so\", \ncanCache=112 'p',\n trusted=1 '\\001', byte_pct=100, perbyte_cpu=0, percall_cpu=0, \noutin_ratio=100, argList=0x166bd0,\n dest=Remote) at pg_proc.c:275\n#4 0x55674 in CreateFunction (stmt=0x165a50, dest=Remote) at define.c:329\n#5 0xb8430 in ProcessUtility (parsetree=0x165a50, dest=Remote) at utility.c:392\n#6 0xb60f8 in pg_exec_query_dest (\n query_string=0xefffd1a0 \"CREATE FUNCTION widget_in(opaque)\\n RETURNS \nwidget\\n AS '/usr/local/pgsql/src/test/regress/input/../regress.so'\\n \nLANGUAGE 'c';\", dest=Remote, aclOverride=0 '\\000') at postgres.c:749\n#7 0xb5fec in pg_exec_query (\n query_string=0xefffd1a0 \"CREATE FUNCTION widget_in(opaque)\\n RETURNS \nwidget\\n AS '/usr/local/pgsql/src/test/regress/input/../regress.so'\\n \nLANGUAGE 'c';\") at postgres.c:687\n#8 0xb72ec in PostgresMain (argc=10, argv=0xeffff268, real_argc=10, \nreal_argv=0xeffffd84) at postgres.c:1609\n#9 0x9f27c in DoBackend (port=0x107c00) at postmaster.c:1519\n#10 0x9ecf4 in BackendStartup (port=0x167c00) at postmaster.c:1291\n#11 0x9e16c in ServerLoop () at postmaster.c:750\n#12 0x9dcc4 in PostmasterMain (argc=0, argv=0xeffffd84) at postmaster.c:556\n#13 0x723b0 in main (argc=10, argv=0xeffffd84) at main.c:93 \n\n",
"msg_date": "Mon, 31 Aug 1998 18:03:17 +0100 (BST)",
"msg_from": "Keith Parks <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] Core dump in regression tests. "
},
{
"msg_contents": "In message <[email protected]>, Keith Parks writes:\n> Thomas A. Szybist\" <[email protected]>\n> > > Bruce Momjian\n> > > \n> > > Again, if someone wants to conditionally compile the directories to find\n> > > the offending file, I am sure we can get a fix for it.\n> > > \n> > \n> > At first look it seems to be: backend/catalog/indexing.c.\n> > Maybe Keith can confirm? \n> > \n> \n> With the latest from cvs the core dump on \"create table\" is back\n> when compiled with -O2.\n> \n> If I compile backend/catalog with -O2 then the table creation is\n ^^^\n> OK. So it looks like it may be indexing.c, even with Bruce's\n> recent fixes.\n\nDo you mean -O0 here?\n\n> \n> I'm still getting some regression test failures, the worst of which\n> is a core when creating a function.\n> \n> Here's a bactrace from a \"create function\" immediately after an initdb\n> and using the template1 database.\n> \n> Keith.\n> \n> Program received signal SIGSEGV, Segmentation fault.\n> 0x34264 in GetIndexValue (tuple=0x1ba810, hTupDesc=0x1ba86c, attOff=0, \n> attrNums=0x1bd544, fInfo=0x0,\n> attNull=0xefffcc97 \"\") at indexam.c:404\n> 404 returnVal = heap_getattr(tuple, attrNums[attOff],\n> (gdb) bt\n> #0 0x34264 in GetIndexValue (tuple=0x1ba810, hTupDesc=0x1ba86c, attOff=0, \n> attrNums=0x1bd544, fInfo=0x0,\n> attNull=0xefffcc97 \"\") at indexam.c:404\n> #1 0x4974c in FormIndexDatum (numberOfAttributes=1, attributeNumber=0x1bd544, \n> heapTuple=0x1ba810,\n> heapDescriptor=0x1ba86c, datum=0xefffcd80, nullv=0xefffcd20 \" \\230\", \n> fInfo=0x0) at index.c:1284\n> #2 0x4a4e8 in CatalogIndexInsert (idescs=0xefffcdf8, nIndices=3, \n> heapRelation=0x171b90, heapTuple=0x1ba810)\n> at indexing.c:154\n> #3 0x4fb2c in ProcedureCreate (procedureName=0x166bf0 \"widget_in\", returnsSet=0 \n> '\\000',\n> returnTypeName=0x166bb0 \"widget\", languageName=0xefffcf98 \"C\", \n> prosrc=0xeb800 \"-\",\n> probin=0x1aeb10 \"/usr/local/pgsql/src/test/regress/input/../regress.so\", \n> canCache=112 'p',\n> trusted=1 '\\001', byte_pct=100, perbyte_cpu=0, percall_cpu=0, \n> outin_ratio=100, argList=0x166bd0,\n> dest=Remote) at pg_proc.c:275\n> #4 0x55674 in CreateFunction (stmt=0x165a50, dest=Remote) at define.c:329\n> #5 0xb8430 in ProcessUtility (parsetree=0x165a50, dest=Remote) at utility.c:392\n> #6 0xb60f8 in pg_exec_query_dest (\n> query_string=0xefffd1a0 \"CREATE FUNCTION widget_in(opaque)\\n RETURNS \n> widget\\n AS '/usr/local/pgsql/src/test/regress/input/../regress.so'\\n \n> LANGUAGE 'c';\", dest=Remote, aclOverride=0 '\\000') at postgres.c:749\n> #7 0xb5fec in pg_exec_query (\n> query_string=0xefffd1a0 \"CREATE FUNCTION widget_in(opaque)\\n RETURNS \n> widget\\n AS '/usr/local/pgsql/src/test/regress/input/../regress.so'\\n \n> LANGUAGE 'c';\") at postgres.c:687\n> #8 0xb72ec in PostgresMain (argc=10, argv=0xeffff268, real_argc=10, \n> real_argv=0xeffffd84) at postgres.c:1609\n> #9 0x9f27c in DoBackend (port=0x107c00) at postmaster.c:1519\n> #10 0x9ecf4 in BackendStartup (port=0x167c00) at postmaster.c:1291\n> #11 0x9e16c in ServerLoop () at postmaster.c:750\n> #12 0x9dcc4 in PostmasterMain (argc=0, argv=0xeffffd84) at postmaster.c:556\n> #13 0x723b0 in main (argc=10, argv=0xeffffd84) at main.c:93 \n> \n> \n\nI managed to get this running on a Solaris box. -O2 was not included\nby default (wonder why :)). I got a core dump when running initdb\nwith -O2. I recompiled indexing.c without -O2, and it is much better.\n(I basically get the same results as under Linux.) I get the same\ncore dumps that Keith is seeing with create function.\n\nSo, both my Sparc boxes are behaving the same.\n\nTom Szybist\[email protected]\n",
"msg_date": "Mon, 31 Aug 1998 13:41:49 -0400",
"msg_from": "\"Thomas A. Szybist\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests. "
},
{
"msg_contents": "> Thomas A. Szybist\" <[email protected]>\n> > > Bruce Momjian\n> > > \n> > > Again, if someone wants to conditionally compile the directories to find\n> > > the offending file, I am sure we can get a fix for it.\n> > > \n> > \n> > At first look it seems to be: backend/catalog/indexing.c.\n> > Maybe Keith can confirm? \n> > \n> \n> With the latest from cvs the core dump on \"create table\" is back\n> when compiled with -O2.\n> \n> If I compile backend/catalog with -O2 then the table creation is\n> OK. So it looks like it may be indexing.c, even with Bruce's\n> recent fixes.\n\nDo you mean -O0 here?\n\n> \n> I'm still getting some regression test failures, the worst of which\n> is a core when creating a function.\n> \n> Here's a bactrace from a \"create function\" immediately after an initdb\n> and using the template1 database.\n\nI have looked over indexing.c and can still see nothing strange. I do\nremember that ProcedureSrcIndexScan/PROSRC cache call never worked in\nthe old code, so this call is now working, but that is the only\nfunctional difference I remember.\n\nThe old code in this section was somewhat mangled.\n\nCan I telnet into this machine?\n\n> \n> Keith.\n> \n> Program received signal SIGSEGV, Segmentation fault.\n> 0x34264 in GetIndexValue (tuple=0x1ba810, hTupDesc=0x1ba86c, attOff=0, \n> attrNums=0x1bd544, fInfo=0x0,\n> attNull=0xefffcc97 \"\") at indexam.c:404\n> 404 returnVal = heap_getattr(tuple, attrNums[attOff],\n> (gdb) bt\n> #0 0x34264 in GetIndexValue (tuple=0x1ba810, hTupDesc=0x1ba86c, attOff=0, \n> attrNums=0x1bd544, fInfo=0x0,\n\nMy guess is that hTupDesc is badly formed, not having the proper\nattributes for the relation. Can you do a print of *hTupDesc, and\nattrNums[0]?\n\n\n> attNull=0xefffcc97 \"\") at indexam.c:404\n> #1 0x4974c in FormIndexDatum (numberOfAttributes=1, attributeNumber=0x1bd544, \n> heapTuple=0x1ba810,\n> heapDescriptor=0x1ba86c, datum=0xefffcd80, nullv=0xefffcd20 \" \\230\", \n> fInfo=0x0) at index.c:1284\n> #2 0x4a4e8 in CatalogIndexInsert (idescs=0xefffcdf8, nIndices=3, \n> heapRelation=0x171b90, heapTuple=0x1ba810)\n> at indexing.c:154\n> #3 0x4fb2c in ProcedureCreate (procedureName=0x166bf0 \"widget_in\", returnsSet=0 \n> '\\000',\n> returnTypeName=0x166bb0 \"widget\", languageName=0xefffcf98 \"C\", \n> prosrc=0xeb800 \"-\",\n> probin=0x1aeb10 \"/usr/local/pgsql/src/test/regress/input/../regress.so\", \n> canCache=112 'p',\n> trusted=1 '\\001', byte_pct=100, perbyte_cpu=0, percall_cpu=0, \n> outin_ratio=100, argList=0x166bd0,\n> dest=Remote) at pg_proc.c:275\n> #4 0x55674 in CreateFunction (stmt=0x165a50, dest=Remote) at define.c:329\n> #5 0xb8430 in ProcessUtility (parsetree=0x165a50, dest=Remote) at utility.c:392\n> #6 0xb60f8 in pg_exec_query_dest (\n> query_string=0xefffd1a0 \"CREATE FUNCTION widget_in(opaque)\\n RETURNS \n> widget\\n AS '/usr/local/pgsql/src/test/regress/input/../regress.so'\\n \n> LANGUAGE 'c';\", dest=Remote, aclOverride=0 '\\000') at postgres.c:749\n> #7 0xb5fec in pg_exec_query (\n> query_string=0xefffd1a0 \"CREATE FUNCTION widget_in(opaque)\\n RETURNS \n> widget\\n AS '/usr/local/pgsql/src/test/regress/input/../regress.so'\\n \n> LANGUAGE 'c';\") at postgres.c:687\n> #8 0xb72ec in PostgresMain (argc=10, argv=0xeffff268, real_argc=10, \n> real_argv=0xeffffd84) at postgres.c:1609\n> #9 0x9f27c in DoBackend (port=0x107c00) at postmaster.c:1519\n> #10 0x9ecf4 in BackendStartup (port=0x167c00) at postmaster.c:1291\n> #11 0x9e16c in ServerLoop () at postmaster.c:750\n> #12 0x9dcc4 in PostmasterMain (argc=0, argv=0xeffffd84) at postmaster.c:556\n> #13 0x723b0 in main (argc=10, argv=0xeffffd84) at main.c:93 \n> \n> \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Mon, 31 Aug 1998 13:47:48 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
}
] |
[
{
"msg_contents": "The recent changes in the tracing code are unfortunately not portable.\n\n#define PRINTF(args...) tprintf(TRACE_ALL, args)\n\nis not accepted by all compilers. Is there another way to express this ?\nIs my AIX xlc Version 3.1.4 the only one with this problem ? \n\nAndreas\n\n",
"msg_date": "Mon, 31 Aug 1998 19:20:26 +0200",
"msg_from": "Andreas Zeugswetter <[email protected]>",
"msg_from_op": true,
"msg_subject": "TPRINTF in trace.h"
},
{
"msg_contents": "> The recent changes in the tracing code are unfortunately not portable.\n> \n> #define PRINTF(args...) tprintf(TRACE_ALL, args)\n> \n> is not accepted by all compilers. Is there another way to express this ?\n> Is my AIX xlc Version 3.1.4 the only one with this problem ? \n\nYikes, that is certainly not standard C. I have never seen that before.\nLooks like a GNU-ism. I nice one, but still a GNU-ism.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Mon, 31 Aug 1998 13:48:52 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] TPRINTF in trace.h"
},
{
"msg_contents": "> \n> > The recent changes in the tracing code are unfortunately not portable.\n> > \n> > #define PRINTF(args...) tprintf(TRACE_ALL, args)\n> > \n> > is not accepted by all compilers. Is there another way to express this ?\n> > Is my AIX xlc Version 3.1.4 the only one with this problem ? \n> \n> Yikes, that is certainly not standard C. I have never seen that before.\n> Looks like a GNU-ism. I nice one, but still a GNU-ism.\n\nSorry, I didn't know it is a GNU extension. I have written this patch\nwhich should fix the problem. Let me know if you still have problems.\n\n*** src/include/utils/trace.h.orig\tTue Aug 25 23:43:47 1998\n--- src/include/utils/trace.h\tMon Aug 31 22:35:47 1998\n***************\n*** 26,31 ****\n--- 26,32 ----\n #define TIMESTAMP_SIZE 0\n #endif\n \n+ extern int tprintf1(const char *fmt, ...);\n extern int tprintf(int flag, const char *fmt, ...);\n extern int eprintf(const char *fmt, ...);\n extern int option_flag(int flag);\n***************\n*** 70,78 ****\n \n extern int pg_options[NUM_PG_OPTIONS];\n \n! #define PRINTF(args...)\t\t\ttprintf(TRACE_ALL, args)\n #define EPRINTF(args...) \t\teprintf(args)\n #define TPRINTF(flag, args...)\ttprintf(flag, args)\n \n #endif\t\t\t\t\t\t\t/* TRACE_H */\n \n--- 71,85 ----\n \n extern int pg_options[NUM_PG_OPTIONS];\n \n! #ifdef __GNUC__\n! #define PRINTF(args...)\t\t\ttprintf1(args)\n #define EPRINTF(args...) \t\teprintf(args)\n #define TPRINTF(flag, args...)\ttprintf(flag, args)\n+ #else\n+ #define PRINTF\ttprintf1\n+ #define EPRINTF eprintf\n+ #define TPRINTF\ttprintf\n+ #endif\n \n #endif\t\t\t\t\t\t\t/* TRACE_H */\n \n*** src/backend/utils/misc/trace.c.orig\tTue Aug 25 23:43:47 1998\n--- src/backend/utils/misc/trace.c\tMon Aug 31 22:36:10 1998\n***************\n*** 126,131 ****\n--- 126,159 ----\n }\n \n /*\n+ * Print a timestamp and a message to stdout or to syslog.\n+ */\n+ int\n+ tprintf1(const char *fmt, ... )\n+ {\n+ \tva_list\t\tap;\n+ \tchar\t\tline[ELOG_MAXLEN+TIMESTAMP_SIZE+1];\n+ \n+ \tva_start(ap, fmt);\n+ #ifdef ELOG_TIMESTAMPS\n+ \tstrcpy(line, tprintf_timestamp());\n+ #endif\n+ \tvsprintf(line+TIMESTAMP_SIZE, fmt, ap);\n+ \tva_end(ap);\n+ \n+ #ifdef USE_SYSLOG\n+ \twrite_syslog(LOG_INFO, line+TIMESTAMP_SIZE);\n+ #endif\n+ \n+ \tif (UseSyslog <= 1) {\n+ \t\tputs(line);\n+ \t\tfflush(stdout);\n+ \t}\n+ \n+ \treturn 1;\n+ }\n+ \n+ /*\n * Print a timestamp and a message to stderr.\n */\n int\n\n-- \nMassimo Dal Zotto\n\n+----------------------------------------------------------------------+\n| Massimo Dal Zotto email: [email protected] |\n| Via Marconi, 141 phone: ++39-461-534251 |\n| 38057 Pergine Valsugana (TN) www: http://www.cs.unitn.it/~dz/ |\n| Italy pgp: finger [email protected] |\n+----------------------------------------------------------------------+\n\n",
"msg_date": "Mon, 31 Aug 1998 22:51:21 +0200 (MET DST)",
"msg_from": "Massimo Dal Zotto <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] TPRINTF in trace.h"
}
] |
[
{
"msg_contents": "Dear Sir,\n I've used UNION operator to combine 3 queries.\n But I found that\n - the number of tuples return from UNION operation was LESS than\n\nthe sum of each query tuples\n - UNION or UNION ALL return the same result set\n\n PLEASE SUGGEST ME WHERE IS INCORRECT. @^.^@\n & HOW TO SOLVE IT.\n\n These are my SQL statements & Tables:-\n\nUnion Statement\n\n SELECT 21, date, service, sum(packets),\nsum(bytes)\n FORM t,ip_in\n WHERE time like '21:%' and t.dst = ip_in.ip\n GROUP BY date,service\n union all\nSELECT 22, date, service, sum(packets),\nsum(bytes)\n FORM t,ip_in\n WHERE time like '22:%' and t.dst = ip_in.ip\n GROUP BY date,service\n union all\n SELECT 23, date, service, sum(packets),\nsum(bytes)\n FORM t,ip_in\n WHERE time like '23:%' and t.dst = ip_in.ip\n GROUP BY date,service\n\n Results Are :-\n\n?column?|date |service |sum| sum\n--------+-----------+-----------+---+------\n 21|1Jun98 |http |683|451852\n 22|1Jun98 |nbdatagram | 2| 477\n 22|1Jun98 |nbname | 32| 4096\n 21|1Jun98 |proxy-squid|240| 86151\n 21|1Jun98 |smtp | 41| 5063\n(5 rows)\n\n\n???????????? But Each Query return More Tuples\n\n SELECT 21, date, service, sum(packets),\nsum(bytes)\n FORM t,ip_in\n WHERE time like '21:%' and t.dst = ip_in.ip\n GROUP BY date,service;\n\nResults Are :-\n\n?column?|date |service |sum| sum\n--------+-----------+-----------+---+------\n 21|1Jun98 |http |683|451852\n 21|1Jun98 |proxy-squid|240| 86151\n 21|1Jun98 |smtp | 41| 5063\n(3 rows)\n\n\n SELECT 22, date, service, sum(packets),\nsum(bytes)\n FORM t,ip_in\n WHERE time like '22:%' and t.dst = ip_in.ip\n GROUP BY date,service;\n\nResults Are :-\n\n?column?|date |service | sum| sum\n--------+-----------+-----------+----+------\n 22|1Jun98 |http |2644|942623\n 22|1Jun98 |nbdatagram | 2| 477\n 22|1Jun98 |nbname | 32| 4096\n 22|1Jun98 |proxy-squid| 99| 28356\n(4 rows)\n\n\n SELECT 23, date, service, sum(packets),\nsum(bytes)\n FORM t,ip_in\n WHERE time like '23:%' and t.dst = ip_in.ip\n GROUP BY date,service;\n\nResults Are :-\n\n?column?|date |service |sum| sum\n--------+-----------+-----------+---+------\n 23|1Jun98 |http |714|189209\n 23|1Jun98 |proxy-squid|964|337385\n(2 rows)\n\n\n\n I used 2 table ;\n -one had only 1 attribute ( contain no duplicate value\n and is contained\n\nin join condition , t.dst = ip_in.ip)\n -and the other had 7.\n\nTable = ip_in\n+----------------------------------+----------------------------------+-------+\n\n| Field | Type |\nLength|\n+----------------------------------+----------------------------------+-------+\n\n| ip | varchar()\n| 50 |\n+----------------------------------+----------------------------------+-------+\n\n\n\n\nTable = t\n+----------------------------------+----------------------------------+-------+\n\n| Field |\nType | Length|\n+----------------------------------+----------------------------------+-------+\n\n| num |\nvarchar() | 20 |\n| date |\nchar() | 11 |\n| time |\nchar() | 8 |\n| dst |\nvarchar() | 50 |\n| service | varchar()\n| 15 |\n| packets | int4\n| 4 |\n| bytes | int4\n| 4 |\n+----------------------------------+----------------------------------+-------+\n\n\n\nTHANK YOU VERY MUCH,\nCharu. Korapat",
"msg_date": "Mon, 31 Aug 1998 18:40:57 +0000",
"msg_from": "korapat <[email protected]>",
"msg_from_op": true,
"msg_subject": "UNION opration NOT return all result set :) pls help"
}
] |
[
{
"msg_contents": "Thomas A. Szybist <[email protected]>\n> \n> > \n> > If I compile backend/catalog with -O2 then the table creation is\n> ^^^\n> > OK. So it looks like it may be indexing.c, even with Bruce's\n> > recent fixes.\n> \n> Do you mean -O0 here?\n> \n\nYes, a typo, I used -O0 for this dir.\n\n> \n> I managed to get this running on a Solaris box. -O2 was not included\n> by default (wonder why :)). I got a core dump when running initdb\n> with -O2. I recompiled indexing.c without -O2, and it is much better.\n> (I basically get the same results as under Linux.) I get the same\n> core dumps that Keith is seeing with create function.\n> \n> So, both my Sparc boxes are behaving the same.\n> \n\nI've not got round to trying a build on my Solaris 2.6 box yet. I was\nhoping that someone with something faster than a SPARC 2 would do\nthe biz and get the same results.\n\nSo we have at least two problems, some code that is tickling a gcc\noptimiser bug (gcc 2.7.2.1 in my case) and an alignment bug in our\ncode that affects SPARC architecture.\n\nI've half a mind to see if there is a later version of gcc that\ndoes the optimisation correctly. (rpm format for Redhat 4.2)\n\nThe \"create function\" problem is a little harder for me to see\na way forward. ( my debugging skills are very few.)\n\nKeith.\n\n",
"msg_date": "Mon, 31 Aug 1998 20:19:29 +0100 (BST)",
"msg_from": "Keith Parks <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] Core dump in regression tests. "
},
{
"msg_contents": "> The \"create function\" problem is a little harder for me to see\n> a way forward. ( my debugging skills are very few.)\n\nHmm. Bruce's most recent patches didn't fix my problems on Linux/i686\nreported earlier. So I figured I'd try a full build with -O0 just to see\nif it helped. Not only did it not help, but I got several other\nregression tests failing, some with core dumps which did not crash with\n-O2. Weird.\n\n - Tom\n",
"msg_date": "Tue, 01 Sep 1998 04:35:37 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "> Thomas A. Szybist <[email protected]>\n> > \n> > > \n> > > If I compile backend/catalog with -O2 then the table creation is\n> > ^^^\n> > > OK. So it looks like it may be indexing.c, even with Bruce's\n> > > recent fixes.\n> > \n> > Do you mean -O0 here?\n> > \n> \n> Yes, a typo, I used -O0 for this dir.\n> \n\nCan you try:\n\n\tselect * from pg_index;\n\nCrashes here. Not good.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Tue, 1 Sep 1998 02:06:40 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "> Thomas A. Szybist <[email protected]>\n> > \n> > > \n> > > If I compile backend/catalog with -O2 then the table creation is\n> > ^^^\n> > > OK. So it looks like it may be indexing.c, even with Bruce's\n> > > recent fixes.\n> > \n> > Do you mean -O0 here?\n> > \n> \n> Yes, a typo, I used -O0 for this dir.\n\nOne idea is to track heapDescriptor from CatalogIndexInsert() all the\nway down into the lower functions.\n\nCompile with assert checking, which I assume you are already doing.\n\nAdd this \"Assert(heapDescriptor->natts != 0)\" to the function, and in\nlower functions substitute heapDescriptor with the new variable name it\ntook as a function parameter.)\n\nWhen the assert fails, we can see where it is getting messed up.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Tue, 1 Sep 1998 02:23:55 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "In message <[email protected]>, Bruce Momjian writes:\n> > Thomas A. Szybist <[email protected]>\n> > > \n> > > > \n> > > > If I compile backend/catalog with -O2 then the table creation is\n> > > ^^^\n> > > > OK. So it looks like it may be indexing.c, even with Bruce's\n> > > > recent fixes.\n> > > \n> > > Do you mean -O0 here?\n> > > \n> > \n> > Yes, a typo, I used -O0 for this dir.\n> \n> One idea is to track heapDescriptor from CatalogIndexInsert() all the\n> way down into the lower functions.\n> \n> Compile with assert checking, which I assume you are already doing.\n> \n> Add this \"Assert(heapDescriptor->natts != 0)\" to the function, and in\n> lower functions substitute heapDescriptor with the new variable name it\n> took as a function parameter.)\n> \n> When the assert fails, we can see where it is getting messed up.\n> \n> \n> -- \n> Bruce Momjian | 830 Blythe Avenue\n> [email protected] | Drexel Hill, Pennsylvania 19026\n> + If your life is a hard drive, | (610) 353-9879(w)\n> + Christ can be your backup. | (610) 853-3000(h)\n> \n\nI don't know if this helps, but here's what I've done so far. I'm now on\na Solaris Box, since the optimization thing seems to be similar to the\nLinux Box. Its just easier for me to work on the Solaris Box.\n\nWhen indexing.c is compiled with -O2, I get a core dump. (Big news.)\nThe core dump occurs at line 208 of backend/access/common/heaptuple.c.\nat this memmove. \n\n\t\t{\n\t\t\tdata = (char *) LONGALIGN(data);\n\t\t\tmemmove(data, DatumGetPointer(value[i]),\n\t\t\t\tatt[i]->attlen);\n\t\t\tdata += att[i]->attlen;\n\t\t} \n\nThis consistantly happens when tupleDesc->natts is 1. When i = 1 on the\nsecond time on the outer loop, value[1] is something like 2123236.\nThis is out of range when it gets derefenced, memmove barfs.\n\nI was backtracking and turning on debugging one file at a time, but got\nlost in fmgr.c.\n\nI'll insert the asserts like you suggested.\n\nBruce, I can let you on this machine if you like.\n\nThanks,\n\nTom\n\n#0 0xef5d0580 in _memcpy ()\n(gdb) bt\n#0 0xef5d0580 in _memcpy ()\n#1 0x297e0 in DataFill (data=0x1a8e0c \"\", tupleDesc=0x15dce8, value=0xefffccac,\nnulls=0xefffccb0 \"\", infomask=0xefffc9c6, bit=0x1a8e00 \"\\003\") at heaptuple.c:208\n#2 0x2bf24 in index_formtuple (tupleDescriptor=0x15dce8, value=0xefffccac, null=0xefffccb0 \"\")\nat indextuple.c:76\n#3 0x3ff40 in btinsert (rel=0x1a8060, datum=0xefffccac, nulls=0xefffccb0 \"\", ht_ctid=0x1a8858,\nheapRel=0x166a38) at nbtree.c:358\n#4 0xde1bc in fmgr_c (finfo=0xefffcb70, values=0xefffcb80, isNull=0xefffcb6f \"\") at fmgr.c:115\n#5 0xde7bc in fmgr (procedureId=331) at fmgr.c:286\n#6 0x38c3c in index_insert ()\n#7 0x4d440 in CatalogIndexInsert ()\n#8 0x4a6c4 in AddNewAttributeTuples ()\n#9 0x4a968 in heap_create_with_catalog ()\n#10 0x51b70 in DefineRelation ()\n#11 0xb7884 in ProcessUtility ()\n#12 0xb5da8 in pg_exec_query_dest ()\n#13 0xb5c9c in pg_exec_query ()\n#14 0xb6eb8 in PostgresMain ()\n#15 0x9ef90 in DoBackend ()\n#16 0x9e9dc in BackendStartup ()\n#17 0x9df64 in ServerLoop ()\n#18 0x9dab8 in PostmasterMain ()\n#19 0x722e4 in main () \n",
"msg_date": "Tue, 01 Sep 1998 10:04:09 -0400",
"msg_from": "\"Thomas A. Szybist\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests. "
},
{
"msg_contents": "> Thomas A. Szybist <[email protected]>\n> > \n> > > \n> > > If I compile backend/catalog with -O2 then the table creation is\n> > ^^^\n> > > OK. So it looks like it may be indexing.c, even with Bruce's\n> > > recent fixes.\n> > \n> > Do you mean -O0 here?\n> > \n> \n> Yes, a typo, I used -O0 for this dir.\n\nCan we try a simple -O rather than just -O2 and -O0. Could this be some\ntype of optimizer bug in gcc2/Solaris?\n\nEverything is pointing to indexing.c, from both the initdb failure and\nthe create function failure. But I can't see anything wrong in there,\nand other platforms seem to be OK.\n\nSomeone mentioned that Solaris does not use -O2 by default, and there\nmay be a good reason for this.\n\nThe new code is more streamlined from the megapatch, and perhaps the\noptimizer is now able to do too much optimizing.\n\nI don't want to go casting blame other places, but I think gcc that may\nbe the cause, and if it is, we just need to lower the default\noptimization for those platforms.\n\nLet's try adding Assert checking with the configure --enable-cassert\noption, and compiling with -O rather than -O2 and see what happens.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Tue, 1 Sep 1998 12:19:48 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "> Can we try a simple -O rather than just -O2 and -O0. Could this be \n> some type of optimizer bug in gcc2/Solaris?\n> Everything is pointing to indexing.c, from both the initdb failure and\n> the create function failure. But I can't see anything wrong in there,\n> and other platforms seem to be OK.\n\nUh, no, Linux/i686 is showing trouble too, but not in the initdb stage.\nThe Sparc platforms will be more sensitive to byte alignment problems,\nespecially within C structures, so this may be illustrating a\ncross-platform problem more clearly.\n\nThere is a repeatable indexing and (perhaps) caching problem I see in\nthe regression tests. Annoyingly, the problems get slightly worse at the\nmoment when compiling with -O0.\n\nThere is a fundamental problem lurking somewhere, and there may not be\nmuch point in going beta unless you think that more testers will help to\ntrack down the problem.\n\n - Tom\n",
"msg_date": "Tue, 01 Sep 1998 16:55:05 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "\n\nBruce Momjian wrote:\n\n> > Thomas A. Szybist <[email protected]>\n> > >\n> > > >\n> > > > If I compile backend/catalog with -O2 then the table creation is\n> > > ^^^\n> > > > OK. So it looks like it may be indexing.c, even with Bruce's\n> > > > recent fixes.\n> > >\n> > > Do you mean -O0 here?\n> > >\n> >\n> > Yes, a typo, I used -O0 for this dir.\n>\n> Can we try a simple -O rather than just -O2 and -O0. Could this be some\n> type of optimizer bug in gcc2/Solaris?\n>\n> Everything is pointing to indexing.c, from both the initdb failure and\n> the create function failure. But I can't see anything wrong in there,\n> and other platforms seem to be OK.\n>\n\nBruce,\n\nI do not know if this problem is related in any way, but I have a serious\nproblem on AIX 4.1. I am jumping in here because there is a chance they are\nrelated. Just manifest differently.\n\nIf I add an index to a table I can no longer use the table. In essence,\nthe look up on relname in pg_class fails. If I:\n SELECT * FROM pg_class WHERE relname = 'table_i_just_indexed'\n -- or \\d table_i_just_indexed\nI get no results.\n SELECT * FROM pg_class\nDisplays it perfectly. So does:\n SELECT * FROM pg_class WHERE relname like '%table_i_just_indexed'\nIf I manually correct relname:\n UPDATE pg_class SET relname = 'table_i_just_indexed' WHERE relname like\n'%table_i_just_indexed'\nEverything seems to function normally again.\n\nI can not reproduce on my Linux box. Assertions show nothing. This can't be\ngood.\n\nAndreas, are you having any success?\n\n",
"msg_date": "Tue, 01 Sep 1998 13:33:49 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "> > Can we try a simple -O rather than just -O2 and -O0. Could this be some\n> > type of optimizer bug in gcc2/Solaris?\n> >\n> > Everything is pointing to indexing.c, from both the initdb failure and\n> > the create function failure. But I can't see anything wrong in there,\n> > and other platforms seem to be OK.\n> >\n> \n> Bruce,\n> \n> I do not know if this problem is related in any way, but I have a serious\n> problem on AIX 4.1. I am jumping in here because there is a chance they are\n> related. Just manifest differently.\n> \n> If I add an index to a table I can no longer use the table. In essence,\n> the look up on relname in pg_class fails. If I:\n> SELECT * FROM pg_class WHERE relname = 'table_i_just_indexed'\n> -- or \\d table_i_just_indexed\n> I get no results.\n> SELECT * FROM pg_class\n> Displays it perfectly. So does:\n> SELECT * FROM pg_class WHERE relname like '%table_i_just_indexed'\n> If I manually correct relname:\n> UPDATE pg_class SET relname = 'table_i_just_indexed' WHERE relname like\n> '%table_i_just_indexed'\n> Everything seems to function normally again.\n> \n> I can not reproduce on my Linux box. Assertions show nothing. This can't be\n> good.\n\nWow, this is terribly frustrating. All these problems, and I can't\nreproduce any of them here.\n\nI sure hope they all have one cause, and I hope we find the cause soon.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Tue, 1 Sep 1998 14:40:19 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "> > Can we try a simple -O rather than just -O2 and -O0. Could this be \n> > some type of optimizer bug in gcc2/Solaris?\n> > Everything is pointing to indexing.c, from both the initdb failure and\n> > the create function failure. But I can't see anything wrong in there,\n> > and other platforms seem to be OK.\n> \n> Uh, no, Linux/i686 is showing trouble too, but not in the initdb stage.\n> The Sparc platforms will be more sensitive to byte alignment problems,\n> especially within C structures, so this may be illustrating a\n> cross-platform problem more clearly.\n> \n> There is a repeatable indexing and (perhaps) caching problem I see in\n> the regression tests. Annoyingly, the problems get slightly worse at the\n> moment when compiling with -O0.\n> \n> There is a fundamental problem lurking somewhere, and there may not be\n> much point in going beta unless you think that more testers will help to\n> track down the problem.\n\nOK, let me send you my regression output, and perhaps you can see the\nproblem in there so I can debug it.\n\nWe have a configure problem too, that Tatsuo pointed out. I removed my\nconfig.cache, and tried to run configure, and got this. I added 'set\n-x' to help.\n\n\n+ pwd\n+ test -z /usr/ucb:/sbin:/usr/sbin:/bin:/usr/bin:/usr/contrib/bin:/usr/X11/bin:/usr/local/postgres/bin:/usr/local/bin:/usr/local/sbin:.:/usr/local/sbin:.:/usr/local/src/pgsql/pgsql/src\n+ test -f /usr/ucb /sbin /usr/sbin /bin /usr/bin /usr/contrib/bin /usr/X11/bin /usr/local/postgres/bin /usr/local/bin /usr/local/sbin . /usr/local/sbin . /usr/local/src/pgsql/pgsql/src/install-sh\ntest: syntax error: Undefined error: 0\n+ IFS= \n\n+ INSTALL=\n+ test -n \n+ echo no\nno\n+ test -n \n+ test -n \n+ INSTALL=NONE\n+ test NONE = NONE\n+ echo - No Install Script found - aborting.\n- No Install Script found - aborting.\n+ exit 0\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Tue, 1 Sep 1998 21:32:33 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "> OK, let me send you my regression output, and perhaps you can see the\n> problem in there so I can debug it.\n\nAs far as the beta, I am totally confused about the problems we are\nhaving, and I don't know what to suggest. Perhaps you can see the\nproblems in my regression output.\n\n\n> \n> We have a configure problem too, that Tatsuo pointed out. I removed my\n> config.cache, and tried to run configure, and got this. I added 'set\n> -x' to help.\n> \n\nOK, I have fixed the configure problem. The path has to have\ndirectories separated by space, not colons. Works now.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Tue, 1 Sep 1998 22:50:23 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "> > Can we try a simple -O rather than just -O2 and -O0. Could this be \n> > some type of optimizer bug in gcc2/Solaris?\n> > Everything is pointing to indexing.c, from both the initdb failure and\n> > the create function failure. But I can't see anything wrong in there,\n> > and other platforms seem to be OK.\n> \n> Uh, no, Linux/i686 is showing trouble too, but not in the initdb stage.\n> The Sparc platforms will be more sensitive to byte alignment problems,\n> especially within C structures, so this may be illustrating a\n> cross-platform problem more clearly.\n> \n> There is a repeatable indexing and (perhaps) caching problem I see in\n> the regression tests. Annoyingly, the problems get slightly worse at the\n> moment when compiling with -O0.\n> \n\nOK, here is my regression output. Do you see anything strange in there?\n\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n\n====== int2 ======\n--- expected/int2.out\tSun Aug 23 11:09:37 1998\n+++ results/int2.out\tTue Sep 1 23:40:10 1998\n@@ -7,7 +7,7 @@\n QUERY: INSERT INTO INT2_TBL(f1) VALUES ('32767');\n QUERY: INSERT INTO INT2_TBL(f1) VALUES ('-32767');\n QUERY: INSERT INTO INT2_TBL(f1) VALUES ('100000');\n-ERROR: pg_atoi: error reading \"100000\": Math result not representable\n+ERROR: pg_atoi: error reading \"100000\": Result too large\n QUERY: INSERT INTO INT2_TBL(f1) VALUES ('asdf');\n ERROR: pg_atoi: error in \"asdf\": can't parse \"asdf\"\n QUERY: SELECT '' AS five, INT2_TBL.*;\n====== int4 ======\n--- expected/int4.out\tSun Aug 23 11:09:37 1998\n+++ results/int4.out\tTue Sep 1 23:40:10 1998\n@@ -7,7 +7,7 @@\n QUERY: INSERT INTO INT4_TBL(f1) VALUES ('2147483647');\n QUERY: INSERT INTO INT4_TBL(f1) VALUES ('-2147483647');\n QUERY: INSERT INTO INT4_TBL(f1) VALUES ('1000000000000');\n-ERROR: pg_atoi: error reading \"1000000000000\": Math result not representable\n+ERROR: pg_atoi: error reading \"1000000000000\": Result too large\n QUERY: INSERT INTO INT4_TBL(f1) VALUES ('asdf');\n ERROR: pg_atoi: error in \"asdf\": can't parse \"asdf\"\n QUERY: SELECT '' AS five, INT4_TBL.*;\n====== int8 ======\n--- expected/int8.out\tSun Aug 23 11:09:38 1998\n+++ results/int8.out\tTue Sep 1 23:40:10 1998\n@@ -6,110 +6,110 @@\n QUERY: INSERT INTO INT8_TBL VALUES('4567890123456789','-4567890123456789');\n QUERY: SELECT * FROM INT8_TBL;\n q1| q2\n-----------------+-----------------\n+----------+-----------\n 123| 456\n- 123| 4567890123456789\n-4567890123456789| 123\n-4567890123456789| 4567890123456789\n-4567890123456789|-4567890123456789\n+ 123| 2147483647\n+2147483647| 123\n+2147483647| 2147483647\n+2147483647|-2147483648\n (5 rows)\n \n QUERY: SELECT '' AS five, q1 AS plus, -q1 AS minus FROM INT8_TBL;\n five| plus| minus\n-----+----------------+-----------------\n+----+----------+-----------\n | 123| -123\n | 123| -123\n- |4567890123456789|-4567890123456789\n- |4567890123456789|-4567890123456789\n- |4567890123456789|-4567890123456789\n+ |2147483647|-2147483647\n+ |2147483647|-2147483647\n+ |2147483647|-2147483647\n (5 rows)\n \n QUERY: SELECT '' AS five, q1, q2, q1 + q2 AS plus FROM INT8_TBL;\n five| q1| q2| plus\n-----+----------------+-----------------+----------------\n+----+----------+-----------+-----------\n | 123| 456| 579\n- | 123| 4567890123456789|4567890123456912\n- |4567890123456789| 123|4567890123456912\n- |4567890123456789| 4567890123456789|9135780246913578\n- |4567890123456789|-4567890123456789| 0\n+ | 123| 2147483647|-2147483526\n+ |2147483647| 123|-2147483526\n+ |2147483647| 2147483647| -2\n+ |2147483647|-2147483648| -1\n (5 rows)\n \n QUERY: SELECT '' AS five, q1, q2, q1 - q2 AS minus FROM INT8_TBL;\n five| q1| q2| minus\n-----+----------------+-----------------+-----------------\n+----+----------+-----------+-----------\n | 123| 456| -333\n- | 123| 4567890123456789|-4567890123456666\n- |4567890123456789| 123| 4567890123456666\n- |4567890123456789| 4567890123456789| 0\n- |4567890123456789|-4567890123456789| 9135780246913578\n+ | 123| 2147483647|-2147483524\n+ |2147483647| 123| 2147483524\n+ |2147483647| 2147483647| 0\n+ |2147483647|-2147483648| -1\n (5 rows)\n \n QUERY: SELECT '' AS three, q1, q2, q1 * q2 AS multiply FROM INT8_TBL\n WHERE q1 < 1000 or (q2 > 0 and q2 < 1000);\n three| q1| q2| multiply\n------+----------------+----------------+------------------\n+-----+----------+----------+----------\n | 123| 456| 56088\n- | 123|4567890123456789|561850485185185047\n- |4567890123456789| 123|561850485185185047\n+ | 123|2147483647|2147483525\n+ |2147483647| 123|2147483525\n (3 rows)\n \n QUERY: SELECT '' AS five, q1, q2, q1 / q2 AS divide FROM INT8_TBL;\n five| q1| q2| divide\n-----+----------------+-----------------+--------------\n+----+----------+-----------+--------\n | 123| 456| 0\n- | 123| 4567890123456789| 0\n- |4567890123456789| 123|37137318076884\n- |4567890123456789| 4567890123456789| 1\n- |4567890123456789|-4567890123456789| -1\n+ | 123| 2147483647| 0\n+ |2147483647| 123|17459216\n+ |2147483647| 2147483647| 1\n+ |2147483647|-2147483648| 0\n (5 rows)\n \n QUERY: SELECT '' AS five, q1, float8(q1) FROM INT8_TBL;\n five| q1|float8 \n-----+----------------+--------------------\n+----+----------+----------\n | 123|123 \n | 123|123 \n- |4567890123456789|4.56789012345679e+15\n- |4567890123456789|4.56789012345679e+15\n- |4567890123456789|4.56789012345679e+15\n+ |2147483647|2147483647\n+ |2147483647|2147483647\n+ |2147483647|2147483647\n (5 rows)\n \n QUERY: SELECT '' AS five, q2, float8(q2) FROM INT8_TBL;\n five| q2|float8 \n-----+-----------------+---------------------\n+----+-----------+-----------\n | 456|456 \n- | 4567890123456789|4.56789012345679e+15 \n+ | 2147483647| 2147483647\n | 123|123 \n- | 4567890123456789|4.56789012345679e+15 \n- |-4567890123456789|-4.56789012345679e+15\n+ | 2147483647| 2147483647\n+ |-2147483648|-2147483648\n (5 rows)\n \n QUERY: SELECT '' AS five, q1, int8(float8(q1)) AS \"two coercions\" FROM INT8_TBL;\n five| q1| two coercions\n-----+----------------+----------------\n+----+----------+-------------\n | 123| 123\n | 123| 123\n- |4567890123456789|4567890123456789\n- |4567890123456789|4567890123456789\n- |4567890123456789|4567890123456789\n+ |2147483647| 2147483647\n+ |2147483647| 2147483647\n+ |2147483647| 2147483647\n (5 rows)\n \n QUERY: SELECT '' AS five, 2 * q1 AS \"twice int4\" FROM INT8_TBL;\n five| twice int4\n-----+----------------\n+----+----------\n | 246\n | 246\n- |9135780246913578\n- |9135780246913578\n- |9135780246913578\n+ | -2\n+ | -2\n+ | -2\n (5 rows)\n \n QUERY: SELECT '' AS five, q1 * 2 AS \"twice int4\" FROM INT8_TBL;\n five| twice int4\n-----+----------------\n+----+----------\n | 246\n | 246\n- |9135780246913578\n- |9135780246913578\n- |9135780246913578\n+ | -2\n+ | -2\n+ | -2\n (5 rows)\n \n====== float8 ======\n--- expected/float8.out\tSun Aug 23 11:09:31 1998\n+++ results/float8.out\tTue Sep 1 23:40:11 1998\n@@ -176,7 +176,7 @@\n ----+--------------------+--------------------\n |0 |0 \n |1004.3 |10.014312837827 \n- |-34.84 |-3.26607421344208 \n+ |-34.84 |3.26607421344208 \n |1.2345678901234e+200|4.97933859234765e+66\n |1.2345678901234e-200|2.3112042409018e-67 \n (5 rows)\n@@ -197,7 +197,7 @@\n QUERY: SELECT '' AS bad, f.f1 * '1e200' from FLOAT8_TBL f;\n ERROR: Bad float8 input format -- overflow\n QUERY: SELECT '' AS bad, f.f1 ^ '1e200' from FLOAT8_TBL f;\n-ERROR: pow() result is out of range\n+ERROR: Bad float8 input format -- overflow\n QUERY: SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 = '0.0' ;\n ERROR: can't take log of zero\n QUERY: SELECT '' AS bad, (; (f.f1)) from FLOAT8_TBL f where f.f1 < '0.0' ;\n====== geometry ======\n--- expected/geometry.out\tSun Aug 23 11:09:34 1998\n+++ results/geometry.out\tTue Sep 1 23:40:14 1998\n@@ -99,7 +99,7 @@\n |(5.1,34.5)|[(1,2),(3,4)] |(3,4) \n |(-5,-12) |[(1,2),(3,4)] |(1,2) \n |(10,10) |[(1,2),(3,4)] |(3,4) \n- |(0,0) |[(0,0),(6,6)] |(-0,0) \n+ |(0,0) |[(0,0),(6,6)] |(0,0) \n |(-10,0) |[(0,0),(6,6)] |(0,0) \n |(-3,4) |[(0,0),(6,6)] |(0.5,0.5) \n |(5.1,34.5)|[(0,0),(6,6)] |(6,6) \n@@ -112,7 +112,7 @@\n |(-5,-12) |[(10,-10),(-3,-4)] |(-1.60487804878049,-4.64390243902439)\n |(10,10) |[(10,-10),(-3,-4)] |(2.39024390243902,-6.48780487804878) \n |(0,0) |[(-1000000,200),(300000,-40)]|(0.0028402365895872,15.384614860264) \n- |(-10,0) |[(-1000000,200),(300000,-40)]|(-9.99715942258202,15.3864610140473) \n+ |(-10,0) |[(-1000000,200),(300000,-40)]|(-9.99715942258202,15.3864610140472) \n |(-3,4) |[(-1000000,200),(300000,-40)]|(-2.99789812267519,15.3851688427303) \n |(5.1,34.5)|[(-1000000,200),(300000,-40)]|(5.09647083221496,15.3836744976925) \n |(-5,-12) |[(-1000000,200),(300000,-40)]|(-4.99494420845634,15.3855375281616) \n@@ -129,11 +129,11 @@\n six|box \n ---+--------------------------------------------------------------------------\n |(2.12132034355964,2.12132034355964),(-2.12132034355964,-2.12132034355964) \n- |(71.7106781186548,72.7106781186548),(-69.7106781186548,-68.7106781186548) \n- |(4.53553390593274,6.53553390593274),(-2.53553390593274,-0.535533905932738)\n- |(3.12132034355964,4.12132034355964),(-1.12132034355964,-0.121320343559643)\n+ |(71.7106781186547,72.7106781186547),(-69.7106781186547,-68.7106781186547) \n+ |(4.53553390593274,6.53553390593274),(-2.53553390593274,-0.535533905932737)\n+ |(3.12132034355964,4.12132034355964),(-1.12132034355964,-0.121320343559642)\n |(107.071067811865,207.071067811865),(92.9289321881345,192.928932188135) \n- |(170.710678118655,70.7106781186548),(29.2893218813452,-70.7106781186548) \n+ |(170.710678118655,70.7106781186547),(29.2893218813453,-70.7106781186547) \n (6 rows)\n \n QUERY: SELECT '' AS twentyfour, b.f1 + p.f1 AS translation\n@@ -204,11 +204,11 @@\n |(0,0),(0,0) \n |(0,0),(0,0) \n |(0,0),(0,0) \n- |(-0,0),(-20,-20) \n+ |(0,0),(-20,-20) \n |(-10,-10),(-30,-30) \n |(-25,-25),(-25,-35) \n |(-30,-30),(-30,-30) \n- |(-0,2),(-14,0) \n+ |(0,2),(-14,0) \n |(-7,3),(-21,1) \n |(-17.5,2.5),(-21.5,-0.5) \n |(-21,3),(-21,3) \n@@ -216,7 +216,7 @@\n |(-29.4,118.8),(-88.2,39.6) \n |(-73.5,104.1),(-108,99) \n |(-88.2,118.8),(-88.2,118.8)\n- |(14,-0),(0,-34) \n+ |(14,0),(0,-34) \n |(21,-17),(7,-51) \n |(29.5,-42.5),(17.5,-47.5) \n |(21,-51),(21,-51) \n@@ -231,11 +231,11 @@\n WHERE (p.f1 <-> '(0,0)'::point) >= 1;\n twenty|rotation \n ------+---------------------------------------------------------------------------------\n- |(0,-0),(-0.2,-0.2) \n+ |(0,0),(-0.2,-0.2) \n |(-0.1,-0.1),(-0.3,-0.3) \n |(-0.25,-0.25),(-0.25,-0.35) \n |(-0.3,-0.3),(-0.3,-0.3) \n- |(0.08,-0),(0,-0.56) \n+ |(0.08,0),(0,-0.56) \n |(0.12,-0.28),(0.04,-0.84) \n |(0.26,-0.7),(0.1,-0.82) \n |(0.12,-0.84),(0.12,-0.84) \n@@ -243,7 +243,7 @@\n |(0.0976764836465887,-0.0241724631246608),(0.0325588278821962,-0.0725173893739825)\n |(0.109762715208919,-0.0562379754328844),(0.0813970697054906,-0.0604311578116521) \n |(0.0976764836465887,-0.0725173893739825),(0.0976764836465887,-0.0725173893739825)\n- |(-0,0.0828402366863905),(-0.201183431952663,0) \n+ |(0,0.0828402366863905),(-0.201183431952663,0) \n |(-0.100591715976331,0.124260355029586),(-0.301775147928994,0.0414201183431953) \n |(-0.251479289940828,0.103550295857988),(-0.322485207100592,0.0739644970414201) \n |(-0.301775147928994,0.124260355029586),(-0.301775147928994,0.124260355029586) \n@@ -409,25 +409,25 @@\n QUERY: SELECT '' AS six, polygon(f1)\n FROM CIRCLE_TBL;\n six|polygon \n----+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n- |((-3,0),(-2.59807621135332,1.5),(-1.5,2.59807621135332),(-1.83690953073357e-16,3),(1.5,2.59807621135332),(2.59807621135332,1.5),(3,3.67381906146713e-16),(2.59807621135332,-1.5),(1.5,-2.59807621135332),(5.5107285922007e-16,-3),(-1.5,-2.59807621135332),(-2.59807621135332,-1.5))\n- |((-99,2),(-85.6025403784439,52),(-49,88.6025403784439),(0.999999999999994,102),(51,88.6025403784439),(87.6025403784439,52),(101,2.00000000000001),(87.6025403784439,-48),(51,-84.6025403784438),(1.00000000000002,-98),(-49,-84.6025403784439),(-85.6025403784438,-48)) \n- |((-4,3),(-3.33012701892219,5.5),(-1.5,7.33012701892219),(1,8),(3.5,7.33012701892219),(5.33012701892219,5.5),(6,3),(5.33012701892219,0.500000000000001),(3.5,-1.33012701892219),(1,-2),(-1.5,-1.33012701892219),(-3.33012701892219,0.499999999999998)) \n- |((-2,2),(-1.59807621135332,3.5),(-0.5,4.59807621135332),(1,5),(2.5,4.59807621135332),(3.59807621135332,3.5),(4,2),(3.59807621135332,0.500000000000001),(2.5,-0.598076211353315),(1,-1),(-0.5,-0.598076211353316),(-1.59807621135332,0.499999999999999)) \n- |((90,200),(91.3397459621556,205),(95,208.660254037844),(100,210),(105,208.660254037844),(108.660254037844,205),(110,200),(108.660254037844,195),(105,191.339745962156),(100,190),(95,191.339745962156),(91.3397459621556,195)) \n- |((0,0),(13.3974596215561,50),(50,86.6025403784439),(100,100),(150,86.6025403784439),(186.602540378444,50),(200,1.22460635382238e-14),(186.602540378444,-50),(150,-86.6025403784438),(100,-100),(50,-86.6025403784439),(13.3974596215562,-50)) \n+---+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n+ |((-3,0),(-2.59807621135076,1.50000000000442),(-1.49999999999116,2.59807621135842),(1.53104195987908e-11,3),(1.50000000001768,2.59807621134311),(2.59807621136607,1.4999999999779),(3,-3.06208391975815e-11),(2.59807621133545,-1.50000000003094),(1.49999999996464,-2.59807621137373),(-4.59312587963723e-11,-3),(-1.5000000000442,-2.5980762113278),(-2.59807621138139,-1.49999999995138))\n+ |((-99,2),(-85.6025403783588,52.0000000001473),(-48.9999999997054,88.602540378614),(1.00000000051035,102),(51.0000000005893,88.6025403781036),(87.6025403788692,51.9999999992634),(101,1.99999999897931),(87.6025403778485,-48.0000000010313),(50.9999999988214,-84.6025403791243),(0.999999998468958,-98),(-49.0000000014732,-84.6025403775933),(-85.6025403793795,-47.9999999983794)) \n+ |((-4,3),(-3.33012701891794,5.50000000000737),(-1.49999999998527,7.3301270189307),(1.00000000002552,8),(3.50000000002946,7.33012701890518),(5.33012701894346,5.49999999996317),(6,2.99999999994897),(5.33012701889242,0.499999999948436),(3.49999999994107,-1.33012701895622),(0.999999999923448,-2),(-1.50000000007366,-1.33012701887966),(-3.33012701896897,0.500000000081029)) \n+ |((-2,2),(-1.59807621135076,3.50000000000442),(-0.499999999991161,4.59807621135842),(1.00000000001531,5),(2.50000000001768,4.59807621134311),(3.59807621136607,3.4999999999779),(4,1.99999999996938),(3.59807621133545,0.499999999969062),(2.49999999996464,-0.59807621137373),(0.999999999954069,-1),(-0.500000000044197,-0.598076211327799),(-1.59807621138139,0.500000000048617)) \n+ |((90,200),(91.3397459621641,205.000000000015),(95.0000000000295,208.660254037861),(100.000000000051,210),(105.000000000059,208.66025403781),(108.660254037887,204.999999999926),(110,199.999999999898),(108.660254037785,194.999999999897),(104.999999999882,191.339745962088),(99.9999999998469,190),(94.9999999998527,191.339745962241),(91.3397459620621,195.000000000162)) \n+ |((0,0),(13.3974596216412,50.0000000001473),(50.0000000002946,86.602540378614),(100.00000000051,100),(150.000000000589,86.6025403781036),(186.602540378869,49.9999999992634),(200,-1.02069463991938e-09),(186.602540377848,-50.0000000010313),(149.999999998821,-86.6025403791243),(99.999999998469,-100),(49.9999999985268,-86.6025403775933),(13.3974596206205,-49.9999999983794)) \n (6 rows)\n \n QUERY: SELECT '' AS six, polygon(8, f1)\n FROM CIRCLE_TBL;\n six|polygon \n----+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n- |((-3,0),(-2.12132034355964,2.12132034355964),(-1.83690953073357e-16,3),(2.12132034355964,2.12132034355964),(3,3.67381906146713e-16),(2.12132034355964,-2.12132034355964),(5.5107285922007e-16,-3),(-2.12132034355964,-2.12132034355964))\n- |((-99,2),(-69.7106781186548,72.7106781186548),(0.999999999999994,102),(71.7106781186547,72.7106781186548),(101,2.00000000000001),(71.7106781186548,-68.7106781186547),(1.00000000000002,-98),(-69.7106781186547,-68.7106781186548)) \n- |((-4,3),(-2.53553390593274,6.53553390593274),(1,8),(4.53553390593274,6.53553390593274),(6,3),(4.53553390593274,-0.535533905932737),(1,-2),(-2.53553390593274,-0.535533905932738)) \n- |((-2,2),(-1.12132034355964,4.12132034355964),(1,5),(3.12132034355964,4.12132034355964),(4,2),(3.12132034355964,-0.121320343559642),(1,-1),(-1.12132034355964,-0.121320343559643)) \n- |((90,200),(92.9289321881345,207.071067811865),(100,210),(107.071067811865,207.071067811865),(110,200),(107.071067811865,192.928932188135),(100,190),(92.9289321881345,192.928932188135)) \n- |((0,0),(29.2893218813452,70.7106781186548),(100,100),(170.710678118655,70.7106781186548),(200,1.22460635382238e-14),(170.710678118655,-70.7106781186547),(100,-100),(29.2893218813453,-70.7106781186548)) \n+---+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n+ |((-3,0),(-2.12132034355423,2.12132034356506),(1.53104195987908e-11,3),(2.12132034357588,2.1213203435434),(3,-3.06208391975815e-11),(2.12132034353258,-2.12132034358671),(-4.59312587963723e-11,-3),(-2.12132034359753,-2.12132034352175))\n+ |((-99,2),(-69.7106781184743,72.7106781188352),(1.00000000051035,102),(71.7106781191961,72.7106781181134),(101,1.99999999897931),(71.7106781177526,-68.7106781195569),(0.999999998468958,-98),(-69.7106781199178,-68.7106781173917)) \n+ |((-4,3),(-2.53553390592372,6.53553390594176),(1.00000000002552,8),(4.5355339059598,6.53553390590567),(6,2.99999999994897),(4.53553390588763,-0.535533905977846),(0.999999999923448,-2),(-2.53553390599589,-0.535533905869586)) \n+ |((-2,2),(-1.12132034355423,4.12132034356506),(1.00000000001531,5),(3.12132034357588,4.1213203435434),(4,1.99999999996938),(3.12132034353258,-0.121320343586708),(0.999999999954069,-1),(-1.12132034359753,-0.121320343521751)) \n+ |((90,200),(92.9289321881526,207.071067811884),(100.000000000051,210),(107.07106781192,207.071067811811),(110,199.999999999898),(107.071067811775,192.928932188044),(99.9999999998469,190),(92.9289321880082,192.928932188261)) \n+ |((0,0),(29.2893218815257,70.7106781188352),(100.00000000051,100),(170.710678119196,70.7106781181134),(200,-1.02069463991938e-09),(170.710678117753,-70.7106781195569),(99.999999998469,-100),(29.2893218800822,-70.7106781173917)) \n (6 rows)\n \n QUERY: SELECT '' AS six, circle(f1, 50.0)\n@@ -466,11 +466,11 @@\n WHERE (p1.f1 <-> c1.f1) > 0\n ORDER BY distance, circle, point using <<;\n twentyfour|circle |point | distance\n-----------+--------------+----------+-----------------\n- |<(100,0),100> |(5.1,34.5)|0.976531926977964\n+----------+--------------+----------+----------------\n+ |<(100,0),100> |(5.1,34.5)|0.97653192697797\n |<(1,2),3> |(-3,4) | 1.47213595499958\n |<(0,0),3> |(-3,4) | 2\n- |<(100,0),100> |(-3,4) | 3.07764064044151\n+ |<(100,0),100> |(-3,4) |3.07764064044152\n |<(100,0),100> |(-5,-12) | 5.68348972285122\n |<(1,3),5> |(-10,0) | 6.40175425099138\n |<(1,3),5> |(10,10) | 6.40175425099138\n@@ -482,7 +482,7 @@\n |<(0,0),3> |(10,10) | 11.142135623731\n |<(1,3),5> |(-5,-12) | 11.1554944214035\n |<(1,2),3> |(-5,-12) | 12.2315462117278\n- |<(1,3),5> |(5.1,34.5)| 26.7657047773224\n+ |<(1,3),5> |(5.1,34.5)|26.7657047773223\n |<(1,2),3> |(5.1,34.5)| 29.757594539282\n |<(0,0),3> |(5.1,34.5)| 31.8749193547455\n |<(100,200),10>|(5.1,34.5)| 180.778038568384\n====== tinterval ======\n--- expected/tinterval.out\tSun Aug 23 11:09:49 1998\n+++ results/tinterval.out\tTue Sep 1 23:40:17 1998\n@@ -110,20 +110,20 @@\n ORDER BY interval1, interval2;\n fourteen|interval1 |interval2 \n --------+---------------------------------------------------------------+---------------------------------------------------------------\n- |[\"-infinity\" \"infinity\"] |[\"Sat May 10 23:59:12 1947 PST\" \"Sun Jan 14 03:14:21 1973 PST\"]\n- |[\"-infinity\" \"infinity\"] |[\"Sun Sep 04 23:59:12 1983 PDT\" \"Tue Oct 04 23:59:12 1983 PDT\"]\n |[\"-infinity\" \"infinity\"] |[\"epoch\" \"Mon May 01 00:30:30 1995 PDT\"] \n+ |[\"-infinity\" \"infinity\"] |[\"Sun Sep 04 23:59:12 1983 PDT\" \"Tue Oct 04 23:59:12 1983 PDT\"]\n |[\"-infinity\" \"infinity\"] |[\"Thu Feb 15 12:15:03 1990 PST\" \"current\"] \n- |[\"Sat May 10 23:59:12 1947 PST\" \"Sun Jan 14 03:14:21 1973 PST\"]|[\"-infinity\" \"infinity\"] \n- |[\"epoch\" \"Mon May 01 00:30:30 1995 PDT\"] |[\"-infinity\" \"infinity\"] \n- |[\"Sun Sep 04 23:59:12 1983 PDT\" \"Tue Oct 04 23:59:12 1983 PDT\"]|[\"-infinity\" \"infinity\"] \n+ |[\"-infinity\" \"infinity\"] |[\"Sat May 10 23:59:12 1947 PST\" \"Sun Jan 14 03:14:21 1973 PST\"]\n |[\"Thu Feb 15 12:15:03 1990 PST\" \"current\"] |[\"-infinity\" \"infinity\"] \n+ |[\"epoch\" \"Mon May 01 00:30:30 1995 PDT\"] |[\"Thu Feb 15 12:15:03 1990 PST\" \"current\"] \n+ |[\"epoch\" \"Mon May 01 00:30:30 1995 PDT\"] |[\"-infinity\" \"infinity\"] \n+ |[\"Sat May 10 23:59:12 1947 PST\" \"Sun Jan 14 03:14:21 1973 PST\"]|[\"-infinity\" \"infinity\"] \n |[\"epoch\" \"Mon May 01 00:30:30 1995 PDT\"] |[\"Sat May 10 23:59:12 1947 PST\" \"Sun Jan 14 03:14:21 1973 PST\"]\n+ |[\"Thu Feb 15 12:15:03 1990 PST\" \"current\"] |[\"epoch\" \"Mon May 01 00:30:30 1995 PDT\"] \n |[\"Sat May 10 23:59:12 1947 PST\" \"Sun Jan 14 03:14:21 1973 PST\"]|[\"epoch\" \"Mon May 01 00:30:30 1995 PDT\"] \n |[\"epoch\" \"Mon May 01 00:30:30 1995 PDT\"] |[\"Sun Sep 04 23:59:12 1983 PDT\" \"Tue Oct 04 23:59:12 1983 PDT\"]\n- |[\"epoch\" \"Mon May 01 00:30:30 1995 PDT\"] |[\"Thu Feb 15 12:15:03 1990 PST\" \"current\"] \n |[\"Sun Sep 04 23:59:12 1983 PDT\" \"Tue Oct 04 23:59:12 1983 PDT\"]|[\"epoch\" \"Mon May 01 00:30:30 1995 PDT\"] \n- |[\"Thu Feb 15 12:15:03 1990 PST\" \"current\"] |[\"epoch\" \"Mon May 01 00:30:30 1995 PDT\"] \n+ |[\"Sun Sep 04 23:59:12 1983 PDT\" \"Tue Oct 04 23:59:12 1983 PDT\"]|[\"-infinity\" \"infinity\"] \n (14 rows)\n \n QUERY: SELECT '' AS five, t1.f1\n====== select_having ======\n--- expected/select_having.out\tSat Aug 29 00:10:03 1998\n+++ results/select_having.out\tTue Sep 1 23:41:51 1998\n@@ -11,27 +11,6 @@\n QUERY: INSERT INTO test_having VALUES (9, 4, 'CCCC', 'j');\n QUERY: SELECT max(a) FROM test_having\n \tGROUP BY lower(c) HAVING count(*) > 2 OR min(b) = 3;\n-max\n----\n- 5\n- 9\n-(2 rows)\n-\n-QUERY: SELECT lower(c), count(c) FROM test_having\n-\tGROUP BY lower(c) HAVING count(*) > 2 OR min(a) = max(a);\n-lower |count\n---------+-----\n-bbbb | 3\n-cccc | 4\n-xxxx | 1\n-(3 rows)\n-\n-QUERY: SELECT c, max(a) FROM test_having\n-\tGROUP BY c HAVING count(*) > 2 OR min(a) = max(a);\n-c |max\n---------+---\n-XXXX | 0\n-bbbb | 5\n-(2 rows)\n-\n-QUERY: DROP TABLE test_having;\n+pqReadData() -- backend closed the channel unexpectedly.\n+\tThis probably means the backend terminated abnormally before or while processing the request.\n+We have lost the connection to the backend, so further processing is impossible. Terminating.\n====== misc ======\n--- expected/misc.out\tTue Sep 1 23:40:05 1998\n+++ results/misc.out\tTue Sep 1 23:42:04 1998\n@@ -507,11 +507,12 @@\n subselect_tbl \n tenk1 \n tenk2 \n+test_having \n text_tbl \n timespan_tbl \n tinterval_tbl \n toyemp \n varchar_tbl \n xacttest \n-(71 rows)\n+(72 rows)\n \n====== run_ruletest ======\n--- expected/run_ruletest.out\tSun Aug 23 11:09:42 1998\n+++ results/run_ruletest.out\tTue Sep 1 23:42:25 1998\n@@ -254,12 +254,12 @@\n QUERY: delete from rtest_emp where ename = 'gates';\n QUERY: select * from rtest_emplog;\n ename |who |action |newsal |oldsal \n---------------------+-----+----------+----------+----------\n-wiech |pgsql|hired |$5,000.00 |$0.00 \n-gates |pgsql|hired |$80,000.00|$0.00 \n-wieck |pgsql|honored |$6,000.00 |$5,000.00 \n-wieck |pgsql|honored |$7,000.00 |$6,000.00 \n-gates |pgsql|fired |$0.00 |$80,000.00\n+--------------------+--------+----------+----------+----------\n+wiech |postgres|hired |$5,000.00 |$0.00 \n+gates |postgres|hired |$80,000.00|$0.00 \n+wieck |postgres|honored |$6,000.00 |$5,000.00 \n+wieck |postgres|honored |$7,000.00 |$6,000.00 \n+gates |postgres|fired |$0.00 |$80,000.00\n (5 rows)\n \n QUERY: insert into rtest_empmass values ('meyer', '4000.00');\n@@ -268,53 +268,53 @@\n QUERY: insert into rtest_emp select * from rtest_empmass;\n QUERY: select * from rtest_emplog;\n ename |who |action |newsal |oldsal \n---------------------+-----+----------+----------+----------\n-wiech |pgsql|hired |$5,000.00 |$0.00 \n-gates |pgsql|hired |$80,000.00|$0.00 \n-wieck |pgsql|honored |$6,000.00 |$5,000.00 \n-wieck |pgsql|honored |$7,000.00 |$6,000.00 \n-gates |pgsql|fired |$0.00 |$80,000.00\n-meyer |pgsql|hired |$4,000.00 |$0.00 \n-maier |pgsql|hired |$5,000.00 |$0.00 \n-mayr |pgsql|hired |$6,000.00 |$0.00 \n+--------------------+--------+----------+----------+----------\n+wiech |postgres|hired |$5,000.00 |$0.00 \n+gates |postgres|hired |$80,000.00|$0.00 \n+wieck |postgres|honored |$6,000.00 |$5,000.00 \n+wieck |postgres|honored |$7,000.00 |$6,000.00 \n+gates |postgres|fired |$0.00 |$80,000.00\n+meyer |postgres|hired |$4,000.00 |$0.00 \n+maier |postgres|hired |$5,000.00 |$0.00 \n+mayr |postgres|hired |$6,000.00 |$0.00 \n (8 rows)\n \n QUERY: update rtest_empmass set salary = salary + '1000.00';\n QUERY: update rtest_emp set salary = rtest_empmass.salary where ename = rtest_empmass.ename;\n QUERY: select * from rtest_emplog;\n ename |who |action |newsal |oldsal \n---------------------+-----+----------+----------+----------\n-wiech |pgsql|hired |$5,000.00 |$0.00 \n-gates |pgsql|hired |$80,000.00|$0.00 \n-wieck |pgsql|honored |$6,000.00 |$5,000.00 \n-wieck |pgsql|honored |$7,000.00 |$6,000.00 \n-gates |pgsql|fired |$0.00 |$80,000.00\n-meyer |pgsql|hired |$4,000.00 |$0.00 \n-maier |pgsql|hired |$5,000.00 |$0.00 \n-mayr |pgsql|hired |$6,000.00 |$0.00 \n-maier |pgsql|honored |$6,000.00 |$5,000.00 \n-mayr |pgsql|honored |$7,000.00 |$6,000.00 \n-meyer |pgsql|honored |$5,000.00 |$4,000.00 \n+--------------------+--------+----------+----------+----------\n+wiech |postgres|hired |$5,000.00 |$0.00 \n+gates |postgres|hired |$80,000.00|$0.00 \n+wieck |postgres|honored |$6,000.00 |$5,000.00 \n+wieck |postgres|honored |$7,000.00 |$6,000.00 \n+gates |postgres|fired |$0.00 |$80,000.00\n+meyer |postgres|hired |$4,000.00 |$0.00 \n+maier |postgres|hired |$5,000.00 |$0.00 \n+mayr |postgres|hired |$6,000.00 |$0.00 \n+maier |postgres|honored |$6,000.00 |$5,000.00 \n+mayr |postgres|honored |$7,000.00 |$6,000.00 \n+meyer |postgres|honored |$5,000.00 |$4,000.00 \n (11 rows)\n \n QUERY: delete from rtest_emp where ename = rtest_empmass.ename;\n QUERY: select * from rtest_emplog;\n ename |who |action |newsal |oldsal \n---------------------+-----+----------+----------+----------\n-wiech |pgsql|hired |$5,000.00 |$0.00 \n-gates |pgsql|hired |$80,000.00|$0.00 \n-wieck |pgsql|honored |$6,000.00 |$5,000.00 \n-wieck |pgsql|honored |$7,000.00 |$6,000.00 \n-gates |pgsql|fired |$0.00 |$80,000.00\n-meyer |pgsql|hired |$4,000.00 |$0.00 \n-maier |pgsql|hired |$5,000.00 |$0.00 \n-mayr |pgsql|hired |$6,000.00 |$0.00 \n-maier |pgsql|honored |$6,000.00 |$5,000.00 \n-mayr |pgsql|honored |$7,000.00 |$6,000.00 \n-meyer |pgsql|honored |$5,000.00 |$4,000.00 \n-maier |pgsql|fired |$0.00 |$6,000.00 \n-mayr |pgsql|fired |$0.00 |$7,000.00 \n-meyer |pgsql|fired |$0.00 |$5,000.00 \n+--------------------+--------+----------+----------+----------\n+wiech |postgres|hired |$5,000.00 |$0.00 \n+gates |postgres|hired |$80,000.00|$0.00 \n+wieck |postgres|honored |$6,000.00 |$5,000.00 \n+wieck |postgres|honored |$7,000.00 |$6,000.00 \n+gates |postgres|fired |$0.00 |$80,000.00\n+meyer |postgres|hired |$4,000.00 |$0.00 \n+maier |postgres|hired |$5,000.00 |$0.00 \n+mayr |postgres|hired |$6,000.00 |$0.00 \n+maier |postgres|honored |$6,000.00 |$5,000.00 \n+mayr |postgres|honored |$7,000.00 |$6,000.00 \n+meyer |postgres|honored |$5,000.00 |$4,000.00 \n+maier |postgres|fired |$0.00 |$6,000.00 \n+mayr |postgres|fired |$0.00 |$7,000.00 \n+meyer |postgres|fired |$0.00 |$5,000.00 \n (14 rows)\n \n QUERY: insert into rtest_t4 values (1, 'Record should go to rtest_t4');",
"msg_date": "Tue, 1 Sep 1998 23:43:23 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "> > Uh, no, Linux/i686 is showing trouble too, but not in the initdb \n> > stage. The Sparc platforms will be more sensitive to byte alignment \n> > problems, especially within C structures, so this may be \n> > illustrating a cross-platform problem more clearly.\n> > There is a repeatable indexing and (perhaps) caching problem I see \n> > in the regression tests. Annoyingly, the problems get slightly worse \n> > at the moment when compiling with -O0.\n> OK, here is my regression output. Do you see anything strange in \n> there?\n\nWell, yes, just not as strange as my tests :) You don't have int8\nenabled, and if your compiler and libc allow it I'd like to get that\ngoing. But that isn't a problem.\n\nYou have a core dump from the \"having\" test. Is that a known problem\nwith someone working on a solution? The test worked on my ~month-old\ndevelopment tree (I could probably figure out the vintage of that tree\nto more precision if it would be helpful), so something has happened in\nthe meantime.\n\nI suspect that (possibly) more than one thing is going on, since there\nwere some changes directly related to removing the oddball OID types as\nwell as perhaps cleanup changes made while traversing the code.\nSomething may have crept in there.\n\nIf these tests are the only ones showing problems on your machine, then\nconsider yourself lucky. I've got several more failures, including the\none where I can't create indices on a table until after terminating and\nrestarting the session. The Sparc contingent sees more problems than I,\nbut they are on a Risc machine so will see alignment problems if they\nare present.\n\n - Tom\n\n> ====== int8 ======\n> --- expected/int8.out Sun Aug 23 11:09:38 1998\n> +++ results/int8.out Tue Sep 1 23:40:10 1998\n> @@ -6,110 +6,110 @@\n> QUERY: INSERT INTO INT8_TBL VALUES('4567890123456789','-4567890123456789');\n> QUERY: SELECT * FROM INT8_TBL;\n> q1| q2\n> -----------------+-----------------\n> +----------+-----------\n> 123| 456\n> - 123| 4567890123456789\n> -4567890123456789| 123\n> -4567890123456789| 4567890123456789\n> -4567890123456789|-4567890123456789\n> + 123| 2147483647\n> +2147483647| 123\n> +2147483647| 2147483647\n> +2147483647|-2147483648\n> (5 rows)\n> ====== select_having ======\n> --- expected/select_having.out Sat Aug 29 00:10:03 1998\n> +++ results/select_having.out Tue Sep 1 23:41:51 1998\n> @@ -11,27 +11,6 @@\n> QUERY: INSERT INTO test_having VALUES (9, 4, 'CCCC', 'j');\n> QUERY: SELECT max(a) FROM test_having\n> GROUP BY lower(c) HAVING count(*) > 2 OR min(b) = 3;\n<snip>\n> -QUERY: DROP TABLE test_having;\n> +pqReadData() -- backend closed the channel unexpectedly.\n> + This probably means the backend terminated abnormally before or while processing the request.\n> +We have lost the connection to the backend, so further processing is impossible. Terminating.\n\nOK, this test did not fail on my development tree from a month ago. What\nchanged? I'm seeing it fail here also.\n\n - Tom\n",
"msg_date": "Wed, 02 Sep 1998 05:41:08 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "> > > Uh, no, Linux/i686 is showing trouble too, but not in the initdb \n> > > stage. The Sparc platforms will be more sensitive to byte alignment \n> > > problems, especially within C structures, so this may be \n> > > illustrating a cross-platform problem more clearly.\n> > > There is a repeatable indexing and (perhaps) caching problem I see \n> > > in the regression tests. Annoyingly, the problems get slightly worse \n> > > at the moment when compiling with -O0.\n> > OK, here is my regression output. Do you see anything strange in \n> > there?\n> \n> Well, yes, just not as strange as my tests :) You don't have int8\n> enabled, and if your compiler and libc allow it I'd like to get that\n> going. But that isn't a problem.\n> \n> You have a core dump from the \"having\" test. Is that a known problem\n> with someone working on a solution? The test worked on my ~month-old\n> development tree (I could probably figure out the vintage of that tree\n> to more precision if it would be helpful), so something has happened in\n> the meantime.\n> \n> I suspect that (possibly) more than one thing is going on, since there\n> were some changes directly related to removing the oddball OID types as\n> well as perhaps cleanup changes made while traversing the code.\n> Something may have crept in there.\n> \n> If these tests are the only ones showing problems on your machine, then\n> consider yourself lucky. I've got several more failures, including the\n> one where I can't create indices on a table until after terminating and\n> restarting the session. The Sparc contingent sees more problems than I,\n> but they are on a Risc machine so will see alignment problems if they\n> are present.\n\nYes, very strange.\n\n> \n> - Tom\n> \n> > ====== int8 ======\n> > --- expected/int8.out Sun Aug 23 11:09:38 1998\n> > +++ results/int8.out Tue Sep 1 23:40:10 1998\n> > @@ -6,110 +6,110 @@\n> > QUERY: INSERT INTO INT8_TBL VALUES('4567890123456789','-4567890123456789');\n> > QUERY: SELECT * FROM INT8_TBL;\n> > q1| q2\n> > -----------------+-----------------\n> > +----------+-----------\n> > 123| 456\n> > - 123| 4567890123456789\n> > -4567890123456789| 123\n> > -4567890123456789| 4567890123456789\n> > -4567890123456789|-4567890123456789\n> > + 123| 2147483647\n> > +2147483647| 123\n> > +2147483647| 2147483647\n> > +2147483647|-2147483648\n> > (5 rows)\n> > ====== select_having ======\n> > --- expected/select_having.out Sat Aug 29 00:10:03 1998\n> > +++ results/select_having.out Tue Sep 1 23:41:51 1998\n> > @@ -11,27 +11,6 @@\n> > QUERY: INSERT INTO test_having VALUES (9, 4, 'CCCC', 'j');\n> > QUERY: SELECT max(a) FROM test_having\n> > GROUP BY lower(c) HAVING count(*) > 2 OR min(b) = 3;\n> <snip>\n> > -QUERY: DROP TABLE test_having;\n> > +pqReadData() -- backend closed the channel unexpectedly.\n> > + This probably means the backend terminated abnormally before or while processing the request.\n> > +We have lost the connection to the backend, so further processing is impossible. Terminating.\n> \n> OK, this test did not fail on my development tree from a month ago. What\n> changed? I'm seeing it fail here also.\n\nI believe David Hartwig has claimed this problem, and knows the cause. \nHe posted something recently.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Wed, 2 Sep 1998 10:39:58 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "> > Can we try a simple -O rather than just -O2 and -O0. Could this be \n> > some type of optimizer bug in gcc2/Solaris?\n> > Everything is pointing to indexing.c, from both the initdb failure and\n> > the create function failure. But I can't see anything wrong in there,\n> > and other platforms seem to be OK.\n> \n> Uh, no, Linux/i686 is showing trouble too, but not in the initdb stage.\n> The Sparc platforms will be more sensitive to byte alignment problems,\n> especially within C structures, so this may be illustrating a\n> cross-platform problem more clearly.\n> \n> There is a repeatable indexing and (perhaps) caching problem I see in\n> the regression tests. Annoyingly, the problems get slightly worse at the\n> moment when compiling with -O0.\n\nCan you see if compiling indexing.c with different optmization levels\nchange the output? If so, would someone else also look in indexing.c\nfor somethings stupid I did. I can't see it, but EVERYTHING is\npointing to that file.\n\n> \n> There is a fundamental problem lurking somewhere, and there may not be\n> much point in going beta unless you think that more testers will help to\n> track down the problem.\n\nNot sure how to find the problem. Without being able to debug it here,\nI am left staring at the code over and over again.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Wed, 2 Sep 1998 10:58:11 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "Bruce Momjian wrote:\n> \n> Not sure how to find the problem. Without being able to debug it here,\n> I am left staring at the code over and over again.\n\nThat sounds like *so* much fun ;-)\n\nOK, I've been ignoring the problem until now, and of course may not be\nof any help even if I were trying to help. I'm also not quite up on the\nhistory and sequence of events which led to our current state, and I'm\nnot sure we have a strong regression history yet to pin this down.\n\nAt the moment we have Bruce and the two sparc guys working on it, and\nBruce can't reproduce the problems on his machine and Keith's machine is\nso dog-slow that he can't do much testing which involve full rebuilds.\nBoy, it hasn't been long since that model Sparc was the best thing\ngoing, eh?\n\nDoes anyone else have a machine (Linux x86, for example) which exhibits\nproblems with the current development tree, and who has an interest in\nhelping to track this down? \n\nI hate to step away from docs, but could for a while if that would be\nhelpful. I've got a fairly fast machine and can try pinning down when\nthe problems started by doing full builds on fresh trees. Or since we've\nbeen making steady incremental improvements to the tree, maybe we should\nfocus on a particular problem; my \"can't create another index in the\ncurrent session\" problem is probably related to whatever else is going\non with indices.\n\nIn general the problems persist across different \"-O\" compiler settings\nand across different architectures and compilers, though with different\nsymptoms, so I would think that this is not a compiler bug per se.\n\n - Tom\n",
"msg_date": "Wed, 02 Sep 1998 15:40:44 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "> Bruce Momjian wrote:\n> > \n> > Not sure how to find the problem. Without being able to debug it here,\n> > I am left staring at the code over and over again.\n> \n> That sounds like *so* much fun ;-)\n> \n> OK, I've been ignoring the problem until now, and of course may not be\n> of any help even if I were trying to help. I'm also not quite up on the\n> history and sequence of events which led to our current state, and I'm\n> not sure we have a strong regression history yet to pin this down.\n> \n> At the moment we have Bruce and the two sparc guys working on it, and\n> Bruce can't reproduce the problems on his machine and Keith's machine is\n> so dog-slow that he can't do much testing which involve full rebuilds.\n> Boy, it hasn't been long since that model Sparc was the best thing\n> going, eh?\n\nI was on Thomas A. Szybist machine for two hours, and even though I was\ntelnet'ed across three Internet machines to get there, it made my PP200\nlook like it was sitting still. Amazing speed. It is a Sparc running\nSolaris.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Wed, 2 Sep 1998 11:42:13 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests.u"
},
{
"msg_contents": "\n\nThomas G. Lockhart wrote:\n\n> > > Uh, no, Linux/i686 is showing trouble too, but not in the initdb\n> > > stage. The Sparc platforms will be more sensitive to byte alignment\n> > > problems, especially within C structures, so this may be\n> > > illustrating a cross-platform problem more clearly.\n> > > There is a repeatable indexing and (perhaps) caching problem I see\n> > > in the regression tests. Annoyingly, the problems get slightly worse\n> > > at the moment when compiling with -O0.\n> > OK, here is my regression output. Do you see anything strange in\n> > there?\n>\n> Well, yes, just not as strange as my tests :) You don't have int8\n> enabled, and if your compiler and libc allow it I'd like to get that\n> going. But that isn't a problem.\n>\n> You have a core dump from the \"having\" test. Is that a known problem\n> with someone working on a solution? The test worked on my ~month-old\n> development tree (I could probably figure out the vintage of that tree\n> to more precision if it would be helpful), so something has happened in\n> the meantime.\n>\n\nI submitted two patch patches to fix the select_having test. The first patch addressed problems caused by\na machine dependency on the degree of accuracy of datetime. CVS is currently showing this first patch.\n\nThe second patch was to fix my first patch. It has NOT been applied yet. The problem with he first\npatch, which you are seeing now, is that the test case demonstrates another bug which has nothing to do\nwith having. It has to do with GROUPing by a function and the argument of the function not appearing\nelsewhere in the target list. Weird! In any case the latest patch will fix the regression.\n\nBTW, I have also sent one other patch that I am waiting to see in CVS. These one is an interim AND/OR\nmemory exhaustion fix.\n\n",
"msg_date": "Wed, 02 Sep 1998 12:17:36 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "In message <[email protected]>, Bruce Momjian writes:\n> > Bruce Momjian wrote:\n> > > \n> > > Not sure how to find the problem. Without being able to debug it here,\n> > > I am left staring at the code over and over again.\n> > \n> > That sounds like *so* much fun ;-)\n> > \n> > OK, I've been ignoring the problem until now, and of course may not be\n> > of any help even if I were trying to help. I'm also not quite up on the\n> > history and sequence of events which led to our current state, and I'm\n> > not sure we have a strong regression history yet to pin this down.\n> > \n> > At the moment we have Bruce and the two sparc guys working on it, and\n> > Bruce can't reproduce the problems on his machine and Keith's machine is\n> > so dog-slow that he can't do much testing which involve full rebuilds.\n> > Boy, it hasn't been long since that model Sparc was the best thing\n> > going, eh?\n> \n> I was on Thomas A. Szybist machine for two hours, and even though I was\n ^^^^^^^^^^^^^^^^^\nIt's really just Tom :)\n\n> telnet'ed across three Internet machines to get there, it made my PP200\n> look like it was sitting still. Amazing speed. It is a Sparc running\n> Solaris.\n> \n> -- \n> Bruce Momjian | 830 Blythe Avenue\n> [email protected] | Drexel Hill, Pennsylvania 19026\n> + If your life is a hard drive, | (610) 353-9879(w)\n> + Christ can be your backup. | (610) 853-3000(h)\n\n\nI just grabbed grabbed gcc 2.8.1 from smc.vnet.com. I should have that\ninstalled later today. Full rebuilds are not a problem for me. I did\njust get a project bubbled to the top of my queue here that should take\nabout a day or two. I certainly can try patches and such, but I may\nnot have time plod through with gdb for a few days. (Not that I can\nhelp much anyway.) I'm also going to be away for Labor day starting\nFriday night EST. I'm returning on Tuesday night EST. \n\nTom Szybist\[email protected]\n",
"msg_date": "Wed, 02 Sep 1998 12:35:37 -0400",
"msg_from": "\"Thomas A. Szybist\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests.u "
},
{
"msg_contents": "> I submitted two patch patches to fix the select_having test. The first patch addressed problems caused by\n> a machine dependency on the degree of accuracy of datetime. CVS is currently showing this first patch.\n> \n> The second patch was to fix my first patch. It has NOT been applied yet. The problem with he first\n> patch, which you are seeing now, is that the test case demonstrates another bug which has nothing to do\n> with having. It has to do with GROUPing by a function and the argument of the function not appearing\n> elsewhere in the target list. Weird! In any case the latest patch will fix the regression.\n> \n> BTW, I have also sent one other patch that I am waiting to see in CVS. These one is an interim AND/OR\n> memory exhaustion fix.\n\nYes, I am behind on the patch applications. Marc probably stopped while\nI did my mega-cleanup, and I have been scratching my head on the\nplatform failures. Hopefully one of us will get it soon.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Wed, 2 Sep 1998 13:54:03 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "Bruce Momjian wrote:\n\n> > I submitted two patch patches to fix the select_having test. The first patch addressed problems caused by\n> > a machine dependency on the degree of accuracy of datetime. CVS is currently showing this first patch.\n> >\n> > The second patch was to fix my first patch. It has NOT been applied yet. The problem with he first\n> > patch, which you are seeing now, is that the test case demonstrates another bug which has nothing to do\n> > with having. It has to do with GROUPing by a function and the argument of the function not appearing\n> > elsewhere in the target list. Weird! In any case the latest patch will fix the regression.\n> >\n> > BTW, I have also sent one other patch that I am waiting to see in CVS. These one is an interim AND/OR\n> > memory exhaustion fix.\n>\n> Yes, I am behind on the patch applications. Marc probably stopped while\n> I did my mega-cleanup, and I have been scratching my head on the\n> platform failures. Hopefully one of us will get it soon.\n> bug.\n\nNo rush, I can see you're synapses are all firing on this index bug. Just a reminder so it doesn't fall\nthrough the cracks.\n\nMore important, am relieved (in advance) that you have found the problem in the index code.\n\nCan I assume there will be a snapshot I can get tomorrow from my business location to try out on my AIX box? I\nam anxious to know this is behind us.\n\nAppreciation :)\n\n",
"msg_date": "Wed, 02 Sep 1998 16:33:55 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "> \n> No rush, I can see you're synapses are all firing on this index bug. Just a reminder so it doesn't fall\n> through the cracks.\n\nDoing it now.\n\n> \n> More important, am relieved (in advance) that you have found the problem in the index code.\n> \n> Can I assume there will be a snapshot I can get tomorrow from my business location to try out on my AIX box? I\n> am anxious to know this is behind us.\n> \n> Appreciation :)\n\nLast I heard on Monday, Marc is making snapshots every day now, and\nthrough the beta period.\n\nThanks to all the bug reports and tracebacks. They clearly pointed to\nthe problem. I just couldn't see it until today.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Wed, 2 Sep 1998 22:25:06 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
}
] |
[
{
"msg_contents": "\nI've just posted to the patches list the update for the JDBC driver ready\nfor the beta.\n\nThe only thing that still needs work on before 6.4 is the new Object\nserialisation code, but as that's been in the driver for a couple of\nmonths now, I can finish it off while we are in beta ;-)\n\nI've run out of time for the lo orphaning problem (for 6.4), so that will\nhave to go into 6.4.1\n\nHere's what's in the patch:\n\n\t- Created ChangeLog file, and entered stuff done since 6.3.2 and today\n\t- Change version number to 6.4 in Driver.java\n\t- Added fix to DatabaseMetaData.getTables() submitted by\n\t Stefan Andreasen <[email protected]>\n\t- Added fix to DatabaseMetaData.getColumns() to handle patterns\n\t submitted by Stefan Andreasen <[email protected]>\n\t- Set TcpNoDelay on the connection, as this gives us a 10x speed\n\t improvement on FreeBSD (caused by a bug in their TCP Stack). They\n\t should fix the bug before 6.4 is released, but will keep this\n\t in here unless it causes more problems.\n\t Submitted by Jason Venner <[email protected]>\n\t- Removed a duplicate definition of fieldCache\n\t- Added a more meaningful message when the connection is refused. It\n\t now says:\n\t\tConnection refused. Check that the hostname and port is\n\t\tcorrect, and that the postmaster is running with the -i flag,\n\t\twhich enables TCP/IP networking.\n\t- Removed kludge in PreparedStatement.setDate() that acted as a\n\t temporary fix to a bug in SimpleDateFormat, as it broke date\n\t handling in JDK 1.1.6.\n\t- Modified PG_Stream and Connection, so that outbound data is now\n\t buffered. This should give us a speed improvement, and reduce the\n\t ammount of network packets generated.\n\t- Removed duplicate code and optimised PG_Stream.\n\t- PG_Stream now returns a more meaningful message when the connection\n\t is broken by the backend. It now returns:\n\t\tThe backend has broken the connection. Possibly the action you\n\t\thave attempted has caused it to close.\n\t- Removed obsolete code from Connection.\n\t- The error message returned when the authentication scheme is unknown\n\t has been extended. It now reads:\n\t\tAuthentication type ### not supported. Check that you have\n\t\tconfigured the pg_hba.conf file to include the client's IP\n\t\taddress or Subnet, and is using a supported authentication\n\t\tscheme.\n\t- Connection.getMetaData() now caches the instance returned, so\n\t multiple calls will return the same instance.\n\t- Created a test application that tests the DatabaseMetaData and\n\t ResultSetMetaData classes.\n\t- Replaced getString(#).getBytes() with getBytes(#) which should speed\n\t things up, and reduce memory useage.\n\t- Optimised DatabaseMetaData.getProcedures(), and implemented patterns\n\t- Fixed NullPointerExceptions thrown when a field is null (Internal\n\t to the driver, not caused by results from the backend.\n\t DatabaseMetaData.getProcedures() is an example of a method that\n\t causes this):\n\t\t- ResultSetMetaData.getColumnName() now returns field# where\n\t\t # is the column name.\n\t\t- ResultSet.getObject() fixed\n\t\t- Fixed bug in psql example that was affected by null fields\n\t\t- DatabaseMetaData.getTables()\n\t- DatabaseMetaData.getPrimaryKeys() ran a query with an ambiguous field\n\t fixed.\n\t- getTypeInfo() optimised to increase speed and reduce memory useage\n\t- ResultSetMetaData.isCurrency() optimised and is now smaller.\n\t- Removed unnecessary code fromResultSetMetaData.getCatalogName()\n\t and getSchemaName().\n\t- Created new class postgresql.util.PGmoney to map the money type\n\t- Created new class postgresql.geometric.PGline to map the line type\n\t\nJust one or too items ;-)\n\n-- \n Peter T Mount [email protected]\n Main Homepage: http://www.retep.org.uk\nPostgreSQL JDBC Faq: http://www.retep.org.uk/postgres\n Java PDF Generator: http://www.retep.org.uk/pdf\n\n",
"msg_date": "Mon, 31 Aug 1998 22:06:23 +0100 (GMT)",
"msg_from": "Peter T Mount <[email protected]>",
"msg_from_op": true,
"msg_subject": "JDBC Update"
}
] |
[
{
"msg_contents": "The following is a scenario I ran on my AIX box using the Sunday night\nsnapshot. Notice that, after creating an index on foo, relname can not\nbe selected without a wildcard \"%\" on both ends of foo. Equal \"=\" does\nnot work either. It is as if a hidden character is sitting in front of\n\"foo\". This problem only occurs after creatind an index. Needless to\nsay, this situation has rendered the database unusable. Any ideas?\n\nBruce, I thought I saw a blurb about the NAMELEN changing to 31 plus\n'\\0'. Is there any thing going on there.\n\n*************************************************************************\n\nCREATE TABLE foo (\n bar int\n);\nCREATE\n\nselect oid, * from pg_class where relname like '%foo%';\n\noid|relname|reltype|relowner|relam|relpages|reltuples|relhasindex|relisshared|relkind|relnatts|relchecks|reltriggers|relhasrules|r\n\nelacl\n-----+-------+-------+--------+-----+--------+---------+-----------+-----------+-------+--------+---------+-----------+-----------+------\n\n19040|foo | 0| 6095| 0| 0| 0|f\n|f |r | 1| 0| 0|f |\n\n(1 row)\n\n\nCREATE INDEX foo_idx ON foo USING btree(bar);\nCREATE\n\nselect oid, * from pg_class where relname like '%foo%';\n\noid|relname|reltype|relowner|relam|relpages|reltuples|relhasindex|relisshared|relkind|relnatts|relchecks|reltriggers|relhasrules|relacl\n\n-----+-------+-------+--------+-----+--------+---------+-----------+-----------+-------+--------+---------+-----------+-----------+------\n\n19040|foo | 0| 6095| 0| 0| 0|t\n|f |r | 1| 0| 0|f |\n19049|foo_idx| 0| 6095| 403| 2| 2048|f\n|f |i | 1| 0| 0|f |\n\n(2 rows)\n\nselect oid, * from pg_class where relname like 'foo%';\noid|relname|reltype|relowner|relam|relpages|reltuples|relhasindex|relisshared|relkind|relnatts|relchecks|reltriggers|relhasrules|relacl\n\n---+-------+-------+--------+-----+--------+---------+-----------+-----------+-------+--------+---------+-----------+-----------+------\n\n(0 rows)\n\n\\d\n\nDatabase = daveh\n +------------------+----------------------------------+----------+\n | Owner | Relation | Type |\n +------------------+----------------------------------+----------+\n | daveh | foo | table |\n | daveh | foo_idx | index |\n +------------------+----------------------------------+----------+\n\\d foo\nCouldn't find table foo!\n\n\n\n\nThe following is a scenario I ran on my AIX box using the Sunday night\nsnapshot. Notice that, after creating an index on foo, relname\ncan not be selected without a wildcard \"%\" on both ends of foo. \nEqual \"=\" does not work either. It is as if a hidden character\nis sitting in front of \"foo\". This problem only occurs after creatind\nan index. Needless to say, this situation has rendered the database\nunusable. Any ideas?\nBruce, I thought I saw a blurb about the NAMELEN changing to 31\nplus '\\0'. Is there any thing going on there.\n*************************************************************************\nCREATE TABLE foo (\n bar int\n);\nCREATE\nselect oid, * from pg_class where relname like '%foo%';\n oid|relname|reltype|relowner|relam|relpages|reltuples|relhasindex|relisshared|relkind|relnatts|relchecks|reltriggers|relhasrules|r\nelacl\n-----+-------+-------+--------+-----+--------+---------+-----------+-----------+-------+--------+---------+-----------+-----------+------\n19040|foo | 0| \n6095| 0| 0| \n0|f |f \n|r | \n1| 0| \n0|f |\n(1 row)\n \nCREATE INDEX foo_idx ON foo USING btree(bar);\nCREATE\nselect oid, * from pg_class where relname like '%foo%';\n oid|relname|reltype|relowner|relam|relpages|reltuples|relhasindex|relisshared|relkind|relnatts|relchecks|reltriggers|relhasrules|relacl\n-----+-------+-------+--------+-----+--------+---------+-----------+-----------+-------+--------+---------+-----------+-----------+------\n19040|foo | 0| \n6095| 0| 0| \n0|t |f \n|r | \n1| 0| \n0|f |\n19049|foo_idx| 0| \n6095| 403| 2| \n2048|f |f \n|i | \n1| 0| \n0|f |\n(2 rows)\nselect oid, * from pg_class where relname like 'foo%';\noid|relname|reltype|relowner|relam|relpages|reltuples|relhasindex|relisshared|relkind|relnatts|relchecks|reltriggers|relhasrules|relacl\n---+-------+-------+--------+-----+--------+---------+-----------+-----------+-------+--------+---------+-----------+-----------+------\n(0 rows)\n \n\\d\nDatabase = daveh\n +------------------+----------------------------------+----------+\n | Owner \n| \nRelation \n| Type |\n +------------------+----------------------------------+----------+\n | daveh \n| foo \n| table |\n | daveh \n| foo_idx \n| index |\n +------------------+----------------------------------+----------+\n\\d foo\nCouldn't find table foo!",
"msg_date": "Mon, 31 Aug 1998 17:24:31 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": true,
"msg_subject": "AIX Port Strangness"
}
] |
[
{
"msg_contents": "Hi,\ntwo errors:\n1.) missing include (for FreeBSD 3.0-current?) in libpq-fe.h: (Patch below)\n2.) when firing the attached query (query.sql)\n on data which schema is attached(y.sql),\n the backend crashes during the query.\n (droping tage_1 fixes the problem btw.)\n\nany ideas?\n\n#############Patch#######\nIndex: libpq-fe.h\n===================================================================\nRCS file: /mnt/jaz_ufs/CVS/pgsql/src/interfaces/libpq/libpq-fe.h,v\nretrieving revision 1.39\ndiff -u -1 -u -r1.39 libpq-fe.h\n--- libpq-fe.h\t1998/08/29 04:05:45\t1.39\n+++ libpq-fe.h\t1998/08/30 21:05:39\n@@ -26,2 +26,3 @@\n #else\n+#include <sys/types.h>\n #include <sys/socket.h>\n\nBye!\n----\nMichael Reifenberger\nPlaut Software GmbH, R/3 Basis",
"msg_date": "Tue, 1 Sep 1998 00:31:57 +0200 (CEST)",
"msg_from": "Michael Reifenberger <[email protected]>",
"msg_from_op": true,
"msg_subject": "2 Troubles with (current) pgsql 6.4 "
}
] |
[
{
"msg_contents": "Tatsuo Ishii wrote:\n\n> Has anyone seen sh syntax erros in configure?\n> ----------------------------------------------\n> checking for ginstall... test: syntax error\n> no\n> checking for installbsd... test: syntax error\n> no\n> checking for bsdinst... test: syntax error\n> no\n> checking for scoinst... test: syntax error\n> no\n> checking for install... test: syntax error\n> no\n> checking for install-sh... test: syntax error\n> no\n> - No Install Script found - aborting.\n>\n\nYes, just started getting a similar problem today. The code in this\narea has been reworked recently. Don't know who. I just hacked in\nwhat I needed to set the proper install script. I had too many other\nproblems deal with to bother investigating this one.\n\n",
"msg_date": "Mon, 31 Aug 1998 18:49:27 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] configure problem"
},
{
"msg_contents": "Has anyone seen sh syntax erros in configure?\n----------------------------------------------\nchecking for ginstall... test: syntax error\nno\nchecking for installbsd... test: syntax error\nno\nchecking for bsdinst... test: syntax error\nno\nchecking for scoinst... test: syntax error\nno\nchecking for install... test: syntax error\nno\nchecking for install-sh... test: syntax error\nno\n- No Install Script found - aborting.\n\n--\nTatsuo Ishii\[email protected]\n",
"msg_date": "Tue, 01 Sep 1998 10:15:20 +0900",
"msg_from": "Tatsuo Ishii <[email protected]>",
"msg_from_op": false,
"msg_subject": "configure problem"
}
] |
[
{
"msg_contents": "> \n> Bruce Momjian <[email protected]>\n> > \n> > The old code in this section was somewhat mangled.\n> > \n> > Can I telnet into this machine?\n> > \n> \n> I'm afraid I'm dialup only but would be willing to liase with\n> you and be online for you to telnet in, if no alternative\n> permanently connected system can be found.\n> \n> > > \n> > > Program received signal SIGSEGV, Segmentation fault.\n> > > 0x34264 in GetIndexValue (tuple=0x1ba810, hTupDesc=0x1ba86c, attOff=0, \n> > > attrNums=0x1bd544, fInfo=0x0,\n> > > attNull=0xefffcc97 \"\") at indexam.c:404\n> > > 404 returnVal = heap_getattr(tuple, attrNums[attOff],\n> > > (gdb) bt\n> > > #0 0x34264 in GetIndexValue (tuple=0x1ba810, hTupDesc=0x1ba86c, attOff=0, \n> > > attrNums=0x1bd544, fInfo=0x0,\n> > \n> > My guess is that hTupDesc is badly formed, not having the proper\n> > attributes for the relation. Can you do a print of *hTupDesc, and\n> > attrNums[0]?\n> > \n> \n> Breakpoint 1, GetIndexValue (tuple=0x1bc210, hTupDesc=0x1bc26c, attOff=0, \n> attrNums=0x1bf944, fInfo=0x0,\n> attNull=0xefffcc97 \"\") at indexam.c:383\n> 383 if (PointerIsValid(fInfo) && FIgetProcOid(fInfo) != InvalidOid)\n> (gdb) step\n> 404 returnVal = heap_getattr(tuple, attrNums[attOff],\n> (gdb) list\n> 399 pfree(attData);\n> 400 *attNull = FALSE;\n> 401 }\n> 402 else\n> 403 {\n> 404 returnVal = heap_getattr(tuple, attrNums[attOff],\n> 405 \n> hTupDesc, attNull);\n> 406 }\n> 407 return returnVal;\n> 408 }\n> (gdb) print tuple\n> $1 = (HeapTupleData *) 0x1bc210\n> (gdb) print *tuple\n> $2 = {t_len = 205, t_oid = 18241, t_cmin = 0, t_cmax = 0, t_xmin = 22018, t_xmax \n> = 0, t_ctid = {ip_blkid = {\n> bi_hi = 0, bi_lo = 18}, ip_posid = 31}, t_natts = 16, t_infomask = 2050, \n> t_hoff = 40 '(',\n> t_bits = \"\\000\\000\\000\"}\n> (gdb) print attrNums[attOff]\n> $3 = 15\n\nThis is a very interesting number. It is saying that it is the prosrc\nfield index that it is updating. This never used to work because of a\nbug in the code for this index. Let me look at this some more.\n\n\n> (gdb) print *hTupDesc\n> $5 = {natts = 0, attrs = 0x0, constr = 0x0}\n> (gdb) print fInfo\n> $6 = (FuncIndexInfo *) 0x0 \n> \n> Hope this helps,\n> Keith.\n> \n> \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Tue, 1 Sep 1998 01:35:04 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "> (gdb) print attrNums[attOff]\n> $3 = 15\n> (gdb) print *hTupDesc\n> $5 = {natts = 0, attrs = 0x0, constr = 0x0}\n> (gdb) print fInfo\n> $6 = (FuncIndexInfo *) 0x0 \n> \n\nI believe this is the pg_proc.prosrc index. This is the only case of a\nsystem index/cache on a 'text' field, rather than 'name'. 'text' is\nvariable length, unlike the other fields. I wonder if there is some\nproblem with the cache code on this type of index. In 6.3.2, it was\nthere but never used, so it may have been broken all along. This is\njust a guess, though.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Tue, 1 Sep 1998 01:48:30 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] Core dump in regression tests.u"
},
{
"msg_contents": "> \n> Bruce Momjian <[email protected]>\n> > \n> > The old code in this section was somewhat mangled.\n> > \n> > Can I telnet into this machine?\n> > \n> \n> I'm afraid I'm dialup only but would be willing to liase with\n> you and be online for you to telnet in, if no alternative\n> permanently connected system can be found.\n\nSorry. pg_index works now. My fault.\n\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Tue, 1 Sep 1998 02:19:56 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
}
] |
[
{
"msg_contents": "I have completed the source code cleanups for 6.4.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Tue, 1 Sep 1998 02:40:28 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "I am done"
}
] |
[
{
"msg_contents": "Bruce Momjian <[email protected]>\n\n> \n> > Thomas A. Szybist <[email protected]>\n> > > \n> > > > \n> > > > If I compile backend/catalog with -O2 then the table creation is\n> > > ^^^\n> > > > OK. So it looks like it may be indexing.c, even with Bruce's\n> > > > recent fixes.\n> > > \n> > > Do you mean -O0 here?\n> > > \n> > \n> > Yes, a typo, I used -O0 for this dir.\n> > \n> \n> Can you try:\n> \n> \tselect * from pg_index;\n> \n> Crashes here. Not good.\n\nLooks OK here!!\n\ntemplate1=> select * from pg_index;\nindexrelid|indrelid|indproc| indkey| \nindclass|indisclustered|indislossy|indhaskeytype|indisunique|indpred\n----------+--------+-------+----------------+----------------------+------------\n--+----------+-------------+-----------+-------\n 17061| 1249| 0| 1 2 0 0 0 0 0 0| 427 1181 0 0 0 0 0 0|f \n |f |t |f |\n 17064| 1249| 0| 1 6 0 0 0 0 0 0| 427 421 0 0 0 0 0 0|f \n |f |t |f |\n 17067| 1249| 0| 1 0 0 0 0 0 0 0| 427 0 0 0 0 0 0 0|f \n |f |t |f |\n 17070| 1255| 0|-2 0 0 0 0 0 0 0| 427 0 0 0 0 0 0 0|f \n |f |t |f |\n 17073| 1255| 0|1 7 10 0 0 0 0 0|1181 421 435 0 0 0 0 0|f \n |f |t |f |\n 17076| 1255| 0|15 0 0 0 0 0 0 0| 431 0 0 0 0 0 0 0|f \n |f |t |f |\n 17079| 1247| 0|-2 0 0 0 0 0 0 0| 427 0 0 0 0 0 0 0|f \n |f |t |f |\n 17082| 1247| 0| 1 0 0 0 0 0 0 0| 1181 0 0 0 0 0 0 0|f \n |f |t |f |\n 17085| 1259| 0|-2 0 0 0 0 0 0 0| 427 0 0 0 0 0 0 0|f \n |f |t |f |\n 17088| 1259| 0| 1 0 0 0 0 0 0 0| 1181 0 0 0 0 0 0 0|f \n |f |t |f |\n 17091| 1215| 0| 1 0 0 0 0 0 0 0| 427 0 0 0 0 0 0 0|f \n |f |t |f |\n 17094| 1216| 0| 1 0 0 0 0 0 0 0| 427 0 0 0 0 0 0 0|f \n |f |t |f |\n 17097| 1219| 0| 1 0 0 0 0 0 0 0| 427 0 0 0 0 0 0 0|f \n |f |t |f |\n 17100| 17051| 0| 1 0 0 0 0 0 0 0| 427 0 0 0 0 0 0 0|f \n |f |t |f |\n(14 rows)\n\ntemplate1=>\n\n",
"msg_date": "Tue, 1 Sep 1998 09:23:07 +0100 (BST)",
"msg_from": "Keith Parks <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
}
] |
[
{
"msg_contents": "Bruce Momjian <[email protected]>\n> \n> > Thomas A. Szybist <[email protected]>\n> > > \n> > > > \n> > > > If I compile backend/catalog with -O2 then the table creation is\n> > > ^^^\n> > > > OK. So it looks like it may be indexing.c, even with Bruce's\n> > > > recent fixes.\n> > > \n> > > Do you mean -O0 here?\n> > > \n> > \n> > Yes, a typo, I used -O0 for this dir.\n> \n> One idea is to track heapDescriptor from CatalogIndexInsert() all the\n> way down into the lower functions.\n> \n> Compile with assert checking, which I assume you are already doing.\n\nI'm afraid I don't normally as I tend to take everything at it's default\nand build/install without changes.\n\n> \n> Add this \"Assert(heapDescriptor->natts != 0)\" to the function, and in\n> lower functions substitute heapDescriptor with the new variable name it\n> took as a function parameter.)\n> \n> When the assert fails, we can see where it is getting messed up.\n> \n\nI'm on the late shift this week so won't be home until 22:00 BST but\nwill endeavour to do something with this later this evening.\n\nKeith.\n\n",
"msg_date": "Tue, 1 Sep 1998 09:26:41 +0100 (BST)",
"msg_from": "Keith Parks <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
}
] |
[
{
"msg_contents": "Hi,\ntwo errors:\n1.) missing include (for FreeBSD 3.0-current?) in libpq-fe.h: (Patch below)\n2.) when firing the attached query (query.sql)\n on data which schema is attached(y.sql),\n the backend crashes during the query.\n (droping tage_1 fixes the problem btw.)\n\nany ideas?\n\n#############Patch#######\nIndex: libpq-fe.h\n===================================================================\nRCS file: /mnt/jaz_ufs/CVS/pgsql/src/interfaces/libpq/libpq-fe.h,v\nretrieving revision 1.39\ndiff -u -1 -u -r1.39 libpq-fe.h\n--- libpq-fe.h\t1998/08/29 04:05:45\t1.39\n+++ libpq-fe.h\t1998/08/30 21:05:39\n@@ -26,2 +26,3 @@\n #else\n+#include <sys/types.h>\n #include <sys/socket.h>\n\nBye!\n----\nMichael Reifenberger\nPlaut Software GmbH, R/3 Basis",
"msg_date": "Tue, 1 Sep 1998 20:20:17 +0200 (CEST)",
"msg_from": "Michael Reifenberger <[email protected]>",
"msg_from_op": true,
"msg_subject": "2 Troubles with (current) pgsql 6.4 (fwd)"
}
] |
[
{
"msg_contents": "Bruce Momjian <[email protected]>\n\n> \n> > (gdb) print attrNums[attOff]\n> > $3 = 15\n> > (gdb) print *hTupDesc\n> > $5 = {natts = 0, attrs = 0x0, constr = 0x0}\n> > (gdb) print fInfo\n> > $6 = (FuncIndexInfo *) 0x0 \n> > \n> \n> I believe this is the pg_proc.prosrc index. This is the only case of a\n> system index/cache on a 'text' field, rather than 'name'. 'text' is\n> variable length, unlike the other fields. I wonder if there is some\n> problem with the cache code on this type of index. In 6.3.2, it was\n> there but never used, so it may have been broken all along. This is\n> just a guess, though.\n> \n\nI've just cvs updated and built with -O2 and assert checking.\n\nThe automated process actually runs the regression tests at the\nend and gives the following results:-\n\nboolean .. failed\nchar .. failed\nname .. failed\nvarchar .. failed\ntext .. failed\nstrings .. failed\nint2 .. failed\nint4 .. failed\nint8 .. failed\noid .. failed\nfloat4 .. failed\nfloat8 .. failed\nnumerology .. failed\npoint .. failed\nlseg .. failed\nbox .. failed\npath .. failed\npolygon .. failed\ncircle .. failed\ngeometry .. failed\ntimespan .. failed\ndatetime .. failed\nreltime .. failed\nabstime .. failed\ntinterval .. failed\nhorology .. failed\ncomments .. ok\ncreate_function_1 .. ok\t\t<- ******\ncreate_type .. failed\ncreate_table .. failed\ncreate_function_2 .. failed\nconstraints .. failed\ntriggers .. failed\ncopy .. failed\ncreate_misc .. failed\ncreate_aggregate .. ok\ncreate_operator .. failed\ncreate_view .. failed\ncreate_index .. failed\nsanity_check .. failed\nerrors .. failed\nselect .. failed\nselect_into .. failed\nselect_distinct .. failed\nselect_distinct_on .. failed\nselect_implicit .. failed\nselect_having .. failed\nsubselect .. failed\nunion .. failed\naggregates .. failed\ntransactions .. failed\nrandom .. failed\nportals .. failed\nmisc .. failed\narrays .. failed\nbtree_index .. failed\nhash_index .. failed\nselect_views .. failed\nalter_table .. failed\nportals_p2 .. failed\nsetup_ruletest .. failed\nrun_ruletest .. failed \n\n***** So with -O2, one of the few tests that fail with -O0 succeeds!!\n\n\n",
"msg_date": "Tue, 1 Sep 1998 22:20:31 +0100 (BST)",
"msg_from": "Keith Parks <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] Core dump in regression tests.u"
},
{
"msg_contents": "> Bruce Momjian <[email protected]>\n> \n> > \n> > > (gdb) print attrNums[attOff]\n> > > $3 = 15\n> > > (gdb) print *hTupDesc\n> > > $5 = {natts = 0, attrs = 0x0, constr = 0x0}\n> > > (gdb) print fInfo\n> > > $6 = (FuncIndexInfo *) 0x0 \n> > > \n> > \n> > I believe this is the pg_proc.prosrc index. This is the only case of a\n> > system index/cache on a 'text' field, rather than 'name'. 'text' is\n> > variable length, unlike the other fields. I wonder if there is some\n> > problem with the cache code on this type of index. In 6.3.2, it was\n> > there but never used, so it may have been broken all along. This is\n> > just a guess, though.\n> > \n> \n> I've just cvs updated and built with -O2 and assert checking.\n> \n> The automated process actually runs the regression tests at the\n> end and gives the following results:-\n\nI just worked with Thomas A. Szybist and telnet'ed into his\nSolaris/Sparc machine. We worked through gdb, and found the system\nshifting the array values in idesc on the fifth call\nto CatalogIndexInsert() while creating a table. The last time through\nthe for() loop, idesc[2] is null and idesc[1] equals the old value of\nidesc[2].\n\n\n\nBecause recompiling indexing.c with no optimization fixes the problem,\nand because gdb is showing idesc[i] getting modified by the for() loop,\nI am concluding we have some sort of Sparc gcc optimizer problem. This\ncode is only slightly modified from the 6.3.2 version, but perhaps\nenough to cause the optimizer to get confused.\n\nI tried adding some code to make things clearer for the optimizer but\ndid not have any luck.\n\nHe is going to continue researching the crashes, and perhaps try a newer\ngcc.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Tue, 1 Sep 1998 17:41:13 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests.u"
}
] |
[
{
"msg_contents": "I'm taking a MS level database design class this semester, and didn't\nreally want to use the school's ORACLE database on their machines, so...\n\nI built the postgres-6.3.2 package on my NetBSD-current/pc532 machine\nover the last few days. For those of you who care slightly, this is\na NS32532 based machine from the early '90s and I had to add a couple\nof lines af assembler to get the thing to build 8-) I'll send a set\nof diffs in when I think it works.\n\nMy problem is that it failed several of the regression tests. int2 and int4\nscared me until I saw that my machine said something like \"number too big\"\nand the expected output was something like \"bad format\"... However, I\ngot the following lines out of the test with diff -c:\n\n*** expected/datetime.out Sun Jan 4 19:35:27 1998\n--- results/datetime.out Mon Aug 31 18:38:04 1998\n***************\n*** 19,31 ****\n QUERY: SELECT ('current'::datetime = 'now'::datetime) as \"True\";\n True\n ----\n! t \n (1 row)\n \n QUERY: SELECT ('now'::datetime - 'current'::datetime) AS \"ZeroSecs\";\n! ZeroSecs\n! --------\n! @ 0 \n (1 row)\n \n QUERY: CREATE TABLE DATETIME_TBL( d1 datetime);\n--- 19,31 ----\n QUERY: SELECT ('current'::datetime = 'now'::datetime) as \"True\";\n True\n ----\n! f \n (1 row)\n \n QUERY: SELECT ('now'::datetime - 'current'::datetime) AS \"ZeroSecs\";\n! ZeroSecs \n! ---------------------------------------\n! @ 486 days 22 hours 22 mins 13 secs ago\n (1 row)\n \n QUERY: CREATE TABLE DATETIME_TBL( d1 datetime);\n\n\n\n\nThat doesn't seem right 8-) Any suggestions?\nJon Buller\n",
"msg_date": "Tue, 01 Sep 1998 22:11:41 -0500",
"msg_from": "Jon Buller <[email protected]>",
"msg_from_op": true,
"msg_subject": "failed datetime regression tests"
},
{
"msg_contents": "> I'll send a set\n> of diffs in when I think it works.\n\nGreat. Always happy to add one more notch to our pistol :)\n\n> and the expected output was something like \"bad format\"... However, I\n> got the following lines out of the test with diff -c:\n> --- results/datetime.out Mon Aug 31 18:38:04 1998\n> QUERY: SELECT ('now'::datetime - 'current'::datetime) AS \"ZeroSecs\";\n> ! ZeroSecs\n> ! ---------------------------------------\n> ! @ 486 days 22 hours 22 mins 13 secs ago\n> (1 row)\n\nThis seems consistant with 'current' coming up zero, since datetime is\nstored as a double float in seconds from 2000-01-01. Don't know why that\nwould be, but you might want to enable debugging print statements in\nbackend/utils/adt/dt.c by doing the following:\n1) edit the Makefile in that directory to add\n CFLAGS += -DDATEDEBUG\n\n2) do a \"make clean\" in that directory, then rebuild your executables.\n\n3) run postmaster from a window, so you can see the results of print\nstatements.\n\n4) connect a psql session from another window, and try some sample\nqueries like your failed ones above. The print statements might give you\nsome clues if you follow them through the code in a third window :)\n\nLet me know if you get any evidence...\n\n - Tom\n",
"msg_date": "Thu, 03 Sep 1998 04:39:19 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] failed datetime regression tests"
}
] |
[
{
"msg_contents": "When running my perftest example I still create an unaccessible index:\n\npostgres@feivel:~/pgsql/src/interfaces/ecpg.mm/test$ ./perftest\nI needed 14 seconds and 761468 microseconds for the insert test.\nNOTICE: CAN't OPEN INDEX 18378 - SKIP IT\nI needed 28 seconds and 444260 microseconds for the selection&projection test.\nNOTICE: CAN't OPEN INDEX 18378 - SKIP IT\nI needed 72 seconds and 446534 microseconds for the join test.\nNOTICE: CAN't OPEN INDEX 18378 - SKIP IT\nI needed 0 seconds and 723106 microseconds for the update test.\nNOTICE: CAN't OPEN INDEX 18378 - SKIP IT\nI needed 0 seconds and 104815 microseconds for the delete test.\nNOTICE: CAN't OPEN INDEX 18378 - SKIP IT\nsql error Error: ERROR: index \"number1\" nonexistent\n line 118.\nNOTICE: (transaction aborted): all queries ignored until end of transaction\nblock\npostgres@feivel:~/pgsql/src/interfaces/ecpg.mm/test$ psql mm\nWelcome to the POSTGRESQL interactive sql monitor:\n Please read the file COPYRIGHT for copyright terms of POSTGRESQL\n\n type \\? for help on slash commands\n type \\q to quit\n type \\g or terminate with semicolon to execute query\n You are currently connected to the database: mm\n\nmm=> \\z\n\nDatabase = mm\n +------------------+----------------------------------------------------+\n | Relation | Grant/Revoke Permissions |\n +------------------+----------------------------------------------------+\n | number1 | |\n | number2 | |\n | perftest1 | |\n | perftest2 | |\n +------------------+----------------------------------------------------+\nmm=>drop table perftest1;\nDROP\nmm=> drop table perftest2;\nDROP\nmm=> \\z\n\nDatabase = mm\n +------------------+----------------------------------------------------+\n | Relation | Grant/Revoke Permissions |\n +------------------+----------------------------------------------------+\n | number1 | |\n +------------------+----------------------------------------------------+\nmm=> drop table number1;\nERROR: Relation number1 Does Not Exist!\nmm=> drop index number1;\nERROR: index \"number1\" nonexistent\n\nAs an explanation: number1 is a unique index created on perftest1. The only\nway to get rid of it seems to be initdb.\n\nMichael\n\n\n-- \nMichael Meskes\t\t\[email protected], [email protected]\nGo SF49ers! Go Rhein Fire!\tUse Debian GNU/Linux! \n",
"msg_date": "Wed, 2 Sep 1998 07:46:38 +0200",
"msg_from": "Michael Meskes <[email protected]>",
"msg_from_op": true,
"msg_subject": "Still big problem with 6.4"
},
{
"msg_contents": "Hi all,\n\nToday is Tuesday September, 2 and I can't find postgresql-6.4 on postgresql.org/pub.\nThere is only postgresql.snapshot.tar.gz. Should I download this one\nor there's some delay for v6.4 ?\n\nThanks\nJose'\n\n\n",
"msg_date": "Wed, 2 Sep 1998 15:44:55 +0200",
"msg_from": "Sferacarta Software <[email protected]>",
"msg_from_op": false,
"msg_subject": "Release 6.4. where is it?"
},
{
"msg_contents": "\n\nSferacarta Software wrote:\n\n> Hi all,\n>\n> Today is Tuesday September, 2 and I can't find postgresql-6.4 on postgresql.org/pub.\n> There is only postgresql.snapshot.tar.gz. Should I download this one\n> or there's some delay for v6.4 ?\n\nThe snapshot is latest 6.4. Not yet released or stable. I would not recomend using\nthis version unless you plan to assist in the debugging effort.\n\nOct 1 is the scheduled release date.\n\n",
"msg_date": "Wed, 02 Sep 1998 12:29:25 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Release 6.4. where is it?"
},
{
"msg_contents": "On Wed, 2 Sep 1998, Sferacarta Software wrote:\n\n> Hi all,\n> \n> Today is Tuesday September, 2 and I can't find postgresql-6.4 on postgresql.org/pub.\n> There is only postgresql.snapshot.tar.gz. Should I download this one\n> or there's some delay for v6.4 ?\n\nv6.4 isn't to be released until Oct 1st...we just went into beta now, with\nthe snapshot being the current one...\n\n\n",
"msg_date": "Wed, 2 Sep 1998 12:43:51 -0400 (EDT)",
"msg_from": "The Hermit Hacker <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Release 6.4. where is it?"
}
] |
[
{
"msg_contents": "> I can not reproduce on my Linux box. Assertions show nothing. This can't be\n> good.\n> Andreas, are you having any success?\n\nThe goodies:\n\tusing %lld for int8 I get\nint8 .. ok\ncreate_function_2 .. ok\nselect_having .. ok\n\nThe down side:\ncreate_index .. failed\n\nSame problem here:\nafter one create index the pg_class_relname_index is no good any more I get\n\nregression=> CREATE INDEX onek_unique2 ON onek USING btree(unique2 int4_ops);\nCREATE\nregression=> select * from onek;\nERROR: RelationCatalogInformation: Relation 19284 not found\nregression=> \\q\npostgres@zeus:/usr/postgres/src/test/regress> psql regression\nregression=> select * from onek;\nERROR: onek: Table does not exist.\nregression=>\n\none problem with #ifdef 0, please use #ifdef NOT_USED in\nsrc/backend/utils/misc/database.c\n\nAndreas\n\n\n",
"msg_date": "Wed, 2 Sep 1998 13:55:39 +0200",
"msg_from": "Andreas Zeugswetter <[email protected]>",
"msg_from_op": true,
"msg_subject": "AW: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "\n\nAndreas Zeugswetter wrote:\n\n> regression=> CREATE INDEX onek_unique2 ON onek USING btree(unique2 int4_ops);\n> CREATE\n> regression=> select * from onek;\n> ERROR: RelationCatalogInformation: Relation 19284 not found\n> regression=> \\q\n> postgres@zeus:/usr/postgres/src/test/regress> psql regression\n> regression=> select * from onek;\n> ERROR: onek: Table does not exist.\n>\n\nThat's the one. See my earlier posting about the state of the pg_class tuple.\n\n\n",
"msg_date": "Wed, 02 Sep 1998 12:23:28 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: AW: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "> \n> one problem with #ifdef 0, please use #ifdef NOT_USED in\n> src/backend/utils/misc/database.c\n> \n> Andreas\n> \nFixed.\n\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Wed, 2 Sep 1998 22:32:41 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: AW: [HACKERS] Core dump in regression tests."
}
] |
[
{
"msg_contents": "I tried adding the PRIMARY KEY info to pg_class but the resulting data\nbase system simply dumps core everywhere. Can someone point me to the\nareas that need to be addressed? Here's what I did. I added a field\ncalled \"relprimary\" to pg_class in pg_class.h as type Oid then added\n-1 to the pg_class entries in the appropriate place. I would also like\nto figure out the oid of the keys for each system table if someone can\npoint me to those as well.\n\nThe next step, of course, is to turn PRIMARY KEY statements into an\nupdate to the class table to insert the oid of the KEY field. I looked\nat parser/analyze.c but I think I have to look deeper. Any help?\n\n-- \nD'Arcy J.M. Cain <darcy@{druid|vex}.net> | Democracy is three wolves\nhttp://www.druid.net/darcy/ | and a sheep voting on\n+1 416 424 2871 (DoD#0082) (eNTP) | what's for dinner.\n",
"msg_date": "Wed, 2 Sep 1998 08:08:03 -0400 (EDT)",
"msg_from": "[email protected] (D'Arcy J.M. Cain)",
"msg_from_op": true,
"msg_subject": "Adding PRIMARY KEY info"
},
{
"msg_contents": "> I tried adding the PRIMARY KEY info to pg_class but the resulting data\n> base system simply dumps core everywhere.\n> The next step, of course, is to turn PRIMARY KEY statements into an\n> update to the class table to insert the oid of the KEY field. I \n> looked at parser/analyze.c but I think I have to look deeper.\n\nI'm not sure this is easy (or possible :), but don't really know. The\nmulti-parse-tree expansions I've done in the parser do not try to take\nresults and use them as input to a different parse tree. I think if I\nwere trying this I'd look at triggers firing after an insert, but I'm\nnot sure how you would tie things together since the \"primary key\" is\nimplmented as just a unique index in the backend.\n\nHmm. How about having a \"primary key\" flag field in pg_index instead? We\ncould enforce integrity in the parser, since we can check that only one\nprimary key has been specified during the parsing. You might be able to\ndefine a trigger on pg_index to update pg_class (if you still needed\nthat column) if the key field is set.\n\nbtw, if any of this is worth doing it is perhaps to allow us to\nimplement foreign keys later (assuming that primary and foreign keys are\nrelated which is what I am recalling). How would we tie key information\ntogether and enforce integrity? I haven't thought about it yet. Also,\nVadim was thinking about doing something for foreign keys, so we should\nask him where he was headed with that...\n\n - Tom\n",
"msg_date": "Wed, 02 Sep 1998 14:19:50 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Adding PRIMARY KEY info"
},
{
"msg_contents": "> I tried adding the PRIMARY KEY info to pg_class but the resulting data\n> base system simply dumps core everywhere. Can someone point me to the\n> areas that need to be addressed? Here's what I did. I added a field\n> called \"relprimary\" to pg_class in pg_class.h as type Oid then added\n> -1 to the pg_class entries in the appropriate place. I would also like\n> to figure out the oid of the keys for each system table if someone can\n> point me to those as well.\n> \n> The next step, of course, is to turn PRIMARY KEY statements into an\n> update to the class table to insert the oid of the KEY field. I looked\n> at parser/analyze.c but I think I have to look deeper. Any help?\n\nMy recommendation is to find a seldom-used field in pg_class, like\nrelchecks, and find all instances of that in the code, and add code for\nyour new field in all those places. You need to assign the value in\ncall cases where you are inserting into pg_class, not just the initdb\nstuff.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Wed, 2 Sep 1998 10:49:01 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Adding PRIMARY KEY info"
},
{
"msg_contents": "Thomas G. Lockhart wrote:\n> \n> Hmm. How about having a \"primary key\" flag field in pg_index instead? We\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nI like this.\n\n> could enforce integrity in the parser, since we can check that only one\n> primary key has been specified during the parsing. You might be able to\n> define a trigger on pg_index to update pg_class (if you still needed\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nImpossible. Triggers are handled by executor, not by heap access\nmethods...\n\n> that column) if the key field is set.\n> \n> btw, if any of this is worth doing it is perhaps to allow us to\n> implement foreign keys later (assuming that primary and foreign keys are\n> related which is what I am recalling). How would we tie key information\n> together and enforce integrity? I haven't thought about it yet. Also,\n> Vadim was thinking about doing something for foreign keys, so we should\n> ask him where he was headed with that...\n\nImho, indices should be used/created for FOREIGN keys and so pg_index\nis good place for both PRIMARY and FOREIGN keys infos.\n\nVadim\n",
"msg_date": "Thu, 03 Sep 1998 09:11:01 +0800",
"msg_from": "Vadim Mikheev <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Adding PRIMARY KEY info"
},
{
"msg_contents": "Thus spake Bruce Momjian\n> > I tried adding the PRIMARY KEY info to pg_class but the resulting data\n> > base system simply dumps core everywhere. Can someone point me to the\n> \n> My recommendation is to find a seldom-used field in pg_class, like\n> relchecks, and find all instances of that in the code, and add code for\n> your new field in all those places. You need to assign the value in\n> call cases where you are inserting into pg_class, not just the initdb\n> stuff.\n\nDoes this relate to the core dumping? Since there is so far no code\nusing this field, how would adding a field dump core? Can you see\nanything in my description of what I did to account for this.\n\nYour suggestion sounds good for the next step though. Thanks.\n\n-- \nD'Arcy J.M. Cain <darcy@{druid|vex}.net> | Democracy is three wolves\nhttp://www.druid.net/darcy/ | and a sheep voting on\n+1 416 424 2871 (DoD#0082) (eNTP) | what's for dinner.\n",
"msg_date": "Thu, 3 Sep 1998 10:46:55 -0400 (EDT)",
"msg_from": "[email protected] (D'Arcy J.M. Cain)",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] Adding PRIMARY KEY info"
},
{
"msg_contents": "Thus spake Vadim Mikheev\n> Imho, indices should be used/created for FOREIGN keys and so pg_index\n> is good place for both PRIMARY and FOREIGN keys infos.\n\nAre you sure? I don't know about implementing it but it seems more\nlike an attribute thing rather than an index thing. Certainly from a\ndatabase design viewpoint you want to refer to the fields, not the\nindex on them. If you put it into the index then you have to do\nan extra join to get the information.\n\nPerhaps you have to do the extra join anyway for other purposes so it\nmay not matter. All I want is to be able to be able to extract the\nfield that the designer specified as the key. As long as I can design\na select statement that gives me that I don't much care how it is\nimplemented. I'll cache the information anyway so it won't have a\nhuge impact on my programs.\n\n-- \nD'Arcy J.M. Cain <darcy@{druid|vex}.net> | Democracy is three wolves\nhttp://www.druid.net/darcy/ | and a sheep voting on\n+1 416 424 2871 (DoD#0082) (eNTP) | what's for dinner.\n",
"msg_date": "Thu, 3 Sep 1998 10:56:43 -0400 (EDT)",
"msg_from": "[email protected] (D'Arcy J.M. Cain)",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] Adding PRIMARY KEY info"
},
{
"msg_contents": "> Thus spake Bruce Momjian\n> > > I tried adding the PRIMARY KEY info to pg_class but the resulting data\n> > > base system simply dumps core everywhere. Can someone point me to the\n> > \n> > My recommendation is to find a seldom-used field in pg_class, like\n> > relchecks, and find all instances of that in the code, and add code for\n> > your new field in all those places. You need to assign the value in\n> > call cases where you are inserting into pg_class, not just the initdb\n> > stuff.\n> \n> Does this relate to the core dumping? Since there is so far no code\n> using this field, how would adding a field dump core? Can you see\n> anything in my description of what I did to account for this.\n> \n> Your suggestion sounds good for the next step though. Thanks.\n\nIt is possible. Fields are accessed internally for copying and stuff,\nthough because it is a byvalue field, it should not matter.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Thu, 3 Sep 1998 11:37:31 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Adding PRIMARY KEY info"
},
{
"msg_contents": "D'Arcy J.M. Cain wrote:\n> \n> Thus spake Vadim Mikheev\n> > Imho, indices should be used/created for FOREIGN keys and so pg_index\n> > is good place for both PRIMARY and FOREIGN keys infos.\n> \n> Are you sure? I don't know about implementing it but it seems more\n> like an attribute thing rather than an index thing. Certainly from a\n> database design viewpoint you want to refer to the fields, not the\n> index on them. If you put it into the index then you have to do\n> an extra join to get the information.\n> \n> Perhaps you have to do the extra join anyway for other purposes so it\n> may not matter. All I want is to be able to be able to extract the\n> field that the designer specified as the key. As long as I can design\n> a select statement that gives me that I don't much care how it is\n> implemented. I'll cache the information anyway so it won't have a\n> huge impact on my programs.\n\nFirst, let me note that you have to add int28 field to pg_class,\nnot just oid field, to know what attributeS are in primary key\n(we support multi-attribute primary keys).\nThis could be done...\nBut what about foreign and unique (!) keys ?\nThere may be _many_ foreign/unique keys defined for one table!\nAnd so foreign/unique keys info have to be stored somewhere else,\nnot in pg_class.\n\npg_index is good place for all _3_ key types because of:\n\n1. index should be created for each foreign key - \n just for performance.\n2. pg_index already has int28 field for key attributes.\n3. pg_index already has indisunique (note that foreign keys \n may reference unique keys, not just primary ones).\n\n- so we have just add two fields to pg_index:\n\nbool indisprimary;\noid indreferenced; \n^^^^^^^^^^^^^^^^^^\nthis is for foreign keys: oid of referenced relation' \nprimary/unique key index.\n\nI agreed that indices are just implementation...\nIf you don't like to store key infos in pg_index then\nnew pg_key relation have to be added...\n\nComments ?\n\nVadim\n",
"msg_date": "Fri, 04 Sep 1998 11:03:00 +0800",
"msg_from": "Vadim Mikheev <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Adding PRIMARY KEY info"
}
] |
[
{
"msg_contents": "In transcribing Jose's reference page docs, I've come across examples\nwhere Jose has exposed deficiencies in Postgres' support of SQL92. I've\nfixed several (easier than transcribing more words :) and I've run into\na bit of trouble on the latest one with the\n\n CREATE TABLE tablename DEFAULT VALUES\n\nstatement. I changed the parser to allow this syntax and just use a nil\npointer for the column list. Everything works OK except that the first\ncolumn's default value is not assigned correctly.\n\nAny ideas on where to look? I'll probably commit the changes to gram.y\nanyway, since it almost works. Examples below...\n\n - Tom\n\npostgres=> create table t (x text default 'default',\npostgres-> i int default 1);\nCREATE\npostgres=> insert into t default values;\nINSERT 143693 1\npostgres=> select * from t;\nx|i\n-+-\n |1\n(1 row)\n\npostgres=> insert into t (i) values (2);\nINSERT 143694 1\npostgres=> select * from t;\nx |i\n-------+-\n |1\ndefault|2\n(2 rows)\n\npostgres=> create table t3 (x text default 'default',\npostgres-> i int default 1, j int default 2);\nCREATE\npostgres=> insert into t3 default values;\nINSERT 143709 1\npostgres=> select * from t3;\nx|i|j\n-+-+-\n |1|2\n(1 row)\n",
"msg_date": "Wed, 02 Sep 1998 15:15:25 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": true,
"msg_subject": "default values"
},
{
"msg_contents": "> In transcribing Jose's reference page docs, I've come across examples\n> where Jose has exposed deficiencies in Postgres' support of SQL92. I've\n> fixed several (easier than transcribing more words :) and I've run into\n> a bit of trouble on the latest one with the\n> \n> CREATE TABLE tablename DEFAULT VALUES\n> \n> statement. I changed the parser to allow this syntax and just use a nil\n> pointer for the column list. Everything works OK except that the first\n> column's default value is not assigned correctly.\n> \n> Any ideas on where to look? I'll probably commit the changes to gram.y\n> anyway, since it almost works. Examples below...\n> \n\nI thought you did the default values additions? Isn't it all done in\nparser/analyze.c? My guess is that is is looking at the number of\nattributes specified in the target list, while in your case you really\nwant it look at the number of entries NOT in the target list.\n\n\n> - Tom\n> \n> postgres=> create table t (x text default 'default',\n> postgres-> i int default 1);\n> CREATE\n> postgres=> insert into t default values;\n> INSERT 143693 1\n> postgres=> select * from t;\n> x|i\n> -+-\n> |1\n> (1 row)\n> \n> postgres=> insert into t (i) values (2);\n> INSERT 143694 1\n> postgres=> select * from t;\n> x |i\n> -------+-\n> |1\n> default|2\n> (2 rows)\n> \n> postgres=> create table t3 (x text default 'default',\n> postgres-> i int default 1, j int default 2);\n> CREATE\n> postgres=> insert into t3 default values;\n> INSERT 143709 1\n> postgres=> select * from t3;\n> x|i|j\n> -+-+-\n> |1|2\n> (1 row)\n> \n> \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Wed, 2 Sep 1998 11:36:36 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] default values"
},
{
"msg_contents": "> I thought you did the default values additions? Isn't it all done in\n> parser/analyze.c? My guess is that is is looking at the number of\n> attributes specified in the target list, while in your case you really\n> want it look at the number of entries NOT in the target list.\n\nI just helped rewrite the gram.y parts of the default value grammar to\ndo full parsing on the clause. All of the hard work (and real knowledge)\nwas Vadim's...\n\n - Tom\n",
"msg_date": "Wed, 02 Sep 1998 15:50:51 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] default values"
},
{
"msg_contents": "> > CREATE TABLE tablename DEFAULT VALUES\n> I thought you did the default values additions?\n\nSheesh. Of course, what I meant was\n\n INSERT INTO table DEFAULT VALUES\n\nSorry for the misinformation :(\n\n - Tom\n",
"msg_date": "Wed, 02 Sep 1998 15:59:14 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] default values"
},
{
"msg_contents": "Thomas G. Lockhart wrote:\n> \n> In transcribing Jose's reference page docs, I've come across examples\n> where Jose has exposed deficiencies in Postgres' support of SQL92. I've\n> fixed several (easier than transcribing more words :) and I've run into\n> a bit of trouble on the latest one with the\n> \n> CREATE TABLE tablename DEFAULT VALUES\n> \n> statement. I changed the parser to allow this syntax and just use a nil\n> pointer for the column list. Everything works OK except that the first\n> column's default value is not assigned correctly.\n> \n> Any ideas on where to look? I'll probably commit the changes to gram.y\n> anyway, since it almost works. Examples below...\n\nDEFAULT is handled in parser/analyze.c:transformInsertStmt()...\n\nVadim\n",
"msg_date": "Thu, 03 Sep 1998 09:15:33 +0800",
"msg_from": "Vadim Mikheev <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: default values"
}
] |
[
{
"msg_contents": "\nIts not a rave review or anything like that, but its nice that we're\nrecognized as finding standards compliance a priority :)\n\n\n---------- Forwarded message ----------\nDate: Wed, 2 Sep 1998 16:27:25 +0200\nFrom: Johann Visagie <[email protected]>\nTo: Jack Freelander <[email protected]>,\n [email protected]\nSubject: Re: SQL package\n\nOn Tue, 01 Sep 1998 at 13:06 SAT, Jack Freelander wrote:\n> \n> which of the database packages would you recommend? I'm looking for\n> something as close as possible to the official SQL standard, but I don't\n> want to sacrifice performance or stability if I don't have to. \n> \n> Is there one best overall package?\n\nNot really.\n\nIf you're looking for free/open source, your primary choices are probably:\n\nMySQL\t\t- http://www.tcx.se/\nMiniSQL\t\t- http://www.hughes.com.au/\nPostgreSQL\t- http://www.postgresql.org/\n\nNot one of them yet cover the entire ANSI spec, but if standards compliance\nis a priority, PostgreSQL is probably your best bet. It's also the only one\nof the three completely unencumbered by a quasi-commercial licence.\n\n-- V\n\nJohann Visagie | Email: [email protected] | Tel: +27 21 419-7878\n\nTo Unsubscribe: send mail to [email protected]\nwith \"unsubscribe freebsd-questions\" in the body of the message\n\n",
"msg_date": "Wed, 2 Sep 1998 12:45:12 -0400 (EDT)",
"msg_from": "The Hermit Hacker <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: SQL package (fwd)"
}
] |
[
{
"msg_contents": "Thomas G. Lockhart <[email protected]>\n> Bruce Momjian <[email protected]>\n> > Can we try a simple -O rather than just -O2 and -O0. Could this be \n> > some type of optimizer bug in gcc2/Solaris?\n> > Everything is pointing to indexing.c, from both the initdb failure and\n> > the create function failure. But I can't see anything wrong in there,\n> > and other platforms seem to be OK.\n\nCompiled with -O the results are the same as with -O2. (-O is the same as -O1)\n\nAccording to the gcc man -O0 turns off all optimisation.\n\n> \n> Uh, no, Linux/i686 is showing trouble too, but not in the initdb stage.\n> The Sparc platforms will be more sensitive to byte alignment problems,\n> especially within C structures, so this may be illustrating a\n> cross-platform problem more clearly.\n> \n> There is a repeatable indexing and (perhaps) caching problem I see in\n> the regression tests. Annoyingly, the problems get slightly worse at the\n> moment when compiling with -O0.\n> \n> There is a fundamental problem lurking somewhere, and there may not be\n> much point in going beta unless you think that more testers will help to\n> track down the problem.\n> \n\nIt's unfortunate that the person who has the best chance of tracking\ndown the bug(s), Bruce, is not seeing any of the problems :-(\n\nI'm afraid I'm not going to be much help this week as the shift\nI'm on leaves me little time to play with the workstation at home.\n\nI'll be able to do test compiles but not much debugging.\n\nKeith.\n\n",
"msg_date": "Wed, 2 Sep 1998 22:02:05 +0100 (BST)",
"msg_from": "Keith Parks <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "> > There is a fundamental problem lurking somewhere, and there may not be\n> > much point in going beta unless you think that more testers will help to\n> > track down the problem.\n> > \n> \n> It's unfortunate that the person who has the best chance of tracking\n> down the bug(s), Bruce, is not seeing any of the problems :-(\n> \n> I'm afraid I'm not going to be much help this week as the shift\n> I'm on leaves me little time to play with the workstation at home.\n> \n> I'll be able to do test compiles but not much debugging.\n\nWe may have to call in the big guns(Vadim), but if I am not seeing the\nproblem, he may not either on FreeBSD.\n\nAt this point, the only thing we can point at is optimization of\nindexing.c.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Wed, 2 Sep 1998 17:28:02 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests.]"
},
{
"msg_contents": "I think I have the FIX. HOLD ON.\n\n\n> Thomas G. Lockhart <[email protected]>\n> > Bruce Momjian <[email protected]>\n> > > Can we try a simple -O rather than just -O2 and -O0. Could this be \n> > > some type of optimizer bug in gcc2/Solaris?\n> > > Everything is pointing to indexing.c, from both the initdb failure and\n> > > the create function failure. But I can't see anything wrong in there,\n> > > and other platforms seem to be OK.\n> \n> Compiled with -O the results are the same as with -O2. (-O is the same as -O1)\n> \n> According to the gcc man -O0 turns off all optimisation.\n> \n> > \n> > Uh, no, Linux/i686 is showing trouble too, but not in the initdb stage.\n> > The Sparc platforms will be more sensitive to byte alignment problems,\n> > especially within C structures, so this may be illustrating a\n> > cross-platform problem more clearly.\n> > \n> > There is a repeatable indexing and (perhaps) caching problem I see in\n> > the regression tests. Annoyingly, the problems get slightly worse at the\n> > moment when compiling with -O0.\n> > \n> > There is a fundamental problem lurking somewhere, and there may not be\n> > much point in going beta unless you think that more testers will help to\n> > track down the problem.\n> > \n> \n> It's unfortunate that the person who has the best chance of tracking\n> down the bug(s), Bruce, is not seeing any of the problems :-(\n> \n> I'm afraid I'm not going to be much help this week as the shift\n> I'm on leaves me little time to play with the workstation at home.\n> \n> I'll be able to do test compiles but not much debugging.\n> \n> Keith.\n> \n> \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Wed, 2 Sep 1998 17:44:18 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests."
},
{
"msg_contents": "> At this point, the only thing we can point at is optimization of\n> indexing.c.\n\nMaybe alignment from an underlying problem, but -O0 gives me problems\ntoo on Linux/i686. I'll try ramping up in the next day or so to look at\nmy specific indexing symptom. Will be asking for help then...\n\n - Tom\n",
"msg_date": "Thu, 03 Sep 1998 02:44:39 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests.]"
},
{
"msg_contents": "> > At this point, the only thing we can point at is optimization of\n> > indexing.c.\n> \n> Maybe alignment from an underlying problem, but -O0 gives me problems\n> too on Linux/i686. I'll try ramping up in the next day or so to look at\n> my specific indexing symptom. Will be asking for help then...\n> \n> - Tom\n> \n\nFixed. cvsup and let me know.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Wed, 2 Sep 1998 22:56:27 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Core dump in regression tests.]"
}
] |
[
{
"msg_contents": "OK, I have found the problem. I looked AGAIN at CatalogIndexInsert(),\nbecause all problems seem to be localized there. I remembered something\nTom Szybist said yesterday while we were on the phone about Datum only\nbeing one value.\n\nI said they are chained together, which I saw in IndexFormDatum, but\nwhen I looked, I saw that the Datum pointer indexed in IndexFormDatum\nwas only a single Datum value, not an array of datum values like nulls\nis defined.\n\nWith single-key system indexes, this was not a problem, but with the new\nmulti-key system indicies, it is.\n\nI have attached the patch, and it is applied to the tree. Please let me\nknow if this fixes the many reported index problems. It should.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n\nIndex: src/backend/catalog/indexing.c\n===================================================================\nRCS file: /usr/local/cvsroot/pgsql/src/backend/catalog/indexing.c,v\nretrieving revision 1.29\ndiff -c -r1.29 indexing.c\n*** indexing.c\t1998/09/01 16:21:47\t1.29\n--- indexing.c\t1998/09/02 23:00:59\n***************\n*** 109,120 ****\n \tHeapTuple\tindex_tup;\n \tTupleDesc\theapDescriptor;\n \tForm_pg_index index_form;\n! \tDatum\t\tdatum;\n \tint\t\t\tnatts;\n \tAttrNumber *attnumP;\n \tFuncIndexInfo finfo,\n \t\t\t *finfoP;\n- \tchar\t\tnulls[INDEX_MAX_KEYS];\n \tint\t\t\ti;\n \n \theapDescriptor = RelationGetDescr(heapRelation);\n--- 109,120 ----\n \tHeapTuple\tindex_tup;\n \tTupleDesc\theapDescriptor;\n \tForm_pg_index index_form;\n! \tDatum\t\tdatum[INDEX_MAX_KEYS];\n! \tchar\t\tnulls[INDEX_MAX_KEYS];\n \tint\t\t\tnatts;\n \tAttrNumber *attnumP;\n \tFuncIndexInfo finfo,\n \t\t\t *finfoP;\n \tint\t\t\ti;\n \n \theapDescriptor = RelationGetDescr(heapRelation);\n***************\n*** 152,162 ****\n \t\t\t\t\t (AttrNumber *) index_form->indkey,\n \t\t\t\t\t heapTuple,\n \t\t\t\t\t heapDescriptor,\n! \t\t\t\t\t &datum,\n \t\t\t\t\t nulls,\n \t\t\t\t\t finfoP);\n \n! \t\tindexRes = index_insert(idescs[i], &datum, nulls,\n \t\t\t\t\t\t\t\t&heapTuple->t_ctid, heapRelation);\n \t\tif (indexRes)\n \t\t\tpfree(indexRes);\n--- 152,162 ----\n \t\t\t\t\t (AttrNumber *) index_form->indkey,\n \t\t\t\t\t heapTuple,\n \t\t\t\t\t heapDescriptor,\n! \t\t\t\t\t datum,\n \t\t\t\t\t nulls,\n \t\t\t\t\t finfoP);\n \n! \t\tindexRes = index_insert(idescs[i], datum, nulls,\n \t\t\t\t\t\t\t\t&heapTuple->t_ctid, heapRelation);\n \t\tif (indexRes)\n \t\t\tpfree(indexRes);",
"msg_date": "Wed, 2 Sep 1998 19:11:19 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Fix for initdb/indexing problems"
}
] |
[
{
"msg_contents": "Bruce,\n\nI'm just taking an update from CVS.\n\nI'll kick off the process to build and test before I go to bed\nand then check the results in the morning.\n\nIt's 1:45am and I've just logged off from work, connected to my\nISP and seen this mail.\n\nI look forward to seeing a clean set of regression results in \na few hours.\n\nWell done Bruce.\n\nThanks,\nKeith.\n\nBruce Momjian <[email protected]>\n> \n> OK, I have found the problem. I looked AGAIN at CatalogIndexInsert(),\n> because all problems seem to be localized there. I remembered something\n> Tom Szybist said yesterday while we were on the phone about Datum only\n> being one value.\n> \n> I said they are chained together, which I saw in IndexFormDatum, but\n> when I looked, I saw that the Datum pointer indexed in IndexFormDatum\n> was only a single Datum value, not an array of datum values like nulls\n> is defined.\n> \n> With single-key system indexes, this was not a problem, but with the new\n> multi-key system indicies, it is.\n> \n> I have attached the patch, and it is applied to the tree. Please let me\n> know if this fixes the many reported index problems. It should.\n> \n\n",
"msg_date": "Thu, 3 Sep 1998 01:46:24 +0100 (BST)",
"msg_from": "Keith Parks <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] Fix for initdb/indexing problems"
}
] |
[
{
"msg_contents": "I am still waiting for the first report from my index fix.\n\nAnyone?\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Thu, 3 Sep 1998 00:21:50 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "index fix report"
},
{
"msg_contents": "> I am still waiting for the first report from my index fix.\n> Anyone?\n\nOK, here is my interim report: everything is broken :)\n\nLooks like David's patches busted several Makefiles. Will poke at it and\nlet you know.\n\nIn the meantime, I can't test your fixes; maybe next time wait a few\nhours to let things settle down before adding new breakage? *wink*\n\n - Tom\n\ngcc -I../../../include -I../../../backend -O2 -m486 -Wall\n-Wmissing-prototypes -I../.. -Wno-error -c geqo_ox2.c -o geqo_ox2.o\nld -r -o SUBSYS.o geqo_copy.o geqo_eval.o geqo_main.o geqo_misc.o\ngeqo_params.o geqo_paths.o geqo_pool.o geqo_recombination.o\ngeqo_selection.o geqo_erx.o geqo_pmx.o geqo_cx.o geqo_px.o geqo_ox1.o\ngeqo_ox2.o\nmake[3]: Leaving directory\n`/opt/postgres/pgsql/src/backend/optimizer/geqo'\nfor i in path plan prep util geqo; do make -C $i prep/SUBSYS.o; done\nmake[3]: Entering directory\n`/opt/postgres/pgsql/src/backend/optimizer/path'\nmake[3]: *** No rule to make target `prep/SUBSYS.o'. Stop.\nmake[3]: Leaving directory\n`/opt/postgres/pgsql/src/backend/optimizer/path'\nmake[3]: Entering directory\n`/opt/postgres/pgsql/src/backend/optimizer/plan'\nmake[3]: *** No rule to make target `prep/SUBSYS.o'. Stop.\nmake[3]: Leaving directory\n`/opt/postgres/pgsql/src/backend/optimizer/plan'\nmake[3]: Entering directory\n`/opt/postgres/pgsql/src/backend/optimizer/prep'\nmake[3]: *** No rule to make target `prep/SUBSYS.o'. Stop.\nmake[3]: Leaving directory\n`/opt/postgres/pgsql/src/backend/optimizer/prep'\nmake[3]: Entering directory\n`/opt/postgres/pgsql/src/backend/optimizer/util'\nmake[3]: *** No rule to make target `prep/SUBSYS.o'. Stop.\nmake[3]: Leaving directory\n`/opt/postgres/pgsql/src/backend/optimizer/util'\nmake[3]: Entering directory\n`/opt/postgres/pgsql/src/backend/optimizer/geqo'\nmake[3]: *** No rule to make target `prep/SUBSYS.o'. Stop.\nmake[3]: Leaving directory\n`/opt/postgres/pgsql/src/backend/optimizer/geqo'\nmake[2]: *** [prep/SUBSYS.o] Error 2\nmake[2]: Leaving directory `/opt/postgres/pgsql/src/backend/optimizer'\nmake[1]: *** [optimizer.dir] Error 2\nmake[1]: Leaving directory `/opt/postgres/pgsql/src/backend'\nmake: *** [install] Error 2\n",
"msg_date": "Thu, 03 Sep 1998 04:59:33 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "> > I am still waiting for the first report from my index fix.\n> > Anyone?\n> \n> OK, here is my interim report: everything is broken :)\n> \n> Looks like David's patches busted several Makefiles. Will poke at it and\n> let you know.\n> \n> In the meantime, I can't test your fixes; maybe next time wait a few\n> hours to let things settle down before adding new breakage? *wink*\n\nIt is compiling here now. Strange. There are few problems with\nlibpgtcl and psql.c that I am fixing now.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Thu, 3 Sep 1998 01:08:12 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "> OK, it looks like there is a missing file in the tree. I had to modify\n> \n> ./backend/optimizer/prep/Makefile\n> \n> to remove a reference to a nonexistant object file prepkeyset.o\n> presumably needing to be built from prepkeyset.c.\n> \n> That got things building until the next link step, when some routines\n> were a missin'. Got that file anywhere? Seems useful...\n\nNo wonder it compiles here so nicely. Adding it now. I will also do a\nmake distclean and cvs to see if any other files are missing.\n> \n> - Tom\n> \n> commands/SUBSYS.o: In function `parse_ksqo':\n> commands/SUBSYS.o(.text+0xdff4): undefined reference to\n> `_use_keyset_query_optimizer'\n> commands/SUBSYS.o(.text+0xe014): undefined reference to\n> `_use_keyset_query_optimizer'\n> commands/SUBSYS.o: In function `show_ksqo':\n> commands/SUBSYS.o(.text+0xe045): undefined reference to\n> `_use_keyset_query_optimizer'\n> commands/SUBSYS.o: In function `reset_ksqo':\n> commands/SUBSYS.o(.text+0xe085): undefined reference to\n> `_use_keyset_query_optimizer'\n> optimizer/SUBSYS.o: In function `planner':\n> optimizer/SUBSYS.o(.text+0x564b): undefined reference to\n> `transformKeySetQuery'\n> make[1]: *** [postgres] Error 1\n> make[1]: Leaving directory `/opt/postgres/pgsql/src/backend'\n> make: *** [install] Error 2\n> \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Thu, 3 Sep 1998 01:09:50 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "OK, it looks like there is a missing file in the tree. I had to modify\n\n ./backend/optimizer/prep/Makefile\n\nto remove a reference to a nonexistant object file prepkeyset.o\npresumably needing to be built from prepkeyset.c.\n\nThat got things building until the next link step, when some routines\nwere a missin'. Got that file anywhere? Seems useful...\n\n - Tom\n\ncommands/SUBSYS.o: In function `parse_ksqo':\ncommands/SUBSYS.o(.text+0xdff4): undefined reference to\n`_use_keyset_query_optimizer'\ncommands/SUBSYS.o(.text+0xe014): undefined reference to\n`_use_keyset_query_optimizer'\ncommands/SUBSYS.o: In function `show_ksqo':\ncommands/SUBSYS.o(.text+0xe045): undefined reference to\n`_use_keyset_query_optimizer'\ncommands/SUBSYS.o: In function `reset_ksqo':\ncommands/SUBSYS.o(.text+0xe085): undefined reference to\n`_use_keyset_query_optimizer'\noptimizer/SUBSYS.o: In function `planner':\noptimizer/SUBSYS.o(.text+0x564b): undefined reference to\n`transformKeySetQuery'\nmake[1]: *** [postgres] Error 1\nmake[1]: Leaving directory `/opt/postgres/pgsql/src/backend'\nmake: *** [install] Error 2\n",
"msg_date": "Thu, 03 Sep 1998 05:11:32 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "> > I am still waiting for the first report from my index fix.\n> > Anyone?\n> \n> OK, here is my interim report: everything is broken :)\n> \n> Looks like David's patches busted several Makefiles. Will poke at it and\n> let you know.\n> \n> In the meantime, I can't test your fixes; maybe next time wait a few\n> hours to let things settle down before adding new breakage? *wink*\n\nOK, everything is there now.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Thu, 3 Sep 1998 01:18:05 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "> make distclean and cvs to see if any other files are missing.\n\nMore breakage. Will disable the tcl stuff and see if I can proceed...\n\n - Tom\n\ngcc -I../../include -I../../backend -O2 -m486 -Wall\n-Wmissing-prototypes -I../../backend -I../../include\n-I../../interfaces/libpq -fpic -c pgtclCmds.c -o pgtclCmds.o\npgtclCmds.c: In function `Pg_connect':\npgtclCmds.c:366: parse error before `else'\npgtclCmds.c:373: warning: control reaches end of non-void function\npgtclCmds.c: In function `Pg_listen':\npgtclCmds.c:1460: parse error at end of input\nmake[2]: *** [pgtclCmds.o] Error 1\nmake[2]: Leaving directory `/opt/postgres/pgsql/src/interfaces/libpgtcl'\nmake[1]: *** [install] Error 2\nmake[1]: Leaving directory `/opt/postgres/pgsql/src/interfaces'\nmake: *** [install] Error 2\n",
"msg_date": "Thu, 03 Sep 1998 05:30:25 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "> make distclean and cvs to see if any other files are missing.\n\n... And more breakage ... Fortunately I had a psql from yesterday lying\naround, so will continue testing ...\n\n - Tom\n\npsql.c: In function `SendQuery':\npsql.c:1139: warning: passing arg 1 of `handleCopyIn' from incompatible\npointer type\npsql.c:1143: warning: passing arg 1 of `handleCopyIn' from incompatible\npointer type\npsql.c: At top level:\npsql.c:2957: conflicting types for `handleCopyIn'\npsql.c:153: previous declaration of `handleCopyIn'\nmake[2]: *** [psql.o] Error 1\nmake[2]: Leaving directory `/opt/postgres/pgsql/src/bin/psql'\nmake[2]: Entering directory `/opt/postgres/pgsql/src/bin/pg_dump'\n",
"msg_date": "Thu, 03 Sep 1998 05:36:31 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "> OK, everything is there now.\n\nThe select_having test now passes. The other tests which were broken\nyesterday are still broken:\n\nconstraints .. failed -- trouble finding a new table after dropping old\n...\ncreate_index .. failed -- trouble creating an index after creating first\nsanity_check .. failed -- missing tables from previous failures, n/a\n...\nselect_views .. failed -- old (one month?) problem with core dump\n...\nrun_ruletest .. failed -- dba account name differs, n/a\n\nI did a \"make distclean\" earlier this evening, and a \"make clean\" and\n\"initdb\" during this recent build session, so things should be up to\ndate. Let's not worry about select_views until we've fixed constraints\nand create_index, since that is an older problem.\n\nI'm sure we are getting closer though...\n\n - Tom\n",
"msg_date": "Thu, 03 Sep 1998 05:52:52 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "around line 812 in access/common/heaptuple.c:\n\n\tlen = sizeof *tuple - sizeof tuple->t_bits;\n\nThis seems questionable for me. \n\ntuple is a pointer to struct HeaptupleData.\n\ntypedef struct HeapTupleData\n{\n\tunsigned int t_len;\t\t\t/* length of entire tuple */\n\n\t[snip]\n\n\tuint8\t\tt_hoff;\t\t\t/* sizeof tuple header */\n\n\tbits8\t\tt_bits[MinHeapTupleBitmapSize / 8];\n\t/* bit map of domains */\n\n\t/* MORE DATA FOLLOWS AT END OF STRUCT */\n} HeapTupleData;\n\nI think the code tries to calculate the offset from top of the\nstructure to t_bits. t_bits is the last structure member of\nHeapTupleData, and that would give the offset...\n\nNo. since the size of the whole structure is aligned to 2-byte, there\nis a \"padding\" byte after t_bits.\n\nI think more acculate way to calculate the offset is:\n\n\tlen = (char *)&tuple->t_bits[0] - (char *)tuple;\n\nI ran a test and found the first one gives len = 36, while second one\ngives 35.\n\nI'm not sure how this affects. maybe nothing (len is aligned to 8-byte\nboundary later).\n--\nTatsuo Ishii\[email protected]\n",
"msg_date": "Thu, 03 Sep 1998 15:52:19 +0900",
"msg_from": "Tatsuo Ishii <[email protected]>",
"msg_from_op": false,
"msg_subject": "questionable code in heap_formtuple()"
},
{
"msg_contents": "\n\nThomas G. Lockhart wrote:\n\n> > I am still waiting for the first report from my index fix.\n> > Anyone?\n>\n> OK, here is my interim report: everything is broken :)\n>\n> Looks like David's patches busted several Makefiles. Will poke at it and\n> let you know.\n>\n\nDid this get resolved? I reviewed the original patch, and the missing\nitems that are mentioned in this thread are in the patch.\n\n",
"msg_date": "Thu, 03 Sep 1998 09:33:17 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "> Did this get resolved?\n\nYes, a file got left out of the cvs commit; Bruce fixed it right away.\n\nUpdate: \n\nI'm still seeing problems with the regression tests, and it appears to\nbe the same symptom reported by someone else earlier: a couple of tables\n(or indices) exist but something is munged in pg_class so that I can\nonly see the entry using a \"like\" query; an \"=\" equals query does not\nreturn the row.\n\nThis may only happen with tables which have been destroyed and then\nredefined??\n\nI've done a full \"cvs update -Pd\", a \"make distclean\", and an initdb.\nI'll try a clean checkout next. If that doesn't help, then will start\npoking at it...\n\n - Tom\n",
"msg_date": "Thu, 03 Sep 1998 14:11:50 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "\n\nThomas G. Lockhart wrote:\n\n> > Did this get resolved?\n>\n> Yes, a file got left out of the cvs commit; Bruce fixed it right away.\n>\n> Update:\n>\n> I'm still seeing problems with the regression tests, and it appears to\n> be the same symptom reported by someone else earlier: a couple of tables\n> (or indices) exist but something is munged in pg_class so that I can\n> only see the entry using a \"like\" query; an \"=\" equals query does not\n> return the row.\n\nI know why this was happening. (At least on the surface) In my case,\nwhenever a I added an index to a table pg_class_relname_index was getting\ncorrupted. The nature of the corruption was that any query that used the\npg_class_relname_index to find a table that was just indexed, could no\nlonger find it. The corruption must occur on the update of pg_class when\nthe index is added. This explains why:\n\n CREATE TABLE foo (i int);\n CREATE INDEX foo_idx ON foo USING btree(i);\n\n SELECT * FROM pg_class;\n\n Showed a complete correct list of tables.\n\n SELECT * FROM pg_class WHERE = 'foo';\n and\n SELECT * FROM pg_class WHERE LIKE 'foo%';\n\n Showed nothing. I did not know LIKE was using an index. It through\nme. Nice job by sombody.\n\n SELECT * FROM pg_class WHERE LIKE '%foo';\n\n Showed my original table. But this query like the first does a full\nscan.\n\n\nIn any case I will be doing some testing myself this afternoon.\n\n\n\n\n",
"msg_date": "Thu, 03 Sep 1998 10:41:29 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "> OK, everything is there now.\n\nI did a CVSup, a cvs checkout into a new tree, and still see the same\nproblems. I'll bet that most of the symptoms in the regression tests are\ndue to the same thing, which seems to involve table munging of pg_class.\nIt looks like some tuples end up with leading garbage of some sort in\nthe first field: see the example below.\n\nI'll try to distill this down to a simpler test case. If anyone has some\nhints on where to look...\n\n - Tom\n\nregression=> select * from primary_tbl;\nERROR: primary_tbl: Table does not exist.\n\nregression=> select * from pg_class where relname = 'primary_tbl';\nrelname|reltype|relowner|relam|relpages|reltuples|relhasindex|relisshared|relkind|relnatts|relchecks|reltriggers|relhasrules|relacl\n-------+-------+--------+-----+--------+---------+-----------+-----------+-------+--------+---------+-----------+-----------+------\n(0 rows)\n\nregression=> select * from pg_class where relname like '%primary_tbl%';\nrelname \n|reltype|relowner|relam|relpages|reltuples|relhasindex|relisshared|relkind|relnatts|relchecks|reltriggers|relhasrules|relacl\n----------------+-------+--------+-----+--------+---------+-----------+-----------+-------+--------+---------+-----------+-----------+------\nprimary_tbl | 0| 500| 0| 0| 0|t \n|f |r | 2| 0| 0|f |\nprimary_tbl_pkey| 0| 500| 403| 2| 1024|f \n|f |i | 2| 0| 0|f |\n(2 rows)\n\nregression=> select * from pg_class where relname like 'primary_tbl%';\nrelname|reltype|relowner|relam|relpages|reltuples|relhasindex|relisshared|relkind|relnatts|relchecks|reltriggers|relhasrules|relacl\n-------+-------+--------+-----+--------+---------+-----------+-----------+-------+--------+---------+-----------+-----------+------\n(0 rows)\n\nregression=> select * from pg_class where relname like '%primary_tbl';\nrelname \n|reltype|relowner|relam|relpages|reltuples|relhasindex|relisshared|relkind|relnatts|relchecks|reltriggers|relhasrules|relacl\n-----------+-------+--------+-----+--------+---------+-----------+-----------+-------+--------+---------+-----------+-----------+------\nprimary_tbl| 0| 500| 0| 0| 0|t \n|f |r | 2| 0| 0|f |\n(1 row)\n",
"msg_date": "Thu, 03 Sep 1998 15:06:43 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "> \n> \n> Thomas G. Lockhart wrote:\n> \n> > > I am still waiting for the first report from my index fix.\n> > > Anyone?\n> >\n> > OK, here is my interim report: everything is broken :)\n> >\n> > Looks like David's patches busted several Makefiles. Will poke at it and\n> > let you know.\n> >\n> \n> Did this get resolved? I reviewed the original patch, and the missing\n> items that are mentioned in this thread are in the patch.\n\nResolved. I forgot to add the new file.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Thu, 3 Sep 1998 11:09:54 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "Tom, its in the index. Do an explain before each of your queries.\n\nThomas G. Lockhart wrote:\n\n> > OK, everything is there now.\n>\n> I did a CVSup, a cvs checkout into a new tree, and still see the same\n> problems. I'll bet that most of the symptoms in the regression tests are\n> due to the same thing, which seems to involve table munging of pg_class.\n> It looks like some tuples end up with leading garbage of some sort in\n> the first field: see the example below.\n>\n> I'll try to distill this down to a simpler test case. If anyone has some\n> hints on where to look...\n>\n> - Tom\n>\n> regression=> select * from primary_tbl;\n> ERROR: primary_tbl: Table does not exist.\n>\n> regression=> select * from pg_class where relname = 'primary_tbl';\n> relname|reltype|relowner|relam|relpages|reltuples|relhasindex|relisshared|relkind|relnatts|relchecks|reltriggers|relhasrules|relacl\n> -------+-------+--------+-----+--------+---------+-----------+-----------+-------+--------+---------+-----------+-----------+------\n> (0 rows)\n>\n> regression=> select * from pg_class where relname like '%primary_tbl%';\n> relname\n> |reltype|relowner|relam|relpages|reltuples|relhasindex|relisshared|relkind|relnatts|relchecks|reltriggers|relhasrules|relacl\n> ----------------+-------+--------+-----+--------+---------+-----------+-----------+-------+--------+---------+-----------+-----------+------\n> primary_tbl | 0| 500| 0| 0| 0|t\n> |f |r | 2| 0| 0|f |\n> primary_tbl_pkey| 0| 500| 403| 2| 1024|f\n> |f |i | 2| 0| 0|f |\n> (2 rows)\n>\n> regression=> select * from pg_class where relname like 'primary_tbl%';\n> relname|reltype|relowner|relam|relpages|reltuples|relhasindex|relisshared|relkind|relnatts|relchecks|reltriggers|relhasrules|relacl\n> -------+-------+--------+-----+--------+---------+-----------+-----------+-------+--------+---------+-----------+-----------+------\n> (0 rows)\n>\n> regression=> select * from pg_class where relname like '%primary_tbl';\n> relname\n> |reltype|relowner|relam|relpages|reltuples|relhasindex|relisshared|relkind|relnatts|relchecks|reltriggers|relhasrules|relacl\n> -----------+-------+--------+-----+--------+---------+-----------+-----------+-------+--------+---------+-----------+-----------+------\n> primary_tbl| 0| 500| 0| 0| 0|t\n> |f |r | 2| 0| 0|f |\n> (1 row)\n\n\n\n",
"msg_date": "Thu, 03 Sep 1998 11:13:43 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "\n\nThomas G. Lockhart wrote:\n\n> > OK, everything is there now.\n>\n> I did a CVSup, a cvs checkout into a new tree, and still see the same\n> problems.\n\nForgot to mention. I still have the problem also. Tom, what are you running on? Is platform still a factor in this problem?\n\n",
"msg_date": "Thu, 03 Sep 1998 11:19:00 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "In message <[email protected]>, \"Thomas G. Lockhart\" writes:\n> > Did this get resolved?\n> \n> Yes, a file got left out of the cvs commit; Bruce fixed it right away.\n> \n> Update: \n> \n> I'm still seeing problems with the regression tests, and it appears to\n> be the same symptom reported by someone else earlier: a couple of tables\n> (or indices) exist but something is munged in pg_class so that I can\n> only see the entry using a \"like\" query; an \"=\" equals query does not\n> return the row.\n> \n> This may only happen with tables which have been destroyed and then\n> redefined??\n> \n> I've done a full \"cvs update -Pd\", a \"make distclean\", and an initdb.\n> I'll try a clean checkout next. If that doesn't help, then will start\n> poking at it...\n> \n> - Tom\n> \n\nI just did a cvs update, and ran the regression test on solaris.\n\nI think what Tom is describes is my only remaining problem. \nTables just appear to \"vanish\". For instance this is from the\ntriggers test:\n\nQUERY: create table pkeys (pkey1 int4 not null, pkey2 text not null);\nQUERY: create table fkeys (fkey1 int4, fkey2 text, fkey3 int);\nQUERY: create table fkeys2 (fkey21 int4, fkey22 text, pkey23 int not null);\nQUERY: create index fkeys_i on fkeys (fkey1, fkey2);\nQUERY: create index fkeys2_i on fkeys2 (fkey21, fkey22);\nQUERY: create index fkeys2p_i on fkeys2 (pkey23);\nERROR: DefineIndex: fkeys2 relation not found \n\nOdd that it works the first time. The triggers test later crashes.\n\nI also had this at to top of sanity_check:\n\nQUERY: VACUUM;\nNOTICE: Index pg_class_relname_index: NUMBER OF INDEX' TUPLES (169) IS NOT THE SAME AS HEAP' (139)\nNOTICE: Index pg_class_oid_index: NUMBER OF INDEX' TUPLES (169) IS NOT THE SAME AS HEAP' (139)\nNOTICE: Rel pg_trigger: Uninitialized page 0 - fixing \n\n\nAll in all *much* better!\n\nThanks,\n\nTom Szybist\[email protected]\n",
"msg_date": "Thu, 03 Sep 1998 11:26:40 -0400",
"msg_from": "\"Thomas A. Szybist\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] index fix report "
},
{
"msg_contents": "> Forgot to mention. I still have the problem also. Tom, what are \n> you running on? Is platform still a factor in this problem?\n\nPlatform is a problem in that Bruce's FreeBSD/i686 machine does not show\nthe symptoms, but it's a pretty widespread problem beyond that afaik.\nI'm running on Linux/i686. Tatsuo sees problems on Linux/PPC. Some Sparc\nmachines running Solaris and Linux apparently still show problems.\n\nI'm guessing that it is a byte alignment difference in malloc behavior\nbetween the systems which exposes misaligned structures on some\nplatforms. How's that for pure speculation, eh?\n\n - Tom\n",
"msg_date": "Fri, 04 Sep 1998 01:22:30 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "> > Forgot to mention. I still have the problem also. Tom, what are \n> > you running on? Is platform still a factor in this problem?\n> \n> Platform is a problem in that Bruce's FreeBSD/i686 machine does not show\n> the symptoms, but it's a pretty widespread problem beyond that afaik.\n> I'm running on Linux/i686. Tatsuo sees problems on Linux/PPC. Some Sparc\n> machines running Solaris and Linux apparently still show problems.\n> \n> I'm guessing that it is a byte alignment difference in malloc behavior\n> between the systems which exposes misaligned structures on some\n> platforms. How's that for pure speculation, eh?\n\nLet me tell you what I need to help debug this.\n\nIt would help to know if it is the cache, or an index problem. It is\nsometimes hard to determine because the cache often uses the indexes to\nload the cache.\n\nCan someone step through a bad entry, and tell me where it is failing?\nIf it is in the executor, it probably is an index. EXPLAIN does show\nwhat indexes are involved. Are several indexes failing, or just one?\n\nI like the malloc idea, but am unsure how the problem just started\nhappening with the multi-key system indexes.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Thu, 3 Sep 1998 21:24:48 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "Bruce Momjian wrote:\n> \n> > > Forgot to mention. I still have the problem also. Tom, what are\n> > > you running on? Is platform still a factor in this problem?\n> >\n> > Platform is a problem in that Bruce's FreeBSD/i686 machine does not show\n> > the symptoms, but it's a pretty widespread problem beyond that afaik.\n> > I'm running on Linux/i686. Tatsuo sees problems on Linux/PPC. Some Sparc\n ^^^^^^^^^^\n> > machines running Solaris and Linux apparently still show problems.\n ^^^^^^^^^^^^^^^^^^^^^^^^\nThis is what I have:\n\nSunOS sunpine.krs.ru 5.5.1 Generic_103640-12 sun4u sparc SUNW,Ultra-4\n\nI didn't install 6.4 on this machine but could to do this...\nWhat are the problems ?\n\nVadim\n",
"msg_date": "Fri, 04 Sep 1998 11:07:41 +0800",
"msg_from": "Vadim Mikheev <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "\n\nBruce Momjian wrote:\n\n> > > Forgot to mention. I still have the problem also. Tom, what are\n> > > you running on? Is platform still a factor in this problem?\n> >\n> > Platform is a problem in that Bruce's FreeBSD/i686 machine does not show\n> > the symptoms, but it's a pretty widespread problem beyond that afaik.\n> > I'm running on Linux/i686. Tatsuo sees problems on Linux/PPC. Some Sparc\n> > machines running Solaris and Linux apparently still show problems.\n> >\n> > I'm guessing that it is a byte alignment difference in malloc behavior\n> > between the systems which exposes misaligned structures on some\n> > platforms. How's that for pure speculation, eh?\n>\n> Let me tell you what I need to help debug this.\n>\n> It would help to know if it is the cache, or an index problem. It is\n> sometimes hard to determine because the cache often uses the indexes to\n> load the cache.\n>\n> Can someone step through a bad entry, and tell me where it is failing?\n> If it is in the executor, it probably is an index. EXPLAIN does show\n> what indexes are involved. Are several indexes failing, or just one?\n>\n> I like the malloc idea, but am unsure how the problem just started\n> happening with the multi-key system indexes.\n\nI will try to frame this as best I can. I would be good it other could\nverify my statements or add to them.\n\nWhen I run this simple scenario:\n\n create table foo (i int);\n -- everything is fine\n select * from pg_class where relname = 'foo'\n -- no problem\n select * from pg_class where oid = {oid_num}\n -- no problem\n create index foo_x on foo using btree(i);\n -- Looks ok but it is not\n select * from pg_class where relname = 'foo'\n -- no rows found\n select * from pg_class where oid = {oid_num}\n -- no rows found\n -- The table and the index in pg_class cannot be found via ether index.\n -- They look like single part indexes too.\n select * from pg_class\n -- shows foo and foo_x along w/ everything else.\n -- I can use the UPDATE statement to rewrite the foo and foo_x rows into\npg_class\n -- and all is well again.\n -- INSERTing into foo does not seem to be a problem.\n -- ALTER table has similar negative effects on the system tables, but I\nhave yet to sort them all out.\n\nI have verified all this using the latest snapshot on an AIX 4.1.4 system.\nNon-gcc compiler. I will let you know if the problem is on my Linux box. I\nneed to reboot and test. But to the best of my knowledge the problem in not\nshowing itself there.\n\n",
"msg_date": "Thu, 03 Sep 1998 23:22:43 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "> When I run this simple scenario:\n> \n> create table foo (i int);\n> -- everything is fine\n> select * from pg_class where relname = 'foo'\n> -- no problem\n> select * from pg_class where oid = {oid_num}\n> -- no problem\n> create index foo_x on foo using btree(i);\n> -- Looks ok but it is not\n> select * from pg_class where relname = 'foo'\n> -- no rows found\n> select * from pg_class where oid = {oid_num}\n> -- no rows found\n> -- The table and the index in pg_class cannot be found via ether index.\n> -- They look like single part indexes too.\n> select * from pg_class\n> -- shows foo and foo_x along w/ everything else.\n> -- I can use the UPDATE statement to rewrite the foo and foo_x rows into\n> pg_class\n> -- and all is well again.\n> -- INSERTing into foo does not seem to be a problem.\n> -- ALTER table has similar negative effects on the system tables, but I\n> have yet to sort them all out.\n\nThis does help. Can you check UpdateRelationRelation(), which is called\nfrom create_index, and which calls CatalogIndexInsert()? Seems like the\nproblem must be in that area.\n\nLooks like Tatsuo Ishii is on this already, as he has suggested some\ngood fixes to heap_addheader(), which is called from\nUpdateRelationRelation().\n\nAgain, I am sorry to have broken this stuff so badly.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Fri, 4 Sep 1998 10:59:59 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "> It would help to know if it is the cache, or an index problem. It is\n> sometimes hard to determine because the cache often uses the indexes \n> to load the cache.\n> Can someone step through a bad entry, and tell me where it is failing?\n> If it is in the executor, it probably is an index. EXPLAIN does show\n> what indexes are involved. Are several indexes failing, or just one?\n\nI'm not sure how to \"step through a bad entry\" for this case. Just\nhaven't done it before, and have never used gdb on the backend. That may\nexplain why I've got so many debugging print statements :)\n\nI believe that in at least some cases the index itself is damaged. If it\nwere just problems _updating_ the cache, then stopping and restarting\nall frontends and backends might fix the problem, at least for the first\nquery. That doesn't eliminate the possibility that it is a problem with\nthe cache as it is first built though.\n\nregression=> select oid, relname from pg_class where relname =\n'primary_tbl';\noid|relname\n---+-------\n(0 rows)\n\nregression=> explain select relname\nregression-> from pg_class where relname = 'primary_key';\nNOTICE: QUERY PLAN:\n\nIndex Scan using pg_class_relname_index on pg_class\n (cost=2.03 size=2 width=32)\n\nEXPLAIN\n\nregression=> select oid, relname from pg_class\nregression-> where relname like '%primary%';\n oid|relname\n-----+----------------\n19947|primary_tbl\n19957|primary_tbl_pkey\n(2 rows)\n\nregression=> explain select oid, relname from pg_class\nregression-> where oid = 19947;\nNOTICE: QUERY PLAN:\n\nIndex Scan using pg_class_oid_index on pg_class\n (cost=2.03 size=2 width=36)\n\nEXPLAIN\n\nSo these indices appear damaged. Now here is another symptom from my\nregression tests, which appears to illustrate cache damage, though since\nit is after the fact perhaps a damaged index has just been changed\nenough in the meantime to uncover the right nodes...\n\nThe regression result shows trouble finding a relation on which to\ncreate the index, and once it has trouble it never finds the relation\n_during the same session_:\n\nQUERY: CREATE INDEX onek_unique1 ON onek USING btree(unique1 int4_ops);\nQUERY: CREATE INDEX onek_unique2 ON onek USING btree(unique2 int4_ops);\nERROR: DefineIndex: onek relation not found\nQUERY: CREATE INDEX onek_hundred ON onek USING btree(hundred int4_ops);\nERROR: DefineIndex: onek relation not found\nQUERY: CREATE INDEX onek_stringu1 ON onek USING btree(stringu1\nname_ops);\nERROR: DefineIndex: onek relation not found\nQUERY: CREATE INDEX tenk1_unique1 ON tenk1 USING btree(unique1\nint4_ops);\nQUERY: CREATE INDEX tenk1_unique2 ON tenk1 USING btree(unique2\nint4_ops);\nQUERY: CREATE INDEX tenk1_hundred ON tenk1 USING btree(hundred\nint4_ops);\nQUERY: CREATE INDEX tenk2_unique1 ON tenk2 USING btree(unique1\nint4_ops);\nQUERY: CREATE INDEX tenk2_unique2 ON tenk2 USING btree(unique2\nint4_ops);\nERROR: DefineIndex: tenk2 relation not found\nQUERY: CREATE INDEX tenk2_hundred ON tenk2 USING btree(hundred\nint4_ops);\nERROR: DefineIndex: tenk2 relation not found\n<snip other tables' indices successfully created>\n\nHowever, if I go back in after the regression test is over, the table is\nfound and the index created:\n\nregression=> CREATE INDEX onek_unique2 ON onek\nregression-> USING btree(unique2 int4_ops);\nCREATE\n\nbtw, my linux box is not quite as sensitive to the problem(s) as David's\nAIX box; his simpler test case does not fail on my machine :(\n\n - Tom\n",
"msg_date": "Fri, 04 Sep 1998 15:08:02 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "> regression=> explain select oid, relname from pg_class\n> regression-> where oid = 19947;\n> NOTICE: QUERY PLAN:\n> \n> Index Scan using pg_class_oid_index on pg_class\n> (cost=2.03 size=2 width=36)\n> \n> EXPLAIN\n> \n> So these indices appear damaged.\n\nSorry, left out one of the test cases which lead to the conclusion that\nmultiple indices are damaged on my machine:\n\nregression=> select oid, relname from pg_class\nregression-> where oid = 19947;\noid|relname\n---+-------\n(0 rows)\n\n - Tom\n",
"msg_date": "Fri, 04 Sep 1998 15:52:54 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "> > It would help to know if it is the cache, or an index problem. It is\n> > sometimes hard to determine because the cache often uses the indexes \n> > to load the cache.\n> > Can someone step through a bad entry, and tell me where it is failing?\n> > If it is in the executor, it probably is an index. EXPLAIN does show\n> > what indexes are involved. Are several indexes failing, or just one?\n> \n> I'm not sure how to \"step through a bad entry\" for this case. Just\n> haven't done it before, and have never used gdb on the backend. That may\n> explain why I've got so many debugging print statements :)\n\nOh, you are missing so much fun. Just compile with -g, and run gdb as\nthe postgres user, and do 'run -D /usr/local/pgsql/data test' and you\nget a nice prompt. You are not using the postmaster, and are not using\nthe shared buffer cache, but this is usually not a problem. Give you\nthe ability to do all sorts of things. 's' steps into functions, 'n'\nsteps over functions, 'break' stops at certain functions or line\nnumbers.\n\n> \n> I believe that in at least some cases the index itself is damaged. If it\n> were just problems _updating_ the cache, then stopping and restarting\n> all frontends and backends might fix the problem, at least for the first\n> query. That doesn't eliminate the possibility that it is a problem with\n> the cache as it is first built though.\n> \n\nOK, let me suggest something. Create a table, make it int4, stuff some\nvalues in there, create an index, do a vacuum, and make sure the index\nis being used using EXPLAIN. Then, see if you can retrieve the values\nusing the index.\n\nThis should show if the problem exists external to pg_class. I believe\nyou will find that it works fine, so it must be the system indexes that\nare at fault. Are other system indexes affected, or only pg_class\nindexes?\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Fri, 4 Sep 1998 12:13:44 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "> around line 812 in access/common/heaptuple.c:\n> \n> \tlen = sizeof *tuple - sizeof tuple->t_bits;\n> \n> This seems questionable for me. \n\nThis is interesting. They are getting the sizeof tuple->t_bits, not the\noffset, so aren't they getting this very wrong?\n\nThey are computing the size of the tuple, minus the t_bits field, which\nmeans nothing, no?\n\n> \n> tuple is a pointer to struct HeaptupleData.\n> \n> typedef struct HeapTupleData\n> {\n> \tunsigned int t_len;\t\t\t/* length of entire tuple */\n> \n> \t[snip]\n> \n> \tuint8\t\tt_hoff;\t\t\t/* sizeof tuple header */\n> \n> \tbits8\t\tt_bits[MinHeapTupleBitmapSize / 8];\n> \t/* bit map of domains */\n> \n> \t/* MORE DATA FOLLOWS AT END OF STRUCT */\n> } HeapTupleData;\n> \n> I think the code tries to calculate the offset from top of the\n> structure to t_bits. t_bits is the last structure member of\n> HeapTupleData, and that would give the offset...\n\nDoes it?\n\n> \n> No. since the size of the whole structure is aligned to 2-byte, there\n> is a \"padding\" byte after t_bits.\n> \n> I think more acculate way to calculate the offset is:\n> \n> \tlen = (char *)&tuple->t_bits[0] - (char *)tuple;\n\nYours is much better.\n\n> \n> I ran a test and found the first one gives len = 36, while second one\n> gives 35.\n> \n> I'm not sure how this affects. maybe nothing (len is aligned to 8-byte\n> boundary later).\n\nShould affect a lot, if I am understanding it properly. This is also\ndone in heap_addheader() later in the file.\n\nI just ran a little test:\n\t\n\t#include <stdio.h>\n\t\n\tstruct test {\n\t int x;\n\t int y;\n\t} test;\n\t\n\tmain()\n\t{\n\t printf(\"%d\\n\",sizeof(test.y));\n\t return 0;\n\t}\n\nand with sizeof int == 4, the program returns 4, which is not the offset\nof y, but the size of y. 6.3.2 has the same code.\n\nI must be misunderstanding this.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Fri, 4 Sep 1998 13:02:53 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] questionable code in heap_formtuple()"
},
{
"msg_contents": "> > around line 812 in access/common/heaptuple.c:\n> > \n> > \tlen = sizeof *tuple - sizeof tuple->t_bits;\n> > \n> > This seems questionable for me. \n\n\n> > I think more acculate way to calculate the offset is:\n> > \n> > \tlen = (char *)&tuple->t_bits[0] - (char *)tuple;\n\nOK, now I am more confused. Doesn't this work:\n\n len = sizeof(HeapTupleData) - offsetof(HeapTupleData.t_bits); \n\nwhile your solution is finding the size of the area before t_bits?\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Fri, 4 Sep 1998 13:51:13 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] questionable code in heap_formtuple()]"
},
{
"msg_contents": "> > > around line 812 in access/common/heaptuple.c:\n> > > \n> > > \tlen = sizeof *tuple - sizeof tuple->t_bits;\n> > > \n> > > This seems questionable for me. \n> \n> \n> > > I think more acculate way to calculate the offset is:\n> > > \n> > > \tlen = (char *)&tuple->t_bits[0] - (char *)tuple;\n> \n> OK, now I am more confused. Doesn't this work:\n> \n> len = sizeof(HeapTupleData) - offsetof(HeapTupleData.t_bits); \n> \n> while your solution is finding the size of the area before t_bits?\n\nOK, I finally get it. I was thinking HeapTupleData had the tuple data\nin the structure, while obviously it does not.\n\nSometimes there is no HeapTuple to get the size of at the point you need\nit, so I have applied a patch to do\n\n\tlen = offsetof(HeapTupleData.t_bits);\n\nwhich should fix the obvious problem Tatsuo Ishii found. Does that fix\nanything, index people?\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Fri, 4 Sep 1998 14:07:18 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] questionable code in heap_formtuple()]"
},
{
"msg_contents": "Oops, I meant:\n\n\tlen = offsetof(HeapTupleData, t_bits);\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Fri, 4 Sep 1998 14:21:23 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] questionable code in heap_formtuple()"
},
{
"msg_contents": "\n\nBruce Momjian wrote:\n\n> Oops, I meant:\n>\n> len = offsetof(HeapTupleData, t_bits);\n>\n\nNo luck so far. I am digging around to see if anything has been effected at\nall.\n\nAt line 812\n /* len = sizeof *tuple - sizeof tuple->t_bits; */\n len = offsetof(HeapTupleData, t_bits);\n\n",
"msg_date": "Fri, 04 Sep 1998 15:11:57 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] questionable code in heap_formtuple()"
},
{
"msg_contents": "At 10:59 AM 98.9.4 -0400, Bruce Momjian wrote:\n\n>This does help. Can you check UpdateRelationRelation(), which is called\n>from create_index, and which calls CatalogIndexInsert()? Seems like the\n>problem must be in that area.\n\nThe test case David showed no error on my LinuxPPC box.\nmaybe platform dependent.\n\n>Looks like Tatsuo Ishii is on this already, as he has suggested some\n>good fixes to heap_addheader(), which is called from\n>UpdateRelationRelation().\n\nNo progress so far. I'm looking for the smallest test case which definitely\ncauses problems. But the behavior of the problems seem \"random\" on LinuxBox.\nReally strange...\n\nBTW, in catalog/pg_type.h:\n\n#define Anum_pg_index_indisunique\t\t8\n\nI think this should be 9.\n\n--\nTatsuo Ishii\[email protected]\n\n",
"msg_date": "Sun, 6 Sep 1998 12:52:31 +0900",
"msg_from": "[email protected] (Tatsuo Ishii)",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "> BTW, in catalog/pg_type.h:\n>\n> #define Anum_pg_index_indisunique\t\t8\n>\n> I think this should be 9.\n\n\nYep, patch applied.\n\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sun, 6 Sep 1998 00:50:48 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "> The test case David showed no error on my LinuxPPC box.\n> maybe platform dependent.\n\nSame on my Linux/i686 box. No error with David's simple test.\n\n> No progress so far. I'm looking for the smallest test case which \n> definitely causes problems. But the behavior of the problems seem \n> \"random\" on LinuxBox. Really strange...\n\nI haven't yet tried stepping through code. But random as it seems the\nbehavior in the regression test is quite repeatable. I wonder how few\ntests we could include and still see a problem there? Maybe I'll look at\nthat a bit to see if I can help with a repeatable case.\n\nGood hunting...\n\n - Tom\n",
"msg_date": "Sun, 06 Sep 1998 05:37:59 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "> > The test case David showed no error on my LinuxPPC box.\n> > maybe platform dependent.\n> \n> Same on my Linux/i686 box. No error with David's simple test.\n> \n> > No progress so far. I'm looking for the smallest test case which \n> > definitely causes problems. But the behavior of the problems seem \n> > \"random\" on LinuxBox. Really strange...\n> \n> I haven't yet tried stepping through code. But random as it seems the\n> behavior in the regression test is quite repeatable. I wonder how few\n> tests we could include and still see a problem there? Maybe I'll look at\n> that a bit to see if I can help with a repeatable case.\n> \n> Good hunting...\n\nI just e-mailed David Hartwig who is in Maryland. I am going to dial\ninto his machine in the next day or two and see the problem for myself.\nWe will work together to see what information we can gather.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sun, 6 Sep 1998 01:43:42 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "Here are some recent observations.\n\n create table foo (bar int);\n\n select oid, relname from pg_class;\n oid|relname\n-----+-------------------------------\n 1247|pg_type\n 1249|pg_attribute\n 1255|pg_proc\n 1259|pg_class\n23296|foo\n 1261|pg_group\n 1262|pg_database\n 1264|pg_variable\n 1269|pg_log\n 1215|pg_attrdef\n 1216|pg_relcheck\n 1219|pg_trigger\n16537|pg_inherits\n16548|pg_index\n16566|pg_version\n16577|pg_statistic\n16590|pg_operator\n16614|pg_opclass\n16624|pg_am\n16654|pg_amop\n16805|pg_amproc\n16869|pg_language\n16882|pg_parg\n16946|pg_aggregate\n17002|pg_ipl\n17013|pg_inheritproc\n17025|pg_rewrite\n17040|pg_listener\n17051|pg_description\n17061|pg_attribute_relid_attnam_index\n17064|pg_attribute_relid_attnum_index\n17067|pg_attribute_attrelid_index\n17070|pg_proc_oid_index\n17073|pg_proc_proname_narg_type_index\n17076|pg_proc_prosrc_index\n17079|pg_type_oid_index\n17082|pg_type_typname_index\n17085|pg_class_oid_index\n17088|pg_class_relname_index\n17091|pg_attrdef_adrelid_index\n17094|pg_relcheck_rcrelid_index\n17097|pg_trigger_tgrelid_index\n17100|pg_description_objoid_index\n17184|pg_user\n 1260|pg_shadow\n17248|pg_rule\n17312|pg_view\n(47 rows)\n\n[ Notice where \"foo\" ends up in the list. What has changed to make it not\nbe the last row??? ]\n\nFurthermore...\n\ncreate index foo_idx on foo using btree (bar);\n\nselect oid, relname from pg_class;\n oid|relname\n-----+-------------------------------\n 1247|pg_type\n 1249|pg_attribute\n 1255|pg_proc\n 1259|pg_class\n 1261|pg_group\n 1262|pg_database\n 1264|pg_variable\n 1269|pg_log\n 1215|pg_attrdef\n 1216|pg_relcheck\n 1219|pg_trigger\n16537|pg_inherits\n16548|pg_index\n16566|pg_version\n16577|pg_statistic\n16590|pg_operator\n16614|pg_opclass\n16624|pg_am\n16654|pg_amop\n16805|pg_amproc\n16869|pg_language\n16882|pg_parg\n16946|pg_aggregate\n17002|pg_ipl\n17013|pg_inheritproc\n17025|pg_rewrite\n17040|pg_listener\n17051|pg_description\n17061|pg_attribute_relid_attnam_index\n17064|pg_attribute_relid_attnum_index\n17067|pg_attribute_attrelid_index\n17070|pg_proc_oid_index\n17073|pg_proc_proname_narg_type_index\n17076|pg_proc_prosrc_index\n17079|pg_type_oid_index\n17082|pg_type_typname_index\n17085|pg_class_oid_index\n17088|pg_class_relname_index\n17091|pg_attrdef_adrelid_index\n17094|pg_relcheck_rcrelid_index\n17097|pg_trigger_tgrelid_index\n17100|pg_description_objoid_index\n23296|foo\n17184|pg_user\n 1260|pg_shadow\n23305|foo_idx\n17248|pg_rule\n17312|pg_view\n(48 rows)\n\n[ Again neither \"foo' nor 'foo_idx are last. ]\n\nPerhaps this is normal, but I have never seen before; not in system tables or\nuser tables.\n\n\nAlso Bruce,\nAs you requested, I SELECT'ed pg_class into another table. Then, added the\nrelname and oid indexes to the new table. After making the corrections to\npg_class to make the new table usable, I was able to INSERT, UPDATE, and\nSELECT using indexes, without any problems.\n\n\n\n\n\n\n\n\n",
"msg_date": "Tue, 08 Sep 1998 15:04:01 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] index fix report"
},
{
"msg_contents": "More observations.\n\n I can produce the exact scenario on my Linux box at home. (i.e. create table,\ncreate index, pg_class index damage) I don't know why I had not come across this\nsooner. I had heard other Linux people could not produce the problem\nreliably.\n\nIt doesn't solves the problem; I just don't feel alone any more. :)\n\nTheory: Could it be that the index is ok, but that pg_class is corrupted. This\nis based on the earlier observation that shows the most recent inserts and\nupdated no being appended to the end of the table.\n\nDavid Hartwig wrote:\n\n> Here are some recent observations.\n>\n> create table foo (bar int);\n>\n> select oid, relname from pg_class;\n> oid|relname\n> -----+-------------------------------\n> 1247|pg_type\n> 1249|pg_attribute\n> 1255|pg_proc\n> 1259|pg_class\n> 23296|foo\n> 1261|pg_group\n> 1262|pg_database\n> 1264|pg_variable\n> 1269|pg_log\n> 1215|pg_attrdef\n> 1216|pg_relcheck\n> 1219|pg_trigger\n> 16537|pg_inherits\n> 16548|pg_index\n> 16566|pg_version\n> 16577|pg_statistic\n> 16590|pg_operator\n> 16614|pg_opclass\n> 16624|pg_am\n> 16654|pg_amop\n> 16805|pg_amproc\n> 16869|pg_language\n> 16882|pg_parg\n> 16946|pg_aggregate\n> 17002|pg_ipl\n> 17013|pg_inheritproc\n> 17025|pg_rewrite\n> 17040|pg_listener\n> 17051|pg_description\n> 17061|pg_attribute_relid_attnam_index\n> 17064|pg_attribute_relid_attnum_index\n> 17067|pg_attribute_attrelid_index\n> 17070|pg_proc_oid_index\n> 17073|pg_proc_proname_narg_type_index\n> 17076|pg_proc_prosrc_index\n> 17079|pg_type_oid_index\n> 17082|pg_type_typname_index\n> 17085|pg_class_oid_index\n> 17088|pg_class_relname_index\n> 17091|pg_attrdef_adrelid_index\n> 17094|pg_relcheck_rcrelid_index\n> 17097|pg_trigger_tgrelid_index\n> 17100|pg_description_objoid_index\n> 17184|pg_user\n> 1260|pg_shadow\n> 17248|pg_rule\n> 17312|pg_view\n> (47 rows)\n>\n> [ Notice where \"foo\" ends up in the list. What has changed to make it not\n> be the last row??? ]\n>\n> Furthermore...\n>\n> create index foo_idx on foo using btree (bar);\n>\n> select oid, relname from pg_class;\n> oid|relname\n> -----+-------------------------------\n> 1247|pg_type\n> 1249|pg_attribute\n> 1255|pg_proc\n> 1259|pg_class\n> 1261|pg_group\n> 1262|pg_database\n> 1264|pg_variable\n> 1269|pg_log\n> 1215|pg_attrdef\n> 1216|pg_relcheck\n> 1219|pg_trigger\n> 16537|pg_inherits\n> 16548|pg_index\n> 16566|pg_version\n> 16577|pg_statistic\n> 16590|pg_operator\n> 16614|pg_opclass\n> 16624|pg_am\n> 16654|pg_amop\n> 16805|pg_amproc\n> 16869|pg_language\n> 16882|pg_parg\n> 16946|pg_aggregate\n> 17002|pg_ipl\n> 17013|pg_inheritproc\n> 17025|pg_rewrite\n> 17040|pg_listener\n> 17051|pg_description\n> 17061|pg_attribute_relid_attnam_index\n> 17064|pg_attribute_relid_attnum_index\n> 17067|pg_attribute_attrelid_index\n> 17070|pg_proc_oid_index\n> 17073|pg_proc_proname_narg_type_index\n> 17076|pg_proc_prosrc_index\n> 17079|pg_type_oid_index\n> 17082|pg_type_typname_index\n> 17085|pg_class_oid_index\n> 17088|pg_class_relname_index\n> 17091|pg_attrdef_adrelid_index\n> 17094|pg_relcheck_rcrelid_index\n> 17097|pg_trigger_tgrelid_index\n> 17100|pg_description_objoid_index\n> 23296|foo\n> 17184|pg_user\n> 1260|pg_shadow\n> 23305|foo_idx\n> 17248|pg_rule\n> 17312|pg_view\n> (48 rows)\n>\n> [ Again neither \"foo' nor 'foo_idx are last. ]\n>\n> Perhaps this is normal, but I have never seen before; not in system tables or\n> user tables.\n>\n> Also Bruce,\n> As you requested, I SELECT'ed pg_class into another table. Then, added the\n> relname and oid indexes to the new table. After making the corrections to\n> pg_class to make the new table usable, I was able to INSERT, UPDATE, and\n> SELECT using indexes, without any problems.\n\n",
"msg_date": "Tue, 08 Sep 1998 22:45:27 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] index fix report"
}
] |
[
{
"msg_contents": "Bruce,\n\nJust to confirm, your fixes are just the job.\n\nThe regression tests run fine with only the failures I have always\nseen due to maths precision and SIGFPE handling.\n\nThanks for your persistence in tracking this \"bug\" down.\n\nKeith.\n\n\nBruce Momjian <[email protected]>\n> \n> OK, I have found the problem. I looked AGAIN at CatalogIndexInsert(),\n> because all problems seem to be localized there. I remembered something\n> Tom Szybist said yesterday while we were on the phone about Datum only\n> being one value.\n> \n> I said they are chained together, which I saw in IndexFormDatum, but\n> when I looked, I saw that the Datum pointer indexed in IndexFormDatum\n> was only a single Datum value, not an array of datum values like nulls\n> is defined.\n> \n> With single-key system indexes, this was not a problem, but with the new\n> multi-key system indicies, it is.\n> \n> I have attached the patch, and it is applied to the tree. Please let me\n> know if this fixes the many reported index problems. It should.\n> \n\n",
"msg_date": "Thu, 3 Sep 1998 10:25:37 +0100 (BST)",
"msg_from": "Keith Parks <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] Fix for initdb/indexing problems"
},
{
"msg_contents": "In message <[email protected]>, Keith Parks writes:\n> Bruce,\n> \n> Just to confirm, your fixes are just the job.\n> \n> The regression tests run fine with only the failures I have always\n> seen due to maths precision and SIGFPE handling.\n> \n> Thanks for your persistence in tracking this \"bug\" down.\n> \n> Keith.\n> \n> \n> Bruce Momjian <[email protected]>\n> > \n> > OK, I have found the problem. I looked AGAIN at CatalogIndexInsert(),\n> > because all problems seem to be localized there. I remembered something\n> > Tom Szybist said yesterday while we were on the phone about Datum only\n> > being one value.\n> > \n> > I said they are chained together, which I saw in IndexFormDatum, but\n> > when I looked, I saw that the Datum pointer indexed in IndexFormDatum\n> > was only a single Datum value, not an array of datum values like nulls\n> > is defined.\n> > \n> > With single-key system indexes, this was not a problem, but with the new\n> > multi-key system indicies, it is.\n> > \n> > I have attached the patch, and it is applied to the tree. Please let me\n> > know if this fixes the many reported index problems. It should.\n> > \n> \n> \n\nI just applied this patch to my 08/28 tree. Looks good! I'm seeing a\nbunch of other regression test failures, but I think most of these\nhave been resolved. I compiling a fresh update now. Will report later.\n(BTW I'm still in Solaris mode. I'll also take a look at S/Linux).\n\nThanks!!\n\nTom Szybist\n\[email protected]\n",
"msg_date": "Thu, 03 Sep 1998 09:23:39 -0400",
"msg_from": "\"Thomas A. Szybist\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Fix for initdb/indexing problems "
}
] |
[
{
"msg_contents": "\n\n\nI still have the same problems with one of my indices. To reproduce this\nproblem just go into pgsql/src/interfaces/ecpg/test and type make; createdb\nmm; ./perftest.\n\nThe index number1 will never go away.\n\nMichael\n\n\n",
"msg_date": "Thu, 3 Sep 1998 12:42:19 +0100",
"msg_from": "mummert&[email protected]",
"msg_from_op": true,
"msg_subject": "Index problems"
}
] |
[
{
"msg_contents": "\n\n\nI still have the same problems with one of my indices. To reproduce this\nproblem just go into pgsql/src/interfaces/ecpg/test and type make; createdb\nmm; ./perftest.\n\nThe index number1 will never go away.\n\nMichael\n\n\n",
"msg_date": "Thu, 3 Sep 1998 12:42:21 +0100",
"msg_from": "mummert&[email protected]",
"msg_from_op": true,
"msg_subject": "Index problems"
}
] |
[
{
"msg_contents": "Here is the result of regression test of the latest cvs\non Linux box, p200MMX, I compiled pgsql witj egcs using\n-O2 -mpentium - just failed tests:\n\ngeometry .. failed\nhorology .. failed\nconstraints .. failed\nconstraints .. failed\ntriggers .. failed\ncreate_index .. failed\nsanity_check .. failed\nselect_implicit .. failed\nselect_having .. failed\nmisc .. failed\nselect_views .. failed\nrun_ruletest .. failed\n\nThis is a big progress - first time I could run regression test\nsince megapatch.\n\n\tOleg\n\n_____________________________________________________________\nOleg Bartunov, sci.researcher, hostmaster of AstroNet,\nSternberg Astronomical Institute, Moscow University (Russia)\nInternet: [email protected], http://www.sai.msu.su/~megera/\nphone: +007(095)939-16-83, +007(095)939-23-83\n\n",
"msg_date": "Thu, 3 Sep 1998 17:54:07 +0400 (MSK DST)",
"msg_from": "Oleg Bartunov <[email protected]>",
"msg_from_op": true,
"msg_subject": "regression test result on latest cvs - linux-x86"
}
] |
[
{
"msg_contents": "Hello Lorenzo,\n\n PostgreSQL v6.4 which is, currently in Beta and scheduled for release\nOct. 1, is planned to have an IPV6 type (can't remember what it was\ndecided to call it). You might just want to grab the current snapshot\nand see what it has to offer.\n\t\t-DEJ\n\n\n\n> Hello, \n> \n> How big a number can be stored as a integer in the lateset version of\n> postgres. See i got some code to do IP management and since i am just\n> using IPV4 addresses right now i am able to math operations on the\n> octets w/o to much fuss, since each octet is just composed of 8 bits.\n> But of course IPV6 is composed of 4-32 bit parts , or 1 - 128 bit\n> number.\n> \n> \n> -lorenzo\n> \n> \n> \n> _________________________________________________________\n> DO YOU YAHOO!?\n> Get your free @yahoo.com address at http://mail.yahoo.com\n> \n",
"msg_date": "Thu, 3 Sep 1998 12:00:47 -0500",
"msg_from": "\"Jackson, DeJuan\" <[email protected]>",
"msg_from_op": true,
"msg_subject": "RE: [GENERAL] big numbers"
},
{
"msg_contents": "> Hello Lorenzo,\n> \n> PostgreSQL v6.4 which is, currently in Beta and scheduled for release\n> Oct. 1, is planned to have an IPV6 type (can't remember what it was\n> decided to call it). You might just want to grab the current snapshot\n> and see what it has to offer.\n> \t\t-DEJ\n> \n\nThe person who said they were going to work on the IP type has not\nresponded to my requests for a status, and nothing has been added in\nthat area in 6.4.\n\nNot sure what to do about it yet.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Thu, 3 Sep 1998 21:02:21 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [GENERAL] big numbers"
},
{
"msg_contents": "Bruce Momjian <[email protected]> writes:\n\n> The person who said they were going to work on the IP type has not\n> responded to my requests for a status, and nothing has been added in\n> that area in 6.4.\n\nThat would be me. What I said was that it looked like the thing to do\nwas to pick the best ideas the three implementations available, and\nthat I, at least, would be doing that for my local needs. I still\nplan to do that, but having recently become a father for the first\ntime, and having lots of projects going at work, I haven't found time\nyet. Unless someone beats me to it, I will be doing this soon, and\nprobably within the next couple of weeks, but obviously not in time\nfor the 6.4 beta period. Besides, I have no idea how to integrate a\nnew type as a built-in type, so someone else would have to do that.\n\n-tih\n-- \nPopularity is the hallmark of mediocrity. --Niles Crane, \"Frasier\"\n",
"msg_date": "04 Sep 1998 09:46:30 +0200",
"msg_from": "Tom Ivar Helbekkmo <[email protected]>",
"msg_from_op": false,
"msg_subject": "CIDR/IP types. Was: [GENERAL] big numbers"
},
{
"msg_contents": "> Bruce Momjian <[email protected]> writes:\n> \n> > The person who said they were going to work on the IP type has not\n> > responded to my requests for a status, and nothing has been added in\n> > that area in 6.4.\n> \n> That would be me. What I said was that it looked like the thing to do\n> was to pick the best ideas the three implementations available, and\n> that I, at least, would be doing that for my local needs. I still\n> plan to do that, but having recently become a father for the first\n> time, and having lots of projects going at work, I haven't found time\n> yet. Unless someone beats me to it, I will be doing this soon, and\n> probably within the next couple of weeks, but obviously not in time\n> for the 6.4 beta period. Besides, I have no idea how to integrate a\n> new type as a built-in type, so someone else would have to do that.\n\nI would be glad to help with integrating it. We need a decision,\npeople. Who do we want to do this, and how are we going to handle\nintegrating this into the beta, if we want to?\n\nBTW, does pg_upgrade work for people. That may be a quick fix for the\nbeta people to get these new system types WITHOUT dump/reload.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Fri, 4 Sep 1998 10:28:40 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: CIDR/IP types. Was: [GENERAL] big numbers]"
},
{
"msg_contents": "> I would be glad to help with integrating it. We need a decision,\n> people. Who do we want to do this, and how are we going to handle\n> integrating this into the beta, if we want to?\n> \n> BTW, does pg_upgrade work for people. That may be a quick fix for the\n> beta people to get these new system types WITHOUT dump/reload.\n\nBetter yet, they _should_ use pg_upgrade, so it gets some beta testing\ntoo :)\n\nI can help with making the types built-in, once there is code ready.\nHowever, until we finish tracking down the indexing problems I'd like to\nstay away from unrelated changes to the catalogs and backend code to\navoid confusing the issue.\n\nNow that I think about it, that would have probably included the\nsnprintf changes, since now people trying to do debugging may not be\nable to build with a new tree until that gets integrated...\n\n - Tom\n",
"msg_date": "Fri, 04 Sep 1998 14:54:20 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Re: CIDR/IP types. Was: [GENERAL] big numbers]"
},
{
"msg_contents": "On Fri, 4 Sep 1998, Thomas G. Lockhart wrote:\n\n> > I would be glad to help with integrating it. We need a decision,\n> > people. Who do we want to do this, and how are we going to handle\n> > integrating this into the beta, if we want to?\n> > \n> > BTW, does pg_upgrade work for people. That may be a quick fix for the\n> > beta people to get these new system types WITHOUT dump/reload.\n> \n> Better yet, they _should_ use pg_upgrade, so it gets some beta testing\n> too :)\n> \n> I can help with making the types built-in, once there is code ready.\n> However, until we finish tracking down the indexing problems I'd like to\n> stay away from unrelated changes to the catalogs and backend code to\n> avoid confusing the issue.\n> \n> Now that I think about it, that would have probably included the\n> snprintf changes, since now people trying to do debugging may not be\n> able to build with a new tree until that gets integrated...\n\n\tI'm going to be spending this afternoon on one of my Solaris 2.5.1\nmachines making sure that it does compile...I have to do an upgrade here\nanyway :) Well, not \"here\", but at work...\n\n",
"msg_date": "Fri, 4 Sep 1998 11:01:27 -0400 (EDT)",
"msg_from": "The Hermit Hacker <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Re: CIDR/IP types. Was: [GENERAL] big numbers]"
},
{
"msg_contents": "> > I would be glad to help with integrating it. We need a decision,\n> > people. Who do we want to do this, and how are we going to handle\n> > integrating this into the beta, if we want to?\n> > \n> > BTW, does pg_upgrade work for people. That may be a quick fix for the\n> > beta people to get these new system types WITHOUT dump/reload.\n> \n> Better yet, they _should_ use pg_upgrade, so it gets some beta testing\n> too :)\n> \n> I can help with making the types built-in, once there is code ready.\n> However, until we finish tracking down the indexing problems I'd like to\n> stay away from unrelated changes to the catalogs and backend code to\n> avoid confusing the issue.\n> \n> Now that I think about it, that would have probably included the\n> snprintf changes, since now people trying to do debugging may not be\n> able to build with a new tree until that gets integrated...\n\nYes, we are definately on hold until the indexing this is fixed.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Fri, 4 Sep 1998 11:54:08 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Re: CIDR/IP types. Was: [GENERAL] big numbers]"
},
{
"msg_contents": "> Bruce Momjian <[email protected]> writes:\n> \n> > The person who said they were going to work on the IP type has not\n> > responded to my requests for a status, and nothing has been added in\n> > that area in 6.4.\n> \n> That would be me. What I said was that it looked like the thing to do\n> was to pick the best ideas the three implementations available, and\n> that I, at least, would be doing that for my local needs. I still\n> plan to do that, but having recently become a father for the first\n> time, and having lots of projects going at work, I haven't found time\n> yet. Unless someone beats me to it, I will be doing this soon, and\n> probably within the next couple of weeks, but obviously not in time\n> for the 6.4 beta period. Besides, I have no idea how to integrate a\n> new type as a built-in type, so someone else would have to do that.\n\nTom, Paul Vixie has said he can work on it, and in fact he already sent\nin his version a month ago. I just had a baby three months ago, so I\nknow how busy you must be.\n\nUnfortunately, there are few people who can integrate Paul's stuff with\nthe current ip_and_mac code, to get the best of both. I would hate to\nthrow out the ip_and_mac stuff without knowing if it has certain\nadvantages over his in certain areas.\n\nI can take care of putting the code into the main PostgreSQL system, but\nI need someone to give me a definitive cidr/ip type that I can\nintegrate.\n\nPeople really want this for 6.4. We are in beta, but we can add this\ntype IF we can get it integrated within the next week or ten days.\n\nWhen do you think you can you look over both versions, and send me one\ngood version to work with? \n\nI can take it from there, and Paul and I can work out any bugs in the\ncode.\n\nEven if you just say, \"Paul's is better, throw out ip_and_mac\", that is\nall we need.\n\n--\nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Fri, 4 Sep 1998 14:15:55 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: CIDR/IP types. Was: [GENERAL] big numbers"
},
{
"msg_contents": "> I can take care of putting the code into the main PostgreSQL system, but\n> I need someone to give me a definitive cidr/ip type that I can\n> integrate.\n> \n> People really want this for 6.4. We are in beta, but we can add this\n> type IF we can get it integrated within the next week or ten days.\n> \n> When do you think you can you look over both versions, and send me one\n> good version to work with? \n> \n> I can take it from there, and Paul and I can work out any bugs in the\n> code.\n> \n> Even if you just say, \"Paul's is better, throw out ip_and_mac\", that is\n> all we need.\n\ni don't think it's that clear cut. my type is intended for layer 3\napplications (IP) where either hosts or networks (or subnets including\nvariable-width subnets) need to be used as keys. the ip_and_mac type\nis host-only but has an unfortunate bridging between layer 3 and layer 2.\nin my opinion these are separate types, and since cidr is ready to go in\nwe ought to defer ip_and_mac to 6.5, and refocus it on layer 2 applications.\n\nconsider an ARP or DHCP table, which maps between layer 3 and layer 2.\nhaving a type optimized for layer 3 and a different type optimized for\nlayer 2 creates no ugliness in my mind, and in fact serves the only need\ni can imagine better than a single multihedral type would do.\n\nnote that cidr as supplied is capable of holding ipv6, which is also a\nlayer 3 entity. changing the name from CIDR to INET would be ok by me,\nbut making a type which is capable of holding either a layer 3 entity\nor a layer 2 one would create semantic tension in my mind about it.\n",
"msg_date": "Fri, 04 Sep 1998 11:24:59 -0700",
"msg_from": "Paul A Vixie <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: CIDR/IP types. Was: [GENERAL] big numbers "
},
{
"msg_contents": "On Fri, 4 Sep 1998, Bruce Momjian wrote:\n\n> Unfortunately, there are few people who can integrate Paul's stuff with\n> the current ip_and_mac code, to get the best of both. I would hate to\n> throw out the ip_and_mac stuff without knowing if it has certain\n> advantages over his in certain areas.\n\n\tCan we integrate Paul's CIDR type to give us the base, leave the\nip_and_mac stuff in contrib and then once Tom has a spare moment between\nfeedings *grin* we can get what is in the ip_and_mac stuff integrated? \n\n> Even if you just say, \"Paul's is better, throw out ip_and_mac\", that is\n> all we need.\n\n\tThat woudn't be wise...Paul's stuff focuses on the ip aspect of\nip_and_mac, not the the _and_mac part, which I feel to be as valuable,\nespecially in a DHCP environment :)\n\n\n",
"msg_date": "Fri, 4 Sep 1998 14:40:14 -0400 (EDT)",
"msg_from": "The Hermit Hacker <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Re: CIDR/IP types. Was: [GENERAL] big numbers"
},
{
"msg_contents": "On Fri, Sep 04, 1998 at 02:15:55PM -0400, Bruce Momjian wrote:\n> > plan to do that, but having recently become a father for the first\n\nCongrats Mark. How do you feel getting up each night? :-)\n\n> Tom, Paul Vixie has said he can work on it, and in fact he already sent\n> in his version a month ago. I just had a baby three months ago, so I\n> know how busy you must be.\n\nOops, missed that. Congrats to you also, Bruce.\n\nMichael\n-- \nMichael Meskes\t\t\[email protected], [email protected]\nGo SF49ers! Go Rhein Fire!\tUse Debian GNU/Linux! \n",
"msg_date": "Fri, 4 Sep 1998 21:15:21 +0200",
"msg_from": "Michael Meskes <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Re: CIDR/IP types. Was: [GENERAL] big numbers"
},
{
"msg_contents": "Bruce Momjian wrote:\n\n> When do you think you can you look over both versions, and send me\n> one good version to work with?\n\nI've got something working right now, by taking what I was using, and\nchanging it to work the way Paul's code does, with some enhancements:\nMy code is ready for storing both IPV4 and IPV6 at the same time with\nvariable length storage in the data base, and it's got Aleksei's index\nintegration in place. The type name is still \"ipaddr\" -- but that's\neasy to change, of course.\n\n> Even if you just say, \"Paul's is better, throw out ip_and_mac\", that\n> is all we need.\n\nI am definitely *not* going to say \"I can do this better than Vixie\".\n\nThe way I feel about this right now is that Paul's code is better than\nwhat I originally submitted, and better than Aleksei's improvements on\nthat code. However, what I currently run has certain improvements\nover all of those versions, and I kind of like the way it's going...\n\nI'll append it below. Take a look, and let me know what you think.\n\nOh, and a correction: Paul Vixie wrote:\n\n> the ip_and_mac type is host-only but has an unfortunate bridging\n> between layer 3 and layer 2.\n\nNo, it was (and is) two different types, just packaged in the same\ndirectory because I thought they conceptually belonged together.\n\nAnyway, I'm appending a shar of what I've got right now. It's only\nminimally tested so far, and I'm *not* a professional programmer.\nI'm basically just having a lot of fun with this, while it is at the\nsame time useful for me in my work, and if what I write can be of use\nto others, that's great! :-)\n\n-tih\n-- \nPopularity is the hallmark of mediocrity. --Niles Crane, \"Frasier\"\n\n# This is a shell archive. Save it in a file, remove anything before\n# this line, and then unpack it by entering \"sh file\". Note, it may\n# create directories; files and directories will be owned by you and\n# have default permissions.\n#\n# This archive contains:\n#\n#\tMakefile\n#\tREADME\n#\tinet_net_ntop.c\n#\tinet_net_pton.c\n#\tip.c\n#\tip.sql.in\n#\tmac.c\n#\tmac.h\n#\tmac.sql.in\n#\ttest.sql\n#\necho x - Makefile\nsed 's/^X//' >Makefile << 'END-of-Makefile'\nX#\nX#\tPostgreSQL types for IP and MAC addresses\nX#\nX#\t$Id: Makefile,v 1.4 1998/09/08 12:23:30 tih Exp $\nX\nXPGINST=/usr/local/pgsql\nXTARGET=/u/tih/databases\nX\nXall: ip.so mac.so ip.sql mac.sql\nX\nXip.so: ip.o inet_net_ntop.o inet_net_pton.o\nX\tld -Bshareable -o ip.so ip.o inet_net_ntop.o inet_net_pton.o\nX\nXip.o: ip.c\nX\tcc -g -O -fPIC -I${PGINST}/include -c ip.c\nX\nXinet_net_ntop.o: inet_net_ntop.c\nX\tcc -g -O -fPIC -c inet_net_ntop.c\nX\nXinet_net_pton.o: inet_net_pton.c\nX\tcc -g -O -fPIC -c inet_net_pton.c\nX\nXmac.so: mac.o\nX\tld -Bshareable -o mac.so mac.o\nX\nXmac.o: mac.c mac.h\nX\tcc -g -O -fPIC -I${PGINST}/include -c mac.c\nX\nXip.sql: ip.sql.in\nX\tcat ip.sql.in | sed s@TARGET@${TARGET}/modules@ > ip.sql\nX\nXmac.sql: mac.sql.in\nX\tcat mac.sql.in | sed s@TARGET@${TARGET}/modules@ > mac.sql\nX\nXinstall: ip.so mac.so\nX\tinstall -c ip.sql ip.so mac.sql mac.so ${TARGET}/modules\nX\nXclean:\nX\trm -f *.o *.so ip.sql mac.sql\nX\nXFILES=Makefile README inet_net_ntop.c inet_net_pton.c \\\nX\tip.c ip.sql.in mac.c mac.h mac.sql.in test.sql\nX\nXip+mac.shar: ${FILES}\nX\tshar ${FILES} > ip+mac.shar\nX\nX#\nX#\teof\nX#\nEND-of-Makefile\necho x - README\nsed 's/^X//' >README << 'END-of-README'\nXPostgreSQL type extensions for IP and MAC addresses.\nX---------------------------------------------------\nX\nX$Id: README,v 1.2 1998/09/08 12:10:22 tih Exp $\nX\nXI needed to record IP and MAC level ethernet addresses in a data\nXbase, and I really didn't want to store them as plain strings, with\nXno enforced error checking, so I put together the accompanying code\nXas my first experiment with adding a data type to PostgreSQL. I\nXthen thought that this might be useful to others, both directly and\nXas a very simple example of how to do this sort of thing, so I\nXsubmitted it to the PostgreSQL project for inclusion in the contrib\nXdirectory. Since then, that directory has been modified to contain\nXAleksei Roudnev's implementation, which is based on mine.\nX\nXFor those who have seen my previous contribution of these types, note\nXthat much has changed: I've modified the IP address type to work the\nXway Paul Vixie did with his CIDR type. In fact, I've pretty much just\nXstolen his solution, modifying it into my framework in such a way as\nXto facilitate the addition of IPV6 handling code in the future. I've\nXpretty much ignored Aleksei's C code, but I've added his SQL code to\nXenter the necessary operators into the various system tables needed to\nXmake the types indexable.\nX\nXIP addresses are implemented as a struct of fixed in-memory length,\nXbut variable on-disk storage size. For IPV4, it contains the address\nXfamily (AF_INET), the CIDR prefix length and four byte address. For\nXIPV6, the address family will be different, and the address longer.\nX\nXThe external representation of an IP address generally looks like\nX'158.37.96.15/32'. This address happens to be part of a subnet where\nXI work; '158.37.96.0/24', which itself is a part of the larger subnet\nXallocated to our site, which is '158.37.96.0/21', which again, if you\nXgo by the old book, is part of the class \"B\" net '158.37.0.0/16'.\nX\nXInput and output functions are supplied, along with the \"normal\" <,\nX<=, =, >=, > and <> operators, which all do what you expect. In\nXaddition, there are operators to check for networks or addresses being\nXsubnets of or addresses contained within other networks. << tests\nXwhether the left operand is contained within the right, <<= includes\nXequality, >> and >>= do the same things the opposite way.\nX\nXThe input and output functions use routines from Paul Vixie's BIND,\nXand I've snarfed the source files inet_net_ntop.c and inet_net_pton.c\nXdirectly from a recent distribution of that code. They are included\nXhere to avoid the need to fetch and install the BIND libraries to be\nXable to use this code. IANAL, but it looks from the copyright\nXmessages in the files as if this should be acceptable. Read the\nXdocumentation in inet_net_pton.c to see the legal input formats.\nX\nXMAC level ethernet addresses are implemented as a 6 byte struct that\nXcontains the address as unsigned chars. Several input forms are\nXaccepted; the following are all the same address: '08002b:010203',\nX'08002b-010203', '0800.2b01.0203', '08-00-2b-01-02-03' and\nX'08:00:2b:01:02:03'. Upper and lower case is accepted for the digits\nX'a' through 'f'. Output is always in the latter of the given forms.\nX\nXAs with IP addresses, input and output functions are supplied as well\nXas the \"normal\" operators, which do what you expect. As an extra\nXfeature, a function macaddr_manuf() is defined, which returns the name\nXof the manufacturer as a string. This is currently held in a\nXhard-coded struct internal to the C module -- it might be smarter to\nXput this information into an actual data base table, and look up the\nXmanufacturer there.\nX\nXMany thanks to Aleksei Roudnev and Paul Vixie for their fine work!\nX\nXI don't know what changes are needed to the Makefile for other systems\nXthan the one I'm running (NetBSD 1.3), but anyway: to install on a BSD\nXsystem: fix the path names in the Makefile if you need to, then make,\nXmake install, slurp the SQL files into psql or whatever, and you're\nXoff. Enjoy!\nX\nXBergen, Norway, 1998-08-09, Tom Ivar Helbekkmo ([email protected]).\nEND-of-README\necho x - inet_net_ntop.c\nsed 's/^X//' >inet_net_ntop.c << 'END-of-inet_net_ntop.c'\nX/*\nX * Copyright (c) 1996 by Internet Software Consortium.\nX *\nX * Permission to use, copy, modify, and distribute this software for any\nX * purpose with or without fee is hereby granted, provided that the above\nX * copyright notice and this permission notice appear in all copies.\nX *\nX * THE SOFTWARE IS PROVIDED \"AS IS\" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS\nX * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES\nX * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE\nX * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL\nX * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR\nX * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS\nX * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\nX * SOFTWARE.\nX */\nX\nX#if defined(LIBC_SCCS) && !defined(lint)\nXstatic const char rcsid[] = \"$Id: inet_net_ntop.c,v 8.2 1996/08/08 06:54:44 vixie Exp $\";\nX#endif\nX\nX#include <sys/types.h>\nX#include <sys/socket.h>\nX#include <netinet/in.h>\nX#include <arpa/inet.h>\nX\nX#include <errno.h>\nX#include <stdio.h>\nX#include <string.h>\nX#include <stdlib.h>\nX\nX#ifdef SPRINTF_CHAR\nX# define SPRINTF(x) strlen(sprintf/**/x)\nX#else\nX# define SPRINTF(x) ((size_t)sprintf x)\nX#endif\nX\nXstatic char *\tinet_net_ntop_ipv4 __P((const u_char *src, int bits,\nX\t\t\t\t\tchar *dst, size_t size));\nX\nX/*\nX * char *\nX * inet_net_ntop(af, src, bits, dst, size)\nX *\tconvert network number from network to presentation format.\nX *\tgenerates CIDR style result always.\nX * return:\nX *\tpointer to dst, or NULL if an error occurred (check errno).\nX * author:\nX *\tPaul Vixie (ISC), July 1996\nX */\nXchar *\nXinet_net_ntop(af, src, bits, dst, size)\nX\tint af;\nX\tconst void *src;\nX\tint bits;\nX\tchar *dst;\nX\tsize_t size;\nX{\nX\tswitch (af) {\nX\tcase AF_INET:\nX\t\treturn (inet_net_ntop_ipv4(src, bits, dst, size));\nX\tdefault:\nX\t\terrno = EAFNOSUPPORT;\nX\t\treturn (NULL);\nX\t}\nX}\nX\nX/*\nX * static char *\nX * inet_net_ntop_ipv4(src, bits, dst, size)\nX *\tconvert IPv4 network number from network to presentation format.\nX *\tgenerates CIDR style result always.\nX * return:\nX *\tpointer to dst, or NULL if an error occurred (check errno).\nX * note:\nX *\tnetwork byte order assumed. this means 192.5.5.240/28 has\nX *\t0x11110000 in its fourth octet.\nX * author:\nX *\tPaul Vixie (ISC), July 1996\nX */\nXstatic char *\nXinet_net_ntop_ipv4(src, bits, dst, size)\nX\tconst u_char *src;\nX\tint bits;\nX\tchar *dst;\nX\tsize_t size;\nX{\nX\tchar *odst = dst;\nX\tchar *t;\nX\tu_int m;\nX\tint b;\nX\nX\tif (bits < 0 || bits > 32) {\nX\t\terrno = EINVAL;\nX\t\treturn (NULL);\nX\t}\nX\tif (bits == 0) {\nX\t\tif (size < sizeof \"0\")\nX\t\t\tgoto emsgsize;\nX\t\t*dst++ = '0';\nX\t\t*dst = '\\0';\nX\t}\nX\nX\t/* Format whole octets. */\nX\tfor (b = bits / 8; b > 0; b--) {\nX\t\tif (size < sizeof \"255.\")\nX\t\t\tgoto emsgsize;\nX\t\tt = dst;\nX\t\tdst += SPRINTF((dst, \"%u\", *src++));\nX\t\tif (b > 1) {\nX\t\t\t*dst++ = '.';\nX\t\t\t*dst = '\\0';\nX\t\t}\nX\t\tsize -= (size_t)(dst - t);\nX\t}\nX\nX\t/* Format partial octet. */\nX\tb = bits % 8;\nX\tif (b > 0) {\nX\t\tif (size < sizeof \".255\")\nX\t\t\tgoto emsgsize;\nX\t\tt = dst;\nX\t\tif (dst != odst)\nX\t\t\t*dst++ = '.';\nX\t\tm = ((1 << b) - 1) << (8 - b);\nX\t\tdst += SPRINTF((dst, \"%u\", *src & m));\nX\t\tsize -= (size_t)(dst - t);\nX\t}\nX\nX\t/* Format CIDR /width. */\nX\tif (size < sizeof \"/32\")\nX\t\tgoto emsgsize;\nX\tdst += SPRINTF((dst, \"/%u\", bits));\nX\treturn (odst);\nX\nX emsgsize:\nX\terrno = EMSGSIZE;\nX\treturn (NULL);\nX}\nEND-of-inet_net_ntop.c\necho x - inet_net_pton.c\nsed 's/^X//' >inet_net_pton.c << 'END-of-inet_net_pton.c'\nX/*\nX * Copyright (c) 1996 by Internet Software Consortium.\nX *\nX * Permission to use, copy, modify, and distribute this software for any\nX * purpose with or without fee is hereby granted, provided that the above\nX * copyright notice and this permission notice appear in all copies.\nX *\nX * THE SOFTWARE IS PROVIDED \"AS IS\" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS\nX * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES\nX * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE\nX * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL\nX * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR\nX * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS\nX * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\nX * SOFTWARE.\nX */\nX\nX#if defined(LIBC_SCCS) && !defined(lint)\nXstatic const char rcsid[] = \"$Id: inet_net_pton.c,v 8.3 1996/11/11 06:36:52 vixie Exp $\";\nX#endif\nX\nX#include <sys/types.h>\nX#include <sys/socket.h>\nX#include <netinet/in.h>\nX#include <arpa/inet.h>\nX\nX#include <assert.h>\nX#include <ctype.h>\nX#include <errno.h>\nX#include <stdio.h>\nX#include <string.h>\nX#include <stdlib.h>\nX\nX#ifdef SPRINTF_CHAR\nX# define SPRINTF(x) strlen(sprintf/**/x)\nX#else\nX# define SPRINTF(x) ((size_t)sprintf x)\nX#endif\nX\nXstatic int\tinet_net_pton_ipv4 __P((const char *src, u_char *dst,\nX\t\t\t\t\tsize_t size));\nX\nX/*\nX * static int\nX * inet_net_pton(af, src, dst, size)\nX *\tconvert network number from presentation to network format.\nX *\taccepts hex octets, hex strings, decimal octets, and /CIDR.\nX *\t\"size\" is in bytes and describes \"dst\".\nX * return:\nX *\tnumber of bits, either imputed classfully or specified with /CIDR,\nX *\tor -1 if some failure occurred (check errno). ENOENT means it was\nX *\tnot a valid network specification.\nX * author:\nX *\tPaul Vixie (ISC), June 1996\nX */\nXint\nXinet_net_pton(af, src, dst, size)\nX\tint af;\nX\tconst char *src;\nX\tvoid *dst;\nX\tsize_t size;\nX{\nX\tswitch (af) {\nX\tcase AF_INET:\nX\t\treturn (inet_net_pton_ipv4(src, dst, size));\nX\tdefault:\nX\t\terrno = EAFNOSUPPORT;\nX\t\treturn (-1);\nX\t}\nX}\nX\nX/*\nX * static int\nX * inet_net_pton_ipv4(src, dst, size)\nX *\tconvert IPv4 network number from presentation to network format.\nX *\taccepts hex octets, hex strings, decimal octets, and /CIDR.\nX *\t\"size\" is in bytes and describes \"dst\".\nX * return:\nX *\tnumber of bits, either imputed classfully or specified with /CIDR,\nX *\tor -1 if some failure occurred (check errno). ENOENT means it was\nX *\tnot an IPv4 network specification.\nX * note:\nX *\tnetwork byte order assumed. this means 192.5.5.240/28 has\nX *\t0x11110000 in its fourth octet.\nX * author:\nX *\tPaul Vixie (ISC), June 1996\nX */\nXstatic int\nXinet_net_pton_ipv4(src, dst, size)\nX\tconst char *src;\nX\tu_char *dst;\nX\tsize_t size;\nX{\nX\tstatic const char\nX\t\txdigits[] = \"0123456789abcdef\",\nX\t\tdigits[] = \"0123456789\";\nX\tint n, ch, tmp, dirty, bits;\nX\tconst u_char *odst = dst;\nX\nX\tch = *src++;\nX\tif (ch == '0' && (src[0] == 'x' || src[0] == 'X')\nX\t && isascii(src[1]) && isxdigit(src[1])) {\nX\t\t/* Hexadecimal: Eat nybble string. */\nX\t\tif (size <= 0)\nX\t\t\tgoto emsgsize;\nX\t\t*dst = 0, dirty = 0;\nX\t\tsrc++;\t/* skip x or X. */\nX\t\twhile ((ch = *src++) != '\\0' &&\nX\t\t isascii(ch) && isxdigit(ch)) {\nX\t\t\tif (isupper(ch))\nX\t\t\t\tch = tolower(ch);\nX\t\t\tn = strchr(xdigits, ch) - xdigits;\nX\t\t\tassert(n >= 0 && n <= 15);\nX\t\t\t*dst |= n;\nX\t\t\tif (!dirty++)\nX\t\t\t\t*dst <<= 4;\nX\t\t\telse if (size-- > 0)\nX\t\t\t\t*++dst = 0, dirty = 0;\nX\t\t\telse\nX\t\t\t\tgoto emsgsize;\nX\t\t}\nX\t\tif (dirty)\nX\t\t\tsize--;\nX\t} else if (isascii(ch) && isdigit(ch)) {\nX\t\t/* Decimal: eat dotted digit string. */\nX\t\tfor (;;) {\nX\t\t\ttmp = 0;\nX\t\t\tdo {\nX\t\t\t\tn = strchr(digits, ch) - digits;\nX\t\t\t\tassert(n >= 0 && n <= 9);\nX\t\t\t\ttmp *= 10;\nX\t\t\t\ttmp += n;\nX\t\t\t\tif (tmp > 255)\nX\t\t\t\t\tgoto enoent;\nX\t\t\t} while ((ch = *src++) != '\\0' &&\nX\t\t\t\t isascii(ch) && isdigit(ch));\nX\t\t\tif (size-- <= 0)\nX\t\t\t\tgoto emsgsize;\nX\t\t\t*dst++ = (u_char) tmp;\nX\t\t\tif (ch == '\\0' || ch == '/')\nX\t\t\t\tbreak;\nX\t\t\tif (ch != '.')\nX\t\t\t\tgoto enoent;\nX\t\t\tch = *src++;\nX\t\t\tif (!isascii(ch) || !isdigit(ch))\nX\t\t\t\tgoto enoent;\nX\t\t}\nX\t} else\nX\t\tgoto enoent;\nX\nX\tbits = -1;\nX\tif (ch == '/' && isascii(src[0]) && isdigit(src[0]) && dst > odst) {\nX\t\t/* CIDR width specifier. Nothing can follow it. */\nX\t\tch = *src++;\t/* Skip over the /. */\nX\t\tbits = 0;\nX\t\tdo {\nX\t\t\tn = strchr(digits, ch) - digits;\nX\t\t\tassert(n >= 0 && n <= 9);\nX\t\t\tbits *= 10;\nX\t\t\tbits += n;\nX\t\t} while ((ch = *src++) != '\\0' &&\nX\t\t\t isascii(ch) && isdigit(ch));\nX\t\tif (ch != '\\0')\nX\t\t\tgoto enoent;\nX\t\tif (bits > 32)\nX\t\t\tgoto emsgsize;\nX\t}\nX\nX\t/* Firey death and destruction unless we prefetched EOS. */\nX\tif (ch != '\\0')\nX\t\tgoto enoent;\nX\nX\t/* If nothing was written to the destination, we found no address. */\nX\tif (dst == odst)\nX\t\tgoto enoent;\nX\t/* If no CIDR spec was given, infer width from net class. */\nX\tif (bits == -1) {\nX\t\tif (*odst >= 240)\t/* Class E */\nX\t\t\tbits = 32;\nX\t\telse if (*odst >= 224)\t/* Class D */\nX\t\t\tbits = 4;\nX\t\telse if (*odst >= 192)\t/* Class C */\nX\t\t\tbits = 24;\nX\t\telse if (*odst >= 128)\t/* Class B */\nX\t\t\tbits = 16;\nX\t\telse\t\t\t/* Class A */\nX\t\t\tbits = 8;\nX\t\t/* If imputed mask is narrower than specified octets, widen. */\nX\t\tif (bits >= 8 && bits < ((dst - odst) * 8))\nX\t\t\tbits = (dst - odst) * 8;\nX\t}\nX\t/* Extend network to cover the actual mask. */\nX\twhile (bits > ((dst - odst) * 8)) {\nX\t\tif (size-- <= 0)\nX\t\t\tgoto emsgsize;\nX\t\t*dst++ = '\\0';\nX\t}\nX\treturn (bits);\nX\nX enoent:\nX\terrno = ENOENT;\nX\treturn (-1);\nX\nX emsgsize:\nX\terrno = EMSGSIZE;\nX\treturn (-1);\nX}\nEND-of-inet_net_pton.c\necho x - ip.c\nsed 's/^X//' >ip.c << 'END-of-ip.c'\nX/*\nX *\tPostgreSQL type definitions for IP addresses. This\nX *\tis for IP V4 CIDR notation, but prepared for V6: just\nX *\tadd the necessary bits where the comments indicate.\nX *\nX *\t$Id: ip.c,v 1.2 1998/09/08 12:10:36 tih Exp $\nX */\nX\nX#include <sys/types.h>\nX#include <sys/socket.h>\nX\nX#include <stdio.h>\nX#include <errno.h>\nX\nX#include <netinet/in.h>\nX#include <arpa/inet.h>\nX\nX#include <postgres.h>\nX#include <utils/palloc.h>\nX\nX/*\nX *\tThis is the internal storage format for IP addresses:\nX */\nX\nXtypedef struct {\nX unsigned char family;\nX unsigned char bits;\nX union {\nX u_int32_t ipv4_addr;\t/* network byte order */\nX\t\t\t\t/* add IPV6 address type here */\nX } addr;\nX} ipaddr_struct;\nX\nXtypedef struct varlena ipaddr;\nX\nX/*\nX *\tAccess macros. Add IPV6 support.\nX */\nX\nX#define ip_addrsize(ipaddrptr) \\\nX\t(((ipaddr_struct *)VARDATA(ipaddrptr))->family == AF_INET ? 4 : -1)\nX\nX#define ip_family(ipaddrptr) \\\nX\t(((ipaddr_struct *)VARDATA(ipaddrptr))->family)\nX\nX#define ip_bits(ipaddrptr) \\\nX\t(((ipaddr_struct *)VARDATA(ipaddrptr))->bits)\nX\nX#define ip_v4addr(ipaddrptr) \\\nX\t(((ipaddr_struct *)VARDATA(ipaddrptr))->addr.ipv4_addr)\nX\nX/*\nX *\tVarious forward declarations:\nX */\nX\nXipaddr *ipaddr_in(char *str);\nXchar *ipaddr_out(ipaddr *addr);\nX\nXbool ipaddr_lt(ipaddr *a1, ipaddr *a2);\nXbool ipaddr_le(ipaddr *a1, ipaddr *a2);\nXbool ipaddr_eq(ipaddr *a1, ipaddr *a2);\nXbool ipaddr_ge(ipaddr *a1, ipaddr *a2);\nXbool ipaddr_gt(ipaddr *a1, ipaddr *a2);\nX\nXbool ipaddr_ne(ipaddr *a1, ipaddr *a2);\nX\nXbool ipaddr_sub(ipaddr *a1, ipaddr *a2);\nXbool ipaddr_subeq(ipaddr *a1, ipaddr *a2);\nXbool ipaddr_sup(ipaddr *a1, ipaddr *a2);\nXbool ipaddr_supeq(ipaddr *a1, ipaddr *a2);\nX\nXint4 ipaddr_cmp(ipaddr *a1, ipaddr *a2);\nX\nXint v4bitncmp(u_int32_t a1, u_int32_t a2, int bits);\nX\nX/*\nX *\tIP address reader.\nX */\nX\nXipaddr *ipaddr_in(char *src) {\nX int bits;\nX ipaddr *dst;\nX\nX dst = palloc(VARHDRSZ + sizeof(ipaddr_struct));\nX if (dst == NULL) {\nX elog(ERROR, \"unable to allocate memory in ipaddr_in()\");\nX return(NULL);\nX }\nX /* First, try for an IP V4 address: */\nX ip_family(dst) = AF_INET;\nX bits = inet_net_pton(ip_family(dst), src, &ip_v4addr(dst), ip_addrsize(dst));\nX if ((bits < 0) || (bits > 32)) {\nX /* Go for an IPV6 address here, before faulting out: */\nX elog(ERROR, \"could not parse \\\"%s\\\"\", src);\nX pfree(dst);\nX return(NULL);\nX }\nX VARSIZE(dst) = VARHDRSZ\nX + ((char *)&ip_v4addr(dst) - (char *)VARDATA(dst))\nX + ip_addrsize(dst);\nX ip_bits(dst) = bits;\nX return(dst);\nX}\nX\nX/*\nX *\tIP address output function.\nX */\nX\nXchar *ipaddr_out(ipaddr *src) {\nX char *dst, tmp[sizeof(\"255.255.255.255/32\")];\nX\nX if (ip_family(src) == AF_INET) {\nX /* It's an IP V4 address: */\nX if (inet_net_ntop(AF_INET, &ip_v4addr(src), ip_bits(src),\nX\t\t tmp, sizeof(tmp)) < 0) {\nX elog(ERROR, \"unable to print address (%s)\", strerror(errno));\nX return(NULL);\nX }\nX } else {\nX /* Go for an IPV6 address here, before faulting out: */\nX elog(ERROR, \"unknown address family (%d)\", ip_family(src));\nX return(NULL);\nX }\nX dst = palloc(strlen(tmp) + 1);\nX if (dst == NULL) {\nX elog(ERROR, \"unable to allocate memory in ipaddr_out()\");\nX return(NULL);\nX }\nX strcpy(dst, tmp);\nX return(dst);\nX}\nX\nX/*\nX *\tBoolean tests for magnitude. Add V4/V6 testing!\nX */\nX\nXbool ipaddr_lt(ipaddr *a1, ipaddr *a2) {\nX if ((ip_family(a1) == AF_INET) && (ip_family(a2) == AF_INET)) {\nX int order = v4bitncmp(ip_v4addr(a1), ip_v4addr(a2), ip_bits(a2));\nX return((order < 0) || ((order == 0) && (ip_bits(a1) < ip_bits(a2))));\nX } else {\nX /* Go for an IPV6 address here, before faulting out: */\nX elog(ERROR, \"cannot compare address families %d and %d\",\nX\t ip_family(a1), ip_family(a2));\nX return(FALSE);\nX }\nX}\nX\nXbool ipaddr_le(ipaddr *a1, ipaddr *a2) {\nX return(ipaddr_lt(a1, a2) || ipaddr_eq(a1, a2));\nX}\nX\nXbool ipaddr_eq(ipaddr *a1, ipaddr *a2) {\nX if ((ip_family(a1) == AF_INET) && (ip_family(a2) == AF_INET)) {\nX return((ip_bits(a1) == ip_bits(a2))\nX\t && (v4bitncmp(ip_v4addr(a1), ip_v4addr(a2), ip_bits(a1)) == 0));\nX } else {\nX /* Go for an IPV6 address here, before faulting out: */\nX elog(ERROR, \"cannot compare address families %d and %d\",\nX\t ip_family(a1), ip_family(a2));\nX return(FALSE);\nX }\nX}\nX\nXbool ipaddr_ge(ipaddr *a1, ipaddr *a2) {\nX return(ipaddr_gt(a1, a2) || ipaddr_eq(a1, a2));\nX}\nX\nXbool ipaddr_gt(ipaddr *a1, ipaddr *a2) {\nX if ((ip_family(a1) == AF_INET) && (ip_family(a2) == AF_INET)) {\nX int order = v4bitncmp(ip_v4addr(a1), ip_v4addr(a2), ip_bits(a2));\nX return((order > 0) || ((order == 0) && (ip_bits(a1) > ip_bits(a2))));\nX } else {\nX /* Go for an IPV6 address here, before faulting out: */\nX elog(ERROR, \"cannot compare address families %d and %d\",\nX\t ip_family(a1), ip_family(a2));\nX return(FALSE);\nX }\nX}\nX\nXbool ipaddr_ne(ipaddr *a1, ipaddr *a2) {\nX return(!ipaddr_eq(a1, a2));\nX}\nX\nXbool ipaddr_sub(ipaddr *a1, ipaddr *a2) {\nX if ((ip_family(a1) == AF_INET) && (ip_family(a2) == AF_INET)) {\nX return((ip_bits(a1) > ip_bits(a2))\nX\t && (v4bitncmp(ip_v4addr(a1), ip_v4addr(a2), ip_bits(a2)) == 0));\nX } else {\nX /* Go for an IPV6 address here, before faulting out: */\nX elog(ERROR, \"cannot compare address families %d and %d\",\nX\t ip_family(a1), ip_family(a2));\nX return(FALSE);\nX }\nX}\nX\nXbool ipaddr_subeq(ipaddr *a1, ipaddr *a2) {\nX if ((ip_family(a1) == AF_INET) && (ip_family(a2) == AF_INET)) {\nX return((ip_bits(a1) >= ip_bits(a2))\nX\t && (v4bitncmp(ip_v4addr(a1), ip_v4addr(a2), ip_bits(a2)) == 0));\nX } else {\nX /* Go for an IPV6 address here, before faulting out: */\nX elog(ERROR, \"cannot compare address families %d and %d\",\nX\t ip_family(a1), ip_family(a2));\nX return(FALSE);\nX }\nX}\nX\nXbool ipaddr_sup(ipaddr *a1, ipaddr *a2) {\nX if ((ip_family(a1) == AF_INET) && (ip_family(a2) == AF_INET)) {\nX return((ip_bits(a1) < ip_bits(a2))\nX\t && (v4bitncmp(ip_v4addr(a1), ip_v4addr(a2), ip_bits(a1)) == 0));\nX } else {\nX /* Go for an IPV6 address here, before faulting out: */\nX elog(ERROR, \"cannot compare address families %d and %d\",\nX\t ip_family(a1), ip_family(a2));\nX return(FALSE);\nX }\nX}\nX\nXbool ipaddr_supeq(ipaddr *a1, ipaddr *a2) {\nX if ((ip_family(a1) == AF_INET) && (ip_family(a2) == AF_INET)) {\nX return((ip_bits(a1) <= ip_bits(a2))\nX\t && (v4bitncmp(ip_v4addr(a1), ip_v4addr(a2), ip_bits(a1)) == 0));\nX } else {\nX /* Go for an IPV6 address here, before faulting out: */\nX elog(ERROR, \"cannot compare address families %d and %d\",\nX\t ip_family(a1), ip_family(a2));\nX return(FALSE);\nX }\nX}\nX\nX/*\nX *\tComparison function for sorting. Add V4/V6 testing!\nX */\nX\nXint4 ipaddr_cmp(ipaddr *a1, ipaddr *a2) {\nX if (ntohl(ip_v4addr(a1)) < ntohl(ip_v4addr(a2))) {\nX return(-1);\nX } else if (ntohl(ip_v4addr(a1)) > ntohl(ip_v4addr(a2))) {\nX return(1);\nX }\nX return 0;\nX}\nX\nX/*\nX *\tBitwise comparison for V4 addresses. Add V6 implementation!\nX */\nX\nXint v4bitncmp(u_int32_t a1, u_int32_t a2, int bits) {\nX unsigned long mask = 0;\nX int i;\nX for (i = 0; i < bits; i++) {\nX mask = (mask >> 1) | 0x80000000;\nX }\nX a1 = ntohl(a1);\nX a2 = ntohl(a2);\nX if ((a1 & mask) < (a2 & mask)) {\nX return(-1);\nX } else if ((a1 & mask) > (a2 & mask)) {\nX return(1);\nX }\nX return(0);\nX}\nX\nX/*\nX *\teof\nX */\nEND-of-ip.c\necho x - ip.sql.in\nsed 's/^X//' >ip.sql.in << 'END-of-ip.sql.in'\nX--\nX--\tPostgreSQL code for IP addresses.\nX--\nX--\t$Id: ip.sql.in,v 1.2 1998/09/08 12:10:45 tih Exp $\nX--\nX\nXload 'TARGET/ip.so';\nX\nX--\nX--\tInput and output functions and the type itself:\nX--\nX\nXcreate function ipaddr_in(opaque)\nX\treturns opaque\nX\tas 'TARGET/ip.so'\nX\tlanguage 'c';\nX\nXcreate function ipaddr_out(opaque)\nX\treturns opaque\nX\tas 'TARGET/ip.so'\nX\tlanguage 'c';\nX\nXcreate type ipaddr (\nX\tinternallength = variable,\nX\texternallength = variable,\nX\tinput = ipaddr_in,\nX\toutput = ipaddr_out\nX);\nX\nX--\nX--\tThe various boolean tests:\nX--\nX\nXcreate function ipaddr_lt(ipaddr, ipaddr)\nX\treturns bool\nX\tas 'TARGET/ip.so'\nX\tlanguage 'c';\nX\nXcreate function ipaddr_le(ipaddr, ipaddr)\nX\treturns bool\nX\tas 'TARGET/ip.so'\nX\tlanguage 'c';\nX\nXcreate function ipaddr_eq(ipaddr, ipaddr)\nX\treturns bool\nX\tas 'TARGET/ip.so'\nX\tlanguage 'c';\nX\nXcreate function ipaddr_ge(ipaddr, ipaddr)\nX\treturns bool\nX\tas 'TARGET/ip.so'\nX\tlanguage 'c';\nX\nXcreate function ipaddr_gt(ipaddr, ipaddr)\nX\treturns bool\nX\tas 'TARGET/ip.so'\nX\tlanguage 'c';\nX\nXcreate function ipaddr_ne(ipaddr, ipaddr)\nX\treturns bool\nX\tas 'TARGET/ip.so'\nX\tlanguage 'c';\nX\nXcreate function ipaddr_sub(ipaddr, ipaddr)\nX\treturns bool\nX\tas 'TARGET/ip.so'\nX\tlanguage 'c';\nX\nXcreate function ipaddr_subeq(ipaddr, ipaddr)\nX\treturns bool\nX\tas 'TARGET/ip.so'\nX\tlanguage 'c';\nX\nXcreate function ipaddr_sup(ipaddr, ipaddr)\nX\treturns bool\nX\tas 'TARGET/ip.so'\nX\tlanguage 'c';\nX\nXcreate function ipaddr_supeq(ipaddr, ipaddr)\nX\treturns bool\nX\tas 'TARGET/ip.so'\nX\tlanguage 'c';\nX\nXcreate function ipaddr_cmp(ipaddr, ipaddr)\nX\treturns int4\nX\tas 'TARGET/ip.so'\nX\tlanguage 'c';\nX\nX--\nX--\tNow the operators. Note how some of the parameters to some\nX--\tof the 'create operator' commands are commented out. This\nX--\tis because they reference as yet undefined operators, and\nX--\twill be implicitly defined when those are, further down.\nX--\nX\nXcreate operator < (\nX\tleftarg = ipaddr,\nX\trightarg = ipaddr,\nX--\tnegator = >=,\nX\trestrict = intltsel,\nX\tjoin = intltjoinsel,\nX\tprocedure = ipaddr_lt\nX);\nX\nXcreate operator <= (\nX\tleftarg = ipaddr,\nX\trightarg = ipaddr,\nX--\tnegator = >,\nX\trestrict = intltsel,\nX\tjoin = intltjoinsel,\nX\tprocedure = ipaddr_le\nX);\nX\nXcreate operator = (\nX\tleftarg = ipaddr,\nX\trightarg = ipaddr,\nX\tcommutator = =,\nX--\tnegator = <>,\nX\trestrict = eqsel,\nX\tjoin = eqjoinsel,\nX\tprocedure = ipaddr_eq\nX);\nX\nXcreate operator >= (\nX\tleftarg = ipaddr,\nX\trightarg = ipaddr,\nX\tnegator = <,\nX\trestrict = intgtsel,\nX\tjoin = intgtjoinsel,\nX\tprocedure = ipaddr_ge\nX);\nX\nXcreate operator > (\nX\tleftarg = ipaddr,\nX\trightarg = ipaddr,\nX\tnegator = <=,\nX\trestrict = intgtsel,\nX\tjoin = intgtjoinsel,\nX\tprocedure = ipaddr_gt\nX);\nX\nXcreate operator <> (\nX\tleftarg = ipaddr,\nX\trightarg = ipaddr,\nX\tnegator = =,\nX\trestrict = neqsel,\nX\tjoin = neqjoinsel,\nX\tprocedure = ipaddr_ne\nX);\nX\nXcreate operator << (\nX\tleftarg = ipaddr,\nX\trightarg = ipaddr,\nX\tprocedure = ipaddr_sub\nX);\nX\nXcreate operator <<= (\nX\tleftarg = ipaddr,\nX\trightarg = ipaddr,\nX\tprocedure = ipaddr_subeq\nX);\nX\nXcreate operator >> (\nX\tleftarg = ipaddr,\nX\trightarg = ipaddr,\nX\tprocedure = ipaddr_sup\nX);\nX\nXcreate operator >>= (\nX\tleftarg = ipaddr,\nX\trightarg = ipaddr,\nX\tprocedure = ipaddr_supeq\nX);\nX\nX--\nX--\tFinally, make it possible to do btree indexing on IP addresses.\nX--\nX\nXbegin;\nX\nXcreate table tmp_op (oprname name, opi int2);\nX\nXinsert into tmp_op values ('<', 1);\nXinsert into tmp_op values ('<=', 2);\nXinsert into tmp_op values ('=', 3);\nXinsert into tmp_op values ('>=', 4);\nXinsert into tmp_op values ('>', 5);\nX\nXdelete from pg_opclass\nX\twhere opcname = 'ipaddr_ops';\nX\nXinsert into pg_opclass (opcname, opcdeftype)\nX\tselect 'ipaddr_ops', oid from pg_type\nX\t\twhere typname = 'ipaddr';\nX\nXselect o.oid as opoid, o.oprname\nX\tinto table ipaddr_tmp\nX\tfrom pg_operator o, pg_type t\nX\twhere o.oprleft = t.oid and\nX\t o.oprright = t.oid and\nX\t t.typname = 'ipaddr';\nX\nXinsert into pg_amop (amopid, amopclaid, amopopr, amopstrategy,\nX\t\t amopselect, amopnpages)\nX\tselect am.oid, opcl.oid, c.opoid, t.opi,\nX\t\t\t'btreesel'::regproc, 'btreenpage'::regproc\nX\t\tfrom pg_am am, pg_opclass opcl, ipaddr_tmp c, tmp_op t\nX\t\twhere t.oprname = c.oprname and\nX\t\t amname = 'btree' and opcname = 'ipaddr_ops';\nX\nXinsert into pg_amproc (amid, amopclaid, amproc, amprocnum)\nX\tselect pgam.oid, opc.oid, prc.oid, '1'::int2\nX\t\tfrom pg_am pgam, pg_opclass opc, pg_proc prc\nX\t\twhere prc.proname = 'ipaddr_cmp' and\nX\t\t pgam.amname = 'btree' and\nX\t\t opc.opcname = 'ipaddr_ops';\nX\nXdrop table tmp_op;\nXdrop table ipaddr_tmp;\nX\nXcommit;\nX\nX--\nX--\teof\nX--\nEND-of-ip.sql.in\necho x - mac.c\nsed 's/^X//' >mac.c << 'END-of-mac.c'\nX/*\nX *\tPostgreSQL type definitions for MAC addresses.\nX *\nX *\t$Id: mac.c,v 1.1 1998/09/07 12:31:18 tih Exp $\nX */\nX\nX#include <stdio.h>\nX\nX#include <postgres.h>\nX#include <utils/palloc.h>\nX\nX#include \"mac.h\"\nX\nX/*\nX *\tThis is the internal storage format for MAC addresses:\nX */\nX\nXtypedef struct macaddr {\nX unsigned char a;\nX unsigned char b;\nX unsigned char c;\nX unsigned char d;\nX unsigned char e;\nX unsigned char f;\nX} macaddr;\nX\nX/*\nX *\tVarious forward declarations:\nX */\nX\nXmacaddr *macaddr_in(char *str);\nXchar *macaddr_out(macaddr *addr);\nX\nXbool macaddr_lt(macaddr *a1, macaddr *a2);\nXbool macaddr_le(macaddr *a1, macaddr *a2);\nXbool macaddr_eq(macaddr *a1, macaddr *a2);\nXbool macaddr_ge(macaddr *a1, macaddr *a2);\nXbool macaddr_gt(macaddr *a1, macaddr *a2);\nX\nXbool macaddr_ne(macaddr *a1, macaddr *a2);\nX\nXint4 macaddr_cmp(macaddr *a1, macaddr *a2);\nX\nXtext *macaddr_manuf(macaddr *addr);\nX\nX/*\nX *\tUtility macros used for sorting and comparing:\nX */\nX\nX#define hibits(addr) \\\nX ((unsigned long)((addr->a<<16)|(addr->b<<8)|(addr->c)))\nX\nX#define lobits(addr) \\\nX ((unsigned long)((addr->c<<16)|(addr->e<<8)|(addr->f)))\nX\nX/*\nX *\tMAC address reader. Accepts several common notations.\nX */\nX\nXmacaddr *macaddr_in(char *str) {\nX int a, b, c, d, e, f;\nX macaddr *result;\nX int count;\nX\nX if (strlen(str) > 0) {\nX\nX count = sscanf(str, \"%x:%x:%x:%x:%x:%x\", &a, &b, &c, &d, &e, &f);\nX if (count != 6)\nX count = sscanf(str, \"%x-%x-%x-%x-%x-%x\", &a, &b, &c, &d, &e, &f);\nX if (count != 6)\nX count = sscanf(str, \"%2x%2x%2x:%2x%2x%2x\", &a, &b, &c, &d, &e, &f);\nX if (count != 6)\nX count = sscanf(str, \"%2x%2x%2x-%2x%2x%2x\", &a, &b, &c, &d, &e, &f);\nX if (count != 6)\nX count = sscanf(str, \"%2x%2x.%2x%2x.%2x%2x\", &a, &b, &c, &d, &e, &f);\nX \nX if (count != 6) {\nX elog(ERROR, \"macaddr_in: error in parsing \\\"%s\\\"\", str);\nX return(NULL);\nX }\nX \nX if ((a < 0) || (a > 255) || (b < 0) || (b > 255) ||\nX\t(c < 0) || (c > 255) || (d < 0) || (d > 255) ||\nX\t(e < 0) || (e > 255) || (f < 0) || (f > 255)) {\nX elog(ERROR, \"macaddr_in: illegal address \\\"%s\\\"\", str);\nX return(NULL);\nX }\nX } else {\nX a = b = c = d = e = f = 0;\t/* special case for missing address */\nX }\nX\nX result = (macaddr *)palloc(sizeof(macaddr));\nX\nX result->a = a;\nX result->b = b;\nX result->c = c;\nX result->d = d;\nX result->e = e;\nX result->f = f;\nX\nX return(result);\nX}\nX\nX/*\nX *\tMAC address output function. Fixed format.\nX */\nX\nXchar *macaddr_out(macaddr *addr) {\nX char *result;\nX\nX if (addr == NULL)\nX return(NULL);\nX\nX result = (char *)palloc(32);\nX\nX if ((hibits(addr) > 0) || (lobits(addr) > 0)) {\nX sprintf(result, \"%02x:%02x:%02x:%02x:%02x:%02x\",\nX\t addr->a, addr->b, addr->c, addr->d, addr->e, addr->f);\nX } else {\nX result[0] = 0;\t\t/* special case for missing address */\nX }\nX return(result);\nX}\nX\nX/*\nX *\tBoolean tests.\nX */\nX\nXbool macaddr_lt(macaddr *a1, macaddr *a2) {\nX return((hibits(a1) < hibits(a2)) ||\nX\t ((hibits(a1) == hibits(a2)) && lobits(a1) < lobits(a2)));\nX};\nX\nXbool macaddr_le(macaddr *a1, macaddr *a2) {\nX return((hibits(a1) < hibits(a2)) ||\nX\t ((hibits(a1) == hibits(a2)) && lobits(a1) <= lobits(a2)));\nX};\nX\nXbool macaddr_eq(macaddr *a1, macaddr *a2) {\nX return ((hibits(a1) == hibits(a2)) && (lobits(a1) == lobits(a2)));\nX};\nX\nXbool macaddr_ge(macaddr *a1, macaddr *a2) {\nX return((hibits(a1) > hibits(a2)) ||\nX\t ((hibits(a1) == hibits(a2)) && lobits(a1) >= lobits(a2)));\nX};\nX\nXbool macaddr_gt(macaddr *a1, macaddr *a2) {\nX return((hibits(a1) > hibits(a2)) ||\nX\t ((hibits(a1) == hibits(a2)) && lobits(a1) > lobits(a2)));\nX};\nX\nXbool macaddr_ne(macaddr *a1, macaddr *a2) {\nX return ((hibits(a1) != hibits(a2)) || (lobits(a1) != lobits(a2)));\nX};\nX\nX/*\nX *\tComparison function for sorting:\nX */\nX\nXint4 macaddr_cmp(macaddr *a1, macaddr *a2) {\nX if (hibits(a1) < hibits(a2))\nX return -1;\nX else if (hibits(a1) > hibits(a2))\nX return 1;\nX else if (lobits(a1) < lobits(a2))\nX return -1;\nX else if (lobits(a1) > lobits(a2))\nX return 1;\nX else\nX return 0;\nX}\nX\nX/*\nX *\tThe special manufacturer fetching function. See \"mac.h\".\nX */\nX\nXtext *macaddr_manuf(macaddr *addr) {\nX manufacturer *manuf;\nX int length;\nX text *result;\nX\nX for (manuf = manufacturers; manuf->name != NULL; manuf++) {\nX if ((manuf->a == addr->a) &&\nX\t(manuf->b == addr->b) &&\nX\t(manuf->c == addr->c))\nX break;\nX }\nX if (manuf->name == NULL) {\nX result = palloc(VARHDRSZ + 1);\nX memset(result, 0, VARHDRSZ + 1);\nX VARSIZE(result) = VARHDRSZ + 1;\nX } else {\nX length = strlen(manuf->name) + 1;\nX result = palloc(length + VARHDRSZ);\nX memset(result, 0, length + VARHDRSZ);\nX VARSIZE(result) = length + VARHDRSZ;\nX memcpy(VARDATA(result), manuf->name, length);\nX }\nX return result;\nX}\nX\nX/*\nX *\teof\nX */\nEND-of-mac.c\necho x - mac.h\nsed 's/^X//' >mac.h << 'END-of-mac.h'\nX/*\nX *\tPostgreSQL type definitions for MAC addresses.\nX *\nX *\t$Id: mac.h,v 1.1 1998/09/07 12:31:22 tih Exp $\nX */\nX\nXtypedef struct manufacturer {\nX unsigned char a;\nX unsigned char b;\nX unsigned char c;\nX char *name;\nX} manufacturer;\nX\nXmanufacturer manufacturers[] = {\nX {0x00, 0x00, 0x0C, \"Cisco\"},\nX {0x00, 0x00, 0x0E, \"Fujitsu\"},\nX {0x00, 0x00, 0x0F, \"NeXT\"},\nX {0x00, 0x00, 0x10, \"Sytek\"},\nX {0x00, 0x00, 0x1D, \"Cabletron\"},\nX {0x00, 0x00, 0x20, \"DIAB\"},\nX {0x00, 0x00, 0x22, \"Visual Technology\"},\nX {0x00, 0x00, 0x2A, \"TRW\"},\nX {0x00, 0x00, 0x32, \"GPT Limited\"},\nX {0x00, 0x00, 0x5A, \"S & Koch\"},\nX {0x00, 0x00, 0x5E, \"IANA\"},\nX {0x00, 0x00, 0x65, \"Network General\"},\nX {0x00, 0x00, 0x6B, \"MIPS\"},\nX {0x00, 0x00, 0x77, \"MIPS\"},\nX {0x00, 0x00, 0x7A, \"Ardent\"},\nX {0x00, 0x00, 0x89, \"Cayman Systems\"},\nX {0x00, 0x00, 0x93, \"Proteon\"},\nX {0x00, 0x00, 0x9F, \"Ameristar Technology\"},\nX {0x00, 0x00, 0xA2, \"Wellfleet\"},\nX {0x00, 0x00, 0xA3, \"Network Application Technology\"},\nX {0x00, 0x00, 0xA6, \"Network General\"},\nX {0x00, 0x00, 0xA7, \"NCD\"},\nX {0x00, 0x00, 0xA9, \"Network Systems\"},\nX {0x00, 0x00, 0xAA, \"Xerox\"},\nX {0x00, 0x00, 0xB3, \"CIMLinc\"},\nX {0x00, 0x00, 0xB7, \"Dove Fastnet\"},\nX {0x00, 0x00, 0xBC, \"Allen-Bradley\"},\nX {0x00, 0x00, 0xC0, \"Western Digital\"},\nX {0x00, 0x00, 0xC5, \"Farallon\"},\nX {0x00, 0x00, 0xC6, \"Hewlett-Packard\"},\nX {0x00, 0x00, 0xC8, \"Altos\"},\nX {0x00, 0x00, 0xC9, \"Emulex\"},\nX {0x00, 0x00, 0xD7, \"Dartmouth College\"},\nX {0x00, 0x00, 0xD8, \"3Com (?)\"},\nX {0x00, 0x00, 0xDD, \"Gould\"},\nX {0x00, 0x00, 0xDE, \"Unigraph\"},\nX {0x00, 0x00, 0xE2, \"Acer Counterpoint\"},\nX {0x00, 0x00, 0xEF, \"Alantec\"},\nX {0x00, 0x00, 0xFD, \"High Level Hardware\"},\nX {0x00, 0x01, 0x02, \"BBN internal usage\"},\nX {0x00, 0x20, 0xAF, \"3Com\"},\nX {0x00, 0x17, 0x00, \"Kabel\"},\nX {0x00, 0x80, 0x64, \"Wyse Technology\"},\nX {0x00, 0x80, 0x2B, \"IMAC (?)\"},\nX {0x00, 0x80, 0x2D, \"Xylogics, Inc.\"},\nX {0x00, 0x80, 0x8C, \"Frontier Software Development\"},\nX {0x00, 0x80, 0xC2, \"IEEE 802.1 Committee\"},\nX {0x00, 0x80, 0xD3, \"Shiva\"},\nX {0x00, 0xAA, 0x00, \"Intel\"},\nX {0x00, 0xDD, 0x00, \"Ungermann-Bass\"},\nX {0x00, 0xDD, 0x01, \"Ungermann-Bass\"},\nX {0x02, 0x07, 0x01, \"Racal InterLan\"},\nX {0x02, 0x04, 0x06, \"BBN internal usage\"},\nX {0x02, 0x60, 0x86, \"Satelcom MegaPac\"},\nX {0x02, 0x60, 0x8C, \"3Com\"},\nX {0x02, 0xCF, 0x1F, \"CMC\"},\nX {0x08, 0x00, 0x02, \"3Com\"},\nX {0x08, 0x00, 0x03, \"ACC\"},\nX {0x08, 0x00, 0x05, \"Symbolics\"},\nX {0x08, 0x00, 0x08, \"BBN\"},\nX {0x08, 0x00, 0x09, \"Hewlett-Packard\"},\nX {0x08, 0x00, 0x0A, \"Nestar Systems\"},\nX {0x08, 0x00, 0x0B, \"Unisys\"},\nX {0x08, 0x00, 0x11, \"Tektronix\"},\nX {0x08, 0x00, 0x14, \"Excelan\"},\nX {0x08, 0x00, 0x17, \"NSC\"},\nX {0x08, 0x00, 0x1A, \"Data General\"},\nX {0x08, 0x00, 0x1B, \"Data General\"},\nX {0x08, 0x00, 0x1E, \"Apollo\"},\nX {0x08, 0x00, 0x20, \"Sun\"},\nX {0x08, 0x00, 0x22, \"NBI\"},\nX {0x08, 0x00, 0x25, \"CDC\"},\nX {0x08, 0x00, 0x26, \"Norsk Data\"},\nX {0x08, 0x00, 0x27, \"PCS Computer Systems GmbH\"},\nX {0x08, 0x00, 0x28, \"Texas Instruments\"},\nX {0x08, 0x00, 0x2B, \"DEC\"},\nX {0x08, 0x00, 0x2E, \"Metaphor\"},\nX {0x08, 0x00, 0x2F, \"Prime Computer\"},\nX {0x08, 0x00, 0x36, \"Intergraph\"},\nX {0x08, 0x00, 0x37, \"Fujitsu-Xerox\"},\nX {0x08, 0x00, 0x38, \"Bull\"},\nX {0x08, 0x00, 0x39, \"Spider Systems\"},\nX {0x08, 0x00, 0x41, \"DCA Digital Comm. Assoc.\"},\nX {0x08, 0x00, 0x45, \"Xylogics (?)\"},\nX {0x08, 0x00, 0x46, \"Sony\"},\nX {0x08, 0x00, 0x47, \"Sequent\"},\nX {0x08, 0x00, 0x49, \"Univation\"},\nX {0x08, 0x00, 0x4C, \"Encore\"},\nX {0x08, 0x00, 0x4E, \"BICC\"},\nX {0x08, 0x00, 0x56, \"Stanford University\"},\nX {0x08, 0x00, 0x58, \"DECsystem 20 (?)\"},\nX {0x08, 0x00, 0x5A, \"IBM\"},\nX {0x08, 0x00, 0x67, \"Comdesign\"},\nX {0x08, 0x00, 0x68, \"Ridge\"},\nX {0x08, 0x00, 0x69, \"Silicon Graphics\"},\nX {0x08, 0x00, 0x6E, \"Concurrent\"},\nX {0x08, 0x00, 0x75, \"DDE\"},\nX {0x08, 0x00, 0x7C, \"Vitalink\"},\nX {0x08, 0x00, 0x80, \"XIOS\"},\nX {0x08, 0x00, 0x86, \"Imagen/QMS\"},\nX {0x08, 0x00, 0x87, \"Xyplex\"},\nX {0x08, 0x00, 0x89, \"Kinetics\"},\nX {0x08, 0x00, 0x8B, \"Pyramid\"},\nX {0x08, 0x00, 0x8D, \"XyVision\"},\nX {0x08, 0x00, 0x90, \"Retix Inc\"},\nX {0x48, 0x44, 0x53, \"HDS (?)\"},\nX {0x80, 0x00, 0x10, \"AT&T\"},\nX {0xAA, 0x00, 0x00, \"DEC\"},\nX {0xAA, 0x00, 0x01, \"DEC\"},\nX {0xAA, 0x00, 0x02, \"DEC\"},\nX {0xAA, 0x00, 0x03, \"DEC\"},\nX {0xAA, 0x00, 0x04, \"DEC\"},\nX {0x00, 0x00, 0x00, NULL}\nX};\nX\nX/*\nX *\teof\nX */\nEND-of-mac.h\necho x - mac.sql.in\nsed 's/^X//' >mac.sql.in << 'END-of-mac.sql.in'\nX--\nX--\tPostgreSQL code for MAC addresses.\nX--\nX--\t$Id: mac.sql.in,v 1.2 1998/09/08 12:11:18 tih Exp $\nX--\nX\nXload 'TARGET/mac.so';\nX\nX--\nX--\tInput and output functions and the type itself:\nX--\nX\nXcreate function macaddr_in(opaque)\nX\treturns opaque\nX\tas 'TARGET/mac.so'\nX\tlanguage 'c';\nX\nXcreate function macaddr_out(opaque)\nX\treturns opaque\nX\tas 'TARGET/mac.so'\nX\tlanguage 'c';\nX\nXcreate type macaddr (\nX\tinternallength = 6,\nX\texternallength = variable,\nX\tinput = macaddr_in,\nX\toutput = macaddr_out\nX);\nX\nX--\nX--\tThe boolean tests:\nX--\nX\nXcreate function macaddr_lt(macaddr, macaddr)\nX\treturns bool\nX\tas 'TARGET/mac.so'\nX\tlanguage 'c';\nX\nXcreate function macaddr_le(macaddr, macaddr)\nX\treturns bool\nX\tas 'TARGET/mac.so'\nX\tlanguage 'c';\nX\nXcreate function macaddr_eq(macaddr, macaddr)\nX\treturns bool\nX\tas 'TARGET/mac.so'\nX\tlanguage 'c';\nX\nXcreate function macaddr_ge(macaddr, macaddr)\nX\treturns bool\nX\tas 'TARGET/mac.so'\nX\tlanguage 'c';\nX\nXcreate function macaddr_gt(macaddr, macaddr)\nX\treturns bool\nX\tas 'TARGET/mac.so'\nX\tlanguage 'c';\nX\nXcreate function macaddr_ne(macaddr, macaddr)\nX\treturns bool\nX\tas 'TARGET/mac.so'\nX\tlanguage 'c';\nX\nXcreate function macaddr_cmp(macaddr, macaddr)\nX\treturns int4\nX\tas 'TARGET/mac.so'\nX\tlanguage 'c';\nX\nX--\nX--\tNow the operators. Note how some of the parameters to some\nX--\tof the 'create operator' commands are commented out. This\nX--\tis because they reference as yet undefined operators, and\nX--\twill be implicitly defined when those are, further down.\nX--\nX\nXcreate operator < (\nX\tleftarg = macaddr,\nX\trightarg = macaddr,\nX--\tnegator = >=,\nX\tprocedure = macaddr_lt\nX);\nX\nXcreate operator <= (\nX\tleftarg = macaddr,\nX\trightarg = macaddr,\nX--\tnegator = >,\nX\tprocedure = macaddr_le\nX);\nX\nXcreate operator = (\nX\tleftarg = macaddr,\nX\trightarg = macaddr,\nX\tcommutator = =,\nX--\tnegator = <>,\nX\tprocedure = macaddr_eq\nX);\nX\nXcreate operator >= (\nX\tleftarg = macaddr,\nX\trightarg = macaddr,\nX\tnegator = <,\nX\tprocedure = macaddr_ge\nX);\nX\nXcreate operator > (\nX\tleftarg = macaddr,\nX\trightarg = macaddr,\nX\tnegator = <=,\nX\tprocedure = macaddr_gt\nX);\nX\nXcreate operator <> (\nX\tleftarg = macaddr,\nX\trightarg = macaddr,\nX\tnegator = =,\nX\tprocedure = macaddr_ne\nX);\nX\nX--\nX--\tFinally, the special manufacurer matching function:\nX--\nX\nXcreate function macaddr_manuf(macaddr)\nX\treturns text\nX\tas 'TARGET/mac.so'\nX\tlanguage 'c';\nX\nX--\nX--\tFinally, make it possible to do btree indexing on MAC addresses.\nX--\nX\nXbegin;\nX\nXcreate table tmp_op (oprname name, opi int2);\nX\nXinsert into tmp_op values ('<', 1);\nXinsert into tmp_op values ('<=', 2);\nXinsert into tmp_op values ('=', 3);\nXinsert into tmp_op values ('>=', 4);\nXinsert into tmp_op values ('>', 5);\nX\nXdelete from pg_opclass\nX\twhere opcname = 'macaddr_ops';\nX\nXinsert into pg_opclass (opcname, opcdeftype)\nX\tselect 'macaddr_ops', oid from pg_type\nX\t\twhere typname = 'macaddr';\nX\nXselect o.oid as opoid, o.oprname\nX\tinto table macaddr_tmp\nX\tfrom pg_operator o, pg_type t\nX\twhere o.oprleft = t.oid and\nX\t o.oprright = t.oid and\nX\t t.typname = 'macaddr';\nX\nXinsert into pg_amop (amopid, amopclaid, amopopr, amopstrategy,\nX\t\t amopselect, amopnpages)\nX\tselect am.oid, opcl.oid, c.opoid, t.opi,\nX\t\t\t'btreesel'::regproc, 'btreenpage'::regproc\nX\t\tfrom pg_am am, pg_opclass opcl, macaddr_tmp c, tmp_op t\nX\t\twhere t.oprname = c.oprname and\nX\t\t amname = 'btree' and opcname = 'macaddr_ops';\nX\nXinsert into pg_amproc (amid, amopclaid, amproc, amprocnum)\nX\tselect pgam.oid, opc.oid, prc.oid, '1'::int2\nX\t\tfrom pg_am pgam, pg_opclass opc, pg_proc prc\nX\t\twhere prc.proname = 'macaddr_cmp' and\nX\t\t pgam.amname = 'btree' and\nX\t\t opc.opcname = 'macaddr_ops';\nX\nXdrop table tmp_op;\nXdrop table macaddr_tmp;\nX\nXcommit;\nX\nX--\nX--\teof\nX--\nEND-of-mac.sql.in\necho x - test.sql\nsed 's/^X//' >test.sql << 'END-of-test.sql'\nX--\nX--\tA quick test of the IP address code\nX--\nX--\t$Id: test.sql,v 1.2 1998/09/08 12:11:34 tih Exp $\nX--\nX\nX-- temporary table:\nXcreate table addresses (address ipaddr);\nX\nX-- sample data from two subnets:\nXinsert into addresses values ('158.37.96.15');\nXinsert into addresses values ('158.37.96.16');\nXinsert into addresses values ('158.37.96.17');\nXinsert into addresses values ('158.37.97.15');\nXinsert into addresses values ('158.37.97.16');\nXinsert into addresses values ('158.37.97.17');\nXinsert into addresses values ('158.37.98.15');\nXinsert into addresses values ('158.37.98.16');\nXinsert into addresses values ('158.37.98.17');\nXinsert into addresses values ('158.37.96.150');\nXinsert into addresses values ('158.37.96.160');\nXinsert into addresses values ('158.37.96.170');\nXinsert into addresses values ('158.37.97.150');\nXinsert into addresses values ('158.37.97.160');\nXinsert into addresses values ('158.37.97.170');\nXinsert into addresses values ('158.37.98.150');\nXinsert into addresses values ('158.37.98.160');\nXinsert into addresses values ('158.37.98.170');\nX\nX-- show them all:\nXselect * from addresses;\nX\nX-- select the ones in subnet 96:\nXselect * from addresses where address << '158.37.96.0/24';\nX\nX-- select the ones not in subnet 96:\nXselect * from addresses where not address << '158.37.96.0/24';\nX\nX-- select the ones in subnet 97:\nXselect * from addresses where address << '158.37.97.0/24';\nX\nX-- select the ones not in subnet 97:\nXselect * from addresses where not address << '158.37.97.0/24';\nX\nX-- select the ones in subnet 96 or 97, sorted:\nXselect * from addresses where address << '158.37.96.0/23'\nX\torder by address;\nX\nX-- now some networks:\nXcreate table networks (network ipaddr);\nX\nX-- now the subnets mentioned above:\nXinsert into networks values ('158.37.96.0/24');\nXinsert into networks values ('158.37.97.0/24');\nXinsert into networks values ('158.37.98.0/24');\nX\nX-- select matching pairs of addresses and containing nets:\nXselect address, network from addresses, networks\nX\twhere address << network;\nX\nX-- tidy up:\nXdrop table addresses;\nXdrop table networks;\nX\nX--\nX--\teof\nX--\nEND-of-test.sql\nexit\n",
"msg_date": "08 Sep 1998 15:04:49 +0200",
"msg_from": "Tom Ivar Helbekkmo <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: CIDR/IP types. Was: [GENERAL] big numbers"
},
{
"msg_contents": "Good. Keep going and let me know when you want it added. We need to\nfix the other problems first before merging your stuff in, so we have\nsome time. I assume you are merging Paul's code with your own, to make\na \"best of both worlds\" group of types.\n\n\n> Bruce Momjian wrote:\n> \n> > When do you think you can you look over both versions, and send me\n> > one good version to work with?\n> \n> I've got something working right now, by taking what I was using, and\n> changing it to work the way Paul's code does, with some enhancements:\n> My code is ready for storing both IPV4 and IPV6 at the same time with\n> variable length storage in the data base, and it's got Aleksei's index\n> integration in place. The type name is still \"ipaddr\" -- but that's\n> easy to change, of course.\n> \n> > Even if you just say, \"Paul's is better, throw out ip_and_mac\", that\n> > is all we need.\n> \n> I am definitely *not* going to say \"I can do this better than Vixie\".\n> \n> The way I feel about this right now is that Paul's code is better than\n> what I originally submitted, and better than Aleksei's improvements on\n> that code. However, what I currently run has certain improvements\n> over all of those versions, and I kind of like the way it's going...\n> \n> I'll append it below. Take a look, and let me know what you think.\n> \n> Oh, and a correction: Paul Vixie wrote:\n> \n> > the ip_and_mac type is host-only but has an unfortunate bridging\n> > between layer 3 and layer 2.\n> \n> No, it was (and is) two different types, just packaged in the same\n> directory because I thought they conceptually belonged together.\n> \n> Anyway, I'm appending a shar of what I've got right now. It's only\n> minimally tested so far, and I'm *not* a professional programmer.\n> I'm basically just having a lot of fun with this, while it is at the\n> same time useful for me in my work, and if what I write can be of use\n> to others, that's great! :-)\n> \n> -tih\n> -- \n> Popularity is the hallmark of mediocrity. --Niles Crane, \"Frasier\"\n> \n> # This is a shell archive. Save it in a file, remove anything before\n> # this line, and then unpack it by entering \"sh file\". Note, it may\n> # create directories; files and directories will be owned by you and\n> # have default permissions.\n> #\n> # This archive contains:\n> #\n> #\tMakefile\n> #\tREADME\n> #\tinet_net_ntop.c\n> #\tinet_net_pton.c\n> #\tip.c\n> #\tip.sql.in\n> #\tmac.c\n> #\tmac.h\n> #\tmac.sql.in\n> #\ttest.sql\n> #\n> echo x - Makefile\n> sed 's/^X//' >Makefile << 'END-of-Makefile'\n> X#\n> X#\tPostgreSQL types for IP and MAC addresses\n> X#\n> X#\t$Id: Makefile,v 1.4 1998/09/08 12:23:30 tih Exp $\n> X\n> XPGINST=/usr/local/pgsql\n> XTARGET=/u/tih/databases\n> X\n> Xall: ip.so mac.so ip.sql mac.sql\n> X\n> Xip.so: ip.o inet_net_ntop.o inet_net_pton.o\n> X\tld -Bshareable -o ip.so ip.o inet_net_ntop.o inet_net_pton.o\n> X\n> Xip.o: ip.c\n> X\tcc -g -O -fPIC -I${PGINST}/include -c ip.c\n> X\n> Xinet_net_ntop.o: inet_net_ntop.c\n> X\tcc -g -O -fPIC -c inet_net_ntop.c\n> X\n> Xinet_net_pton.o: inet_net_pton.c\n> X\tcc -g -O -fPIC -c inet_net_pton.c\n> X\n> Xmac.so: mac.o\n> X\tld -Bshareable -o mac.so mac.o\n> X\n> Xmac.o: mac.c mac.h\n> X\tcc -g -O -fPIC -I${PGINST}/include -c mac.c\n> X\n> Xip.sql: ip.sql.in\n> X\tcat ip.sql.in | sed s@TARGET@${TARGET}/modules@ > ip.sql\n> X\n> Xmac.sql: mac.sql.in\n> X\tcat mac.sql.in | sed s@TARGET@${TARGET}/modules@ > mac.sql\n> X\n> Xinstall: ip.so mac.so\n> X\tinstall -c ip.sql ip.so mac.sql mac.so ${TARGET}/modules\n> X\n> Xclean:\n> X\trm -f *.o *.so ip.sql mac.sql\n> X\n> XFILES=Makefile README inet_net_ntop.c inet_net_pton.c \\\n> X\tip.c ip.sql.in mac.c mac.h mac.sql.in test.sql\n> X\n> Xip+mac.shar: ${FILES}\n> X\tshar ${FILES} > ip+mac.shar\n> X\n> X#\n> X#\teof\n> X#\n> END-of-Makefile\n> echo x - README\n> sed 's/^X//' >README << 'END-of-README'\n> XPostgreSQL type extensions for IP and MAC addresses.\n> X---------------------------------------------------\n> X\n> X$Id: README,v 1.2 1998/09/08 12:10:22 tih Exp $\n> X\n> XI needed to record IP and MAC level ethernet addresses in a data\n> Xbase, and I really didn't want to store them as plain strings, with\n> Xno enforced error checking, so I put together the accompanying code\n> Xas my first experiment with adding a data type to PostgreSQL. I\n> Xthen thought that this might be useful to others, both directly and\n> Xas a very simple example of how to do this sort of thing, so I\n> Xsubmitted it to the PostgreSQL project for inclusion in the contrib\n> Xdirectory. Since then, that directory has been modified to contain\n> XAleksei Roudnev's implementation, which is based on mine.\n> X\n> XFor those who have seen my previous contribution of these types, note\n> Xthat much has changed: I've modified the IP address type to work the\n> Xway Paul Vixie did with his CIDR type. In fact, I've pretty much just\n> Xstolen his solution, modifying it into my framework in such a way as\n> Xto facilitate the addition of IPV6 handling code in the future. I've\n> Xpretty much ignored Aleksei's C code, but I've added his SQL code to\n> Xenter the necessary operators into the various system tables needed to\n> Xmake the types indexable.\n> X\n> XIP addresses are implemented as a struct of fixed in-memory length,\n> Xbut variable on-disk storage size. For IPV4, it contains the address\n> Xfamily (AF_INET), the CIDR prefix length and four byte address. For\n> XIPV6, the address family will be different, and the address longer.\n> X\n> XThe external representation of an IP address generally looks like\n> X'158.37.96.15/32'. This address happens to be part of a subnet where\n> XI work; '158.37.96.0/24', which itself is a part of the larger subnet\n> Xallocated to our site, which is '158.37.96.0/21', which again, if you\n> Xgo by the old book, is part of the class \"B\" net '158.37.0.0/16'.\n> X\n> XInput and output functions are supplied, along with the \"normal\" <,\n> X<=, =, >=, > and <> operators, which all do what you expect. In\n> Xaddition, there are operators to check for networks or addresses being\n> Xsubnets of or addresses contained within other networks. << tests\n> Xwhether the left operand is contained within the right, <<= includes\n> Xequality, >> and >>= do the same things the opposite way.\n> X\n> XThe input and output functions use routines from Paul Vixie's BIND,\n> Xand I've snarfed the source files inet_net_ntop.c and inet_net_pton.c\n> Xdirectly from a recent distribution of that code. They are included\n> Xhere to avoid the need to fetch and install the BIND libraries to be\n> Xable to use this code. IANAL, but it looks from the copyright\n> Xmessages in the files as if this should be acceptable. Read the\n> Xdocumentation in inet_net_pton.c to see the legal input formats.\n> X\n> XMAC level ethernet addresses are implemented as a 6 byte struct that\n> Xcontains the address as unsigned chars. Several input forms are\n> Xaccepted; the following are all the same address: '08002b:010203',\n> X'08002b-010203', '0800.2b01.0203', '08-00-2b-01-02-03' and\n> X'08:00:2b:01:02:03'. Upper and lower case is accepted for the digits\n> X'a' through 'f'. Output is always in the latter of the given forms.\n> X\n> XAs with IP addresses, input and output functions are supplied as well\n> Xas the \"normal\" operators, which do what you expect. As an extra\n> Xfeature, a function macaddr_manuf() is defined, which returns the name\n> Xof the manufacturer as a string. This is currently held in a\n> Xhard-coded struct internal to the C module -- it might be smarter to\n> Xput this information into an actual data base table, and look up the\n> Xmanufacturer there.\n> X\n> XMany thanks to Aleksei Roudnev and Paul Vixie for their fine work!\n> X\n> XI don't know what changes are needed to the Makefile for other systems\n> Xthan the one I'm running (NetBSD 1.3), but anyway: to install on a BSD\n> Xsystem: fix the path names in the Makefile if you need to, then make,\n> Xmake install, slurp the SQL files into psql or whatever, and you're\n> Xoff. Enjoy!\n> X\n> XBergen, Norway, 1998-08-09, Tom Ivar Helbekkmo ([email protected]).\n> END-of-README\n> echo x - inet_net_ntop.c\n> sed 's/^X//' >inet_net_ntop.c << 'END-of-inet_net_ntop.c'\n> X/*\n> X * Copyright (c) 1996 by Internet Software Consortium.\n> X *\n> X * Permission to use, copy, modify, and distribute this software for any\n> X * purpose with or without fee is hereby granted, provided that the above\n> X * copyright notice and this permission notice appear in all copies.\n> X *\n> X * THE SOFTWARE IS PROVIDED \"AS IS\" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS\n> X * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES\n> X * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE\n> X * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL\n> X * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR\n> X * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS\n> X * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\n> X * SOFTWARE.\n> X */\n> X\n> X#if defined(LIBC_SCCS) && !defined(lint)\n> Xstatic const char rcsid[] = \"$Id: inet_net_ntop.c,v 8.2 1996/08/08 06:54:44 vixie Exp $\";\n> X#endif\n> X\n> X#include <sys/types.h>\n> X#include <sys/socket.h>\n> X#include <netinet/in.h>\n> X#include <arpa/inet.h>\n> X\n> X#include <errno.h>\n> X#include <stdio.h>\n> X#include <string.h>\n> X#include <stdlib.h>\n> X\n> X#ifdef SPRINTF_CHAR\n> X# define SPRINTF(x) strlen(sprintf/**/x)\n> X#else\n> X# define SPRINTF(x) ((size_t)sprintf x)\n> X#endif\n> X\n> Xstatic char *\tinet_net_ntop_ipv4 __P((const u_char *src, int bits,\n> X\t\t\t\t\tchar *dst, size_t size));\n> X\n> X/*\n> X * char *\n> X * inet_net_ntop(af, src, bits, dst, size)\n> X *\tconvert network number from network to presentation format.\n> X *\tgenerates CIDR style result always.\n> X * return:\n> X *\tpointer to dst, or NULL if an error occurred (check errno).\n> X * author:\n> X *\tPaul Vixie (ISC), July 1996\n> X */\n> Xchar *\n> Xinet_net_ntop(af, src, bits, dst, size)\n> X\tint af;\n> X\tconst void *src;\n> X\tint bits;\n> X\tchar *dst;\n> X\tsize_t size;\n> X{\n> X\tswitch (af) {\n> X\tcase AF_INET:\n> X\t\treturn (inet_net_ntop_ipv4(src, bits, dst, size));\n> X\tdefault:\n> X\t\terrno = EAFNOSUPPORT;\n> X\t\treturn (NULL);\n> X\t}\n> X}\n> X\n> X/*\n> X * static char *\n> X * inet_net_ntop_ipv4(src, bits, dst, size)\n> X *\tconvert IPv4 network number from network to presentation format.\n> X *\tgenerates CIDR style result always.\n> X * return:\n> X *\tpointer to dst, or NULL if an error occurred (check errno).\n> X * note:\n> X *\tnetwork byte order assumed. this means 192.5.5.240/28 has\n> X *\t0x11110000 in its fourth octet.\n> X * author:\n> X *\tPaul Vixie (ISC), July 1996\n> X */\n> Xstatic char *\n> Xinet_net_ntop_ipv4(src, bits, dst, size)\n> X\tconst u_char *src;\n> X\tint bits;\n> X\tchar *dst;\n> X\tsize_t size;\n> X{\n> X\tchar *odst = dst;\n> X\tchar *t;\n> X\tu_int m;\n> X\tint b;\n> X\n> X\tif (bits < 0 || bits > 32) {\n> X\t\terrno = EINVAL;\n> X\t\treturn (NULL);\n> X\t}\n> X\tif (bits == 0) {\n> X\t\tif (size < sizeof \"0\")\n> X\t\t\tgoto emsgsize;\n> X\t\t*dst++ = '0';\n> X\t\t*dst = '\\0';\n> X\t}\n> X\n> X\t/* Format whole octets. */\n> X\tfor (b = bits / 8; b > 0; b--) {\n> X\t\tif (size < sizeof \"255.\")\n> X\t\t\tgoto emsgsize;\n> X\t\tt = dst;\n> X\t\tdst += SPRINTF((dst, \"%u\", *src++));\n> X\t\tif (b > 1) {\n> X\t\t\t*dst++ = '.';\n> X\t\t\t*dst = '\\0';\n> X\t\t}\n> X\t\tsize -= (size_t)(dst - t);\n> X\t}\n> X\n> X\t/* Format partial octet. */\n> X\tb = bits % 8;\n> X\tif (b > 0) {\n> X\t\tif (size < sizeof \".255\")\n> X\t\t\tgoto emsgsize;\n> X\t\tt = dst;\n> X\t\tif (dst != odst)\n> X\t\t\t*dst++ = '.';\n> X\t\tm = ((1 << b) - 1) << (8 - b);\n> X\t\tdst += SPRINTF((dst, \"%u\", *src & m));\n> X\t\tsize -= (size_t)(dst - t);\n> X\t}\n> X\n> X\t/* Format CIDR /width. */\n> X\tif (size < sizeof \"/32\")\n> X\t\tgoto emsgsize;\n> X\tdst += SPRINTF((dst, \"/%u\", bits));\n> X\treturn (odst);\n> X\n> X emsgsize:\n> X\terrno = EMSGSIZE;\n> X\treturn (NULL);\n> X}\n> END-of-inet_net_ntop.c\n> echo x - inet_net_pton.c\n> sed 's/^X//' >inet_net_pton.c << 'END-of-inet_net_pton.c'\n> X/*\n> X * Copyright (c) 1996 by Internet Software Consortium.\n> X *\n> X * Permission to use, copy, modify, and distribute this software for any\n> X * purpose with or without fee is hereby granted, provided that the above\n> X * copyright notice and this permission notice appear in all copies.\n> X *\n> X * THE SOFTWARE IS PROVIDED \"AS IS\" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS\n> X * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES\n> X * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE\n> X * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL\n> X * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR\n> X * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS\n> X * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS\n> X * SOFTWARE.\n> X */\n> X\n> X#if defined(LIBC_SCCS) && !defined(lint)\n> Xstatic const char rcsid[] = \"$Id: inet_net_pton.c,v 8.3 1996/11/11 06:36:52 vixie Exp $\";\n> X#endif\n> X\n> X#include <sys/types.h>\n> X#include <sys/socket.h>\n> X#include <netinet/in.h>\n> X#include <arpa/inet.h>\n> X\n> X#include <assert.h>\n> X#include <ctype.h>\n> X#include <errno.h>\n> X#include <stdio.h>\n> X#include <string.h>\n> X#include <stdlib.h>\n> X\n> X#ifdef SPRINTF_CHAR\n> X# define SPRINTF(x) strlen(sprintf/**/x)\n> X#else\n> X# define SPRINTF(x) ((size_t)sprintf x)\n> X#endif\n> X\n> Xstatic int\tinet_net_pton_ipv4 __P((const char *src, u_char *dst,\n> X\t\t\t\t\tsize_t size));\n> X\n> X/*\n> X * static int\n> X * inet_net_pton(af, src, dst, size)\n> X *\tconvert network number from presentation to network format.\n> X *\taccepts hex octets, hex strings, decimal octets, and /CIDR.\n> X *\t\"size\" is in bytes and describes \"dst\".\n> X * return:\n> X *\tnumber of bits, either imputed classfully or specified with /CIDR,\n> X *\tor -1 if some failure occurred (check errno). ENOENT means it was\n> X *\tnot a valid network specification.\n> X * author:\n> X *\tPaul Vixie (ISC), June 1996\n> X */\n> Xint\n> Xinet_net_pton(af, src, dst, size)\n> X\tint af;\n> X\tconst char *src;\n> X\tvoid *dst;\n> X\tsize_t size;\n> X{\n> X\tswitch (af) {\n> X\tcase AF_INET:\n> X\t\treturn (inet_net_pton_ipv4(src, dst, size));\n> X\tdefault:\n> X\t\terrno = EAFNOSUPPORT;\n> X\t\treturn (-1);\n> X\t}\n> X}\n> X\n> X/*\n> X * static int\n> X * inet_net_pton_ipv4(src, dst, size)\n> X *\tconvert IPv4 network number from presentation to network format.\n> X *\taccepts hex octets, hex strings, decimal octets, and /CIDR.\n> X *\t\"size\" is in bytes and describes \"dst\".\n> X * return:\n> X *\tnumber of bits, either imputed classfully or specified with /CIDR,\n> X *\tor -1 if some failure occurred (check errno). ENOENT means it was\n> X *\tnot an IPv4 network specification.\n> X * note:\n> X *\tnetwork byte order assumed. this means 192.5.5.240/28 has\n> X *\t0x11110000 in its fourth octet.\n> X * author:\n> X *\tPaul Vixie (ISC), June 1996\n> X */\n> Xstatic int\n> Xinet_net_pton_ipv4(src, dst, size)\n> X\tconst char *src;\n> X\tu_char *dst;\n> X\tsize_t size;\n> X{\n> X\tstatic const char\n> X\t\txdigits[] = \"0123456789abcdef\",\n> X\t\tdigits[] = \"0123456789\";\n> X\tint n, ch, tmp, dirty, bits;\n> X\tconst u_char *odst = dst;\n> X\n> X\tch = *src++;\n> X\tif (ch == '0' && (src[0] == 'x' || src[0] == 'X')\n> X\t && isascii(src[1]) && isxdigit(src[1])) {\n> X\t\t/* Hexadecimal: Eat nybble string. */\n> X\t\tif (size <= 0)\n> X\t\t\tgoto emsgsize;\n> X\t\t*dst = 0, dirty = 0;\n> X\t\tsrc++;\t/* skip x or X. */\n> X\t\twhile ((ch = *src++) != '\\0' &&\n> X\t\t isascii(ch) && isxdigit(ch)) {\n> X\t\t\tif (isupper(ch))\n> X\t\t\t\tch = tolower(ch);\n> X\t\t\tn = strchr(xdigits, ch) - xdigits;\n> X\t\t\tassert(n >= 0 && n <= 15);\n> X\t\t\t*dst |= n;\n> X\t\t\tif (!dirty++)\n> X\t\t\t\t*dst <<= 4;\n> X\t\t\telse if (size-- > 0)\n> X\t\t\t\t*++dst = 0, dirty = 0;\n> X\t\t\telse\n> X\t\t\t\tgoto emsgsize;\n> X\t\t}\n> X\t\tif (dirty)\n> X\t\t\tsize--;\n> X\t} else if (isascii(ch) && isdigit(ch)) {\n> X\t\t/* Decimal: eat dotted digit string. */\n> X\t\tfor (;;) {\n> X\t\t\ttmp = 0;\n> X\t\t\tdo {\n> X\t\t\t\tn = strchr(digits, ch) - digits;\n> X\t\t\t\tassert(n >= 0 && n <= 9);\n> X\t\t\t\ttmp *= 10;\n> X\t\t\t\ttmp += n;\n> X\t\t\t\tif (tmp > 255)\n> X\t\t\t\t\tgoto enoent;\n> X\t\t\t} while ((ch = *src++) != '\\0' &&\n> X\t\t\t\t isascii(ch) && isdigit(ch));\n> X\t\t\tif (size-- <= 0)\n> X\t\t\t\tgoto emsgsize;\n> X\t\t\t*dst++ = (u_char) tmp;\n> X\t\t\tif (ch == '\\0' || ch == '/')\n> X\t\t\t\tbreak;\n> X\t\t\tif (ch != '.')\n> X\t\t\t\tgoto enoent;\n> X\t\t\tch = *src++;\n> X\t\t\tif (!isascii(ch) || !isdigit(ch))\n> X\t\t\t\tgoto enoent;\n> X\t\t}\n> X\t} else\n> X\t\tgoto enoent;\n> X\n> X\tbits = -1;\n> X\tif (ch == '/' && isascii(src[0]) && isdigit(src[0]) && dst > odst) {\n> X\t\t/* CIDR width specifier. Nothing can follow it. */\n> X\t\tch = *src++;\t/* Skip over the /. */\n> X\t\tbits = 0;\n> X\t\tdo {\n> X\t\t\tn = strchr(digits, ch) - digits;\n> X\t\t\tassert(n >= 0 && n <= 9);\n> X\t\t\tbits *= 10;\n> X\t\t\tbits += n;\n> X\t\t} while ((ch = *src++) != '\\0' &&\n> X\t\t\t isascii(ch) && isdigit(ch));\n> X\t\tif (ch != '\\0')\n> X\t\t\tgoto enoent;\n> X\t\tif (bits > 32)\n> X\t\t\tgoto emsgsize;\n> X\t}\n> X\n> X\t/* Firey death and destruction unless we prefetched EOS. */\n> X\tif (ch != '\\0')\n> X\t\tgoto enoent;\n> X\n> X\t/* If nothing was written to the destination, we found no address. */\n> X\tif (dst == odst)\n> X\t\tgoto enoent;\n> X\t/* If no CIDR spec was given, infer width from net class. */\n> X\tif (bits == -1) {\n> X\t\tif (*odst >= 240)\t/* Class E */\n> X\t\t\tbits = 32;\n> X\t\telse if (*odst >= 224)\t/* Class D */\n> X\t\t\tbits = 4;\n> X\t\telse if (*odst >= 192)\t/* Class C */\n> X\t\t\tbits = 24;\n> X\t\telse if (*odst >= 128)\t/* Class B */\n> X\t\t\tbits = 16;\n> X\t\telse\t\t\t/* Class A */\n> X\t\t\tbits = 8;\n> X\t\t/* If imputed mask is narrower than specified octets, widen. */\n> X\t\tif (bits >= 8 && bits < ((dst - odst) * 8))\n> X\t\t\tbits = (dst - odst) * 8;\n> X\t}\n> X\t/* Extend network to cover the actual mask. */\n> X\twhile (bits > ((dst - odst) * 8)) {\n> X\t\tif (size-- <= 0)\n> X\t\t\tgoto emsgsize;\n> X\t\t*dst++ = '\\0';\n> X\t}\n> X\treturn (bits);\n> X\n> X enoent:\n> X\terrno = ENOENT;\n> X\treturn (-1);\n> X\n> X emsgsize:\n> X\terrno = EMSGSIZE;\n> X\treturn (-1);\n> X}\n> END-of-inet_net_pton.c\n> echo x - ip.c\n> sed 's/^X//' >ip.c << 'END-of-ip.c'\n> X/*\n> X *\tPostgreSQL type definitions for IP addresses. This\n> X *\tis for IP V4 CIDR notation, but prepared for V6: just\n> X *\tadd the necessary bits where the comments indicate.\n> X *\n> X *\t$Id: ip.c,v 1.2 1998/09/08 12:10:36 tih Exp $\n> X */\n> X\n> X#include <sys/types.h>\n> X#include <sys/socket.h>\n> X\n> X#include <stdio.h>\n> X#include <errno.h>\n> X\n> X#include <netinet/in.h>\n> X#include <arpa/inet.h>\n> X\n> X#include <postgres.h>\n> X#include <utils/palloc.h>\n> X\n> X/*\n> X *\tThis is the internal storage format for IP addresses:\n> X */\n> X\n> Xtypedef struct {\n> X unsigned char family;\n> X unsigned char bits;\n> X union {\n> X u_int32_t ipv4_addr;\t/* network byte order */\n> X\t\t\t\t/* add IPV6 address type here */\n> X } addr;\n> X} ipaddr_struct;\n> X\n> Xtypedef struct varlena ipaddr;\n> X\n> X/*\n> X *\tAccess macros. Add IPV6 support.\n> X */\n> X\n> X#define ip_addrsize(ipaddrptr) \\\n> X\t(((ipaddr_struct *)VARDATA(ipaddrptr))->family == AF_INET ? 4 : -1)\n> X\n> X#define ip_family(ipaddrptr) \\\n> X\t(((ipaddr_struct *)VARDATA(ipaddrptr))->family)\n> X\n> X#define ip_bits(ipaddrptr) \\\n> X\t(((ipaddr_struct *)VARDATA(ipaddrptr))->bits)\n> X\n> X#define ip_v4addr(ipaddrptr) \\\n> X\t(((ipaddr_struct *)VARDATA(ipaddrptr))->addr.ipv4_addr)\n> X\n> X/*\n> X *\tVarious forward declarations:\n> X */\n> X\n> Xipaddr *ipaddr_in(char *str);\n> Xchar *ipaddr_out(ipaddr *addr);\n> X\n> Xbool ipaddr_lt(ipaddr *a1, ipaddr *a2);\n> Xbool ipaddr_le(ipaddr *a1, ipaddr *a2);\n> Xbool ipaddr_eq(ipaddr *a1, ipaddr *a2);\n> Xbool ipaddr_ge(ipaddr *a1, ipaddr *a2);\n> Xbool ipaddr_gt(ipaddr *a1, ipaddr *a2);\n> X\n> Xbool ipaddr_ne(ipaddr *a1, ipaddr *a2);\n> X\n> Xbool ipaddr_sub(ipaddr *a1, ipaddr *a2);\n> Xbool ipaddr_subeq(ipaddr *a1, ipaddr *a2);\n> Xbool ipaddr_sup(ipaddr *a1, ipaddr *a2);\n> Xbool ipaddr_supeq(ipaddr *a1, ipaddr *a2);\n> X\n> Xint4 ipaddr_cmp(ipaddr *a1, ipaddr *a2);\n> X\n> Xint v4bitncmp(u_int32_t a1, u_int32_t a2, int bits);\n> X\n> X/*\n> X *\tIP address reader.\n> X */\n> X\n> Xipaddr *ipaddr_in(char *src) {\n> X int bits;\n> X ipaddr *dst;\n> X\n> X dst = palloc(VARHDRSZ + sizeof(ipaddr_struct));\n> X if (dst == NULL) {\n> X elog(ERROR, \"unable to allocate memory in ipaddr_in()\");\n> X return(NULL);\n> X }\n> X /* First, try for an IP V4 address: */\n> X ip_family(dst) = AF_INET;\n> X bits = inet_net_pton(ip_family(dst), src, &ip_v4addr(dst), ip_addrsize(dst));\n> X if ((bits < 0) || (bits > 32)) {\n> X /* Go for an IPV6 address here, before faulting out: */\n> X elog(ERROR, \"could not parse \\\"%s\\\"\", src);\n> X pfree(dst);\n> X return(NULL);\n> X }\n> X VARSIZE(dst) = VARHDRSZ\n> X + ((char *)&ip_v4addr(dst) - (char *)VARDATA(dst))\n> X + ip_addrsize(dst);\n> X ip_bits(dst) = bits;\n> X return(dst);\n> X}\n> X\n> X/*\n> X *\tIP address output function.\n> X */\n> X\n> Xchar *ipaddr_out(ipaddr *src) {\n> X char *dst, tmp[sizeof(\"255.255.255.255/32\")];\n> X\n> X if (ip_family(src) == AF_INET) {\n> X /* It's an IP V4 address: */\n> X if (inet_net_ntop(AF_INET, &ip_v4addr(src), ip_bits(src),\n> X\t\t tmp, sizeof(tmp)) < 0) {\n> X elog(ERROR, \"unable to print address (%s)\", strerror(errno));\n> X return(NULL);\n> X }\n> X } else {\n> X /* Go for an IPV6 address here, before faulting out: */\n> X elog(ERROR, \"unknown address family (%d)\", ip_family(src));\n> X return(NULL);\n> X }\n> X dst = palloc(strlen(tmp) + 1);\n> X if (dst == NULL) {\n> X elog(ERROR, \"unable to allocate memory in ipaddr_out()\");\n> X return(NULL);\n> X }\n> X strcpy(dst, tmp);\n> X return(dst);\n> X}\n> X\n> X/*\n> X *\tBoolean tests for magnitude. Add V4/V6 testing!\n> X */\n> X\n> Xbool ipaddr_lt(ipaddr *a1, ipaddr *a2) {\n> X if ((ip_family(a1) == AF_INET) && (ip_family(a2) == AF_INET)) {\n> X int order = v4bitncmp(ip_v4addr(a1), ip_v4addr(a2), ip_bits(a2));\n> X return((order < 0) || ((order == 0) && (ip_bits(a1) < ip_bits(a2))));\n> X } else {\n> X /* Go for an IPV6 address here, before faulting out: */\n> X elog(ERROR, \"cannot compare address families %d and %d\",\n> X\t ip_family(a1), ip_family(a2));\n> X return(FALSE);\n> X }\n> X}\n> X\n> Xbool ipaddr_le(ipaddr *a1, ipaddr *a2) {\n> X return(ipaddr_lt(a1, a2) || ipaddr_eq(a1, a2));\n> X}\n> X\n> Xbool ipaddr_eq(ipaddr *a1, ipaddr *a2) {\n> X if ((ip_family(a1) == AF_INET) && (ip_family(a2) == AF_INET)) {\n> X return((ip_bits(a1) == ip_bits(a2))\n> X\t && (v4bitncmp(ip_v4addr(a1), ip_v4addr(a2), ip_bits(a1)) == 0));\n> X } else {\n> X /* Go for an IPV6 address here, before faulting out: */\n> X elog(ERROR, \"cannot compare address families %d and %d\",\n> X\t ip_family(a1), ip_family(a2));\n> X return(FALSE);\n> X }\n> X}\n> X\n> Xbool ipaddr_ge(ipaddr *a1, ipaddr *a2) {\n> X return(ipaddr_gt(a1, a2) || ipaddr_eq(a1, a2));\n> X}\n> X\n> Xbool ipaddr_gt(ipaddr *a1, ipaddr *a2) {\n> X if ((ip_family(a1) == AF_INET) && (ip_family(a2) == AF_INET)) {\n> X int order = v4bitncmp(ip_v4addr(a1), ip_v4addr(a2), ip_bits(a2));\n> X return((order > 0) || ((order == 0) && (ip_bits(a1) > ip_bits(a2))));\n> X } else {\n> X /* Go for an IPV6 address here, before faulting out: */\n> X elog(ERROR, \"cannot compare address families %d and %d\",\n> X\t ip_family(a1), ip_family(a2));\n> X return(FALSE);\n> X }\n> X}\n> X\n> Xbool ipaddr_ne(ipaddr *a1, ipaddr *a2) {\n> X return(!ipaddr_eq(a1, a2));\n> X}\n> X\n> Xbool ipaddr_sub(ipaddr *a1, ipaddr *a2) {\n> X if ((ip_family(a1) == AF_INET) && (ip_family(a2) == AF_INET)) {\n> X return((ip_bits(a1) > ip_bits(a2))\n> X\t && (v4bitncmp(ip_v4addr(a1), ip_v4addr(a2), ip_bits(a2)) == 0));\n> X } else {\n> X /* Go for an IPV6 address here, before faulting out: */\n> X elog(ERROR, \"cannot compare address families %d and %d\",\n> X\t ip_family(a1), ip_family(a2));\n> X return(FALSE);\n> X }\n> X}\n> X\n> Xbool ipaddr_subeq(ipaddr *a1, ipaddr *a2) {\n> X if ((ip_family(a1) == AF_INET) && (ip_family(a2) == AF_INET)) {\n> X return((ip_bits(a1) >= ip_bits(a2))\n> X\t && (v4bitncmp(ip_v4addr(a1), ip_v4addr(a2), ip_bits(a2)) == 0));\n> X } else {\n> X /* Go for an IPV6 address here, before faulting out: */\n> X elog(ERROR, \"cannot compare address families %d and %d\",\n> X\t ip_family(a1), ip_family(a2));\n> X return(FALSE);\n> X }\n> X}\n> X\n> Xbool ipaddr_sup(ipaddr *a1, ipaddr *a2) {\n> X if ((ip_family(a1) == AF_INET) && (ip_family(a2) == AF_INET)) {\n> X return((ip_bits(a1) < ip_bits(a2))\n> X\t && (v4bitncmp(ip_v4addr(a1), ip_v4addr(a2), ip_bits(a1)) == 0));\n> X } else {\n> X /* Go for an IPV6 address here, before faulting out: */\n> X elog(ERROR, \"cannot compare address families %d and %d\",\n> X\t ip_family(a1), ip_family(a2));\n> X return(FALSE);\n> X }\n> X}\n> X\n> Xbool ipaddr_supeq(ipaddr *a1, ipaddr *a2) {\n> X if ((ip_family(a1) == AF_INET) && (ip_family(a2) == AF_INET)) {\n> X return((ip_bits(a1) <= ip_bits(a2))\n> X\t && (v4bitncmp(ip_v4addr(a1), ip_v4addr(a2), ip_bits(a1)) == 0));\n> X } else {\n> X /* Go for an IPV6 address here, before faulting out: */\n> X elog(ERROR, \"cannot compare address families %d and %d\",\n> X\t ip_family(a1), ip_family(a2));\n> X return(FALSE);\n> X }\n> X}\n> X\n> X/*\n> X *\tComparison function for sorting. Add V4/V6 testing!\n> X */\n> X\n> Xint4 ipaddr_cmp(ipaddr *a1, ipaddr *a2) {\n> X if (ntohl(ip_v4addr(a1)) < ntohl(ip_v4addr(a2))) {\n> X return(-1);\n> X } else if (ntohl(ip_v4addr(a1)) > ntohl(ip_v4addr(a2))) {\n> X return(1);\n> X }\n> X return 0;\n> X}\n> X\n> X/*\n> X *\tBitwise comparison for V4 addresses. Add V6 implementation!\n> X */\n> X\n> Xint v4bitncmp(u_int32_t a1, u_int32_t a2, int bits) {\n> X unsigned long mask = 0;\n> X int i;\n> X for (i = 0; i < bits; i++) {\n> X mask = (mask >> 1) | 0x80000000;\n> X }\n> X a1 = ntohl(a1);\n> X a2 = ntohl(a2);\n> X if ((a1 & mask) < (a2 & mask)) {\n> X return(-1);\n> X } else if ((a1 & mask) > (a2 & mask)) {\n> X return(1);\n> X }\n> X return(0);\n> X}\n> X\n> X/*\n> X *\teof\n> X */\n> END-of-ip.c\n> echo x - ip.sql.in\n> sed 's/^X//' >ip.sql.in << 'END-of-ip.sql.in'\n> X--\n> X--\tPostgreSQL code for IP addresses.\n> X--\n> X--\t$Id: ip.sql.in,v 1.2 1998/09/08 12:10:45 tih Exp $\n> X--\n> X\n> Xload 'TARGET/ip.so';\n> X\n> X--\n> X--\tInput and output functions and the type itself:\n> X--\n> X\n> Xcreate function ipaddr_in(opaque)\n> X\treturns opaque\n> X\tas 'TARGET/ip.so'\n> X\tlanguage 'c';\n> X\n> Xcreate function ipaddr_out(opaque)\n> X\treturns opaque\n> X\tas 'TARGET/ip.so'\n> X\tlanguage 'c';\n> X\n> Xcreate type ipaddr (\n> X\tinternallength = variable,\n> X\texternallength = variable,\n> X\tinput = ipaddr_in,\n> X\toutput = ipaddr_out\n> X);\n> X\n> X--\n> X--\tThe various boolean tests:\n> X--\n> X\n> Xcreate function ipaddr_lt(ipaddr, ipaddr)\n> X\treturns bool\n> X\tas 'TARGET/ip.so'\n> X\tlanguage 'c';\n> X\n> Xcreate function ipaddr_le(ipaddr, ipaddr)\n> X\treturns bool\n> X\tas 'TARGET/ip.so'\n> X\tlanguage 'c';\n> X\n> Xcreate function ipaddr_eq(ipaddr, ipaddr)\n> X\treturns bool\n> X\tas 'TARGET/ip.so'\n> X\tlanguage 'c';\n> X\n> Xcreate function ipaddr_ge(ipaddr, ipaddr)\n> X\treturns bool\n> X\tas 'TARGET/ip.so'\n> X\tlanguage 'c';\n> X\n> Xcreate function ipaddr_gt(ipaddr, ipaddr)\n> X\treturns bool\n> X\tas 'TARGET/ip.so'\n> X\tlanguage 'c';\n> X\n> Xcreate function ipaddr_ne(ipaddr, ipaddr)\n> X\treturns bool\n> X\tas 'TARGET/ip.so'\n> X\tlanguage 'c';\n> X\n> Xcreate function ipaddr_sub(ipaddr, ipaddr)\n> X\treturns bool\n> X\tas 'TARGET/ip.so'\n> X\tlanguage 'c';\n> X\n> Xcreate function ipaddr_subeq(ipaddr, ipaddr)\n> X\treturns bool\n> X\tas 'TARGET/ip.so'\n> X\tlanguage 'c';\n> X\n> Xcreate function ipaddr_sup(ipaddr, ipaddr)\n> X\treturns bool\n> X\tas 'TARGET/ip.so'\n> X\tlanguage 'c';\n> X\n> Xcreate function ipaddr_supeq(ipaddr, ipaddr)\n> X\treturns bool\n> X\tas 'TARGET/ip.so'\n> X\tlanguage 'c';\n> X\n> Xcreate function ipaddr_cmp(ipaddr, ipaddr)\n> X\treturns int4\n> X\tas 'TARGET/ip.so'\n> X\tlanguage 'c';\n> X\n> X--\n> X--\tNow the operators. Note how some of the parameters to some\n> X--\tof the 'create operator' commands are commented out. This\n> X--\tis because they reference as yet undefined operators, and\n> X--\twill be implicitly defined when those are, further down.\n> X--\n> X\n> Xcreate operator < (\n> X\tleftarg = ipaddr,\n> X\trightarg = ipaddr,\n> X--\tnegator = >=,\n> X\trestrict = intltsel,\n> X\tjoin = intltjoinsel,\n> X\tprocedure = ipaddr_lt\n> X);\n> X\n> Xcreate operator <= (\n> X\tleftarg = ipaddr,\n> X\trightarg = ipaddr,\n> X--\tnegator = >,\n> X\trestrict = intltsel,\n> X\tjoin = intltjoinsel,\n> X\tprocedure = ipaddr_le\n> X);\n> X\n> Xcreate operator = (\n> X\tleftarg = ipaddr,\n> X\trightarg = ipaddr,\n> X\tcommutator = =,\n> X--\tnegator = <>,\n> X\trestrict = eqsel,\n> X\tjoin = eqjoinsel,\n> X\tprocedure = ipaddr_eq\n> X);\n> X\n> Xcreate operator >= (\n> X\tleftarg = ipaddr,\n> X\trightarg = ipaddr,\n> X\tnegator = <,\n> X\trestrict = intgtsel,\n> X\tjoin = intgtjoinsel,\n> X\tprocedure = ipaddr_ge\n> X);\n> X\n> Xcreate operator > (\n> X\tleftarg = ipaddr,\n> X\trightarg = ipaddr,\n> X\tnegator = <=,\n> X\trestrict = intgtsel,\n> X\tjoin = intgtjoinsel,\n> X\tprocedure = ipaddr_gt\n> X);\n> X\n> Xcreate operator <> (\n> X\tleftarg = ipaddr,\n> X\trightarg = ipaddr,\n> X\tnegator = =,\n> X\trestrict = neqsel,\n> X\tjoin = neqjoinsel,\n> X\tprocedure = ipaddr_ne\n> X);\n> X\n> Xcreate operator << (\n> X\tleftarg = ipaddr,\n> X\trightarg = ipaddr,\n> X\tprocedure = ipaddr_sub\n> X);\n> X\n> Xcreate operator <<= (\n> X\tleftarg = ipaddr,\n> X\trightarg = ipaddr,\n> X\tprocedure = ipaddr_subeq\n> X);\n> X\n> Xcreate operator >> (\n> X\tleftarg = ipaddr,\n> X\trightarg = ipaddr,\n> X\tprocedure = ipaddr_sup\n> X);\n> X\n> Xcreate operator >>= (\n> X\tleftarg = ipaddr,\n> X\trightarg = ipaddr,\n> X\tprocedure = ipaddr_supeq\n> X);\n> X\n> X--\n> X--\tFinally, make it possible to do btree indexing on IP addresses.\n> X--\n> X\n> Xbegin;\n> X\n> Xcreate table tmp_op (oprname name, opi int2);\n> X\n> Xinsert into tmp_op values ('<', 1);\n> Xinsert into tmp_op values ('<=', 2);\n> Xinsert into tmp_op values ('=', 3);\n> Xinsert into tmp_op values ('>=', 4);\n> Xinsert into tmp_op values ('>', 5);\n> X\n> Xdelete from pg_opclass\n> X\twhere opcname = 'ipaddr_ops';\n> X\n> Xinsert into pg_opclass (opcname, opcdeftype)\n> X\tselect 'ipaddr_ops', oid from pg_type\n> X\t\twhere typname = 'ipaddr';\n> X\n> Xselect o.oid as opoid, o.oprname\n> X\tinto table ipaddr_tmp\n> X\tfrom pg_operator o, pg_type t\n> X\twhere o.oprleft = t.oid and\n> X\t o.oprright = t.oid and\n> X\t t.typname = 'ipaddr';\n> X\n> Xinsert into pg_amop (amopid, amopclaid, amopopr, amopstrategy,\n> X\t\t amopselect, amopnpages)\n> X\tselect am.oid, opcl.oid, c.opoid, t.opi,\n> X\t\t\t'btreesel'::regproc, 'btreenpage'::regproc\n> X\t\tfrom pg_am am, pg_opclass opcl, ipaddr_tmp c, tmp_op t\n> X\t\twhere t.oprname = c.oprname and\n> X\t\t amname = 'btree' and opcname = 'ipaddr_ops';\n> X\n> Xinsert into pg_amproc (amid, amopclaid, amproc, amprocnum)\n> X\tselect pgam.oid, opc.oid, prc.oid, '1'::int2\n> X\t\tfrom pg_am pgam, pg_opclass opc, pg_proc prc\n> X\t\twhere prc.proname = 'ipaddr_cmp' and\n> X\t\t pgam.amname = 'btree' and\n> X\t\t opc.opcname = 'ipaddr_ops';\n> X\n> Xdrop table tmp_op;\n> Xdrop table ipaddr_tmp;\n> X\n> Xcommit;\n> X\n> X--\n> X--\teof\n> X--\n> END-of-ip.sql.in\n> echo x - mac.c\n> sed 's/^X//' >mac.c << 'END-of-mac.c'\n> X/*\n> X *\tPostgreSQL type definitions for MAC addresses.\n> X *\n> X *\t$Id: mac.c,v 1.1 1998/09/07 12:31:18 tih Exp $\n> X */\n> X\n> X#include <stdio.h>\n> X\n> X#include <postgres.h>\n> X#include <utils/palloc.h>\n> X\n> X#include \"mac.h\"\n> X\n> X/*\n> X *\tThis is the internal storage format for MAC addresses:\n> X */\n> X\n> Xtypedef struct macaddr {\n> X unsigned char a;\n> X unsigned char b;\n> X unsigned char c;\n> X unsigned char d;\n> X unsigned char e;\n> X unsigned char f;\n> X} macaddr;\n> X\n> X/*\n> X *\tVarious forward declarations:\n> X */\n> X\n> Xmacaddr *macaddr_in(char *str);\n> Xchar *macaddr_out(macaddr *addr);\n> X\n> Xbool macaddr_lt(macaddr *a1, macaddr *a2);\n> Xbool macaddr_le(macaddr *a1, macaddr *a2);\n> Xbool macaddr_eq(macaddr *a1, macaddr *a2);\n> Xbool macaddr_ge(macaddr *a1, macaddr *a2);\n> Xbool macaddr_gt(macaddr *a1, macaddr *a2);\n> X\n> Xbool macaddr_ne(macaddr *a1, macaddr *a2);\n> X\n> Xint4 macaddr_cmp(macaddr *a1, macaddr *a2);\n> X\n> Xtext *macaddr_manuf(macaddr *addr);\n> X\n> X/*\n> X *\tUtility macros used for sorting and comparing:\n> X */\n> X\n> X#define hibits(addr) \\\n> X ((unsigned long)((addr->a<<16)|(addr->b<<8)|(addr->c)))\n> X\n> X#define lobits(addr) \\\n> X ((unsigned long)((addr->c<<16)|(addr->e<<8)|(addr->f)))\n> X\n> X/*\n> X *\tMAC address reader. Accepts several common notations.\n> X */\n> X\n> Xmacaddr *macaddr_in(char *str) {\n> X int a, b, c, d, e, f;\n> X macaddr *result;\n> X int count;\n> X\n> X if (strlen(str) > 0) {\n> X\n> X count = sscanf(str, \"%x:%x:%x:%x:%x:%x\", &a, &b, &c, &d, &e, &f);\n> X if (count != 6)\n> X count = sscanf(str, \"%x-%x-%x-%x-%x-%x\", &a, &b, &c, &d, &e, &f);\n> X if (count != 6)\n> X count = sscanf(str, \"%2x%2x%2x:%2x%2x%2x\", &a, &b, &c, &d, &e, &f);\n> X if (count != 6)\n> X count = sscanf(str, \"%2x%2x%2x-%2x%2x%2x\", &a, &b, &c, &d, &e, &f);\n> X if (count != 6)\n> X count = sscanf(str, \"%2x%2x.%2x%2x.%2x%2x\", &a, &b, &c, &d, &e, &f);\n> X \n> X if (count != 6) {\n> X elog(ERROR, \"macaddr_in: error in parsing \\\"%s\\\"\", str);\n> X return(NULL);\n> X }\n> X \n> X if ((a < 0) || (a > 255) || (b < 0) || (b > 255) ||\n> X\t(c < 0) || (c > 255) || (d < 0) || (d > 255) ||\n> X\t(e < 0) || (e > 255) || (f < 0) || (f > 255)) {\n> X elog(ERROR, \"macaddr_in: illegal address \\\"%s\\\"\", str);\n> X return(NULL);\n> X }\n> X } else {\n> X a = b = c = d = e = f = 0;\t/* special case for missing address */\n> X }\n> X\n> X result = (macaddr *)palloc(sizeof(macaddr));\n> X\n> X result->a = a;\n> X result->b = b;\n> X result->c = c;\n> X result->d = d;\n> X result->e = e;\n> X result->f = f;\n> X\n> X return(result);\n> X}\n> X\n> X/*\n> X *\tMAC address output function. Fixed format.\n> X */\n> X\n> Xchar *macaddr_out(macaddr *addr) {\n> X char *result;\n> X\n> X if (addr == NULL)\n> X return(NULL);\n> X\n> X result = (char *)palloc(32);\n> X\n> X if ((hibits(addr) > 0) || (lobits(addr) > 0)) {\n> X sprintf(result, \"%02x:%02x:%02x:%02x:%02x:%02x\",\n> X\t addr->a, addr->b, addr->c, addr->d, addr->e, addr->f);\n> X } else {\n> X result[0] = 0;\t\t/* special case for missing address */\n> X }\n> X return(result);\n> X}\n> X\n> X/*\n> X *\tBoolean tests.\n> X */\n> X\n> Xbool macaddr_lt(macaddr *a1, macaddr *a2) {\n> X return((hibits(a1) < hibits(a2)) ||\n> X\t ((hibits(a1) == hibits(a2)) && lobits(a1) < lobits(a2)));\n> X};\n> X\n> Xbool macaddr_le(macaddr *a1, macaddr *a2) {\n> X return((hibits(a1) < hibits(a2)) ||\n> X\t ((hibits(a1) == hibits(a2)) && lobits(a1) <= lobits(a2)));\n> X};\n> X\n> Xbool macaddr_eq(macaddr *a1, macaddr *a2) {\n> X return ((hibits(a1) == hibits(a2)) && (lobits(a1) == lobits(a2)));\n> X};\n> X\n> Xbool macaddr_ge(macaddr *a1, macaddr *a2) {\n> X return((hibits(a1) > hibits(a2)) ||\n> X\t ((hibits(a1) == hibits(a2)) && lobits(a1) >= lobits(a2)));\n> X};\n> X\n> Xbool macaddr_gt(macaddr *a1, macaddr *a2) {\n> X return((hibits(a1) > hibits(a2)) ||\n> X\t ((hibits(a1) == hibits(a2)) && lobits(a1) > lobits(a2)));\n> X};\n> X\n> Xbool macaddr_ne(macaddr *a1, macaddr *a2) {\n> X return ((hibits(a1) != hibits(a2)) || (lobits(a1) != lobits(a2)));\n> X};\n> X\n> X/*\n> X *\tComparison function for sorting:\n> X */\n> X\n> Xint4 macaddr_cmp(macaddr *a1, macaddr *a2) {\n> X if (hibits(a1) < hibits(a2))\n> X return -1;\n> X else if (hibits(a1) > hibits(a2))\n> X return 1;\n> X else if (lobits(a1) < lobits(a2))\n> X return -1;\n> X else if (lobits(a1) > lobits(a2))\n> X return 1;\n> X else\n> X return 0;\n> X}\n> X\n> X/*\n> X *\tThe special manufacturer fetching function. See \"mac.h\".\n> X */\n> X\n> Xtext *macaddr_manuf(macaddr *addr) {\n> X manufacturer *manuf;\n> X int length;\n> X text *result;\n> X\n> X for (manuf = manufacturers; manuf->name != NULL; manuf++) {\n> X if ((manuf->a == addr->a) &&\n> X\t(manuf->b == addr->b) &&\n> X\t(manuf->c == addr->c))\n> X break;\n> X }\n> X if (manuf->name == NULL) {\n> X result = palloc(VARHDRSZ + 1);\n> X memset(result, 0, VARHDRSZ + 1);\n> X VARSIZE(result) = VARHDRSZ + 1;\n> X } else {\n> X length = strlen(manuf->name) + 1;\n> X result = palloc(length + VARHDRSZ);\n> X memset(result, 0, length + VARHDRSZ);\n> X VARSIZE(result) = length + VARHDRSZ;\n> X memcpy(VARDATA(result), manuf->name, length);\n> X }\n> X return result;\n> X}\n> X\n> X/*\n> X *\teof\n> X */\n> END-of-mac.c\n> echo x - mac.h\n> sed 's/^X//' >mac.h << 'END-of-mac.h'\n> X/*\n> X *\tPostgreSQL type definitions for MAC addresses.\n> X *\n> X *\t$Id: mac.h,v 1.1 1998/09/07 12:31:22 tih Exp $\n> X */\n> X\n> Xtypedef struct manufacturer {\n> X unsigned char a;\n> X unsigned char b;\n> X unsigned char c;\n> X char *name;\n> X} manufacturer;\n> X\n> Xmanufacturer manufacturers[] = {\n> X {0x00, 0x00, 0x0C, \"Cisco\"},\n> X {0x00, 0x00, 0x0E, \"Fujitsu\"},\n> X {0x00, 0x00, 0x0F, \"NeXT\"},\n> X {0x00, 0x00, 0x10, \"Sytek\"},\n> X {0x00, 0x00, 0x1D, \"Cabletron\"},\n> X {0x00, 0x00, 0x20, \"DIAB\"},\n> X {0x00, 0x00, 0x22, \"Visual Technology\"},\n> X {0x00, 0x00, 0x2A, \"TRW\"},\n> X {0x00, 0x00, 0x32, \"GPT Limited\"},\n> X {0x00, 0x00, 0x5A, \"S & Koch\"},\n> X {0x00, 0x00, 0x5E, \"IANA\"},\n> X {0x00, 0x00, 0x65, \"Network General\"},\n> X {0x00, 0x00, 0x6B, \"MIPS\"},\n> X {0x00, 0x00, 0x77, \"MIPS\"},\n> X {0x00, 0x00, 0x7A, \"Ardent\"},\n> X {0x00, 0x00, 0x89, \"Cayman Systems\"},\n> X {0x00, 0x00, 0x93, \"Proteon\"},\n> X {0x00, 0x00, 0x9F, \"Ameristar Technology\"},\n> X {0x00, 0x00, 0xA2, \"Wellfleet\"},\n> X {0x00, 0x00, 0xA3, \"Network Application Technology\"},\n> X {0x00, 0x00, 0xA6, \"Network General\"},\n> X {0x00, 0x00, 0xA7, \"NCD\"},\n> X {0x00, 0x00, 0xA9, \"Network Systems\"},\n> X {0x00, 0x00, 0xAA, \"Xerox\"},\n> X {0x00, 0x00, 0xB3, \"CIMLinc\"},\n> X {0x00, 0x00, 0xB7, \"Dove Fastnet\"},\n> X {0x00, 0x00, 0xBC, \"Allen-Bradley\"},\n> X {0x00, 0x00, 0xC0, \"Western Digital\"},\n> X {0x00, 0x00, 0xC5, \"Farallon\"},\n> X {0x00, 0x00, 0xC6, \"Hewlett-Packard\"},\n> X {0x00, 0x00, 0xC8, \"Altos\"},\n> X {0x00, 0x00, 0xC9, \"Emulex\"},\n> X {0x00, 0x00, 0xD7, \"Dartmouth College\"},\n> X {0x00, 0x00, 0xD8, \"3Com (?)\"},\n> X {0x00, 0x00, 0xDD, \"Gould\"},\n> X {0x00, 0x00, 0xDE, \"Unigraph\"},\n> X {0x00, 0x00, 0xE2, \"Acer Counterpoint\"},\n> X {0x00, 0x00, 0xEF, \"Alantec\"},\n> X {0x00, 0x00, 0xFD, \"High Level Hardware\"},\n> X {0x00, 0x01, 0x02, \"BBN internal usage\"},\n> X {0x00, 0x20, 0xAF, \"3Com\"},\n> X {0x00, 0x17, 0x00, \"Kabel\"},\n> X {0x00, 0x80, 0x64, \"Wyse Technology\"},\n> X {0x00, 0x80, 0x2B, \"IMAC (?)\"},\n> X {0x00, 0x80, 0x2D, \"Xylogics, Inc.\"},\n> X {0x00, 0x80, 0x8C, \"Frontier Software Development\"},\n> X {0x00, 0x80, 0xC2, \"IEEE 802.1 Committee\"},\n> X {0x00, 0x80, 0xD3, \"Shiva\"},\n> X {0x00, 0xAA, 0x00, \"Intel\"},\n> X {0x00, 0xDD, 0x00, \"Ungermann-Bass\"},\n> X {0x00, 0xDD, 0x01, \"Ungermann-Bass\"},\n> X {0x02, 0x07, 0x01, \"Racal InterLan\"},\n> X {0x02, 0x04, 0x06, \"BBN internal usage\"},\n> X {0x02, 0x60, 0x86, \"Satelcom MegaPac\"},\n> X {0x02, 0x60, 0x8C, \"3Com\"},\n> X {0x02, 0xCF, 0x1F, \"CMC\"},\n> X {0x08, 0x00, 0x02, \"3Com\"},\n> X {0x08, 0x00, 0x03, \"ACC\"},\n> X {0x08, 0x00, 0x05, \"Symbolics\"},\n> X {0x08, 0x00, 0x08, \"BBN\"},\n> X {0x08, 0x00, 0x09, \"Hewlett-Packard\"},\n> X {0x08, 0x00, 0x0A, \"Nestar Systems\"},\n> X {0x08, 0x00, 0x0B, \"Unisys\"},\n> X {0x08, 0x00, 0x11, \"Tektronix\"},\n> X {0x08, 0x00, 0x14, \"Excelan\"},\n> X {0x08, 0x00, 0x17, \"NSC\"},\n> X {0x08, 0x00, 0x1A, \"Data General\"},\n> X {0x08, 0x00, 0x1B, \"Data General\"},\n> X {0x08, 0x00, 0x1E, \"Apollo\"},\n> X {0x08, 0x00, 0x20, \"Sun\"},\n> X {0x08, 0x00, 0x22, \"NBI\"},\n> X {0x08, 0x00, 0x25, \"CDC\"},\n> X {0x08, 0x00, 0x26, \"Norsk Data\"},\n> X {0x08, 0x00, 0x27, \"PCS Computer Systems GmbH\"},\n> X {0x08, 0x00, 0x28, \"Texas Instruments\"},\n> X {0x08, 0x00, 0x2B, \"DEC\"},\n> X {0x08, 0x00, 0x2E, \"Metaphor\"},\n> X {0x08, 0x00, 0x2F, \"Prime Computer\"},\n> X {0x08, 0x00, 0x36, \"Intergraph\"},\n> X {0x08, 0x00, 0x37, \"Fujitsu-Xerox\"},\n> X {0x08, 0x00, 0x38, \"Bull\"},\n> X {0x08, 0x00, 0x39, \"Spider Systems\"},\n> X {0x08, 0x00, 0x41, \"DCA Digital Comm. Assoc.\"},\n> X {0x08, 0x00, 0x45, \"Xylogics (?)\"},\n> X {0x08, 0x00, 0x46, \"Sony\"},\n> X {0x08, 0x00, 0x47, \"Sequent\"},\n> X {0x08, 0x00, 0x49, \"Univation\"},\n> X {0x08, 0x00, 0x4C, \"Encore\"},\n> X {0x08, 0x00, 0x4E, \"BICC\"},\n> X {0x08, 0x00, 0x56, \"Stanford University\"},\n> X {0x08, 0x00, 0x58, \"DECsystem 20 (?)\"},\n> X {0x08, 0x00, 0x5A, \"IBM\"},\n> X {0x08, 0x00, 0x67, \"Comdesign\"},\n> X {0x08, 0x00, 0x68, \"Ridge\"},\n> X {0x08, 0x00, 0x69, \"Silicon Graphics\"},\n> X {0x08, 0x00, 0x6E, \"Concurrent\"},\n> X {0x08, 0x00, 0x75, \"DDE\"},\n> X {0x08, 0x00, 0x7C, \"Vitalink\"},\n> X {0x08, 0x00, 0x80, \"XIOS\"},\n> X {0x08, 0x00, 0x86, \"Imagen/QMS\"},\n> X {0x08, 0x00, 0x87, \"Xyplex\"},\n> X {0x08, 0x00, 0x89, \"Kinetics\"},\n> X {0x08, 0x00, 0x8B, \"Pyramid\"},\n> X {0x08, 0x00, 0x8D, \"XyVision\"},\n> X {0x08, 0x00, 0x90, \"Retix Inc\"},\n> X {0x48, 0x44, 0x53, \"HDS (?)\"},\n> X {0x80, 0x00, 0x10, \"AT&T\"},\n> X {0xAA, 0x00, 0x00, \"DEC\"},\n> X {0xAA, 0x00, 0x01, \"DEC\"},\n> X {0xAA, 0x00, 0x02, \"DEC\"},\n> X {0xAA, 0x00, 0x03, \"DEC\"},\n> X {0xAA, 0x00, 0x04, \"DEC\"},\n> X {0x00, 0x00, 0x00, NULL}\n> X};\n> X\n> X/*\n> X *\teof\n> X */\n> END-of-mac.h\n> echo x - mac.sql.in\n> sed 's/^X//' >mac.sql.in << 'END-of-mac.sql.in'\n> X--\n> X--\tPostgreSQL code for MAC addresses.\n> X--\n> X--\t$Id: mac.sql.in,v 1.2 1998/09/08 12:11:18 tih Exp $\n> X--\n> X\n> Xload 'TARGET/mac.so';\n> X\n> X--\n> X--\tInput and output functions and the type itself:\n> X--\n> X\n> Xcreate function macaddr_in(opaque)\n> X\treturns opaque\n> X\tas 'TARGET/mac.so'\n> X\tlanguage 'c';\n> X\n> Xcreate function macaddr_out(opaque)\n> X\treturns opaque\n> X\tas 'TARGET/mac.so'\n> X\tlanguage 'c';\n> X\n> Xcreate type macaddr (\n> X\tinternallength = 6,\n> X\texternallength = variable,\n> X\tinput = macaddr_in,\n> X\toutput = macaddr_out\n> X);\n> X\n> X--\n> X--\tThe boolean tests:\n> X--\n> X\n> Xcreate function macaddr_lt(macaddr, macaddr)\n> X\treturns bool\n> X\tas 'TARGET/mac.so'\n> X\tlanguage 'c';\n> X\n> Xcreate function macaddr_le(macaddr, macaddr)\n> X\treturns bool\n> X\tas 'TARGET/mac.so'\n> X\tlanguage 'c';\n> X\n> Xcreate function macaddr_eq(macaddr, macaddr)\n> X\treturns bool\n> X\tas 'TARGET/mac.so'\n> X\tlanguage 'c';\n> X\n> Xcreate function macaddr_ge(macaddr, macaddr)\n> X\treturns bool\n> X\tas 'TARGET/mac.so'\n> X\tlanguage 'c';\n> X\n> Xcreate function macaddr_gt(macaddr, macaddr)\n> X\treturns bool\n> X\tas 'TARGET/mac.so'\n> X\tlanguage 'c';\n> X\n> Xcreate function macaddr_ne(macaddr, macaddr)\n> X\treturns bool\n> X\tas 'TARGET/mac.so'\n> X\tlanguage 'c';\n> X\n> Xcreate function macaddr_cmp(macaddr, macaddr)\n> X\treturns int4\n> X\tas 'TARGET/mac.so'\n> X\tlanguage 'c';\n> X\n> X--\n> X--\tNow the operators. Note how some of the parameters to some\n> X--\tof the 'create operator' commands are commented out. This\n> X--\tis because they reference as yet undefined operators, and\n> X--\twill be implicitly defined when those are, further down.\n> X--\n> X\n> Xcreate operator < (\n> X\tleftarg = macaddr,\n> X\trightarg = macaddr,\n> X--\tnegator = >=,\n> X\tprocedure = macaddr_lt\n> X);\n> X\n> Xcreate operator <= (\n> X\tleftarg = macaddr,\n> X\trightarg = macaddr,\n> X--\tnegator = >,\n> X\tprocedure = macaddr_le\n> X);\n> X\n> Xcreate operator = (\n> X\tleftarg = macaddr,\n> X\trightarg = macaddr,\n> X\tcommutator = =,\n> X--\tnegator = <>,\n> X\tprocedure = macaddr_eq\n> X);\n> X\n> Xcreate operator >= (\n> X\tleftarg = macaddr,\n> X\trightarg = macaddr,\n> X\tnegator = <,\n> X\tprocedure = macaddr_ge\n> X);\n> X\n> Xcreate operator > (\n> X\tleftarg = macaddr,\n> X\trightarg = macaddr,\n> X\tnegator = <=,\n> X\tprocedure = macaddr_gt\n> X);\n> X\n> Xcreate operator <> (\n> X\tleftarg = macaddr,\n> X\trightarg = macaddr,\n> X\tnegator = =,\n> X\tprocedure = macaddr_ne\n> X);\n> X\n> X--\n> X--\tFinally, the special manufacurer matching function:\n> X--\n> X\n> Xcreate function macaddr_manuf(macaddr)\n> X\treturns text\n> X\tas 'TARGET/mac.so'\n> X\tlanguage 'c';\n> X\n> X--\n> X--\tFinally, make it possible to do btree indexing on MAC addresses.\n> X--\n> X\n> Xbegin;\n> X\n> Xcreate table tmp_op (oprname name, opi int2);\n> X\n> Xinsert into tmp_op values ('<', 1);\n> Xinsert into tmp_op values ('<=', 2);\n> Xinsert into tmp_op values ('=', 3);\n> Xinsert into tmp_op values ('>=', 4);\n> Xinsert into tmp_op values ('>', 5);\n> X\n> Xdelete from pg_opclass\n> X\twhere opcname = 'macaddr_ops';\n> X\n> Xinsert into pg_opclass (opcname, opcdeftype)\n> X\tselect 'macaddr_ops', oid from pg_type\n> X\t\twhere typname = 'macaddr';\n> X\n> Xselect o.oid as opoid, o.oprname\n> X\tinto table macaddr_tmp\n> X\tfrom pg_operator o, pg_type t\n> X\twhere o.oprleft = t.oid and\n> X\t o.oprright = t.oid and\n> X\t t.typname = 'macaddr';\n> X\n> Xinsert into pg_amop (amopid, amopclaid, amopopr, amopstrategy,\n> X\t\t amopselect, amopnpages)\n> X\tselect am.oid, opcl.oid, c.opoid, t.opi,\n> X\t\t\t'btreesel'::regproc, 'btreenpage'::regproc\n> X\t\tfrom pg_am am, pg_opclass opcl, macaddr_tmp c, tmp_op t\n> X\t\twhere t.oprname = c.oprname and\n> X\t\t amname = 'btree' and opcname = 'macaddr_ops';\n> X\n> Xinsert into pg_amproc (amid, amopclaid, amproc, amprocnum)\n> X\tselect pgam.oid, opc.oid, prc.oid, '1'::int2\n> X\t\tfrom pg_am pgam, pg_opclass opc, pg_proc prc\n> X\t\twhere prc.proname = 'macaddr_cmp' and\n> X\t\t pgam.amname = 'btree' and\n> X\t\t opc.opcname = 'macaddr_ops';\n> X\n> Xdrop table tmp_op;\n> Xdrop table macaddr_tmp;\n> X\n> Xcommit;\n> X\n> X--\n> X--\teof\n> X--\n> END-of-mac.sql.in\n> echo x - test.sql\n> sed 's/^X//' >test.sql << 'END-of-test.sql'\n> X--\n> X--\tA quick test of the IP address code\n> X--\n> X--\t$Id: test.sql,v 1.2 1998/09/08 12:11:34 tih Exp $\n> X--\n> X\n> X-- temporary table:\n> Xcreate table addresses (address ipaddr);\n> X\n> X-- sample data from two subnets:\n> Xinsert into addresses values ('158.37.96.15');\n> Xinsert into addresses values ('158.37.96.16');\n> Xinsert into addresses values ('158.37.96.17');\n> Xinsert into addresses values ('158.37.97.15');\n> Xinsert into addresses values ('158.37.97.16');\n> Xinsert into addresses values ('158.37.97.17');\n> Xinsert into addresses values ('158.37.98.15');\n> Xinsert into addresses values ('158.37.98.16');\n> Xinsert into addresses values ('158.37.98.17');\n> Xinsert into addresses values ('158.37.96.150');\n> Xinsert into addresses values ('158.37.96.160');\n> Xinsert into addresses values ('158.37.96.170');\n> Xinsert into addresses values ('158.37.97.150');\n> Xinsert into addresses values ('158.37.97.160');\n> Xinsert into addresses values ('158.37.97.170');\n> Xinsert into addresses values ('158.37.98.150');\n> Xinsert into addresses values ('158.37.98.160');\n> Xinsert into addresses values ('158.37.98.170');\n> X\n> X-- show them all:\n> Xselect * from addresses;\n> X\n> X-- select the ones in subnet 96:\n> Xselect * from addresses where address << '158.37.96.0/24';\n> X\n> X-- select the ones not in subnet 96:\n> Xselect * from addresses where not address << '158.37.96.0/24';\n> X\n> X-- select the ones in subnet 97:\n> Xselect * from addresses where address << '158.37.97.0/24';\n> X\n> X-- select the ones not in subnet 97:\n> Xselect * from addresses where not address << '158.37.97.0/24';\n> X\n> X-- select the ones in subnet 96 or 97, sorted:\n> Xselect * from addresses where address << '158.37.96.0/23'\n> X\torder by address;\n> X\n> X-- now some networks:\n> Xcreate table networks (network ipaddr);\n> X\n> X-- now the subnets mentioned above:\n> Xinsert into networks values ('158.37.96.0/24');\n> Xinsert into networks values ('158.37.97.0/24');\n> Xinsert into networks values ('158.37.98.0/24');\n> X\n> X-- select matching pairs of addresses and containing nets:\n> Xselect address, network from addresses, networks\n> X\twhere address << network;\n> X\n> X-- tidy up:\n> Xdrop table addresses;\n> Xdrop table networks;\n> X\n> X--\n> X--\teof\n> X--\n> END-of-test.sql\n> exit\n> \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Tue, 8 Sep 1998 11:07:08 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: CIDR/IP types. Was: [GENERAL] big numbers"
},
{
"msg_contents": "golden! ship that puppy!\n",
"msg_date": "Tue, 08 Sep 1998 10:35:57 -0700",
"msg_from": "Paul A Vixie <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: CIDR/IP types. Was: [GENERAL] big numbers "
}
] |
[
{
"msg_contents": "> On Thu, 03 Sep 1998, you wrote:\n> >> Is there something like:\n> >> SET LOCK MODE {TO WAIT | TO NO WAIT | TO WAIT n}\n> >> in postgresql?\n> >> Thanks\n> >What does it do?\n> >\t-DEJ\n> \n> It means if during your transaction you've found something\n> locked you will WAIT for it, or NO WAIT, or WAIT n seconds.\n> It's a standard SQL command, the main idea is to avoid\n> the deadlocks.\n> \n> (dim)\nWhich standard is it in? I don't believe our current deadlock\nresolution supports the syntax, but it may be possible to include it in\nv6.5, so I'm sending a copy of this to the HACKERS list. \n\t-DEJ\n",
"msg_date": "Thu, 3 Sep 1998 13:10:38 -0500",
"msg_from": "\"Jackson, DeJuan\" <[email protected]>",
"msg_from_op": true,
"msg_subject": "RE: [GENERAL] SET LOCK MODE ?"
}
] |
[
{
"msg_contents": "Hi patchers/hackers.\n\nHere's a patch for initdb that does two things.\n\n1) Encloses the created rulenames in quotes to preserve case\n in the creation step. (stores _RETpg... instead of _retpg...)\n I believe _RET is standard for views.\n \n2) Renames pg_view to pg_views and pg_rule to pg_rules.\n I believe Jan and myself agreed this would be a \"good idea\"\n \nBoth aspects open for discussion.\n\nAre there any docs considerations?\n\nKeith.",
"msg_date": "Fri, 4 Sep 1998 00:27:34 +0100 (BST)",
"msg_from": "Keith Parks <[email protected]>",
"msg_from_op": true,
"msg_subject": "Patch for initdb"
},
{
"msg_contents": "Applied. Let's see if this fixes the pg_user problem.\n\n\n> Hi patchers/hackers.\n> \n> Here's a patch for initdb that does two things.\n> \n> 1) Encloses the created rulenames in quotes to preserve case\n> in the creation step. (stores _RETpg... instead of _retpg...)\n> I believe _RET is standard for views.\n> \n> 2) Renames pg_view to pg_views and pg_rule to pg_rules.\n> I believe Jan and myself agreed this would be a \"good idea\"\n> \n> Both aspects open for discussion.\n> \n> Are there any docs considerations?\n> \n> Keith. \n\n> \nContent-Description: initdb.sh.patch\n\n> *** src/bin/initdb/initdb.sh.orig\tThu Sep 3 23:04:10 1998\n> --- src/bin/initdb/initdb.sh\tThu Sep 3 23:14:30 1998\n> ***************\n> *** 425,431 ****\n> \tpostgres $PGSQL_OPT template1 > /dev/null\n> mv $PGDATA/base/template1/xpg_user $PGDATA/base/template1/pg_user\n> \n> ! echo \"CREATE RULE _RETpg_user AS ON SELECT TO pg_user DO INSTEAD\t\\\n> \t SELECT usename, usesysid, usecreatedb, usetrace,\t\t\\\n> \t usesuper, usecatupd, '********'::text as passwd,\t\\\n> \t\t valuntil FROM pg_shadow;\" | \\\n> --- 425,431 ----\n> \tpostgres $PGSQL_OPT template1 > /dev/null\n> mv $PGDATA/base/template1/xpg_user $PGDATA/base/template1/pg_user\n> \n> ! echo \"CREATE RULE \\\"_RETpg_user\\\" AS ON SELECT TO pg_user DO INSTEAD\t\\\n> \t SELECT usename, usesysid, usecreatedb, usetrace,\t\t\\\n> \t usesuper, usecatupd, '********'::text as passwd,\t\\\n> \t\t valuntil FROM pg_shadow;\" | \\\n> ***************\n> *** 433,465 ****\n> echo \"REVOKE ALL on pg_shadow FROM public\" | \\\n> \tpostgres $PGSQL_OPT template1 > /dev/null\n> \n> ! echo \"Creating view pg_rule\"\n> ! echo \"CREATE TABLE xpg_rule (\t\t\\\n> \t rulename\tname,\t\t\\\n> \t definition\ttext);\" | postgres $PGSQL_OPT template1 > /dev/null\n> ! #move it into pg_rule\n> ! echo \"UPDATE pg_class SET relname = 'pg_rule' WHERE relname = 'xpg_rule';\" |\\\n> \tpostgres $PGSQL_OPT template1 > /dev/null\n> ! echo \"UPDATE pg_type SET typname = 'pg_rule' WHERE typname = 'xpg_rule';\" |\\\n> \tpostgres $PGSQL_OPT template1 > /dev/null\n> ! mv $PGDATA/base/template1/xpg_rule $PGDATA/base/template1/pg_rule\n> \n> ! echo \"CREATE RULE _RETpg_rule AS ON SELECT TO pg_rule DO INSTEAD\t\\\n> \t SELECT rulename, pg_get_ruledef(rulename) AS definition\t\\\n> \t FROM pg_rewrite;\" | postgres $PGSQL_OPT template1 > /dev/null\n> \n> ! echo \"Creating view pg_view\"\n> ! echo \"CREATE TABLE xpg_view (\t\t\\\n> \t viewname\tname,\t\t\\\n> \t definition\ttext);\" | postgres $PGSQL_OPT template1 > /dev/null\n> ! #move it into pg_view\n> ! echo \"UPDATE pg_class SET relname = 'pg_view' WHERE relname = 'xpg_view';\" |\\\n> \tpostgres $PGSQL_OPT template1 > /dev/null\n> ! echo \"UPDATE pg_type SET typname = 'pg_view' WHERE typname = 'xpg_view';\" |\\\n> \tpostgres $PGSQL_OPT template1 > /dev/null\n> ! mv $PGDATA/base/template1/xpg_view $PGDATA/base/template1/pg_view\n> \n> ! echo \"CREATE RULE _RETpg_view AS ON SELECT TO pg_view DO INSTEAD\t\\\n> \t SELECT relname AS viewname, \t\t\t\t\\\n> \t pg_get_viewdef(relname) AS definition\t\t\\\n> \t FROM pg_class WHERE relhasrules AND\t\t\t\\\n> --- 433,465 ----\n> echo \"REVOKE ALL on pg_shadow FROM public\" | \\\n> \tpostgres $PGSQL_OPT template1 > /dev/null\n> \n> ! echo \"Creating view pg_rules\"\n> ! echo \"CREATE TABLE xpg_rules (\t\t\\\n> \t rulename\tname,\t\t\\\n> \t definition\ttext);\" | postgres $PGSQL_OPT template1 > /dev/null\n> ! #move it into pg_rules\n> ! echo \"UPDATE pg_class SET relname = 'pg_rules' WHERE relname = 'xpg_rules';\" |\\\n> \tpostgres $PGSQL_OPT template1 > /dev/null\n> ! echo \"UPDATE pg_type SET typname = 'pg_rules' WHERE typname = 'xpg_rules';\" |\\\n> \tpostgres $PGSQL_OPT template1 > /dev/null\n> ! mv $PGDATA/base/template1/xpg_rules $PGDATA/base/template1/pg_rules\n> \n> ! echo \"CREATE RULE \\\"_RETpg_rules\\\" AS ON SELECT TO pg_rules DO INSTEAD\t\\\n> \t SELECT rulename, pg_get_ruledef(rulename) AS definition\t\\\n> \t FROM pg_rewrite;\" | postgres $PGSQL_OPT template1 > /dev/null\n> \n> ! echo \"Creating view pg_views\"\n> ! echo \"CREATE TABLE xpg_views (\t\t\\\n> \t viewname\tname,\t\t\\\n> \t definition\ttext);\" | postgres $PGSQL_OPT template1 > /dev/null\n> ! #move it into pg_views\n> ! echo \"UPDATE pg_class SET relname = 'pg_views' WHERE relname = 'xpg_views';\" |\\\n> \tpostgres $PGSQL_OPT template1 > /dev/null\n> ! echo \"UPDATE pg_type SET typname = 'pg_views' WHERE typname = 'xpg_views';\" |\\\n> \tpostgres $PGSQL_OPT template1 > /dev/null\n> ! mv $PGDATA/base/template1/xpg_views $PGDATA/base/template1/pg_views\n> \n> ! echo \"CREATE RULE \\\"_RETpg_views\\\" AS ON SELECT TO pg_views DO INSTEAD\t\\\n> \t SELECT relname AS viewname, \t\t\t\t\\\n> \t pg_get_viewdef(relname) AS definition\t\t\\\n> \t FROM pg_class WHERE relhasrules AND\t\t\t\\\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Wed, 9 Sep 1998 14:17:31 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Patch for initdb"
},
{
"msg_contents": "> Applied. Let's see if this fixes the pg_user problem.\n\nLooks like not, and even if it did I would be worried. We shouldn't have\nsegfaults from query cleanup even if a table name is a bit screwy...\n\npostgres=> select * from pg_user;\npqReadData() -- backend closed the channel unexpectedly.\n\n> > Here's a patch for initdb that does two things.\n> > Are there any docs considerations?\n\nThere is a diagram of system tables which is now out of date. No real\nmention of these tables elsewhere in the sgml docs (yet). Feel free to\nwrite some, but the patch by itself doesn't obligate you to :)\n\n - Tom\n",
"msg_date": "Thu, 10 Sep 1998 01:54:23 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Patch for initdb"
}
] |
[
{
"msg_contents": "I put some extra checks to make sure a query was a good candidate for\nrewrite into a UNION. Besides the existing checks:\n\n1. Make sure the AND/OR tree was rectangular. ( i.e. 3 X 4 or 10 X\n3)\n2. Only one table.\n3. Must have an AND dimension.\n4. At least 9 OP expressions total\n\nAlso cleaned up and commented.",
"msg_date": "Thu, 03 Sep 1998 21:05:18 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": true,
"msg_subject": "Clean up prepkeyset.c"
}
] |
[
{
"msg_contents": "Bruce mentioned that he'd had some trouble applying my last set of\npatches, because he'd already run his reformatting script against\nthe files involved. So, I took the trouble to grovel through a\n\"diff --ignore-all-space\" comparison of tonight's cvs tree with what\nI had last week. (I didn't have the energy to go through the *whole*\ntree, but I did look through all of src/interfaces/.) It was a\nworthwhile exercise because I found a couple of minor errors --- see\nattached patch.\n\nI was mostly pretty happy with what the formatting script had done with\nthe code, especially in libpgtcl which had not been anywhere close to\nmatching the formatting conventions of the rest of pgsql. Nice job!\n\nBUT: I am not happy that the script chooses to reflow block comments.\nLine breaks chosen on the basis of how much fits are not a readability\nimprovement over line breaks placed where a human author felt they made\nsense. For example, is this really an improvement in readability?\n(And if it's *not* a clear gain, why are we doing it?)\n\n*** 201,209 ****\n \n /* === in fe-misc.c === */\n \n! \t/* \"Get\" and \"Put\" routines return 0 if successful, EOF if not.\n! \t * Note that for Get, EOF merely means the buffer is exhausted,\n! \t * not that there is necessarily any error.\n \t */\n \textern int\tpqGetc(char *result, PGconn *conn);\n \textern int\tpqGets(char *s, int maxlen, PGconn *conn);\n--- 201,210 ----\n \n /* === in fe-misc.c === */\n \n! /*\n! * \"Get\" and \"Put\" routines return 0 if successful, EOF if not. Note that\n! * for Get, EOF merely means the buffer is exhausted, not that there is\n! * necessarily any error.\n */\n extern int\tpqGetc(char *result, PGconn *conn);\n extern int\tpqGets(char *s, int maxlen, PGconn *conn);\n***************\n\nThe only case within src/interfaces for which I am sufficiently annoyed\nto submit a reversing patch is this one:\n\n*** 1462,1476 ****\n \tif (strncmp(res->cmdStatus, \"INSERT \", 7) != 0)\n \t\treturn \"\";\n \n! \t/* The cmdStatus string looks like\n! \t * INSERT oid count\\0\n! \t * In order to be able to return an ordinary C string without\n! \t * damaging the result for PQcmdStatus or PQcmdTuples, we copy\n! \t * the oid part of the string to just after the null, so that\n! \t * cmdStatus looks like\n! \t * INSERT oid count\\0oid\\0\n! \t * ^ our return value points here\n! \t * Pretty klugy eh? This routine should've just returned an Oid value.\n \t */\n \n \tslen = strlen(res->cmdStatus);\n--- 1488,1500 ----\n \tif (strncmp(res->cmdStatus, \"INSERT \", 7) != 0)\n \t\treturn \"\";\n \n! \t/*\n! \t * The cmdStatus string looks like INSERT oid count\\0 In order to be\n! \t * able to return an ordinary C string without damaging the result for\n! \t * PQcmdStatus or PQcmdTuples, we copy the oid part of the string to\n! \t * just after the null, so that cmdStatus looks like INSERT oid\n! \t * count\\0oid\\0 ^ our return value points here Pretty klugy eh? This\n! \t * routine should've just returned an Oid value.\n \t */\n \n \tslen = strlen(res->cmdStatus);\n***************\n\nbut I hope this one drives home the point that automatic reflow of\nblock comments is a pretty stupid idea. I strongly recommend that\nthat \"feature\" be disabled forthwith. I'd further recommend that\nsomeone look through the full source tree to see if any other block\ncomments have been rendered equally illegible. I haven't got time\nto do it myself right now, however.\n\nPatch attached that corrects two minor errors introduced into\nlibpgtcl and libpq, and corrects the above loss of readability\nof one block comment.\n\n\t\t\tregards, tom lane\n\n*** src/interfaces/libpgtcl/pgtclCmds.c.orig\tThu Sep 3 01:08:28 1998\n--- src/interfaces/libpgtcl/pgtclCmds.c\tThu Sep 3 23:06:36 1998\n***************\n*** 616,623 ****\n \t\t\tfor (i = 1; i < PQnfields(result); i++)\n \t\t\t{\n \t\t\t\tsprintf(workspace, \"%s,%.200s%s\", field0, PQfname(result,i),\n! \t\t\t\t\tappendstr);\n! \t\t\t\tsprintf(workspace, \"%s,%.200s\", field0, PQfname(result,i));\n \t\t\t\tif (Tcl_SetVar2(interp, arrVar, workspace,\n \t\t\t\t\t\t\t\tPQgetvalue(result, tupno, i),\n \t\t\t\t\t\t\t\tTCL_LEAVE_ERR_MSG) == NULL)\n--- 616,622 ----\n \t\t\tfor (i = 1; i < PQnfields(result); i++)\n \t\t\t{\n \t\t\t\tsprintf(workspace, \"%s,%.200s%s\", field0, PQfname(result,i),\n! \t\t\t\t\t\tappendstr);\n \t\t\t\tif (Tcl_SetVar2(interp, arrVar, workspace,\n \t\t\t\t\t\t\t\tPQgetvalue(result, tupno, i),\n \t\t\t\t\t\t\t\tTCL_LEAVE_ERR_MSG) == NULL)\n*** src/interfaces/libpq/libpq-fe.h.orig\tWed Sep 2 22:10:51 1998\n--- src/interfaces/libpq/libpq-fe.h\tThu Sep 3 23:37:43 1998\n***************\n*** 182,188 ****\n \textern ConnStatusType PQstatus(PGconn *conn);\n \textern char *PQerrorMessage(PGconn *conn);\n \textern int\tPQsocket(PGconn *conn);\n- \textern int\tPQsocket(PGconn *conn);\n \textern int\tPQbackendPID(PGconn *conn);\n \n \t/* Enable/disable tracing */\n--- 182,187 ----\n*** src/interfaces/libpq/fe-exec.c.orig\tWed Sep 2 22:10:47 1998\n--- src/interfaces/libpq/fe-exec.c\tThu Sep 3 23:33:42 1998\n***************\n*** 1489,1500 ****\n \t\treturn \"\";\n \n \t/*\n! \t * The cmdStatus string looks like INSERT oid count\\0 In order to be\n! \t * able to return an ordinary C string without damaging the result for\n! \t * PQcmdStatus or PQcmdTuples, we copy the oid part of the string to\n! \t * just after the null, so that cmdStatus looks like INSERT oid\n! \t * count\\0oid\\0 ^ our return value points here Pretty klugy eh? This\n! \t * routine should've just returned an Oid value.\n \t */\n \n \tslen = strlen(res->cmdStatus);\n--- 1489,1503 ----\n \t\treturn \"\";\n \n \t/*\n! \t * The cmdStatus string looks like\n! \t * INSERT oid count\\0\n! \t * In order to be able to return an ordinary C string without\n! \t * damaging the result for PQcmdStatus or PQcmdTuples, we copy\n! \t * the oid part of the string to just after the null, so that\n! \t * cmdStatus looks like\n! \t * INSERT oid count\\0oid\\0\n! \t * ^ our return value points here\n! \t * Pretty klugy eh? This routine should've just returned an Oid value.\n \t */\n \n \tslen = strlen(res->cmdStatus);\n",
"msg_date": "Fri, 04 Sep 1998 00:22:16 -0400",
"msg_from": "Tom Lane <[email protected]>",
"msg_from_op": true,
"msg_subject": "Minor bugs and a formatting gripe"
},
{
"msg_contents": "> Bruce mentioned that he'd had some trouble applying my last set of\n> patches, because he'd already run his reformatting script against\n> the files involved. So, I took the trouble to grovel through a\n> \"diff --ignore-all-space\" comparison of tonight's cvs tree with what\n> I had last week. (I didn't have the energy to go through the *whole*\n> tree, but I did look through all of src/interfaces/.) It was a\n> worthwhile exercise because I found a couple of minor errors --- see\n> attached patch.\n> \n> I was mostly pretty happy with what the formatting script had done with\n> the code, especially in libpgtcl which had not been anywhere close to\n> matching the formatting conventions of the rest of pgsql. Nice job!\n> \n> BUT: I am not happy that the script chooses to reflow block comments.\n> Line breaks chosen on the basis of how much fits are not a readability\n> improvement over line breaks placed where a human author felt they made\n> sense. For example, is this really an improvement in readability?\n> (And if it's *not* a clear gain, why are we doing it?)\n\nGood point. The way to control this is to use:\n\n\t/*--------------\n\t * bla bla\n\t *--------------\n\t */\n\nThis will not be reformatted by the system. When I first ran pgindent,\nI checked all the diffs (whew), and found many box comments that had\nthat format that were not affected. Other comments got gobbled, and I\nbacked out the change and added ----- to the comments. If you see the\nindent manual page, you will see a mention of this.\n\n `Box' comments. Indent assumes that any comment with a dash or star imme-\n diately after the start of comment (that is, `/*-' or `/**') is a comment\n surrounded by a box of stars. Each line of such a comment is left un-\n changed, except that its indentation may be adjusted to account for the\n change in indentation of the first line of the comment.\n\nSo this is the way to preserve comment line numbering, and you will see\nthe main code does handle this properly, and that other code that does\nnot have the box gets reformatted as the code changes to look pretty.\n\nDo you still want me to turn it off?\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Fri, 4 Sep 1998 01:00:49 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Minor bugs and a formatting gripe"
},
{
"msg_contents": "> Bruce mentioned that he'd had some trouble applying my last set of\n> patches, because he'd already run his reformatting script against\n> the files involved. So, I took the trouble to grovel through a\n> \"diff --ignore-all-space\" comparison of tonight's cvs tree with what\n> I had last week. (I didn't have the energy to go through the *whole*\n> tree, but I did look through all of src/interfaces/.) It was a\n> worthwhile exercise because I found a couple of minor errors --- see\n> attached patch.\n> \n> I was mostly pretty happy with what the formatting script had done with\n> the code, especially in libpgtcl which had not been anywhere close to\n> matching the formatting conventions of the rest of pgsql. Nice job!\n> \n> BUT: I am not happy that the script chooses to reflow block comments.\n> Line breaks chosen on the basis of how much fits are not a readability\n> improvement over line breaks placed where a human author felt they made\n> sense. For example, is this really an improvement in readability?\n> (And if it's *not* a clear gain, why are we doing it?)\n\nThanks for checking on my patch job. Patches applied.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Fri, 4 Sep 1998 01:02:56 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Minor bugs and a formatting gripe"
},
{
"msg_contents": "Bruce Momjian <[email protected]> writes:\n>> BUT: I am not happy that the script chooses to reflow block comments.\n\n> `Box' comments. Indent assumes that any comment with a dash or\n> star imme- diately after the start of comment (that is, `/*-' or\n> `/**') is a comment surrounded by a box of stars. Each line of\n> such a comment is left un- changed, except that its indentation\n> may be adjusted to account for the change in indentation of the\n> first line of the comment.\n\n> Do you still want me to turn it off?\n\nAh. OK, learn something new every day ;-). Now that I know how to\ncontrol it, I can live with it.\n\nA suggestion: it'd be worth making an entry in FAQ_DEV that talks about\ncoding style conventions and points out that people should expect to\nhave their code reformatted by pgindent. As I don't have indent\ninstalled on my system, I have very little idea what to expect from it;\nI can't readily consult the man page.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Fri, 04 Sep 1998 10:53:20 -0400",
"msg_from": "Tom Lane <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] Minor bugs and a formatting gripe "
},
{
"msg_contents": "> Bruce Momjian <[email protected]> writes:\n> >> BUT: I am not happy that the script chooses to reflow block comments.\n> \n> > `Box' comments. Indent assumes that any comment with a dash or\n> > star imme- diately after the start of comment (that is, `/*-' or\n> > `/**') is a comment surrounded by a box of stars. Each line of\n> > such a comment is left un- changed, except that its indentation\n> > may be adjusted to account for the change in indentation of the\n> > first line of the comment.\n> \n> > Do you still want me to turn it off?\n> \n> Ah. OK, learn something new every day ;-). Now that I know how to\n> control it, I can live with it.\n> \n> A suggestion: it'd be worth making an entry in FAQ_DEV that talks about\n> coding style conventions and points out that people should expect to\n> have their code reformatted by pgindent. As I don't have indent\n> installed on my system, I have very little idea what to expect from it;\n> I can't readily consult the man page.\n\nOK, new pgindent entry is:\n\n pgindent is run on all source files just before each beta test period.\n It auto-formats all source files to make them consistent. Comment\n blocks that need specific line breaks should be formatted as block \n comments, where the comment starts as /*------. These comments will\n not be reformatted in any way.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Fri, 4 Sep 1998 11:53:07 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Minor bugs and a formatting gripe"
}
] |
[
{
"msg_contents": "hi, hackers!\ndo you plan some improvments on subqueries?\nUnfortunately, in v6.3.2 they often works very slowly, and thus\nare useful only on quite small tables :-(\n\nThanky you\nAleksey.\n\n",
"msg_date": "Fri, 4 Sep 1998 10:15:19 +0300 (IDT)",
"msg_from": "Aleksey Dashevsky <[email protected]>",
"msg_from_op": true,
"msg_subject": "Subqueries?"
},
{
"msg_contents": "Aleksey Dashevsky wrote:\n> \n> hi, hackers!\n> do you plan some improvments on subqueries?\n> Unfortunately, in v6.3.2 they often works very slowly, and thus\n> are useful only on quite small tables :-(\n\nNothing...\nIf you use IN then try to rewrite your queries with EXISTS\nif possible...\n\nVadim\n",
"msg_date": "Fri, 04 Sep 1998 15:55:34 +0800",
"msg_from": "Vadim Mikheev <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Subqueries?"
},
{
"msg_contents": "> hi, hackers!\n> do you plan some improvments on subqueries?\n> Unfortunately, in v6.3.2 they often works very slowly, and thus\n> are useful only on quite small tables :-(\n> \n\nThis is the first report of subquery slowness I have heard. We have\nfixed a problem where using an oid in the subquery caused a loop, but\nother than that, everything seems fine. How about sending us some\nqueries that are slow, and perhaps we can suggest something.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Fri, 4 Sep 1998 10:22:48 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Subqueries?"
}
] |
[
{
"msg_contents": "src/backend/libpq/pqcomm.c:\n\n> socket-flock.patch\n>\n> use advisory locks to check if the unix socket can be deleted.\n> A running postmaster keeps a lock on that file. A starting\n> postmaster exits if the file exists and is locked, otherwise\n> it deletes the sockets and proceeds.\n> This avoid the need to remove manually the file after a postmaster\n> or system crash.\n> I don't know if flock is available on any system. If not we could\n> define a HAVE_FLOCK set by configure.\n\nflock() is not standard call - imho, fcntl() should be used...\n\n---\n\nsrc/backend/port/snprintf.c:\n\nsnprintf.c:84: structure has no member named `_flags'\nsnprintf.c:84: `__SWR' undeclared (first use this function)\nsnprintf.c:84: (Each undeclared identifier is reported only once\nsnprintf.c:84: for each function it appears in.)\nsnprintf.c:84: `__SSTR' undeclared (first use this function)\nsnprintf.c:85: structure has no member named `_bf'\nsnprintf.c:85: structure has no member named `_p'\nsnprintf.c:86: structure has no member named `_bf'\nsnprintf.c:86: structure has no member named `_w'\nsnprintf.c:89: structure has no member named `_p'\n ^^^^^^^^^\nThis is about FILE structure...\nBSD code was used for snprintf.c, but \nFILE in BSD is not the same as in SunOS 5.5.1...\n\nVadim\n",
"msg_date": "Fri, 04 Sep 1998 15:45:37 +0800",
"msg_from": "Vadim Mikheev <[email protected]>",
"msg_from_op": true,
"msg_subject": "SPARC, SunOS 5.5.1, gcc 2.7.2.1 - can't compile..."
},
{
"msg_contents": "\n\nVadim Mikheev wrote:\n\n> src/backend/port/snprintf.c:\n>\n> snprintf.c:84: structure has no member named `_flags'\n> snprintf.c:84: `__SWR' undeclared (first use this function)\n> snprintf.c:84: (Each undeclared identifier is reported only once\n> snprintf.c:84: for each function it appears in.)\n> snprintf.c:84: `__SSTR' undeclared (first use this function)\n> snprintf.c:85: structure has no member named `_bf'\n> snprintf.c:85: structure has no member named `_p'\n> snprintf.c:86: structure has no member named `_bf'\n> snprintf.c:86: structure has no member named `_w'\n> snprintf.c:89: structure has no member named `_p'\n> ^^^^^^^^^\n> This is about FILE structure...\n> BSD code was used for snprintf.c, but\n> FILE in BSD is not the same as in SunOS 5.5.1...\n\nI have the same problem on my AIX box. , Linux includes snprint as in the\nstdio library.\n\nI would prefer to drop snprintf altogether, and replace it with sprintf and a\nsufficient buffer. The places where snprintf is used are logically bound to\nstring lengths less than 64 bytes. Otherwise, snprintf becomes another\nporting issue. I have no idea how to ( or wheather I can) implement this\nusing vprintf. The flags and data structures are very different.\n\n\n",
"msg_date": "Fri, 04 Sep 1998 09:30:02 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] SPARC, SunOS 5.5.1, gcc 2.7.2.1 - can't compile..."
},
{
"msg_contents": "> \n> \n> Vadim Mikheev wrote:\n> \n> > src/backend/port/snprintf.c:\n> >\n> > snprintf.c:84: structure has no member named `_flags'\n> > snprintf.c:84: `__SWR' undeclared (first use this function)\n> > snprintf.c:84: (Each undeclared identifier is reported only once\n> > snprintf.c:84: for each function it appears in.)\n> > snprintf.c:84: `__SSTR' undeclared (first use this function)\n> > snprintf.c:85: structure has no member named `_bf'\n> > snprintf.c:85: structure has no member named `_p'\n> > snprintf.c:86: structure has no member named `_bf'\n> > snprintf.c:86: structure has no member named `_w'\n> > snprintf.c:89: structure has no member named `_p'\n> > ^^^^^^^^^\n> > This is about FILE structure...\n> > BSD code was used for snprintf.c, but\n> > FILE in BSD is not the same as in SunOS 5.5.1...\n> \n> I have the same problem on my AIX box. , Linux includes snprint as in the\n> stdio library.\n> \n> I would prefer to drop snprintf altogether, and replace it with sprintf and a\n> sufficient buffer. The places where snprintf is used are logically bound to\n> string lengths less than 64 bytes. Otherwise, snprintf becomes another\n> porting issue. I have no idea how to ( or wheather I can) implement this\n> using vprintf. The flags and data structures are very different.\n\nAgreed.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Fri, 4 Sep 1998 10:29:54 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] SPARC, SunOS 5.5.1, gcc 2.7.2.1 - can't compile..."
},
{
"msg_contents": "On Fri, 4 Sep 1998, David Hartwig wrote:\n\n> Vadim Mikheev wrote:\n> \n> > src/backend/port/snprintf.c:\n> >\n> > snprintf.c:84: structure has no member named `_flags'\n> > snprintf.c:84: `__SWR' undeclared (first use this function)\n> > snprintf.c:84: (Each undeclared identifier is reported only once\n> > snprintf.c:84: for each function it appears in.)\n> > snprintf.c:84: `__SSTR' undeclared (first use this function)\n> > snprintf.c:85: structure has no member named `_bf'\n> > snprintf.c:85: structure has no member named `_p'\n> > snprintf.c:86: structure has no member named `_bf'\n> > snprintf.c:86: structure has no member named `_w'\n> > snprintf.c:89: structure has no member named `_p'\n> > ^^^^^^^^^\n> > This is about FILE structure...\n> > BSD code was used for snprintf.c, but\n> > FILE in BSD is not the same as in SunOS 5.5.1...\n> \n> I have the same problem on my AIX box. , Linux includes snprint as in the\n> stdio library.\n> \n> I would prefer to drop snprintf altogether, and replace it with\n> sprintf and a sufficient buffer. The places where snprintf is used\n> are logically bound to string lengths less than 64 bytes. \n\n\tsnprintf() has become very popular in dealing with buffer overrun\nsecurity holes, at least that's where I've seen it most. Solaris 2.6 does\nhave snprintf, whereas 2.5.1 doesn't...\n\n> Otherwise, snprintf becomes another porting issue. I have no idea how\n> to ( or wheather I can) implement this using vprintf. The flags and\n> data structures are very different.\n\n\tI'm grabbing a different snprintf()...just looked through\nsendmail's conf.c file, which has an snprintf() implementation in there\nthat looks more \"Generic\"...its not GPLd, so is safe to integrate...\n\n\tWatch the commit messages...\n\n\n",
"msg_date": "Fri, 4 Sep 1998 10:30:34 -0400 (EDT)",
"msg_from": "The Hermit Hacker <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] SPARC, SunOS 5.5.1, gcc 2.7.2.1 - can't compile..."
}
] |
[
{
"msg_contents": "Hi All,\n\nWell, maybe you'll like at least my reasons to ask this\nquestion in the subject field.\n\nI want to know:\n1. Whether PostgreSQL can stand the near real-time\ndemands of a financial trading environment?\n2. Whether there are any examples of this in actual usage?\n\nMy reasons are:\na. I have a serious financial trading project at hand,\nb. I am fed up with all the snobs at commercial\ndatabase distributors in Istanbul, who happens to know\nprecisely not a jack sh*t about development work.\n\nHopefully the answer is a yes. If so, would you please tell:\ni. Any examples in financial, or otherwise real-time apps?\nii. How can we put PostgreSQL under a stress test ourselves?\n\nSuch an app would clearly add to PostgreSQL's reputation,\nand we would be happy to contribute some of the proceeds\nto further development of PostgreSQL.\n\nThanks in advance, and no flames please.\n\n-- \nMetin Ozsavran, BScEE MBA\nTel: +90-216-361-9555\nFax: +90-216-416-5339\n",
"msg_date": "Fri, 04 Sep 1998 11:32:48 +0300",
"msg_from": "Metin Ozsavran <[email protected]>",
"msg_from_op": true,
"msg_subject": "Can PostgreSQL answer near-real-time demands?"
}
] |
[
{
"msg_contents": "\nJust added a more generic looking one from the sendmail\ndistribution...there will be errors with it, as I have yet to test it\nunder Solaris...\n\n\n\n",
"msg_date": "Fri, 4 Sep 1998 10:35:23 -0400 (EDT)",
"msg_from": "The Hermit Hacker <[email protected]>",
"msg_from_op": true,
"msg_subject": "snprintf()"
}
] |
[
{
"msg_contents": "> > The person who said they were going to work on the IP type has not\n> > responded to my requests for a status, and nothing has been added in\n> > that area in 6.4.\n> \n> That would be me. What I said was that it looked like the thing to do\n> was to pick the best ideas the three implementations available, and\n> that I, at least, would be doing that for my local needs. I still\n> plan to do that, but having recently become a father for the first\n> time, and having lots of projects going at work, I haven't found time\n> yet. Unless someone beats me to it, I will be doing this soon, and\n> probably within the next couple of weeks, but obviously not in time\n> for the 6.4 beta period. Besides, I have no idea how to integrate a\n> new type as a built-in type, so someone else would have to do that.\n> \n> -tih\n\nwell, this does not sound like progress. i am willing to dive into PG\nand learn how to integrate new types if noone else *who* *already* *knows*\nhow to do it is going to work on getting CIDR in before 6.4.\n",
"msg_date": "Fri, 04 Sep 1998 09:35:52 -0700",
"msg_from": "Paul A Vixie <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: hackers-digest V1 #954 "
},
{
"msg_contents": "On Fri, 4 Sep 1998, Paul A Vixie wrote:\n\n> > > The person who said they were going to work on the IP type has not\n> > > responded to my requests for a status, and nothing has been added in\n> > > that area in 6.4.\n> > \n> > That would be me. What I said was that it looked like the thing to do\n> > was to pick the best ideas the three implementations available, and\n> > that I, at least, would be doing that for my local needs. I still\n> > plan to do that, but having recently become a father for the first\n> > time, and having lots of projects going at work, I haven't found time\n> > yet. Unless someone beats me to it, I will be doing this soon, and\n> > probably within the next couple of weeks, but obviously not in time\n> > for the 6.4 beta period. Besides, I have no idea how to integrate a\n> > new type as a built-in type, so someone else would have to do that.\n> > \n> > -tih\n> \n> well, this does not sound like progress. i am willing to dive into PG\n> and learn how to integrate new types if noone else *who* *already* *knows*\n> how to do it is going to work on getting CIDR in before 6.4.\n\n\tI would like to see the cidr type for v6.4 myself...and believe\nBruce was willing to do the actual integration work, if we had the code\nfor it...how long would it take to have code ready to be integrated, that\nwould give us a base to build from?\n\n",
"msg_date": "Fri, 4 Sep 1998 13:12:36 -0400 (EDT)",
"msg_from": "The Hermit Hacker <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Re: hackers-digest V1 #954 "
},
{
"msg_contents": "> > well, this does not sound like progress. i am willing to dive into PG\n> > and learn how to integrate new types if noone else *who* *already* *knows*\n> > how to do it is going to work on getting CIDR in before 6.4.\n> \n> \tI would like to see the cidr type for v6.4 myself...and believe\n> Bruce was willing to do the actual integration work, if we had the code\n> for it...how long would it take to have code ready to be integrated, that\n> would give us a base to build from?\n\ni have already sent the code i'm using here. i can send it again. to whom?\n",
"msg_date": "Fri, 04 Sep 1998 10:58:01 -0700",
"msg_from": "Paul A Vixie <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] Re: hackers-digest V1 #954 "
},
{
"msg_contents": "Thus spake The Hermit Hacker\n> \tI would like to see the cidr type for v6.4 myself...and believe\n> Bruce was willing to do the actual integration work, if we had the code\n> for it...how long would it take to have code ready to be integrated, that\n> would give us a base to build from?\n\nThere was a lot of discussion about what types there should be and what\nfunctions should operate on them. Why not do the documentation first?\nOnce the documentation has been debugged, the code itself should be\nrelatively painless. We'll use the documentation as a spec.\n\n-- \nD'Arcy J.M. Cain <darcy@{druid|vex}.net> | Democracy is three wolves\nhttp://www.druid.net/darcy/ | and a sheep voting on\n+1 416 424 2871 (DoD#0082) (eNTP) | what's for dinner.\n",
"msg_date": "Fri, 4 Sep 1998 14:43:18 -0400 (EDT)",
"msg_from": "[email protected] (D'Arcy J.M. Cain)",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Re: hackers-digest V1 #954"
}
] |
[
{
"msg_contents": "\n>In your example:\n>\n> SELECT x.a, x.b, count(y.a) FROM t1 x, t2 y\n> WHERE x.a = y.a GROUP BY x.a, x.b;\n>\n>Are you suggesting that if there are rows in t1 that are not in t2, that the\n>count could/should be zero?\n\nNooooooo, the count can only be 0 if you do an outer join in this example, like:\nSELECT x.a, x.b, count(y.a) FROM t1 x, outer t2 y\n WHERE x.a = y.a GROUP BY x.a, x.b;\nOtherwise rows with count of zero are eliminated. This is correct behavior.\n\nAndreas\n\n",
"msg_date": "Fri, 4 Sep 1998 19:32:29 +0200",
"msg_from": "Andreas Zeugswetter <[email protected]>",
"msg_from_op": true,
"msg_subject": "AW: [HACKERS] Release 6.4"
}
] |
[
{
"msg_contents": "\nOpen portability issues:\n\n/usr/local should be searched for lib and include for all ports if present \n(currently not working, I have libreadline there)\n\nthe stream functions on AIX need a size_t for addrlen's in fe-connect.c and pqcomm.c.\n\nlock.c still has an incompatible TPRINTF(flags, args...) definition\n\nthe long long int printf format in int8.h is %lld on AIX\n\nAIX 4.2.1 and 4.3.1 need one other simpler Makefile, another template\nand must not include dynloader.c\n\n \nAndreas\n\nPS: all unsigned char problems are gone. \nkeep it cidr not inet !!\nand no, the heaptuple.c fix did not fix the pg_class index problem\nsorry i am off to weekend now\n\nbegin 600 aix_42\nM05)/4%0Z8W)S\"D-&3$%'4SHM<6-H87)S/7-I9VYE9\" M<6UA>&UE;3TX,3DR\nM(\"UQ:&%L=#UW(\"UQ<W)C;7-G(\"UQ8VAE8VL]9&EV>F5R;R M<6QO;F=L;VYG\nM\"E-(05)%1%],24(Z\"D%,3#H*4U)#2%])3D,Z\"E-20TA?3$E\".@I54T5?3$]#\nK04Q%.FYO\"D1,4U5&1DE8.BYS;PI91DQ!1U,Z+60*64%#0SH*0T,Z>&QC\"D]#\n`\nend\n\nbegin 600 Makefile.aix4\nM34M?3D]?3$]21$52/2!T<G5E\"@HE)\"A$3%-51D9)6\"DZ(\"4N;PH))\"A,1\"D@\nJ+4<@+6)E>'!A;&P@+6)N;V5N=')Y(\"UO(\"1 (\"0\\(\"0H3$1&3$%'4RD*\n`\nend\n\nbegin 600 .similar\nM86QP:&$M9&5C+6]S9CUA;'!H80IA;'!H82UU;FMN;W=N+6QI;G5X+6=N=3UL\nM:6YU>%]A;'!H80IH<'!A,2XQ+6AP+6AP=7@Q,\"XR,#UH<'5X7V-C\"FAP<&$Q\nM+C$M<W1R871U<RUS>7-V-#US=G(T\"FDS.#8M;F5X=\"UN97AT<W1E<#,];F5X\nM='-T97 *:3,X-BUP8RUB<V1I,BXP/6)S9&E?,BXP\"FDS.#8M<&,M8G-D:3(N\nM,3UB<V1I7S(N,0II,S@V+7!C+6)S9&DS+C ]8G-D:5\\S+C *:3,X-BUP8RUL\nM:6YU>\"UG;G4];&EN=7A?:3,X-@II,S@V+7!C+7-O;&%R:7,R+C8]<V]L87)I\nM<U]I,S@V7V=C8PII,S@V+7!C+7-U;F]S-3US;VQA<FES7VDS.#9?9V-C\"FDS\nM.#8M=6YK;F]W;BUF<F5E8G-D/69R965B<V0*:3,X-BUU;FMN;W=N+6YE=&)S\nM9#UN971B<V0*:30X-BUP8RUL:6YU>\"UG;G4];&EN=7A?:3,X-@II-3@V+7!C\nM+6QI;G5X+6=N=3UL:6YU>%]I,S@V\"FDU.#8M<&,M<V-O,RXR=CUS8V\\*:38X\nM-BUP8RUL:6YU>\"UG;G4];&EN=7A?:3,X-@IM:7!S+7-G:2UI<FEX/6ER:7@U\nM\"G!O=V5R<&,M:6)M+6%I>#,N,BXU/6%I>%\\S,C4*<&]W97)P8RUI8FTM86EX\nM-\"XQ+C0N,#UA:7A?-#$*<&]W97)P8RUI8FTM86EX-\"XQ+C4N,#UA:7A?-#$*\nM<&]W97)P8RUI8FTM86EX-\"XR+C$N,#UA:7A?-#(*<&]W97)P8RUI8FTM86EX\nM-\"XS+C$N,#UA:7A?-#(*<&]W97)P8RUU;FMN;W=N+6QI;G5X+6=N=3UL:6YU\nM>%]P<&,*<W!A<F,M<W5N+7-O;&%R:7,]<V]L87)I<U]S<&%R8U]G8V,*<W!A\nM<F,M<W5N+7-U;F]S-#US=6YO<S1?9V-C\"G-P87)C+7-U;BUS=6YO<S4]<V]L\nM87)I<U]S<&%R8U]G8V,*<W!A<F,M=6YK;F]W;BUL:6YU>\"UG;G4];&EN=7A?\n&<W!A<F,*\n`\nend\n\n",
"msg_date": "Fri, 4 Sep 1998 21:10:52 +0200",
"msg_from": "Andreas Zeugswetter <[email protected]>",
"msg_from_op": true,
"msg_subject": "Open portability issues"
},
{
"msg_contents": " Open portability issues:\n\n /usr/local should be searched for lib and include for all ports if present \n (currently not working, I have libreadline there)\n\nSee the INSTALL file for using configure.\n\n --with-includes=DIRS\n Include DIRS in list of directories searched\n for header files. (Typical use will need\n --with-includes=/usr/local/include)\n\n --with-libs=DIRS\n --with-libraries=DIRS\n Include DIRS in list of directories searched\n for archive libraries. (Typical use will need\n --with-libraries=/usr/local/lib)\n\nCheers,\nBrook\n",
"msg_date": "Fri, 4 Sep 1998 15:53:26 -0600 (MDT)",
"msg_from": "Brook Milligan <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Open portability issues"
},
{
"msg_contents": "> the long long int printf format in int8.h is %lld on AIX\n\nThis is on my list. %lld will work with gcc also, so since we don't have\nvery many reported successful ports for int8, we should just change it\nfor now.\n\n - Tom\n",
"msg_date": "Sat, 05 Sep 1998 01:00:00 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Open portability issues"
},
{
"msg_contents": "> \n> \n> Open portability issues:\n> \n> /usr/local should be searched for lib and include for all ports if present \n> (currently not working, I have libreadline there)\n> \n> the stream functions on AIX need a size_t for addrlen's in fe-connect.c and pqcomm.c.\n> \n> lock.c still has an incompatible TPRINTF(flags, args...) definition\n\nPlease apply this patch:\n\n*** src/backend/storage/lmgr/lock.c.orig\tWed Aug 26 09:00:55 1998\n--- src/backend/storage/lmgr/lock.c\tMon Sep 7 14:44:53 1998\n*************** static int WaitOnLock(LOCKMETHOD lockmet\n*** 136,153 ****\n \t\t xidentP->holders[5], \\\n \t\t xidentP->nHolding)\n \n- #define LOCK_TPRINTF(lock, args...) \\\n- if (((LOCKDEBUG(LOCK_LOCKMETHOD(*(lock))) >= 1) \\\n- \t && (lock->tag.relId >= lockDebugOidMin)) \\\n- \t || (lock->tag.relId == lockDebugRelation)) \\\n- \t TPRINTF(TRACE_ALL, args)\n- \n #else\t/* !LOCK_MGR_DEBUG */\n #define LOCK_PRINT(where,lock,type)\n #define LOCK_PRINT_AUX(where,lock,type)\n #define XID_PRINT(where,xidentP)\n #define XID_PRINT_AUX(where,xidentP)\n- #define LOCK_TPRINTF(lock, args...)\n #endif\t/* !LOCK_MGR_DEBUG */\n \n static char *lock_types[] = {\n--- 136,146 ----\n*************** LockRelease(LOCKMETHOD lockmethod, LOCKT\n*** 1200,1206 ****\n \t}\n \telse\n \t{\n! \t\tLOCK_TPRINTF(lock, \"LockRelease: no wakeup needed\");\n \t}\n \n \tSpinRelease(masterLock);\n--- 1193,1202 ----\n \t}\n \telse\n \t{\n! \t\tif (((LOCKDEBUG(LOCK_LOCKMETHOD(*(lock))) >= 1) \\\n! \t\t\t && (lock->tag.relId >= lockDebugOidMin)) \\\n! \t\t\t|| (lock->tag.relId == lockDebugRelation))\n! \t\t\tTPRINTF(TRACE_ALL, \"LockRelease: no wakeup needed\");\n \t}\n \n \tSpinRelease(masterLock);\n\n\n-- \nMassimo Dal Zotto\n\n+----------------------------------------------------------------------+\n| Massimo Dal Zotto email: [email protected] |\n| Via Marconi, 141 phone: ++39-461-534251 |\n| 38057 Pergine Valsugana (TN) www: http://www.cs.unitn.it/~dz/ |\n| Italy pgp: finger [email protected] |\n+----------------------------------------------------------------------+\n",
"msg_date": "Mon, 7 Sep 1998 21:15:27 +0200 (MET DST)",
"msg_from": "Massimo Dal Zotto <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Open portability issues"
},
{
"msg_contents": "Patch applied.\n\n\n[Charset iso-8859-1 unsupported, filtering to ASCII...]\n> > \n> > \n> > Open portability issues:\n> > \n> > /usr/local should be searched for lib and include for all ports if present \n> > (currently not working, I have libreadline there)\n> > \n> > the stream functions on AIX need a size_t for addrlen's in fe-connect.c and pqcomm.c.\n> > \n> > lock.c still has an incompatible TPRINTF(flags, args...) definition\n> \n> Please apply this patch:\n> \n> *** src/backend/storage/lmgr/lock.c.orig\tWed Aug 26 09:00:55 1998\n> --- src/backend/storage/lmgr/lock.c\tMon Sep 7 14:44:53 1998\n> *************** static int WaitOnLock(LOCKMETHOD lockmet\n> *** 136,153 ****\n> \t\t xidentP->holders[5], \\\n> \t\t xidentP->nHolding)\n> \n> - #define LOCK_TPRINTF(lock, args...) \\\n> - if (((LOCKDEBUG(LOCK_LOCKMETHOD(*(lock))) >= 1) \\\n> - \t && (lock->tag.relId >= lockDebugOidMin)) \\\n> - \t || (lock->tag.relId == lockDebugRelation)) \\\n> - \t TPRINTF(TRACE_ALL, args)\n> - \n> #else\t/* !LOCK_MGR_DEBUG */\n> #define LOCK_PRINT(where,lock,type)\n> #define LOCK_PRINT_AUX(where,lock,type)\n> #define XID_PRINT(where,xidentP)\n> #define XID_PRINT_AUX(where,xidentP)\n> - #define LOCK_TPRINTF(lock, args...)\n> #endif\t/* !LOCK_MGR_DEBUG */\n> \n> static char *lock_types[] = {\n> --- 136,146 ----\n> *************** LockRelease(LOCKMETHOD lockmethod, LOCKT\n> *** 1200,1206 ****\n> \t}\n> \telse\n> \t{\n> ! \t\tLOCK_TPRINTF(lock, \"LockRelease: no wakeup needed\");\n> \t}\n> \n> \tSpinRelease(masterLock);\n> --- 1193,1202 ----\n> \t}\n> \telse\n> \t{\n> ! \t\tif (((LOCKDEBUG(LOCK_LOCKMETHOD(*(lock))) >= 1) \\\n> ! \t\t\t && (lock->tag.relId >= lockDebugOidMin)) \\\n> ! \t\t\t|| (lock->tag.relId == lockDebugRelation))\n> ! \t\t\tTPRINTF(TRACE_ALL, \"LockRelease: no wakeup needed\");\n> \t}\n> \n> \tSpinRelease(masterLock);\n> \n> \n> -- \n> Massimo Dal Zotto\n> \n> +----------------------------------------------------------------------+\n> | Massimo Dal Zotto email: [email protected] |\n> | Via Marconi, 141 phone: ++39-461-534251 |\n> | 38057 Pergine Valsugana (TN) www: http://www.cs.unitn.it/~dz/ |\n> | Italy pgp: finger [email protected] |\n> +----------------------------------------------------------------------+\n> \n> \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Wed, 9 Sep 1998 14:32:19 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Open portability issues"
},
{
"msg_contents": "> \n> Open portability issues:\n> \n> /usr/local should be searched for lib and include for all ports if present \n> (currently not working, I have libreadline there)\n\nI actually us a flag to configure:\n\n --with-includes=\"/u/readline\" \\\n --with-libraries=\"/u/readline /usr/contrib/lib\"\n\nShould we be poking around in /usr/local by default? Comments?\n\n> \n> the stream functions on AIX need a size_t for addrlen's in fe-connect.c and pqcomm.c.\n\nThis has come up before. AIX wants size_t for certain structures like\ngetsockname(). I believe the third parameter on AIX is size_t, while it\nused to be int on my machine, but is not socklen_t. Is this correct? \nThe 'int' code works fine for me, but I can see why AIX is having a\nproblem, and perhaps it is time for configure to check on the various\ntypes.\n\n\tgetsockname(int s, struct sockaddr *name, socklen_t *namelen);\n\nCan you confirm this?\n\n> \n> lock.c still has an incompatible TPRINTF(flags, args...) definition\n\nMassimo has fixed this.\n\n> \n> the long long int printf format in int8.h is %lld on AIX\n> \n> AIX 4.2.1 and 4.3.1 need one other simpler Makefile, another template\n> and must not include dynloader.c\n\nDone. Files added.\n\n\n> \n> PS: all unsigned char problems are gone. \n> keep it cidr not inet !!\n> and no, the heaptuple.c fix did not fix the pg_class index problem\n> sorry i am off to weekend now\n> \n> begin 600 aix_42\n> M05)/4%0Z8W)S\"D-&3$%'4SHM<6-H87)S/7-I9VYE9\" M<6UA>&UE;3TX,3DR\n> M(\"UQ:&%L=#UW(\"UQ<W)C;7-G(\"UQ8VAE8VL]9&EV>F5R;R M<6QO;F=L;VYG\n> M\"E-(05)%1%],24(Z\"D%,3#H*4U)#2%])3D,Z\"E-20TA?3$E\".@I54T5?3$]#\n> K04Q%.FYO\"D1,4U5&1DE8.BYS;PI91DQ!1U,Z+60*64%#0SH*0T,Z>&QC\"D]#\n> `\n> end\n> \n> begin 600 Makefile.aix4\n> M34M?3D]?3$]21$52/2!T<G5E\"@HE)\"A$3%-51D9)6\"DZ(\"4N;PH))\"A,1\"D@\n> J+4<@+6)E>'!A;&P@+6)N;V5N=')Y(\"UO(\"1 (\"0\\(\"0H3$1&3$%'4RD*\n> `\n> end\n> \n> begin 600 .similar\n> M86QP:&$M9&5C+6]S9CUA;'!H80IA;'!H82UU;FMN;W=N+6QI;G5X+6=N=3UL\n> M:6YU>%]A;'!H80IH<'!A,2XQ+6AP+6AP=7@Q,\"XR,#UH<'5X7V-C\"FAP<&$Q\n> M+C$M<W1R871U<RUS>7-V-#US=G(T\"FDS.#8M;F5X=\"UN97AT<W1E<#,];F5X\n> M='-T97 *:3,X-BUP8RUB<V1I,BXP/6)S9&E?,BXP\"FDS.#8M<&,M8G-D:3(N\n> M,3UB<V1I7S(N,0II,S@V+7!C+6)S9&DS+C ]8G-D:5\\S+C *:3,X-BUP8RUL\n> M:6YU>\"UG;G4];&EN=7A?:3,X-@II,S@V+7!C+7-O;&%R:7,R+C8]<V]L87)I\n> M<U]I,S@V7V=C8PII,S@V+7!C+7-U;F]S-3US;VQA<FES7VDS.#9?9V-C\"FDS\n> M.#8M=6YK;F]W;BUF<F5E8G-D/69R965B<V0*:3,X-BUU;FMN;W=N+6YE=&)S\n> M9#UN971B<V0*:30X-BUP8RUL:6YU>\"UG;G4];&EN=7A?:3,X-@II-3@V+7!C\n> M+6QI;G5X+6=N=3UL:6YU>%]I,S@V\"FDU.#8M<&,M<V-O,RXR=CUS8V\\*:38X\n> M-BUP8RUL:6YU>\"UG;G4];&EN=7A?:3,X-@IM:7!S+7-G:2UI<FEX/6ER:7@U\n> M\"G!O=V5R<&,M:6)M+6%I>#,N,BXU/6%I>%\\S,C4*<&]W97)P8RUI8FTM86EX\n> M-\"XQ+C0N,#UA:7A?-#$*<&]W97)P8RUI8FTM86EX-\"XQ+C4N,#UA:7A?-#$*\n> M<&]W97)P8RUI8FTM86EX-\"XR+C$N,#UA:7A?-#(*<&]W97)P8RUI8FTM86EX\n> M-\"XS+C$N,#UA:7A?-#(*<&]W97)P8RUU;FMN;W=N+6QI;G5X+6=N=3UL:6YU\n> M>%]P<&,*<W!A<F,M<W5N+7-O;&%R:7,]<V]L87)I<U]S<&%R8U]G8V,*<W!A\n> M<F,M<W5N+7-U;F]S-#US=6YO<S1?9V-C\"G-P87)C+7-U;BUS=6YO<S4]<V]L\n> M87)I<U]S<&%R8U]G8V,*<W!A<F,M=6YK;F]W;BUL:6YU>\"UG;G4];&EN=7A?\n> &<W!A<F,*\n> `\n> end\n> \n> \n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Wed, 9 Sep 1998 14:47:41 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: Open portability issues"
},
{
"msg_contents": " > Open portability issues:\n > \n > /usr/local should be searched for lib and include for all ports if present \n > (currently not working, I have libreadline there)\n\n I actually us a flag to configure:\n\n\t --with-includes=\"/u/readline\" \\\n\t --with-libraries=\"/u/readline /usr/contrib/lib\"\n\n Should we be poking around in /usr/local by default? Comments?\n\nNo! The configure options (including the /usr/local typical usage)\nare clearly outlined in INSTALL and easy to use. In fact, arbitrary\nseries of space-separated directories can be given as you illustrate.\n\nThe configuration stuff works fine now. Why mung it up again? If we\nmake searching /usr/local a default, we need a way to prevent that if\nthe wrong stuff is in /usr/local. It makes sense to simply specify\nwhere to look, document what to do, and be done.\n\nCheers,\nBrook\n",
"msg_date": "Wed, 9 Sep 1998 14:09:56 -0600 (MDT)",
"msg_from": "Brook Milligan <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Re: Open portability issues"
},
{
"msg_contents": "On Wed, 9 Sep 1998, Bruce Momjian wrote:\n\n> > \n> > Open portability issues:\n> > \n> > /usr/local should be searched for lib and include for all ports if present \n> > (currently not working, I have libreadline there)\n> \n> I actually us a flag to configure:\n> \n> --with-includes=\"/u/readline\" \\\n> --with-libraries=\"/u/readline /usr/contrib/lib\"\n> \n> Should we be poking around in /usr/local by default? Comments?\n\n\tNo...unless someone can point me at a package that explicitly goes\nout and looking /usr/local. I've yet to have a problem with any package\nI've installed not being able to find libraries and include files that are\ninstalled in /usr/local ... if someone is having a problem, they should be\ndirected to look at *fixing* their system in the first place, as they are\ndefinitely going to have more problems then just with PostgreSQL...\n\n\nMarc G. Fournier \nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n",
"msg_date": "Thu, 10 Sep 1998 00:32:14 -0300 (ADT)",
"msg_from": "The Hermit Hacker <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Re: Open portability issues"
}
] |
[
{
"msg_contents": "Hello:\nI am getting the following errors. I am using 6.3.2 on linux Redhat 5.1\n\ncreate table person (person_id int not null,\nmarital_status char(1),\nunique(person_id));\nNOTICE: CREATE TABLE/UNIQUE will create implicit index\nperson_person_id_key for table person\nCREATE\nMy comments: This notice looks ok.\n\ncreate table longtablename (DATE_TIME_STAMP datetime not null,\nUNIQUE (DATE_TIME_STAMP));\nERROR: parser: unable to construct implicit index for table\nlongtablename; name too long\nMy comments: Here if the table name is long and the column name is long\nPostgres has trouble with\nthe index name being too long.\n\nALTER TABLE longtablename ADD FOREIGN KEY (person_ID) REFERENCES\nperson(person_id);\nNOTICE: CREATE TABLE/FOREIGN KEY clause ignored; not yet implemented\nERROR: ALTER TABLE/ADD CONSTRAINT not yet implemented\nMy comments: Here, since the table is empty, should this not be easy for\nthe postgres to alter the table??\n\nALTER TABLE person ADD\ncheck (marital_status in (\"T\",\"F\"))\n;\nERROR: parser: parse error at or near \"in\"\nEOF\nMy comments: Here, since the table is empty, should this not be easy for\nthe postgres to alter the table??\n\n\n",
"msg_date": "Fri, 04 Sep 1998 17:33:43 -0500",
"msg_from": "Dev_Al <Dev_Al/[email protected]>",
"msg_from_op": true,
"msg_subject": "Problems in create table ?? 6.3.2"
}
] |
[
{
"msg_contents": "-----BEGIN PGP SIGNED MESSAGE-----\n\n\n select min(oid) from pg_class;\n ERROR: function min(oid) does not exist\n\nI got this surprise while trying to optimize a hack for the PostgreSQL\nfunctions in Keystone (http://www.stonekeep.com/keystone).\n\nroland\n\n-----BEGIN PGP SIGNATURE-----\nVersion: 2.6.2\nComment: Processed by Mailcrypt 3.4, an Emacs/PGP interface\n\niQCVAwUBNfCGxuoW38lmvDvNAQGA5AP9FkTlbxQlr1jWUASnLPIG7A2/mk0U3eRa\n9mSGts7EorIfqK3swSiU8DoTQ4TkfA7JKqe6SCG0MbLpkD9a8ZhsSO50LzbJuBdb\ngURS3VFUH8ETuB1aKj67TgngNkO9gJkNOpv3HwD1BgdMBj2sb5aCMHsI5wkjKEC2\nGIiOlcvk0Go=\n=Et3z\n-----END PGP SIGNATURE-----\n-- \nRoland B. Roberts, PhD Custom Software Solutions\[email protected] 101 West 15th St #4NN\n New York, NY 10011\n\n",
"msg_date": "04 Sep 1998 20:33:12 -0400",
"msg_from": "Roland Roberts <[email protected]>",
"msg_from_op": true,
"msg_subject": "MIN not defined for OID types"
},
{
"msg_contents": "-- Start of PGP signed section.\n> \n> select min(oid) from pg_class;\n> ERROR: function min(oid) does not exist\n> \n> I got this surprise while trying to optimize a hack for the PostgreSQL\n> functions in Keystone (http://www.stonekeep.com/keystone).\n> \n\nIs this in 6.4 or 6.3.2? I think 6.4 may be able to do this, and if\nnot, perhaps Thomas can add it. Sounds like a good use for\nbinary-compatable operators.\n\nThomas, can we delete the old operators now that the binary compatable\nstuff works? Just an idea, not sure if it is do-able.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sat, 5 Sep 1998 00:37:23 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] MIN not defined for OID types"
},
{
"msg_contents": "> > select min(oid) from pg_class;\n> > ERROR: function min(oid) does not exist\n> > I got this surprise while trying to optimize a hack for the \n> > PostgreSQL functions in Keystone \n> > (http://www.stonekeep.com/keystone).\n> Is this in 6.4 or 6.3.2? I think 6.4 may be able to do this, and if\n> not, perhaps Thomas can add it. Sounds like a good use for\n> binary-compatable operators.\n> Thomas, can we delete the old operators now that the binary compatable\n> stuff works? Just an idea, not sure if it is do-able.\n\nIt is do-able, but I'm not sure it is desirable. If there is an exact\nfunction or operator match, then that would be preferred, right? The\n\"binary-compatible\" is a cheat to help performance and to allow us to\nnot have to define _every_ possible combination of functions and\noperators. So it's helped on some things, but probably shouldn't become\nthe only mechanism. For one thing, if you change the underlying\nimplementation of a type, then it would not longer be binary compatible\nwith a second one, and you would need the explicit functions and\noperators anyway.\n\nI didn't change any of the type matching behavior of the aggregate\nfunctions that I can recall. Maybe I should have; if I have time I'll\nlook at it. That would probably be better than bothering to implement\nsomething explicitly for oids:\n\n postgres=> select min(oid) from foo;\n ERROR: No such function 'min' with the specified attributes\n\nAlso, it's a bit hard to get too excited about a missing feature to\nallow someone to \"optimize a hack\" Isn't that like \"patching a patch\" or\n\"fixing a repair\"? :)\n\n - Tom\n",
"msg_date": "Sat, 05 Sep 1998 05:19:03 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] MIN not defined for OID types"
},
{
"msg_contents": "> It is do-able, but I'm not sure it is desirable. If there is an exact\n> function or operator match, then that would be preferred, right? The\n> \"binary-compatible\" is a cheat to help performance and to allow us to\n> not have to define _every_ possible combination of functions and\n> operators. So it's helped on some things, but probably shouldn't become\n> the only mechanism. For one thing, if you change the underlying\n> implementation of a type, then it would not longer be binary compatible\n> with a second one, and you would need the explicit functions and\n> operators anyway.\n> \n> I didn't change any of the type matching behavior of the aggregate\n> functions that I can recall. Maybe I should have; if I have time I'll\n> look at it. That would probably be better than bothering to implement\n> something explicitly for oids:\n> \n> postgres=> select min(oid) from foo;\n> ERROR: No such function 'min' with the specified attributes\n\nOK. A question. Aren't oid's unsigned int, while int4 is signed. How\ndoes binary compatable indexes handle this. Do oid's grater than 2gig\nwork with the int4 indexes? Do negative integers work with oid indexes?\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sat, 5 Sep 1998 10:20:39 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] MIN not defined for OID types"
},
{
"msg_contents": "> Aren't oid's unsigned int, while int4 is signed. How\n> does binary compatable indexes handle this. Do oid's grater than 2gig\n> work with the int4 indexes? Do negative integers work with oid indexes?\n\nGood point. I have specified that OIDs are binary compatible with ints,\nand in cases where the types mix and there are not explicit\noperators/functions then the OIDs and ints are evaluated as signed\nquantities.\n\nAt the moment, I don't see this as a _big_ problem, in that formerly the\n_only_ way of specifying OIDs above 2^^31 in size was to use the\n\"stringified\" syntax of\n OID '4000000000'\nor\n '4000000000'::OID\nand if one does that now one gets the right thing. All the platforms we\nrun on use twos-complement integers, so signed and unsigned quantities\nbelow 2^^32-1 are binary equivalent.\n\nBut at the least it is sloppy. So perhaps in the future we should have\nmore explicit functions and operators on OIDs to avoid having to choose\nbetween signed and unsigned evaluation. At that point, we should\nprobably no longer consider it equivalent to an integer, but rather have\nexplicit conversion.\n\nWhen we have indices available for constant functions then the automatic\nconversion will work better; I'd made OIDs and int4s equivalent to solve\nthe problem that\n SELECT * FROM foo WHERE oid = 100;\ndid not use an index on oid even if it were available, but that\n SELECT * FROM foo WHERE oid = '100'::oid\ndid.\n\n - Tom\n",
"msg_date": "Sat, 05 Sep 1998 14:49:33 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] MIN not defined for OID types"
},
{
"msg_contents": "-----BEGIN PGP SIGNED MESSAGE-----\n\n>>>>> \"Bruce\" == Bruce Momjian <[email protected]> writes:\n\n >> select min(oid) from pg_class;\n >> ERROR: function min(oid) does not exist\n\n Bruce> Is this in 6.4 or 6.3.2? I think 6.4 may be able to do\n Bruce> this, and if not, perhaps Thomas can add it. Sounds like a\n Bruce> good use for binary-compatable operators.\n\nThis is in 6.3.2 (or rather, min(oid) is not in 6.3.2 :-)\n\nroland\n-----BEGIN PGP SIGNATURE-----\nVersion: 2.6.2\nComment: Processed by Mailcrypt 3.4, an Emacs/PGP interface\n\niQCVAwUBNfFaO+oW38lmvDvNAQEj0QP/XO4fM0ph1xJ8bMLOS5OpbqQ+CM1g8aua\nSd6QRjRNH2nPQ0lC3EQ+mFK9NoCa/+cA61ZACnhacPCMIwhHM22rxjb91bZstOZC\nfhqh0eTrcZ+xcwVL73k7070gOBNQ3CTZHu0Pf74P+sFW3HMMPhUpCAPJrt7WZUbP\nxAib5eRh94U=\n=aOoU\n-----END PGP SIGNATURE-----\n-- \nRoland B. Roberts, PhD Custom Software Solutions\[email protected] 101 West 15th St #4NN\n New York, NY 10011\n\n",
"msg_date": "05 Sep 1998 11:35:31 -0400",
"msg_from": "Roland Roberts <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] MIN not defined for OID types"
},
{
"msg_contents": "-----BEGIN PGP SIGNED MESSAGE-----\n\n>>>>> \"Thomas\" == Thomas G Lockhart <[email protected]> writes:\n\n Thomas> Also, it's a bit hard to get too excited about a missing\n Thomas> feature to allow someone to \"optimize a hack\" Isn't that\n Thomas> like \"patching a patch\" or \"fixing a repair\"? :)\n\nYes, well, in this case, it comes about as a result of trying to make\nsomething database independent. Keystone has functions for both\nPostgreSQL and MySQL, and the MySQL way of doing things seems to be\nlimitation. As a result, the DB-independent code does a \"select *\nfrom <table>\" then queries to find what the column names are.\nObviously, we don't need to do it that way with PostgreSQL. My \"hack\"\nwas to change the query so it wouldn't pull back the whole table just\nto find the column names, so I did a \"select * from <table> where\noid=min(oid)\".\n\nI have no idea how useful the function is in general, but it still\nseems like an obvious hole to not be able to ask what the min of a\nnumeric column is. I can ask what the min(rowid) is in Oracle (but\ndon't get me started on Oracle's abysmal \"support\"...ack!).\n\nroland\n-----BEGIN PGP SIGNATURE-----\nVersion: 2.6.2\nComment: Processed by Mailcrypt 3.4, an Emacs/PGP interface\n\niQCVAwUBNfFfI+oW38lmvDvNAQFI4gP/cCV6JCVmyBiQQqB4GI4lRAMCdbfTI7Wi\n4gtMrHqvy9ct6S2UKbXZFREfVduRzfM9kwxaEw6W5BbcXdaSKQCgoAQrhohMLRtq\nIhcTT0CAqbYuF8oy0cxeHq7EI/nJumXhbxk11ZHFYwsxBFKoxjKqGuzP9GExiAQ5\nP5y78KFJhzQ=\n=NB6u\n-----END PGP SIGNATURE-----\n-- \nRoland B. Roberts, PhD Custom Software Solutions\[email protected] 101 West 15th St #4NN\n New York, NY 10011\n\n",
"msg_date": "05 Sep 1998 11:56:21 -0400",
"msg_from": "Roland Roberts <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] MIN not defined for OID types"
},
{
"msg_contents": "> Yes, well, in this case, it comes about as a result of trying to make\n> something database independent. Keystone has functions for both\n> PostgreSQL and MySQL, and the MySQL way of doing things seems to be\n> limitation. As a result, the DB-independent code does a \"select *\n> from <table>\" then queries to find what the column names are.\n> Obviously, we don't need to do it that way with PostgreSQL. My \"hack\"\n> was to change the query so it wouldn't pull back the whole table just\n> to find the column names, so I did a \"select * from <table> where\n> oid=min(oid)\".\n\nAh. Try another hack:\n\n SELECT * from <table> WHERE FALSE;\n\nThat will return zero rows but tell you about the columns. Even better,\nit won't traverse the table or an index as a min() operation would since\nthe optimizer can tell apriori that there will be no matching rows.\n\nI haven't done it myself, but psql seems to get the information it needs\nabout the columns with a query as above. And if that doesn't work then\nthere will be another trick which does work for you; someone on the list\nwill tell us :)\n\n - Tom\n",
"msg_date": "Sat, 05 Sep 1998 18:50:00 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] MIN not defined for OID types"
},
{
"msg_contents": "-----BEGIN PGP SIGNED MESSAGE-----\n\n>>>>> \"Thomas\" == Thomas G Lockhart <[email protected]> writes:\n\n Thomas> Ah. Try another hack:\n\n Thomas> SELECT * from <table> WHERE FALSE;\n\nCool, it works interactively, now to stuff in into keystone....\n\nThanks,\n\nroland\n\n-----BEGIN PGP SIGNATURE-----\nVersion: 2.6.2\nComment: Processed by Mailcrypt 3.4, an Emacs/PGP interface\n\niQCVAwUBNfGujuoW38lmvDvNAQHpuwQAuQeB4ixP+UNxSHfF6wlpPi07a3kU6CRR\nL/G2gF3ic9ByGWdfYnfJeCg8+IFrz6jswdLmiFuvjJArE96N+WPdvHeaIF81elaL\nuBuT5mcIAvGwqp29YuzvNqRyweDI7JDKLUujpFfTgD0LKvNks8VjtE6Ep1WvuD5s\nluoNuuz3h7E=\n=eK2y\n-----END PGP SIGNATURE-----\n--\nRoland B. Roberts, PhD Custom Software Solutions\[email protected] 101 West 15th St #4NN\n New York, NY 10011\n\n",
"msg_date": "05 Sep 1998 17:35:12 -0400",
"msg_from": "Roland Roberts <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] MIN not defined for OID types"
}
] |
[
{
"msg_contents": "D'Arcy J.M. Cain wrote:\n> \n> >\n> > pg_index is good place for all _3_ key types because of:\n> >\n> > 1. index should be created for each foreign key -\n> > just for performance.\n> > 2. pg_index already has int28 field for key attributes.\n> > 3. pg_index already has indisunique (note that foreign keys\n> > may reference unique keys, not just primary ones).\n> >\n> > - so we have just add two fields to pg_index:\n> >\n> > bool indisprimary;\n> > oid indreferenced;\n> > ^^^^^^^^^^^^^^^^^^\n> > this is for foreign keys: oid of referenced relation'\n> > primary/unique key index.\n> \n> Sounds fine to me. Any chance of seeing this in 6.4?\n\nI could add this (and FOREIGN key implementation) before\n11-13 Sep... But not the ALTER TABLE ADD/DROP CONSTRAINT\nstuff (ok for Entry SQL).\nBut we are in beta...\n\nComments?\n\n> Nope, pg_index is fine by me. Now, once we have this, how do we find\n> the index for a particular attribute? I can't seem to figure out the\n> relationship between pg_attribute and pg_index. The chart in the docs\n> suggests that indkey is the relation but I can't see any useful info\n> there for joining the tables.\n\npg_index:\n\tindrelid - oid of indexed relation\n\tindkey - up to the 8 attnums\n\npg_attribute:\n\tattrelid - oid of relation\n\tattnum - ...\n\nWithout outer join you have to query pg_attribute for each\nvalid attnum from pg_index->indkey -:(\n\nVadim\n",
"msg_date": "Sat, 05 Sep 1998 13:40:43 +0800",
"msg_from": "Vadim Mikheev <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] Adding PRIMARY KEY info"
},
{
"msg_contents": "Thus spake Vadim Mikheev\n> D'Arcy J.M. Cain wrote:\n> > Nope, pg_index is fine by me. Now, once we have this, how do we find\n> > the index for a particular attribute? I can't seem to figure out the\n> > relationship between pg_attribute and pg_index. The chart in the docs\n> > suggests that indkey is the relation but I can't see any useful info\n> > there for joining the tables.\n> \n> pg_index:\n> \tindrelid - oid of indexed relation\n> \tindkey - up to the 8 attnums\n> \n> pg_attribute:\n> \tattrelid - oid of relation\n> \tattnum - ...\n> \n> Without outer join you have to query pg_attribute for each\n> valid attnum from pg_index->indkey -:(\n\nHmmm. Well, to start with, perhaps I can specify that the functions\nonly work with simple keys. Do we even support complex primary keys?\nAnyway, if I do that then the following should work with indisunique\nreplaced by indisprimary.\n\nSELECT pg_class.relname, pg_attribute.attname\n FROM pg_class, pg_attribute, pg_index\n WHERE pg_class.oid = pg_attribute.attrelid AND\n pg_class.oid = pg_index.indrelid AND\n pg_index.indkey[0] = pg_attribute.attnum AND\n pg_index.indisunique = 't';\n\nIn fact, the above would work if I could assume that each table had only\none unique index but I think that that's too much of a restriction. I\nhope you can add that flag for this release.\n\n-- \nD'Arcy J.M. Cain <darcy@{druid|vex}.net> | Democracy is three wolves\nhttp://www.druid.net/darcy/ | and a sheep voting on\n+1 416 424 2871 (DoD#0082) (eNTP) | what's for dinner.\n",
"msg_date": "Sat, 5 Sep 1998 06:32:04 -0400 (EDT)",
"msg_from": "[email protected] (D'Arcy J.M. Cain)",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Adding PRIMARY KEY info"
},
{
"msg_contents": "> D'Arcy J.M. Cain wrote:\n> > \n> > >\n> > > pg_index is good place for all _3_ key types because of:\n> > >\n> > > 1. index should be created for each foreign key -\n> > > just for performance.\n> > > 2. pg_index already has int28 field for key attributes.\n> > > 3. pg_index already has indisunique (note that foreign keys\n> > > may reference unique keys, not just primary ones).\n> > >\n> > > - so we have just add two fields to pg_index:\n> > >\n> > > bool indisprimary;\n> > > oid indreferenced;\n> > > ^^^^^^^^^^^^^^^^^^\n> > > this is for foreign keys: oid of referenced relation'\n> > > primary/unique key index.\n> > \n> > Sounds fine to me. Any chance of seeing this in 6.4?\n> \n> I could add this (and FOREIGN key implementation) before\n> 11-13 Sep... But not the ALTER TABLE ADD/DROP CONSTRAINT\n> stuff (ok for Entry SQL).\n> But we are in beta...\n> \n> Comments?\n\nNow that you have fixed the index problem, I can focus on the other open\nissues. You were asking about adding foreign keys. This, of course, is\na BIG item for our users, and would be nice to have it. Not sure how\nthat is going to merge into the beta, but we are allowing Jan to add\nrewrite changes during the beta, and perhaps Marc will allow foreign\nkeys too, since it is such a HOT item. We may be adding the IP type\nduring beta, which is hot too.\n\nI believe Marc said he was unsure of novices adding stuff during beta,\nbut people who have proven responsible/responsive are OK. (After the\nindex thing, I am not sure if I am still on that list, but I don't have\nanything to add during beta anyway. I did all my damage before the\nbeta. :-))\n\nI say, go ahead and work on it if you want to, and if it looks good, we\ncan add it, if not, it can be added just after the final release. \nEither way, the code is not going to change that much from now until\nfinal, so if you hold on it or you don't finish, you can always add the\ncode later.\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Wed, 9 Sep 1998 14:26:26 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Adding PRIMARY KEY info"
}
] |
[
{
"msg_contents": "Off topic, but I now have a home office webcam. You can see it at:\n\n\thttp://www.op.net/~candle\n\nI will be on-line all day today, so you can click on the bottom link to\nsee a live feed.\n\nHowever, I will not be working today, so the chair will be empty.\nHowever, I will leave a little PostgreSQL surprise on the chair.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sat, 5 Sep 1998 13:28:22 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "new office webcam"
}
] |
[
{
"msg_contents": "Hi!\nI've applied the junkfilter because I want to use the ODBC-driver to \nlet\nAccess make some querys on a postgres-db.\n\nBut since this patch i can't Delete tuples anymore. A 'Delete from \ntable\nwhere x=1;' will crash the backend. :-(\n\nAny hints?\n\nI tryed this with postgresql.6.3.2 with all patches and with no other\npatches applied.\n\nGerald Fischer\n\n",
"msg_date": "Sat, 05 Sep 1998 23:47:39 +0000",
"msg_from": "\"Gerald Fischer\" <[email protected]>",
"msg_from_op": true,
"msg_subject": "None"
},
{
"msg_contents": "Hi all,\n\ndomenica, 6 settembre 98, you wrote:\n\nGF> Hi!\nGF> I've applied the junkfilter because I want to use the ODBC-driver to \nGF> let\nGF> Access make some querys on a postgres-db.\n\nGF> But since this patch i can't Delete tuples anymore. A 'Delete from \nGF> table\nGF> where x=1;' will crash the backend. :-(\n\nGF> Any hints?\n\nGF> I tryed this with postgresql.6.3.2 with all patches and with no other\nGF> patches applied.\n\nGF> Gerald Fischer\n\nNow I have this problem too.\nThis is the second time for me. The other day (August 6)I sent an help message to the\nlist, because my backend crashed during a DELETE or a DROP DATABASE\nstatement. I had no response till Sept 2 and then I decide to re-install PostgreSQL.\nIt works well until today (Sept 7).\n\nI'm working with ODBC and Access too.\n\nPlease help. I don't want to re-install PostgreSQL again.\n\n\nThanks in advance\n Jose' mailto:[email protected]\n\n\n",
"msg_date": "Mon, 7 Sep 1998 17:09:04 +0200",
"msg_from": "Sferacarta Software <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: DELETE FROM TABLE doesn't work (AGAIN)"
}
] |
[
{
"msg_contents": "I see a number of people tried the cam today:\n\t\n\tbootp-150-57.bootp.Virginia.EDU\n\thectic-2.jpl.nasa.gov\n\tdial1-06.zrz.TU-Berlin.DE\n\tROMANI.kfunigraz.ac.at\n\tclassyad.com\n\tmtcc.demon.co.uk\n\tj8.sbu32.jaring.my\n\tdialin4.sf.medweb.net\n\twww-proxy-2.maz.net\n\ttl-1.proxy.is-europe.net\n\twww-proxy-ham-1.maz.net\n\tppp90.rudah.com.br\n\tportinari.artnet.com.br\n\tcache-db02.proxy.aol.com\n\tcache-db04.proxy.aol.com\n\twa0200.tnt1-56k.awod.com\n\twww.electrostore.com\n\tkmkr3DS40.kng.mesh.ad.jp\n\nI recognize a few of them(Thomas from jpl.nasa.gov). Looks like it did\nnot work 100% sometimes, so I have made some adjustments. I did not\nhave lockfiles being generated, so it was getting messed up.\n\nShould be OK now. I will leave it on tonight for more testing.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Sun, 6 Sep 1998 01:47:37 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "my office cam"
},
{
"msg_contents": "At 1:47 AM 98.9.6 -0400, Bruce Momjian wrote:\n>I see a number of people tried the cam today:\n>\t\n>\tbootp-150-57.bootp.Virginia.EDU\n>\thectic-2.jpl.nasa.gov\n>\tdial1-06.zrz.TU-Berlin.DE\n>\tROMANI.kfunigraz.ac.at\n>\tclassyad.com\n>\tmtcc.demon.co.uk\n>\tj8.sbu32.jaring.my\n>\tdialin4.sf.medweb.net\n>\twww-proxy-2.maz.net\n>\ttl-1.proxy.is-europe.net\n>\twww-proxy-ham-1.maz.net\n>\tppp90.rudah.com.br\n>\tportinari.artnet.com.br\n>\tcache-db02.proxy.aol.com\n>\tcache-db04.proxy.aol.com\n>\twa0200.tnt1-56k.awod.com\n>\twww.electrostore.com\n>\tkmkr3DS40.kng.mesh.ad.jp\n>\n>I recognize a few of them(Thomas from jpl.nasa.gov). Looks like it did\n>not work 100% sometimes, so I have made some adjustments. I did not\n>have lockfiles being generated, so it was getting messed up.\n\nThe last one was me:-)(from my dialup account on an ISP)\n--\nTatsuo Ishii\[email protected]\n\n",
"msg_date": "Sun, 6 Sep 1998 23:06:29 +0900",
"msg_from": "[email protected] (Tatsuo Ishii)",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] my office cam"
},
{
"msg_contents": "On Sun, 6 Sep 1998, Bruce Momjian wrote:\n\n> I see a number of people tried the cam today:\n> \t\n> \tbootp-150-57.bootp.Virginia.EDU\n> \thectic-2.jpl.nasa.gov\n> \tdial1-06.zrz.TU-Berlin.DE\n> \tROMANI.kfunigraz.ac.at\n> \tclassyad.com\n> \tmtcc.demon.co.uk\n> \tj8.sbu32.jaring.my\n> \tdialin4.sf.medweb.net\n> \twww-proxy-2.maz.net\n> \ttl-1.proxy.is-europe.net\n> \twww-proxy-ham-1.maz.net\n> \tppp90.rudah.com.br\n> \tportinari.artnet.com.br\n> \tcache-db02.proxy.aol.com\n> \tcache-db04.proxy.aol.com\n> \twa0200.tnt1-56k.awod.com\n> \twww.electrostore.com\n> \tkmkr3DS40.kng.mesh.ad.jp\n> \n> I recognize a few of them(Thomas from jpl.nasa.gov). Looks like it did\n> not work 100% sometimes, so I have made some adjustments. I did not\n> have lockfiles being generated, so it was getting messed up.\n> \n> Should be OK now. I will leave it on tonight for more testing.\n\nI tried it yesterday, and although the page was visible, the picture just\ntimed out.\n\nI did see the front page with the picture of you though ;-)\n\n-- \n Peter T Mount [email protected]\n Main Homepage: http://www.retep.org.uk\nPostgreSQL JDBC Faq: http://www.retep.org.uk/postgres\n Java PDF Generator: http://www.retep.org.uk/pdf\n\n",
"msg_date": "Mon, 7 Sep 1998 19:11:53 +0100 (GMT)",
"msg_from": "Peter T Mount <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] my office cam"
}
] |
[
{
"msg_contents": "Hi,\n\nI've found the following SISGEV while playing around with a snapshot of\nSeptember 3rd.\n\nI did a make all (with -g); make install; rm -rf data; initdb\n\nHere's what I've done in gdb:\n\n[postgres@jeroenv bin]$ gdb postgres\nGDB is free software and you are welcome to distribute copies of it\n under certain conditions; type \"show copying\" to see the conditions.\nThere is absolutely no warranty for GDB; type \"show warranty\" for\ndetails.\nGDB 4.16 (i586-unknown-linux), Copyright 1996 Free Software Foundation,\nInc...\n(gdb) run -D /usr/local/pgsql/data template1\nStarting program: /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data\ntemplate1\n\nPOSTGRES backend interactive interface\n$Revision: 1.89 $ $Date: 1998/09/01 04:32:13 $\n> select * from pg_shadow \nblank\n 1: usename (typeid = 19, len = 32, typmod = -1, byval = f)\n 2: usesysid (typeid = 23, len = 4, typmod = -1, byval = t)\n 3: usecreatedb (typeid = 16, len = 1, typmod = -1, byval = t)\n 4: usetrace (typeid = 16, len = 1, typmod = -1, byval = t)\n 5: usesuper (typeid = 16, len = 1, typmod = -1, byval = t)\n 6: usecatupd (typeid = 16, len = 1, typmod = -1, byval = t)\n 7: passwd (typeid = 25, len = -1, typmod = -1, byval = f)\n 8: valuntil (typeid = 702, len = 4, typmod = -1, byval = t)\n ----\n 1: usename = \"postgres\" (typeid = 19, len = 32, typmod =\n-1, byval = f)\n 2: usesysid = \"203\" (typeid = 23, len = 4, typmod = -1,\nbyval = t)\n 3: usecreatedb = \"t\" (typeid = 16, len = 1, typmod = -1,\nbyval = t)\n 4: usetrace = \"t\" (typeid = 16, len = 1, typmod = -1,\nbyval = t)\n 5: usesuper = \"t\" (typeid = 16, len = 1, typmod = -1,\nbyval = t)\n 6: usecatupd = \"t\" (typeid = 16, len = 1, typmod = -1,\nbyval = t)\n 8: valuntil = \"Sat Jan 31 07:00:00 2037 MET\" (typeid = 702,\nlen = 4, typmod = -1, byval = t)\n ----\n\n[So far, no problems]\n\n> select * from pg_user\nblank\n 1: usename (typeid = 19, len = 32, typmod = -1, byval = f)\n 2: usesysid (typeid = 23, len = 4, typmod = -1, byval = t)\n 3: usecreatedb (typeid = 16, len = 1, typmod = -1, byval = t)\n 4: usetrace (typeid = 16, len = 1, typmod = -1, byval = t)\n 5: usesuper (typeid = 16, len = 1, typmod = -1, byval = t)\n 6: usecatupd (typeid = 16, len = 1, typmod = -1, byval = t)\n 7: passwd (typeid = 25, len = -1, typmod = -1, byval = f)\n 8: valuntil (typeid = 702, len = 4, typmod = -1, byval = t)\n ----\n 1: usename = \"postgres\" (typeid = 19, len = 32, typmod =\n-1, byval = f)\n 2: usesysid = \"203\" (typeid = 23, len = 4, typmod = -1,\nbyval = t)\n 3: usecreatedb = \"t\" (typeid = 16, len = 1, typmod = -1,\nbyval = t)\n 4: usetrace = \"t\" (typeid = 16, len = 1, typmod = -1,\nbyval = t)\n 5: usesuper = \"t\" (typeid = 16, len = 1, typmod = -1,\nbyval = t)\n 6: usecatupd = \"t\" (typeid = 16, len = 1, typmod = -1,\nbyval = t)\n 7: passwd = \"********\" (typeid = 25, len = -1, typmod = -1,\nbyval = f)\n 8: valuntil = \"Sat Jan 31 07:00:00 2037 MET\" (typeid = 702,\nlen = 4, typmod = -1, byval = t)\n ----\n\nProgram received signal SIGSEGV, Segmentation fault.\n0x400e90eb in __libc_free (mem=0x400f9740)\n(gdb) bt\n#0 0x400e90eb in __libc_free (mem=0x400f9740)\n#1 0x81cf188 in ?? ()\n\n\nAs the backtrace shows no clues, I've no idea where this goes wrong.\nNote that the view pg_shadow goes OK.\n\nselect version() returns:\nPostgreSQL 6.4.0 on i586-pc-linux-gnu, compiled by gcc 2.8.1\n\nAnybody know what's going wrong (and where)?\n\nThanks,\n\nJeroen van Vianen\n",
"msg_date": "Sun, 06 Sep 1998 17:45:28 +0200",
"msg_from": "Jeroen van Vianen <[email protected]>",
"msg_from_op": true,
"msg_subject": "SIGSEGV in 'select * from pg_user'"
},
{
"msg_contents": "> I've found the following SISGEV while playing around with a snapshot \n> of September 3rd.\n(did a fresh install with initdb)\n> > select * from pg_shadow\n> > select * from pg_user\n> Program received signal SIGSEGV, Segmentation fault.\n\nI see the same thing with a fresh source tree on my linux box. Is this\nnormal?\n\nAlso, I've been working on a (small) test case, and have at least some\nindication that the problem is not solely indices. I'll send a better\ndocumented example in a bit, but at least the following one will result\nin errors on a fresh install:\n\nCREATE TABLE onek (\n unique1 int4,\n unique2 int4,\n two int4,\n four int4,\n ten int4,\n twenty int4,\n hundred int4,\n thousand int4,\n twothousand int4,\n fivethous int4,\n tenthous int4,\n odd int4,\n even int4,\n stringu1 name,\n stringu2 name,\n string4 name\n);\n\nCOPY onek FROM\n'/opt/postgres/current/src/test/regress/input/../data/onek.data';\n\ncreate table k1 as select unique1, unique2 from onek;\ncopy k1 to '/opt/postgres/current/src/test/regress/k1.data';\ndelete from k1;\ncopy k1 from '/opt/postgres/current/src/test/regress/k1.data';\nCREATE INDEX k1_unique1 ON k1 USING btree(unique1 int4_ops);\nCREATE INDEX k1_unique2 ON k1 USING btree(unique2 int4_ops);\nERROR: DefineIndex: k1 relation not found\n\nIf I leave out the \"delete from\" I don't get the errors. If I do these\nsteps, then do a new initdb and create k1 from the saved data file, then\nI still see the error.\n\n - Tom\n",
"msg_date": "Mon, 07 Sep 1998 00:37:46 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] SIGSEGV in 'select * from pg_user'"
},
{
"msg_contents": "I have just cvsuped the source tree and have tried some tests.\n\n>> I've found the following SISGEV while playing around with a snapshot \n>> of September 3rd.\n>(did a fresh install with initdb)\n>> > select * from pg_shadow\n>> > select * from pg_user\n>> Program received signal SIGSEGV, Segmentation fault.\n>\n>I see the same thing with a fresh source tree on my linux box. Is this\n>normal?\n\nI saw this too on my LinuxPPC box. In my case, just doing:\n\n\tselect * from pg_user\n\ncrashes the backend. The backtrace shows it crashed in chunk_free()\nwhile committing the transaction. I guess something messed up the\ntables managed by malloc().\n\nTalking about the regression, two tests (constraints, select_views)\nproduced core dump. Seems no difference even after applying Bruce's\nlatest patches.\n--\nTatsauo Ishii\[email protected]\n",
"msg_date": "Mon, 07 Sep 1998 16:56:57 +0900",
"msg_from": "Tatsuo Ishii <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] SIGSEGV in 'select * from pg_user' "
},
{
"msg_contents": "> I saw this too on my LinuxPPC box. In my case, just doing:\n> select * from pg_user\n> \n> crashes the backend. The backtrace shows it crashed in chunk_free()\n> while committing the transaction. I guess something messed up the\n> tables managed by malloc().\n> \n> Talking about the regression, two tests (constraints, select_views)\n> produced core dump. Seems no difference even after applying Bruce's\n> latest patches.\n\nI see the same behavior, with a simple \"select * from pg_user\" enough to\ncrash the backend, and with the same two regression tests resulting in\ncore dumps. As I've mentioned earlier, I believe that the select_views\ntest has been failing for quite a while, where the other problems are\nmore recent. Presumably the pg_user problem is similar to the\nselect_views problem??\n\nWould it help to choose a (simple) test case which shows a problem\n(either a core dump or the \"relation not found\" problem) and start\nworking it through together? We could then exchange notes on what we are\nfinding.\n\nI'm not absolutely certain that the problems are directly related to\nchanges for indexing; other changes (the oid removal, the \"name\" type\nchanges, others??) happened in the same time frame...\n\n - Tom\n",
"msg_date": "Mon, 07 Sep 1998 14:59:33 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] SIGSEGV in 'select * from pg_user'"
},
{
"msg_contents": "> I see the same behavior, with a simple \"select * from pg_user\" enough \n> to crash the backend\n\nThe segfault is coming from a call to free() after the command has\nexecuted and while the \"CommitTransactionCommand\" phase is running.\nPutting the query inside a begin/end block does not help. Presumably\nthere is a bad pointer or something getting free'd twice.\n\nAny ideas?\n\n - Tom\n",
"msg_date": "Mon, 07 Sep 1998 16:47:24 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] SIGSEGV in 'select * from pg_user'"
}
] |
[
{
"msg_contents": "Dear PostgreSQLers,\n\nFew days ago I posed a question about\nusage in a real-time environment etc.\n\nHere is a better version of that question:\n\nAs I understand PostgreSQL still has table\nlevel locking when multiple users access\nthe database. This hardly allows for a\nmulti-user database server. \n\nNow, I may be interested in giving a hand\nhere. Can any old-timer provide me with some\nguidance please. Any academic sources on that,\nhow hard is it, any body alreadyy working on it,\netc. etc.\n\nC'mon some light, please?\n\nAnd, thanks for any.\n\n-- \nMetin Ozsavran, BScEE MBA\nTel: +90-216-361-9555\n",
"msg_date": "Mon, 07 Sep 1998 00:00:41 +0300",
"msg_from": "Metin Ozsavran <[email protected]>",
"msg_from_op": true,
"msg_subject": "Field Level Locking Help???"
}
] |
[
{
"msg_contents": "I have just applied a patch to centralize the attribute alignment and\nsize computations in two new macros, att_align() and att_addlength().\n\nThis removes many switch statements that performed this task.\n\nIt probably does not change any functionality, but I was uncertain that\nall the alignment was being handled in the same way, and with this patch\nI guarantee it.\n\nPlease test the index problem to see if anything has changed. My\nregression tests show no changes from the patch, but I don't see the\nindex problem here.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Mon, 7 Sep 1998 01:37:35 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": true,
"msg_subject": "Alignment fix"
}
] |
[
{
"msg_contents": "Gerald Fischer wrote:\n\n> Hi Jose, hi Hackers!\n>\n> I reinstalled Postgresql with this patch about 10 times in the last 2 days, but without success. :-(\n>\n> I tried now to use the snapshot, and it compiled nearly without problems (in /src/interfaces/ecpg/preproc/preproc.y is a ';' missing on line 1562), but the ODBC-Driver can't connect to the database. The logfile\n> says:\n> ----------------\n>\n\nThe snapshot is very unstable at this time. 6.4 will not be official until after Oct.1. I would suggest not using it at this time\n\n> ---------\n> And with the snapshot of sept. 6th, it complains about a missing MSysConf-Table. :-(\n> --------\n> conn=71501948, query='declare SQL_CUR71516440 cursor for SELECT Config, nValue FROM MSysConf'\n> ERROR from backend during send_query: 'ERROR: msysconf: Table does not exist.'\n> --------\n\nThis is a normal error. MS Access always queries this table. It is not necessary for successful processing.\n\n>\n>\n> Please help, because I would need a running system tomorrow :-( (For the moment it will do it without delete, but not for ever).\n>\n\nIt is difficult for me to figure out what your problem is. What we need is a reproducible sequence of events leading up to the crash.\n\nIf you can reproduce the crash through the psql monitor, then we should work with that. No sense in adding an extra layer of complexity by working through the ODBC driver.\n\nThe same goes for the junkfilter patch. The errors as you describe, do not point to the junkfilter patch. Admittedly, it is possible. See if the problem can be reproduced without the junkfilter.\n\n",
"msg_date": "Mon, 07 Sep 1998 10:56:21 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [INTERFACES] Re: DELETE FROM TABLE doesn't work (AGAIN)"
},
{
"msg_contents": "Hi Jose, hi Hackers!\n\nOn Mon, 7 Sep 1998 17:09:04 +0200, Sferacarta Software wrote:\n\n>GF> I've applied the junkfilter because I want to use the ODBC-driver to \n>GF> let Access make some querys on a postgres-db.\n>\n>GF> But since this patch i can't Delete tuples anymore. A 'Delete from \n>GF> table where x=1;' will crash the backend. :-(\n>\n>GF> Any hints?\n>\n>GF> I tryed this with postgresql.6.3.2 with all patches and with no other\n>GF> patches applied.\n\n>Now I have this problem too.\n>This is the second time for me. The other day (August 6)I sent an help message to the\n>list, because my backend crashed during a DELETE or a DROP DATABASE\n>statement. I had no response till Sept 2 and then I decide to re-install PostgreSQL.\n>It works well until today (Sept 7).\n>\n>I'm working with ODBC and Access too.\n>\n>Please help. I don't want to re-install PostgreSQL again.\n\nI reinstalled Postgresql with this patch about 10 times in the last 2 days, but without success. :-(\n\nI tried now to use the snapshot, and it compiled nearly without problems (in /src/interfaces/ecpg/preproc/preproc.y is a ';' missing on line 1562), but the ODBC-Driver can't connect to the database. The logfile \nsays:\n----------------\nconn=71501948, SQLDriverConnect( in)='DRIVER={PostgreSQL};', fDriverCompletion=1\nconn=71501948, SQLDriverConnect(out)='DRIVER={PostgreSQL};DATABASE=test;SERVER=hp;PORT=5432;UID=gerald;PWD=av;READONLY=0;PROTOCOL=;FAKEOIDINDEX=0;SHOWOIDCOLUMN=\n0;ROWVERSIONING=0;SHOWSYSTEMTABLES=0;CONNSETTINGS='\nGlobal Options: fetch=100, socket=4096, unknown_sizes=0, max_varchar_size=255, max_longvarchar_size=4094\n disable_optimizer=1, unique_index=0, use_declarefetch=1\n text_as_longvarchar=1, unknowns_as_longvarchar=0, bools_as_char=1\n extra_systable_prefixes='dd_;', conn_settings=''\nconn=71501948, query=' '\nconn=71501948, query='BEGIN'\nconn=71501948, query='set DateStyle to 'ISO'; set geqo to 'OFF''\nCommand response: 'SET VARIABLE'\nconn=71501948, query='declare SQL_CUR71516440 cursor for select oid from pg_type where typname='lo''\nconn=71501948, query='fetch 100 in SQL_CUR71516440'\n [ fetched 0 rows ]\nconn=71501948, query='close SQL_CUR71516440'\nconn=71501948, query='END'\nconn=71501948, query='BEGIN'\nconn=71501948, query='declare SQL_CUR71582124 cursor for select relname, usename, relhasrules from pg_class, pg_user where relkind = 'r' and relname !~ '^xinv[0-9]+' and int4out(usesysid) = int4out\n(relowner) order by relname'\nconn=71501948, query='fetch 100 in SQL_CUR71582124'\n [ fetched 30 rows ]\nconn=71501948, query='close SQL_CUR71582124'\nconn=71501948, query='END'\nconn=71501948, query='BEGIN'\nconn=71501948, query='declare SQL_CUR71582124 cursor for select u.usename, c.relname, a.attname, a.atttypid,t.typname, a.attnum, a.attlen, a.atttypmod, a.attnotnull from pg_user u, pg_class c, pg_attribute \na, pg_type t where int4out(u.usesysid) = int4out(c.relowner) and c.oid= a.attrelid and a.atttypid = t.oid and (a.attnum > 0) and c.relname like 'test' order by attnum'\nconn=71501948, query='fetch 100 in SQL_CUR71582124'\n [ fetched 2 rows ]\nSTATEMENT ERROR: func=SQLFetch, desc='', errnum=3, errmsg='Null statement result in SQLFetch.'\n ------------------------------------------------------------\n hdbc=0, stmt=71630847, result=0\n manual_result=0, prepare=0, internal=0\n bindings=0, bindings_allocated=0\n parameters=0, parameters_allocated=0\n statement_type=0, statement='(null)'\n stmt_with_params=''\n data_at_exec=0, current_exec_param=0, put_data=0\n currTuple=0, current_col=0, lobj_fd=0\n maxRows=0, rowset_size=0, keyset_size=0, cursor_type=0, scroll_concurrency=0\n cursor_name=''\n ----------------QResult Info -------------------------------\nINVALID CONNECTION HANDLE ERROR: func=SQLFetch, desc=''\nSTATEMENT ERROR: func=SQLColumns, desc='', errnum=0, errmsg='Null statement result in SQLFetch.'\n ------------------------------------------------------------\n hdbc=71501948, stmt=71516440, result=72551288\n manual_result=1, prepare=0, internal=0\n bindings=72551372, bindings_allocated=14\n parameters=0, parameters_allocated=0\n statement_type=-2, statement='(null)'\n stmt_with_params=''\n data_at_exec=-1, current_exec_param=-1, put_data=0\n currTuple=-1, current_col=-1, lobj_fd=-1\n maxRows=0, rowset_size=1, keyset_size=0, cursor_type=0, scroll_concurrency=1\n cursor_name=''\n ----------------QResult Info -------------------------------\n fields=72551348, manual_tuples=71647992, backend_tuples=0, tupleField=0, conn=0\n fetch_count=0, fcount=0, num_fields=0, cursor='(null)'\n message='(null)', command='(null)', notice='(null)'\n status=0, inTuples=0\nCONN ERROR: func=SQLColumns, desc='', errnum=0, errmsg=''\n ------------------------------------------------------------\n henv=72548484, conn=71501948, status=1, num_stmts=16\n sock=72548500, stmts=72548540, lobj_type=-999\n ---------------- Socket Info -------------------------------\n socket=66, reverse=0, errornumber=0, errormsg='(null)'\n buffer_in=71508240, buffer_out=71512340\n buffer_filled_in=279, buffer_filled_out=0, buffer_read_in=279\nconn=71501948, SQLDisconnect\nconn=71501948, query='ABORT'\n---------\nAnd with the snapshot of sept. 6th, it complains about a missing MSysConf-Table. :-(\n--------\nconn=71501948, query='declare SQL_CUR71516440 cursor for SELECT Config, nValue FROM MSysConf'\nERROR from backend during send_query: 'ERROR: msysconf: Table does not exist.'\n--------\n\nPlease help, because I would need a running system tomorrow :-( (For the moment it will do it without delete, but not for ever).\n\nBest regards,\nGerald Fischer\n\n\n",
"msg_date": "Mon, 07 Sep 1998 18:28:41 +0200",
"msg_from": "\"Gerald Fischer\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [INTERFACES] Re: DELETE FROM TABLE doesn't work (AGAIN)"
}
] |
[
{
"msg_contents": "Hi David!\n\nOn Mon, 07 Sep 1998 10:56:21 -0400, David Hartwig wrote:\n\nFirst of all I want to thank you for your mail.\n\n>> I reinstalled Postgresql with this patch about 10 times in the last 2 days, but without success. :-(\n>>\n>> I tried now to use the snapshot, and it compiled nearly without problems (in /src/interfaces/ecpg/preproc/preproc.y is a ';' missing on line 1562), but the ODBC-Driver \ncan't connect to the database. The logfile\n>> says:\n>> ----------------\n>The snapshot is very unstable at this time. 6.4 will not be official until after Oct.1. I would suggest not using it at this time\n\nWell, I gave it a try.\n\n>> ---------\n>> And with the snapshot of sept. 6th, it complains about a missing MSysConf-Table. :-(\n>> --------\n>> conn=71501948, query='declare SQL_CUR71516440 cursor for SELECT Config, nValue FROM MSysConf'\n>> ERROR from backend during send_query: 'ERROR: msysconf: Table does not exist.'\n>> --------\n>\n>This is a normal error. MS Access always queries this table. It is not necessary for successful processing.\n\nTypically M$ :-(\n\n>>\n>>\n>> Please help, because I would need a running system tomorrow :-( (For the moment it will do it without delete, but not for ever).\n>>\n>\n>It is difficult for me to figure out what your problem is. What we need is a reproducible sequence of events leading up to the crash.\n\nWell, no problem :-) I can reproduce the crash. With or without the ODBC-Driver.\n\n>If you can reproduce the crash through the psql monitor, then we should work with that. No sense in adding an extra layer of complexity by working through the ODBC \ndriver.\n>\n>The same goes for the junkfilter patch. The errors as you describe, do not point to the junkfilter patch. Admittedly, it is possible. See if the problem can be reproduced \nwithout the junkfilter.\n\nOk, once again.\n\nI've installed postgresql 6.3.2 with all patches from ftp.postgresql.org/pub/patches. It worked great, but I could not use the ODBC-Driver for stuff like order by and group by \n(this is the bug where the junkfilter is a workaround, i think).\nTherefore I installed the junkfilter, compiled again, and now I was able to order/group over the ODBC-Driver. \nAt this time I was happy :-), but than I wanted to make a destroyuser and the backend crashed. I thought it was the destroyuser-script, but then I tryed to make a simple \n'delete from test;' and this crashed the backend, too :-(.\nA few minutes ago we found out that triggers wont work, too.\nOk, I hoped it was another patch that does not like the junkfilter and I tryed to recompile a completly new version (only with the junkfilter applied). The same error occured. \nTherefore I started today to give the snapshot a try, but it will not work together with the ODBC-Driver :-(. \n\nHere a capture of psql:\n-----\ntest=> \\d test\n\nTable = test\n+----------------------------------+----------------------------------+-------+\n| Field | Type | Length|\n+----------------------------------+----------------------------------+-------+\n| i | int4 | 4 |\n| j | int4 | 4 |\n+----------------------------------+----------------------------------+-------+\ntest=> select * from test;\n i| j\n---+---\n100|100\n(1 row)\n\ntest=> delete from test;\nPQexec() -- Request was sent to backend, but backend closed the channel before r\nesponding.\n This probably means the backend terminated abnormally before or while pr\nocessing the request.\ntest=>\ntest=> select * from test;\nPQexec() -- There is no connection to the backend.\n------\n\nI hope you can help me, because the only thing I could try is to get another linux-distribution and try it with eg redhat (at the moment I use SuSE).\n\nBest regards,\nGerald Fischer\n\nPS: Sorry for my bad english...\n\n\n",
"msg_date": "Mon, 07 Sep 1998 22:36:21 +0200",
"msg_from": "\"Gerald Fischer\" <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [INTERFACES] Re: DELETE FROM TABLE doesn't work (AGAIN)"
},
{
"msg_contents": "\n\nGerald Fischer wrote:\n\n> Hi David!\n>\n> On Mon, 07 Sep 1998 10:56:21 -0400, David Hartwig wrote:\n>\n> First of all I want to thank you for your mail.\n>\n> >> I reinstalled Postgresql with this patch about 10 times in the last 2 days, but without success. :-(\n> >>\n> >> I tried now to use the snapshot, and it compiled nearly without problems (in /src/interfaces/ecpg/preproc/preproc.y is a ';' missing on line 1562), but the ODBC-Driver\n> can't connect to the database. The logfile\n> >> says:\n> >> ----------------\n> >The snapshot is very unstable at this time. 6.4 will not be official until after Oct.1. I would suggest not using it at this time\n>\n> Well, I gave it a try.\n>\n> >> ---------\n> >> And with the snapshot of sept. 6th, it complains about a missing MSysConf-Table. :-(\n> >> --------\n> >> conn=71501948, query='declare SQL_CUR71516440 cursor for SELECT Config, nValue FROM MSysConf'\n> >> ERROR from backend during send_query: 'ERROR: msysconf: Table does not exist.'\n> >> --------\n> >\n> >This is a normal error. MS Access always queries this table. It is not necessary for successful processing.\n>\n> Typically M$ :-(\n>\n> >>\n> >>\n> >> Please help, because I would need a running system tomorrow :-( (For the moment it will do it without delete, but not for ever).\n> >>\n> >\n> >It is difficult for me to figure out what your problem is. What we need is a reproducible sequence of events leading up to the crash.\n>\n> Well, no problem :-) I can reproduce the crash. With or without the ODBC-Driver.\n>\n> >If you can reproduce the crash through the psql monitor, then we should work with that. No sense in adding an extra layer of complexity by working through the ODBC\n> driver.\n> >\n> >The same goes for the junkfilter patch. The errors as you describe, do not point to the junkfilter patch. Admittedly, it is possible. See if the problem can be reproduced\n> without the junkfilter.\n>\n> Ok, once again.\n>\n> I've installed postgresql 6.3.2 with all patches from ftp.postgresql.org/pub/patches. It worked great, but I could not use the ODBC-Driver for stuff like order by and group by\n> (this is the bug where the junkfilter is a workaround, i think).\n\nCorrect. You may want to make sure you have the latest Jet Engine from M$. That are serious bugs in older versions. See our FAQ at\nhttp://www.insightdist.com/psqlodbc This will not solve our current problem.\n\n>\n> Therefore I installed the junkfilter, compiled again, and now I was able to order/group over the ODBC-Driver.\n> At this time I was happy :-), but than I wanted to make a destroyuser and the backend crashed. I thought it was the destroyuser-script, but then I tryed to make a simple\n> 'delete from test;' and this crashed the backend, too :-(.\n> A few minutes ago we found out that triggers wont work, too.\n> Ok, I hoped it was another patch that does not like the junkfilter and I tryed to recompile a completly new version (only with the junkfilter applied). The same error occured.\n\nHmm... Something is not right here. I have not problem on either AIX or Caldera Linux and I know others are using the patch without any problems. I doubt if I are going to be\nable to resolve this soon. I am juggling too many things right now. Our best bet may be to wait until 6.4\n\n\n>\n> Therefore I started today to give the snapshot a try, but it will not work together with the ODBC-Driver :-(.\n\n> Here a capture of psql:\n> -----\n> test=> \\d test\n>\n> Table = test\n> +----------------------------------+----------------------------------+-------+\n> | Field | Type | Length|\n> +----------------------------------+----------------------------------+-------+\n> | i | int4 | 4 |\n> | j | int4 | 4 |\n> +----------------------------------+----------------------------------+-------+\n> test=> select * from test;\n> i| j\n> ---+---\n> 100|100\n> (1 row)\n>\n> test=> delete from test;\n> PQexec() -- Request was sent to backend, but backend closed the channel before r\n> esponding.\n> This probably means the backend terminated abnormally before or while pr\n> ocessing the request.\n> test=>\n> test=> select * from test;\n> PQexec() -- There is no connection to the backend.\n> ------\n>\n> I hope you can help me, because the only thing I could try is to get another linux-distribution and try it with eg redhat (at the moment I use SuSE).\n>\n>\n\nI am not a Linux guru. So I don't have a clue a to weather this is an issue.\n\n>\n>\n> PS: Sorry for my bad english...\n\nIt way better that my second language.\n\n",
"msg_date": "Mon, 07 Sep 1998 17:48:52 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [INTERFACES] Re: DELETE FROM TABLE doesn't work (AGAIN)"
},
{
"msg_contents": "\[email protected] said:\n> Correct. You may want to make sure you have the latest Jet Engine\n> from M$. That are serious bugs in older versions. See our FAQ at\n> http://www.insightdist.com/psqlodbc This will not solve our\n> current problem. \n\nDavid,\n\nCould you please post some more details on which is the latest version of Jet \nand where it is hidden among all of the hype at www. microsoft.com.\n\nCheers and thanks,\nStephen.\n\n========================================================================\nStephen Davies Consulting\t \t\t [email protected]\nAdelaide, South Australia. \t\t\t Voice: 61-8-82728863\nComputing & Network solutions.\t \t Fax: 61-8-82741015\n\n\n",
"msg_date": "Tue, 08 Sep 1998 09:01:03 +0930",
"msg_from": "Stephen Davies <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [INTERFACES] Re: DELETE FROM TABLE doesn't work (AGAIN) "
},
{
"msg_contents": "Hello David,\n\nluned�, 7 settembre 98, you wrote:\n\n\n\nDH> Gerald Fischer wrote:\n\n>> Hi David!\n>>\n>> On Mon, 07 Sep 1998 10:56:21 -0400, David Hartwig wrote:\n>>\n>> First of all I want to thank you for your mail.\n>>\n>> >> I reinstalled Postgresql with this patch about 10 times in the last 2 days, but without success. :-(\n>> >>\n>> >> I tried now to use the snapshot, and it compiled nearly without problems (in /src/interfaces/ecpg/preproc/preproc.y is a ';' missing on line 1562), but the ODBC-Driver\n>> can't connect to the database. The logfile\n>> >> says:\n>> >> ----------------\n>> >The snapshot is very unstable at this time. 6.4 will not be official until after Oct.1. I would suggest not using it at this time\n>>\n>> Well, I gave it a try.\n>>\n>> >> ---------\n>> >> And with the snapshot of sept. 6th, it complains about a missing MSysConf-Table. :-(\n>> >> --------\n>> >> conn=71501948, query='declare SQL_CUR71516440 cursor for SELECT Config, nValue FROM MSysConf'\n>> >> ERROR from backend during send_query: 'ERROR: msysconf: Table does not exist.'\n>> >> --------\n>> >\n>> >This is a normal error. MS Access always queries this table. It is not necessary for successful processing.\n>>\n>> Typically M$ :-(\n>>\n>> >>\n>> >>\n>> >> Please help, because I would need a running system tomorrow :-( (For the moment it will do it without delete, but not for ever).\n>> >>\n>> >\n>> >It is difficult for me to figure out what your problem is. What we need is a reproducible sequence of events leading up to the crash.\n>>\n>> Well, no problem :-) I can reproduce the crash. With or without the ODBC-Driver.\n>>\n>> >If you can reproduce the crash through the psql monitor, then we should work with that. No sense in adding an extra layer of complexity by working through the ODBC\n>> driver.\n>> >\n>> >The same goes for the junkfilter patch. The errors as you describe, do not point to the junkfilter patch. Admittedly, it is possible. See if the problem can be reproduced\n>> without the junkfilter.\n>>\n>> Ok, once again.\n>>\n>> I've installed postgresql 6.3.2 with all patches from ftp.postgresql.org/pub/patches. It worked great, but I could not use the ODBC-Driver for stuff like order by and group by\n>> (this is the bug where the junkfilter is a workaround, i think).\n\nDH> Correct. You may want to make sure you have the latest Jet Engine from M$. That are serious bugs in older versions. See our FAQ at\nDH> http://www.insightdist.com/psqlodbc This will not solve our current problem.\n\n>>\n>> Therefore I installed the junkfilter, compiled again, and now I was able to order/group over the ODBC-Driver.\n>> At this time I was happy :-), but than I wanted to make a destroyuser and the backend crashed. I thought it was the destroyuser-script, but then I tryed to make a simple\n>> 'delete from test;' and this crashed the backend, too :-(.\n>> A few minutes ago we found out that triggers wont work, too.\n>> Ok, I hoped it was another patch that does not like the junkfilter and I tryed to recompile a completly new version (only with the junkfilter applied). The same error occured.\n\nDH> Hmm... Something is not right here. I have not problem on either AIX or Caldera Linux and I know others are using the patch without any problems. I doubt if I are going to be\nDH> able to resolve this soon. I am juggling too many things right now. Our best bet may be to wait until 6.4\n\n>>\n>> Therefore I started today to give the snapshot a try, but it will not work together with the ODBC-Driver :-(.\n\n>> Here a capture of psql:\n>> -----\n>> test=> \\d test\n>>\n>> Table = test\n>> +----------------------------------+----------------------------------+-------+\n>> | Field | Type | Length|\n>> +----------------------------------+----------------------------------+-------+\n>> | i | int4 | 4 |\n>> | j | int4 | 4 |\n>> +----------------------------------+----------------------------------+-------+\n>> test=> select * from test;\n>> i| j\n>> ---+---\n>> 100|100\n>> (1 row)\n>>\n>> test=> delete from test;\n>> PQexec() -- Request was sent to backend, but backend closed the channel before r\n>> esponding.\n>> This probably means the backend terminated abnormally before or while pr\n>> ocessing the request.\n>> test=>\n>> test=> select * from test;\n>> PQexec() -- There is no connection to the backend.\n>> ------\n>>\n>> I hope you can help me, because the only thing I could try is to get\n>> another linux-distribution and try it with eg redhat (at the moment I use SuSE).\n>>\n\nI'm using Debian distribution and I have exactly the same problem. The\nfirst time, it was a couple of weeks ago, then I recompiled and\nreinstalled PostgreSQL and I solved my problem for a few days, but\nnow I have this error again.\nI can't surely connect this error with the junkfilter patch but I can't\ndiscard this possibility because I'm been using v-6.3.2 from the beginning\nof its delivery, with no problems except lately after I applied this patch.\n\nBest regards,\n Jose' mailto:[email protected]\n\n\n",
"msg_date": "Tue, 8 Sep 1998 13:36:06 +0200",
"msg_from": "Sferacarta Software <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re[2]: [INTERFACES] Re: DELETE FROM TABLE doesn't work (AGAIN)"
},
{
"msg_contents": "\n\nStephen Davies wrote:\n\n> [email protected] said:\n> > Correct. You may want to make sure you have the latest Jet Engine\n> > from M$. That are serious bugs in older versions. See our FAQ at\n> > http://www.insightdist.com/psqlodbc This will not solve our\n> > current problem.\n>\n> David,\n>\n> Could you please post some more details on which is the latest version of Jet\n> and where it is hidden among all of the hype at www. microsoft.com.\n>\n\nThe link is on the our FAQ. M$ will first prompt you for some basic demographics tidbits. Like:\n\"Do you have any pets? If so, do they enjoy M$ products as much as you do.\"\n\nOn the FAQ see: 3. Why does MS Access sometimes complain about a GROUP BY or ORDER BY not being\nin the target list?\n\n\n",
"msg_date": "Tue, 08 Sep 1998 09:02:22 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [INTERFACES] Re: DELETE FROM TABLE doesn't work (AGAIN)"
}
] |
[
{
"msg_contents": "This is a very recent addition at line 664 of copy.c It will not\ncompile on AIX 4.1 Help!\n\ngmake[2]: Entering directory `/gnu/postgresql-6.4f/src/backend/commands'\n\nxlc -I../../include -I../../backend -qchars=signed -qmaxmem=8192\n-qhalt=w -qsrcmsg -qcheck=divzero -I/usr/local/include -I.. -c\n copy.c -o copy.o\n 664 | ptr = (\n((attr[i]->attlen) < sizeof(int32)) ? ( ((attr[i]->attlen) == -1\n) ? ( ((attr[i]->attalign) == 'd') ? (((long)(ptr) + (sizeof (double) -\n1)) & ~(sizeof (double) -1)) : (((long)(ptr) + (sizeof (int)\n - 1)) & ~(sizeof (int) -1)) ) : ( ((attr[i]->attlen) == sizeof(char)) ?\n( (ptr) ) : ( (void)((char) 1), (((long)(ptr) + (sizeof (sh\nort) - 1)) & ~(sizeof (short) - 1)) ) ) ) : ( ((attr[i]->attlen) ==\nsizeof(int32)) ? ( (((long)(ptr) + (sizeof (int) - 1)) & ~(sizeo\nf (int) -1)) ) : ( (void)((char) 1), ((attr[i]->attalign) == 'd') ?\n(((long)(ptr) + (sizeof (double) - 1)) & ~(sizeof (double) -1))\n: (((long)(ptr) + (sizeof (long) - 1)) & ~(sizeof (long) -1)) ) ) );\n\n........................................................................................................................\n\n....................................................................................................................................\n\n.......................................................................a..........\n\na - 1506-226 (S) The \":\" operator is not allowed between \"char*\" and\n\"unsigned long\".\ngmake[2]: *** [copy.o] Error 1\n\n\n",
"msg_date": "Mon, 07 Sep 1998 18:04:32 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": true,
"msg_subject": "Macro From Hell"
},
{
"msg_contents": "> This is a very recent addition at line 664 of copy.c It will not\n> compile on AIX 4.1 Help!\n> \n> gmake[2]: Entering directory `/gnu/postgresql-6.4f/src/backend/commands'\n> \n> xlc -I../../include -I../../backend -qchars=signed -qmaxmem=8192\n> -qhalt=w -qsrcmsg -qcheck=divzero -I/usr/local/include -I.. -c\n> copy.c -o copy.o\n> 664 | ptr = (\n> ((attr[i]->attlen) < sizeof(int32)) ? ( ((attr[i]->attlen) == -1\n> ) ? ( ((attr[i]->attalign) == 'd') ? (((long)(ptr) + (sizeof (double) -\n> 1)) & ~(sizeof (double) -1)) : (((long)(ptr) + (sizeof (int)\n> - 1)) & ~(sizeof (int) -1)) ) : ( ((attr[i]->attlen) == sizeof(char)) ?\n> ( (ptr) ) : ( (void)((char) 1), (((long)(ptr) + (sizeof (sh\n> ort) - 1)) & ~(sizeof (short) - 1)) ) ) ) : ( ((attr[i]->attlen) ==\n> sizeof(int32)) ? ( (((long)(ptr) + (sizeof (int) - 1)) & ~(sizeo\n> f (int) -1)) ) : ( (void)((char) 1), ((attr[i]->attalign) == 'd') ?\n> (((long)(ptr) + (sizeof (double) - 1)) & ~(sizeof (double) -1))\n> : (((long)(ptr) + (sizeof (long) - 1)) & ~(sizeof (long) -1)) ) ) );\n> \n> ........................................................................................................................\n> \n> ....................................................................................................................................\n> \n> .......................................................................a..........\n> \n> a - 1506-226 (S) The \":\" operator is not allowed between \"char*\" and\n> \"unsigned long\".\n> gmake[2]: *** [copy.o] Error 1\n> \n\nLooks like I am going to have to do another DISABLE_COMPLEX_MACROS entry\nfor that new macro, just like heap_getattr().\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Tue, 8 Sep 1998 03:15:17 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Macro From Hell"
},
{
"msg_contents": "Bruce Momjian writes:\n> Looks like I am going to have to do another DISABLE_COMPLEX_MACROS entry\n> for that new macro, just like heap_getattr().\n> \nPlease do not use the same define as the one used in heap_getattr(). The new \nmacro compiles fine on UnixWare 7 (and I assume UnixWare 2 and SCO OpenServer).\nIt may be restricted to the AIX compiler.\n-- \n____ | Billy G. Allie | Domain....: [email protected]\n| /| | 7436 Hartwell | Compuserve: 76337,2061\n|-/-|----- | Dearborn, MI 48126| MSN.......: [email protected]\n|/ |LLIE | (313) 582-1540 | \n\n\n",
"msg_date": "Tue, 08 Sep 1998 03:35:23 -0400",
"msg_from": "\"Billy G. Allie\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Macro From Hell "
},
{
"msg_contents": "> > ((attr[i]->attlen) < sizeof(int32)) ? ( ((attr[i]->attlen) == -1\n> > ) ? ( ((attr[i]->attalign) == 'd') ? (((long)(ptr) + (sizeof \n> > (double) -\n> > 1)) & ~(sizeof (double) -1)) : (((long)(ptr) + (sizeof (int)\n> > - 1)) & ~(sizeof (int) -1)) ) : ( ((attr[i]->attlen) == \n> > sizeof(char)) ?\n> > ( (ptr) ) : ( (void)((char) 1), (((long)(ptr) + (sizeof (sh\n ^^^^^ should perhaps be (long)(ptr)\n> > ort) - 1)) & ~(sizeof (short) - 1)) ) ) ) : ( ((attr[i]->attlen) ==\n> > sizeof(int32)) ? ( (((long)(ptr) + (sizeof (int) - 1)) & ~(sizeo\n> > f (int) -1)) ) : ( (void)((char) 1), ((attr[i]->attalign) == 'd') ?\n> > (((long)(ptr) + (sizeof (double) - 1)) & ~(sizeof (double) -1))\n> > : (((long)(ptr) + (sizeof (long) - 1)) & ~(sizeof (long) -1)) ) ) );\n> > a - 1506-226 (S) The \":\" operator is not allowed between \"char*\" and\n> > \"unsigned long\".\n> Looks like I am going to have to do another DISABLE_COMPLEX_MACROS \n> entry for that new macro, just like heap_getattr().\n\nThe error message indicates that the AIX compiler is complaining about a\ntype mismatch within the macro, not the length of the macro itself. Try\nadding that additional coersion and see if it helps. The macro is just a\nbit \"thick\" (OK, _really_ thick :), so there may be another place in\nthere provoking the complaint...\n\n - Tom\n",
"msg_date": "Tue, 08 Sep 1998 14:20:01 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Macro From Hell"
},
{
"msg_contents": "\n\nThomas G. Lockhart wrote:\n\n> > > ((attr[i]->attlen) < sizeof(int32)) ? ( ((attr[i]->attlen) == -1\n> > > ) ? ( ((attr[i]->attalign) == 'd') ? (((long)(ptr) + (sizeof\n> > > (double) -\n> > > 1)) & ~(sizeof (double) -1)) : (((long)(ptr) + (sizeof (int)\n> > > - 1)) & ~(sizeof (int) -1)) ) : ( ((attr[i]->attlen) ==\n> > > sizeof(char)) ?\n> > > ( (ptr) ) : ( (void)((char) 1), (((long)(ptr) + (sizeof (sh\n> ^^^^^ should perhaps be (long)(ptr)\n> > > ort) - 1)) & ~(sizeof (short) - 1)) ) ) ) : ( ((attr[i]->attlen) ==\n> > > sizeof(int32)) ? ( (((long)(ptr) + (sizeof (int) - 1)) & ~(sizeo\n> > > f (int) -1)) ) : ( (void)((char) 1), ((attr[i]->attalign) == 'd') ?\n> > > (((long)(ptr) + (sizeof (double) - 1)) & ~(sizeof (double) -1))\n> > > : (((long)(ptr) + (sizeof (long) - 1)) & ~(sizeof (long) -1)) ) ) );\n> > > a - 1506-226 (S) The \":\" operator is not allowed between \"char*\" and\n> > > \"unsigned long\".\n> > Looks like I am going to have to do another DISABLE_COMPLEX_MACROS\n> > entry for that new macro, just like heap_getattr().\n>\n> The error message indicates that the AIX compiler is complaining about a\n> type mismatch within the macro, not the length of the macro itself. Try\n> adding that additional coersion and see if it helps. The macro is just a\n> bit \"thick\" (OK, _really_ thick :), so there may be another place in\n> there provoking the complaint...\n>\n\nThat is correct. I was able to do several casts to get it to work this\nmorning. It is hacked in for now. Basically the problem is this:\n\n ptr = (test) ? (espression resulting in pointer) : (expression\nresulting in long)\n\nOur compiler does not like this. Bruce, I can send a patch if you like.\n\n",
"msg_date": "Tue, 08 Sep 1998 10:49:58 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Macro From Hell"
},
{
"msg_contents": "> Bruce Momjian writes:\n> > Looks like I am going to have to do another DISABLE_COMPLEX_MACROS entry\n> > for that new macro, just like heap_getattr().\n> > \n> Please do not use the same define as the one used in heap_getattr(). The new \n> macro compiles fine on UnixWare 7 (and I assume UnixWare 2 and SCO OpenServer).\n> It may be restricted to the AIX compiler.\n\nI now realize it is the mixing of the return types for ? : that it does\nnot like. Will fix.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Tue, 8 Sep 1998 11:02:32 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Macro From Hell"
},
{
"msg_contents": "> > > ((attr[i]->attlen) < sizeof(int32)) ? ( ((attr[i]->attlen) == -1\n> > > ) ? ( ((attr[i]->attalign) == 'd') ? (((long)(ptr) + (sizeof \n> > > (double) -\n> > > 1)) & ~(sizeof (double) -1)) : (((long)(ptr) + (sizeof (int)\n> > > - 1)) & ~(sizeof (int) -1)) ) : ( ((attr[i]->attlen) == \n> > > sizeof(char)) ?\n> > > ( (ptr) ) : ( (void)((char) 1), (((long)(ptr) + (sizeof (sh\n> ^^^^^ should perhaps be (long)(ptr)\n> > > ort) - 1)) & ~(sizeof (short) - 1)) ) ) ) : ( ((attr[i]->attlen) ==\n> > > sizeof(int32)) ? ( (((long)(ptr) + (sizeof (int) - 1)) & ~(sizeo\n> > > f (int) -1)) ) : ( (void)((char) 1), ((attr[i]->attalign) == 'd') ?\n> > > (((long)(ptr) + (sizeof (double) - 1)) & ~(sizeof (double) -1))\n> > > : (((long)(ptr) + (sizeof (long) - 1)) & ~(sizeof (long) -1)) ) ) );\n> > > a - 1506-226 (S) The \":\" operator is not allowed between \"char*\" and\n> > > \"unsigned long\".\n> > Looks like I am going to have to do another DISABLE_COMPLEX_MACROS \n> > entry for that new macro, just like heap_getattr().\n> \n> The error message indicates that the AIX compiler is complaining about a\n> type mismatch within the macro, not the length of the macro itself. Try\n> adding that additional coersion and see if it helps. The macro is just a\n> bit \"thick\" (OK, _really_ thick :), so there may be another place in\n> there provoking the complaint...\n\nFixed. Need to cast the sizeof(char) entry to long.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Tue, 8 Sep 1998 11:40:16 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Macro From Hell"
},
{
"msg_contents": "> > This is a very recent addition at line 664 of copy.c It will not\n> > compile on AIX 4.1 Help!\n> > \n> > gmake[2]: Entering directory `/gnu/postgresql-6.4f/src/backend/commands'\n> > \n> > xlc -I../../include -I../../backend -qchars=signed -qmaxmem=8192\n> > -qhalt=w -qsrcmsg -qcheck=divzero -I/usr/local/include -I.. -c\n> > copy.c -o copy.o\n> > 664 | ptr = (\n> > ((attr[i]->attlen) < sizeof(int32)) ? ( ((attr[i]->attlen) == -1\n> > ) ? ( ((attr[i]->attalign) == 'd') ? (((long)(ptr) + (sizeof (double) -\n> > 1)) & ~(sizeof (double) -1)) : (((long)(ptr) + (sizeof (int)\n> > - 1)) & ~(sizeof (int) -1)) ) : ( ((attr[i]->attlen) == sizeof(char)) ?\n> > ( (ptr) ) : ( (void)((char) 1), (((long)(ptr) + (sizeof (sh\n> > ort) - 1)) & ~(sizeof (short) - 1)) ) ) ) : ( ((attr[i]->attlen) ==\n> > sizeof(int32)) ? ( (((long)(ptr) + (sizeof (int) - 1)) & ~(sizeo\n> > f (int) -1)) ) : ( (void)((char) 1), ((attr[i]->attalign) == 'd') ?\n> > (((long)(ptr) + (sizeof (double) - 1)) & ~(sizeof (double) -1))\n> > : (((long)(ptr) + (sizeof (long) - 1)) & ~(sizeof (long) -1)) ) ) );\n> > \n> > ........................................................................................................................\n> > \n> > ....................................................................................................................................\n> > \n> > .......................................................................a..........\n> > \n> > a - 1506-226 (S) The \":\" operator is not allowed between \"char*\" and\n> > \"unsigned long\".\n> > gmake[2]: *** [copy.o] Error 1\n> > \n> \n> Looks like I am going to have to do another DISABLE_COMPLEX_MACROS entry\n> for that new macro, just like heap_getattr().\n> \n> -- \n> Bruce Momjian | 830 Blythe Avenue\n> [email protected] | Drexel Hill, Pennsylvania 19026\n> + If your life is a hard drive, | (610) 353-9879(w)\n> + Christ can be your backup. | (610) 853-3000(h)\n> \n> \n\n> > ( (long)(ptr) ) : ( (void)((char) 1), (((long)(ptr) + (sizeof (sh\n ^^^^^^\n\nThis was the fix. In the code it was:\n\n ((attlen) == sizeof(char)) ? \\\n ( \\\n (long)(cur_offset) \\\n ) \\\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Tue, 8 Sep 1998 11:44:22 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Macro From Hell"
},
{
"msg_contents": "\n\nBruce Momjian wrote:\n\n> This was the fix. In the code it was:\n>\n> ((attlen) == sizeof(char)) ? \\\n> ( \\\n> (long)(cur_offset) \\\n> ) \\\n>\n\nNeeds one more tweak.\n\nIn backend/commands/copy.c May I suggest at line 664:\n\n ptr = (char *)att_align(ptr, attr[i]->attlen, attr[i]->attalign)\n ^^^^^^^^\n\n",
"msg_date": "Tue, 08 Sep 1998 13:13:48 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Macro From Hell"
},
{
"msg_contents": "> \n> This is a very recent addition at line 664 of copy.c It will not\n> compile on AIX 4.1 Help!\n> \n> gmake[2]: Entering directory `/gnu/postgresql-6.4f/src/backend/commands'\n> \n> xlc -I../../include -I../../backend -qchars=signed -qmaxmem=8192\n> -qhalt=w -qsrcmsg -qcheck=divzero -I/usr/local/include -I.. -c\n> copy.c -o copy.o\n> 664 | ptr = (\n> ((attr[i]->attlen) < sizeof(int32)) ? ( ((attr[i]->attlen) == -1\n> ) ? ( ((attr[i]->attalign) == 'd') ? (((long)(ptr) + (sizeof (double) -\n> 1)) & ~(sizeof (double) -1)) : (((long)(ptr) + (sizeof (int)\n> - 1)) & ~(sizeof (int) -1)) ) : ( ((attr[i]->attlen) == sizeof(char)) ?\n> ( (ptr) ) : ( (void)((char) 1), (((long)(ptr) + (sizeof (sh\n> ort) - 1)) & ~(sizeof (short) - 1)) ) ) ) : ( ((attr[i]->attlen) ==\n> sizeof(int32)) ? ( (((long)(ptr) + (sizeof (int) - 1)) & ~(sizeo\n> f (int) -1)) ) : ( (void)((char) 1), ((attr[i]->attalign) == 'd') ?\n> (((long)(ptr) + (sizeof (double) - 1)) & ~(sizeof (double) -1))\n> : (((long)(ptr) + (sizeof (long) - 1)) & ~(sizeof (long) -1)) ) ) );\n> \n> a - 1506-226 (S) The \":\" operator is not allowed between \"char*\" and\n> \"unsigned long\".\n> gmake[2]: *** [copy.o] Error 1\n> \n\n\nThis should not compile anywhere really. The trinary operator must return one\nand only one type. That is for:\n\n (condition) ? (t_result) : (f_result)\n\nboth t_result and f_result must be of the same type.\n\n-dg\n\nDavid Gould [email protected] 510.628.3783 or 510.305.9468 \nInformix Software (No, really) 300 Lakeside Drive Oakland, CA 94612\n - If simplicity worked, the world would be overrun with insects. -\n\n",
"msg_date": "Tue, 8 Sep 1998 11:17:32 -0700 (PDT)",
"msg_from": "[email protected] (David Gould)",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Macro From Hell"
},
{
"msg_contents": "> \n> \n> Bruce Momjian wrote:\n> \n> > This was the fix. In the code it was:\n> >\n> > ((attlen) == sizeof(char)) ? \\\n> > ( \\\n> > (long)(cur_offset) \\\n> > ) \\\n> >\n> \n> Needs one more tweak.\n> \n> In backend/commands/copy.c May I suggest at line 664:\n> \n> ptr = (char *)att_align(ptr, attr[i]->attlen, attr[i]->attalign)\n\nDone.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Tue, 8 Sep 1998 18:18:40 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Macro From Hell"
}
] |
[
{
"msg_contents": "\n>Also, could someone test is HAVING without aggregates\n>disallowed or not:\n>\n>select a, min (b) from x group by a having a = 0;\n\nallowed in Informix:\n a (min)\n No rows found.\n\nAndreas\n\n",
"msg_date": "Tue, 8 Sep 1998 09:40:30 +0200",
"msg_from": "Andreas Zeugswetter <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] 6.4 Aggregate Bug and HAVING problems..."
},
{
"msg_contents": "Andreas Zeugswetter wrote:\n> \n> >Also, could someone test is HAVING without aggregates\n> >disallowed or not:\n> >\n> >select a, min (b) from x group by a having a = 0;\n> \n> allowed in Informix:\n> a (min)\n> No rows found.\n\nThanks, Andreas!\nI'll comment out some code... Actually, non-aggregate expressions\ncould be moved to WHERE, but at the moment I'll just allow them in\nHAVING.\n\nOk, there are also some problems with subselects in HAVING\nbut I haven't time to fix them now:\n\nselect a as a2, b as b2, c as c2 into table x2 from x;\nselect a, sum(b) from x group by a having avg(c) = \n\t(select max(c2) from x2 where a2 = a/2);\n-- ok\n\nselect a/2, sum(b) from x group by a/2 having avg(c) = \n\t(select max(c2) from x2 where a2 = a/2);\n-- ERROR: You must group by the attribute used from outside!\n-- this means that GroupBy func doesn't work here...\n\nselect a, sum(b) from x group by a having avg(c) = \n\t(select max(c2) from x2 where a2 = max(b));\n-- ERROR: parser: aggregates not allowed in WHERE clause\n-- Is this allowed in another dbms-es ???\n\n-- This is not problem of HAVING but subselects...\nselect a as f, sum(b) from x group by f having avg(c) = \n\t(select max(c2) from x2 where a2 = f);\n-- ERROR: attribute 'f' not found\n-- Should be aliasing handled in subselects ???\n\nVadim\n",
"msg_date": "Tue, 08 Sep 1998 16:29:10 +0800",
"msg_from": "Vadim Mikheev <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] 6.4 Aggregate Bug and HAVING problems..."
}
] |
[
{
"msg_contents": "In the constraints test, a table (primary_tbl) is defined with a primary key. \nThe table is created, shows up in the list of table using the \\dt command, but \ndoes not exist if you use the \\d command, or any SQL statement referencing the \ntable. Here is the output from the \\dt and \\d command.\n\n regression=>\\dt\n\n Database = regression\n +------------------+----------------------------------+----------+\n | Owner | Relation | Type |\n +------------------+----------------------------------+----------+\n\t\t\t\t [...]\n | postgres | path_tbl | table |\n | postgres | person | table |\n | postgres | point_tbl | table |\n | postgres | polygon_tbl | table |\n | postgres | primary_tbl | table |\n | postgres | real_city | table |\n | postgres | reltime_tbl | table |\n | postgres | road | table |\n\t\t\t\t [...]\n +------------------+----------------------------------+----------+\n regression=> \\d primary_tbl\n Couldn't find table primary_tbl!\n regression=> \\di\n\n Database = regression\n +------------------+----------------------------------+----------+\n | Owner | Relation | Type |\n +------------------+----------------------------------+----------+\n | postgres | primary_tbl_pkey | index |\n | postgres | unique_tbl_i_key | index |\n +------------------+----------------------------------+----------+\n regression=> \\d primary_tbl_pkey\n\n Table = primary_tbl_pkey\n +----------------------------------+----------------------------+-------+\n | Field | Type | Length|\n +----------------------------------+----------------------------+-------+\n | i | int4 | 4 |\n +----------------------------------+----------------------------+-------+\n regression=> \n\nThe problem seems to be restrict to the use of PRIMARY KEY, since unique_table \nworks fine.\n\nAnd here is the relavent portions from test output.\n\n QUERY: CREATE TABLE PRIMARY_TBL (i int PRIMARY KEY, t text);\n NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index\n primary_tbl_pkey for table primary_tbl\n QUERY: INSERT INTO PRIMARY_TBL VALUES (1, 'one');\n ERROR: primary_tbl: Table does not exist.\n QUERY: INSERT INTO PRIMARY_TBL VALUES (2, 'two');\n ERROR: primary_tbl: Table does not exist.\n\t\t\t [...]\n QUERY: SELECT '' AS four, * FROM PRIMARY_TBL;\n ERROR: primary_tbl: Table does not exist.\n QUERY: DROP TABLE PRIMARY_TBL;\n ERROR: Relation primary_tbl Does Not Exist!\n QUERY: CREATE TABLE PRIMARY_TBL (i int, t text, PRIMARY KEY(i,t));\n NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index\n primary_tbl_pkey for table primary_tbl\n ERROR: cannot create primary_tbl\n QUERY: INSERT INTO PRIMARY_TBL VALUES (1, 'one');\n ERROR: primary_tbl: Table does not exist.\n QUERY: INSERT INTO PRIMARY_TBL VALUES (2, 'two');\n ERROR: primary_tbl: Table does not exist.\n\t\t\t [...]\n QUERY: SELECT '' AS three, * FROM PRIMARY_TBL;\n ERROR: primary_tbl: Table does not exist.\n QUERY: DROP TABLE PRIMARY_TBL;\n ERROR: Relation primary_tbl Does Not Exist!\n\nAny help would be appreciated.\nThanks.\n-- \n____ | Billy G. Allie | Domain....: [email protected]\n| /| | 7436 Hartwell | Compuserve: 76337,2061\n|-/-|----- | Dearborn, MI 48126| MSN.......: [email protected]\n|/ |LLIE | (313) 582-1540 | \n\n\n",
"msg_date": "Tue, 08 Sep 1998 04:02:52 -0400",
"msg_from": "\"Billy G. Allie\" <[email protected]>",
"msg_from_op": true,
"msg_subject": "Problem with the constraints test and PRIMARY KEY on UnixWare 7."
},
{
"msg_contents": "> In the constraints test, a table (primary_tbl) is defined with a \n> primary key. Any help would be appreciated.\n\nUh, yeah. This isn't a \"primary key\" problem, but is the same symptom we\nhave been seeing on Linux boxes. Bruce's FreeBSD box does not exhibit\nthe problem.\n\nIt seems to involve a trashed index on the pg_class table. Do you also\nsee a failure in the create_index regression test? afaik the problem\ntrying to add a second index to the \"onek\" table is also index-related.\nCheck the mhonarc archive for the full history, but we are still trying\nto get a handle on it and would welcome any help.\n\nThere also is a problem with views/rules on the Linux boxes (at least,\nsome problems clearly span multiple platforms but no problems appear on\nall platforms); do you see a failure when doing \"select * from pg_user\"\non a clean installation?\n\n - Tom\n",
"msg_date": "Tue, 08 Sep 1998 14:30:13 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Problem with the constraints test and PRIMARY KEY on\n\tUnixWare 7."
},
{
"msg_contents": "This is the same problem as that has been pestering me for two weeks.\n\nBilly, please try this simple test:\n\nCREATE TABLE foo (bar int);\n\n\\d foo\n\nCREATE INDEX foo_idx ON foo USING btree (bar);\n\n\\d foo\n\nIs foo gone?\n\n\nBilly G. Allie wrote:\n\n> In the constraints test, a table (primary_tbl) is defined with a primary key.\n> The table is created, shows up in the list of table using the \\dt command, but\n> does not exist if you use the \\d command, or any SQL statement referencing the\n> table. Here is the output from the \\dt and \\d command.\n>\n> regression=>\\dt\n>\n> Database = regression\n> +------------------+----------------------------------+----------+\n> | Owner | Relation | Type |\n> +------------------+----------------------------------+----------+\n> [...]\n> | postgres | path_tbl | table |\n> | postgres | person | table |\n> | postgres | point_tbl | table |\n> | postgres | polygon_tbl | table |\n> | postgres | primary_tbl | table |\n> | postgres | real_city | table |\n> | postgres | reltime_tbl | table |\n> | postgres | road | table |\n> [...]\n> +------------------+----------------------------------+----------+\n> regression=> \\d primary_tbl\n> Couldn't find table primary_tbl!\n> regression=> \\di\n>\n> Database = regression\n> +------------------+----------------------------------+----------+\n> | Owner | Relation | Type |\n> +------------------+----------------------------------+----------+\n> | postgres | primary_tbl_pkey | index |\n> | postgres | unique_tbl_i_key | index |\n> +------------------+----------------------------------+----------+\n> regression=> \\d primary_tbl_pkey\n>\n> Table = primary_tbl_pkey\n> +----------------------------------+----------------------------+-------+\n> | Field | Type | Length|\n> +----------------------------------+----------------------------+-------+\n> | i | int4 | 4 |\n> +----------------------------------+----------------------------+-------+\n> regression=>\n>\n> The problem seems to be restrict to the use of PRIMARY KEY, since unique_table\n> works fine.\n>\n> And here is the relavent portions from test output.\n>\n> QUERY: CREATE TABLE PRIMARY_TBL (i int PRIMARY KEY, t text);\n> NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index\n> primary_tbl_pkey for table primary_tbl\n> QUERY: INSERT INTO PRIMARY_TBL VALUES (1, 'one');\n> ERROR: primary_tbl: Table does not exist.\n> QUERY: INSERT INTO PRIMARY_TBL VALUES (2, 'two');\n> ERROR: primary_tbl: Table does not exist.\n> [...]\n> QUERY: SELECT '' AS four, * FROM PRIMARY_TBL;\n> ERROR: primary_tbl: Table does not exist.\n> QUERY: DROP TABLE PRIMARY_TBL;\n> ERROR: Relation primary_tbl Does Not Exist!\n> QUERY: CREATE TABLE PRIMARY_TBL (i int, t text, PRIMARY KEY(i,t));\n> NOTICE: CREATE TABLE/PRIMARY KEY will create implicit index\n> primary_tbl_pkey for table primary_tbl\n> ERROR: cannot create primary_tbl\n> QUERY: INSERT INTO PRIMARY_TBL VALUES (1, 'one');\n> ERROR: primary_tbl: Table does not exist.\n> QUERY: INSERT INTO PRIMARY_TBL VALUES (2, 'two');\n> ERROR: primary_tbl: Table does not exist.\n> [...]\n> QUERY: SELECT '' AS three, * FROM PRIMARY_TBL;\n> ERROR: primary_tbl: Table does not exist.\n> QUERY: DROP TABLE PRIMARY_TBL;\n> ERROR: Relation primary_tbl Does Not Exist!\n>\n> Any help would be appreciated.\n> Thanks.\n> --\n> ____ | Billy G. Allie | Domain....: [email protected]\n> | /| | 7436 Hartwell | Compuserve: 76337,2061\n> |-/-|----- | Dearborn, MI 48126| MSN.......: [email protected]\n> |/ |LLIE | (313) 582-1540 |\n\n\n\n",
"msg_date": "Tue, 08 Sep 1998 10:41:54 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Problem with the constraints test and PRIMARY KEY on\n\tUnixWare 7."
},
{
"msg_contents": "> This is the same problem as that has been pestering me for two weeks.\n\nJust a reminder: you aren't the only one :/\n\n> Billy, please try this simple test:\n> CREATE TABLE foo (bar int);\n> \\d foo\n> CREATE INDEX foo_idx ON foo USING btree (bar);\n> \\d foo\n> Is foo gone?\n\nDepending on the outcome, you will fall into one of three camps wrt\nindexing problems:\n1) no problem, no matter what test you run (Bruce and FreeBSD)\n2) problems at some level, but needing a slightly more complicated\n sequence of commands to get there (Tom, Tatsuo, and Linux, etc.)\n3) problems with a very simple sequence of commands (David and AIX)\n\nAssuming that these all stem from a single underlying problem, then it\nseems that David's machine would have the fast-track on finding it,\nsince he can provoke symptoms so easily. Unfortunately, none of those\naffected with the problem are familiar with the areas of code which are\nproblematic.\n\nDoes anyone else see the problem at David's level? Does anyone see these\nproblems on anything other than Linux and Unixware? Does anyone see no\nproblems on anything other than FreeBSD?\n\nThere is another problem in the code wrt views and rules and freeing\nmemory after a query. I'm starting to look at that one, figuring that it\nwill be easier to track down and will reduce the number of problems we\nare trying to fight at one time.\n\n - Tom\n",
"msg_date": "Tue, 08 Sep 1998 16:44:02 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Problem with the constraints test and PRIMARY KEY on\n\tUnixWare 7."
},
{
"msg_contents": "\n\nThomas G. Lockhart wrote:\n\n> > This is the same problem as that has been pestering me for two weeks.\n>\n> Just a reminder: you aren't the only one :/\n>\n> > Billy, please try this simple test:\n> > CREATE TABLE foo (bar int);\n> > \\d foo\n> > CREATE INDEX foo_idx ON foo USING btree (bar);\n> > \\d foo\n> > Is foo gone?\n>\n> Depending on the outcome, you will fall into one of three camps wrt\n> indexing problems:\n> 1) no problem, no matter what test you run (Bruce and FreeBSD)\n> 2) problems at some level, but needing a slightly more complicated\n> sequence of commands to get there (Tom, Tatsuo, and Linux, etc.)\n> 3) problems with a very simple sequence of commands (David and AIX)\n>\n> Assuming that these all stem from a single underlying problem, then it\n> seems that David's machine would have the fast-track on finding it,\n> since he can provoke symptoms so easily. Unfortunately, none of those\n> affected with the problem are familiar with the areas of code which are\n> problematic.\n>\n> Does anyone else see the problem at David's level? Does anyone see these\n> problems on anything other than Linux and Unixware? Does anyone see no\n> problems on anything other than FreeBSD?\n>\n> There is another problem in the code wrt views and rules and freeing\n> memory after a query. I'm starting to look at that one, figuring that it\n> will be easier to track down and will reduce the number of problems we\n> are trying to fight at one time.\n>\n> - Tom\n\n\n\n",
"msg_date": "Tue, 08 Sep 1998 13:32:20 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Problem with the constraints test and PRIMARY KEY on\n\tUnixWare 7."
},
{
"msg_contents": "David Hartwig wrote:\n> \n> This is the same problem as that has been pestering me for two weeks.\n> \n> Billy, please try this simple test:\n> \n> CREATE TABLE foo (bar int);\n> \n> \\d foo\n> \n> CREATE INDEX foo_idx ON foo USING btree (bar);\n> \n> \\d foo\n> \n> Is foo gone?\n\nPlease apply this patch...\n\nVadim",
"msg_date": "Wed, 09 Sep 1998 11:21:05 +0800",
"msg_from": "Vadim Mikheev <[email protected]>",
"msg_from_op": false,
"msg_subject": "Indixing problems..."
},
{
"msg_contents": ">David Hartwig wrote:\n>> \n>> This is the same problem as that has been pestering me for two weeks.\n>> \n>> Billy, please try this simple test:\n>> \n>> CREATE TABLE foo (bar int);\n>> \n>> \\d foo\n>> \n>> CREATE INDEX foo_idx ON foo USING btree (bar);\n>> \n>> \\d foo\n>> \n>> Is foo gone?\n>\n>Please apply this patch...\n>\n>Vadim\n\nThanks so much. Now index problems have gone from my LinuxPPC box!\n\nOnly remaining problem seems somewhat related to view. Still the\nselect_views test and \"select * from pg_user\" produces core dumps.\n--\nTatuso Ishii\[email protected]\n",
"msg_date": "Wed, 09 Sep 1998 13:05:46 +0900",
"msg_from": "Tatsuo Ishii <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Indixing problems... "
},
{
"msg_contents": "> David Hartwig wrote:\n> > \n> > This is the same problem as that has been pestering me for two weeks.\n> > \n> > Billy, please try this simple test:\n> > \n> > CREATE TABLE foo (bar int);\n> > \n> > \\d foo\n> > \n> > CREATE INDEX foo_idx ON foo USING btree (bar);\n> > \n> > \\d foo\n> > \n> > Is foo gone?\n> \n> Please apply this patch...\n> \n> Vadim\n\n> *** src/backend/catalog/index.c.orig\tWed Sep 9 11:14:40 1998\n> --- src/backend/catalog/index.c\tWed Sep 9 11:15:50 1998\n> ***************\n> *** 1424,1433 ****\n> \n> \t\tnewtup = heap_modifytuple(tuple, pg_class, values, nulls, replace);\n> \t\theap_replace(pg_class, &tuple->t_ctid, newtup);\n> - \t\tpfree(newtup);\n> \t\tCatalogOpenIndices(Num_pg_class_indices, Name_pg_class_indices, idescs);\n> \t\tCatalogIndexInsert(idescs, Num_pg_class_indices, pg_class, newtup);\n> \t\tCatalogCloseIndices(Num_pg_class_indices, idescs);\n> \t}\n> \n> \tif (!IsBootstrapProcessingMode())\n> --- 1424,1433 ----\n> \n> \t\tnewtup = heap_modifytuple(tuple, pg_class, values, nulls, replace);\n> \t\theap_replace(pg_class, &tuple->t_ctid, newtup);\n> \t\tCatalogOpenIndices(Num_pg_class_indices, Name_pg_class_indices, idescs);\n> \t\tCatalogIndexInsert(idescs, Num_pg_class_indices, pg_class, newtup);\n> \t\tCatalogCloseIndices(Num_pg_class_indices, idescs);\n> + \t\tpfree(newtup);\n> \t}\n> \n> \tif (!IsBootstrapProcessingMode())\n\nWow, this is GREAT. Vadim saves me AGAIN.\n\nI did write this code as part of the megpatch, because tuple allocations\nwhere not being properly de-allocated.\n\nThis clearly is a bug, and hopefully it will be the fix I have been\nlooking for. I was supposed to get on David Hartwig's AIX machine\ntomorrow, so if this fixes all our problems, we can move on to more\nproductive items.\n\nAgain, sorry to have introduced this bug into the code, and thanks again\nto Vadim for finding it.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Wed, 9 Sep 1998 00:25:30 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Indixing problems..."
},
{
"msg_contents": "> Thanks so much. Now index problems have gone from my LinuxPPC box!\n\nWhoo hoo! Thanks Vadim! Indices are much happier on my Linux box also :)\n\n> Only remaining problem seems somewhat related to view. Still the\n> select_views test and \"select * from pg_user\" produces core dumps.\n\nSadly, that is still true also. As I mentioned earlier, the actual\nsegfault happens when memory is free'd toward the end of a query. But of\ncourse there is some problem earlier when the memory was allocated...\n\nThis is probably unrelated, but is it expected that the system views\nhave rule names prefixed with \"_ret\" whereas a view I create myself has\na name prefixed with \"_RET\"? Should initdb surround some of these names\nin double quotes while it is doing its brute-force shadowing?\n\n - Tom\n",
"msg_date": "Wed, 09 Sep 1998 06:07:52 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Indixing problems..."
},
{
"msg_contents": "Tatsuo Ishii wrote:\n> \n> \n> Only remaining problem seems somewhat related to view. Still the\n> select_views test and \"select * from pg_user\" produces core dumps.\n ^^^^^^^^^^^^^^^^^^^^^\nAfter some users were added or just after initdb ?\n\nUnfortunately, I still can't compile PG on SPARC/Solaris 2.5.1\nand so have only FreeBSD for testing.\n\nVadim\n",
"msg_date": "Wed, 09 Sep 1998 14:13:27 +0800",
"msg_from": "Vadim Mikheev <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Indixing problems..."
},
{
"msg_contents": "Thomas G. Lockhart wrote:\n> \n> > Only remaining problem seems somewhat related to view. Still the\n> > select_views test and \"select * from pg_user\" produces core dumps.\n> \n> Sadly, that is still true also. As I mentioned earlier, the actual\n> segfault happens when memory is free'd toward the end of a query. But of\n> course there is some problem earlier when the memory was allocated...\n\nCould you post gdb' bt output ?\n\nVadim\n",
"msg_date": "Wed, 09 Sep 1998 14:16:47 +0800",
"msg_from": "Vadim Mikheev <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Indixing problems..."
},
{
"msg_contents": ">> Only remaining problem seems somewhat related to view. Still the\n>> select_views test and \"select * from pg_user\" produces core dumps.\n> ^^^^^^^^^^^^^^^^^^^^^\n>After some users were added or just after initdb ?\n\nJust after initdb. Here is a backtrace info.\n\nPOSTGRES backend interactive interface\n$Revision: 1.89 $ $Date: 1998/09/01 04:32:13 $\n> select * from pg_user;\nblank\n\t 1: usename\t(typeid = 19, len = 32, typmod = -1, byval = f)\n\t 2: usesysid\t(typeid = 23, len = 4, typmod = -1, byval = t)\n\t 3: usecreatedb\t(typeid = 16, len = 1, typmod = -1, byval = t)\n\t 4: usetrace\t(typeid = 16, len = 1, typmod = -1, byval = t)\n\t 5: usesuper\t(typeid = 16, len = 1, typmod = -1, byval = t)\n\t 6: usecatupd\t(typeid = 16, len = 1, typmod = -1, byval = t)\n\t 7: passwd\t(typeid = 25, len = -1, typmod = -1, byval = f)\n\t 8: valuntil\t(typeid = 702, len = 4, typmod = -1, byval = t)\n\t----\n\t 1: usename = \"t-ishii\"\t(typeid = 19, len = 32, typmod = -1, byval = f)\n\t 2: usesysid = \"1739\"\t(typeid = 23, len = 4, typmod = -1, byval = t)\n\t 3: usecreatedb = \"t\"\t(typeid = 16, len = 1, typmod = -1, byval = t)\n\t 4: usetrace = \"t\"\t(typeid = 16, len = 1, typmod = -1, byval = t)\n\t 5: usesuper = \"t\"\t(typeid = 16, len = 1, typmod = -1, byval = t)\n\t 6: usecatupd = \"t\"\t(typeid = 16, len = 1, typmod = -1, byval = t)\n\t 7: passwd = \"********\"\t(typeid = 25, len = -1, typmod = -1, byval = f)\n\t 8: valuntil = \"Sat Jan 31 15:00:00 2037 JST\"\t(typeid = 702, len = 4, typmod = -1, byval = t)\n\t----\n\nProgram received signal SIGSEGV, Segmentation fault.\n0x2ae3b32c in chunk_free ()\n(gdb) where\n#0 0x2ae3b32c in chunk_free ()\n#1 0x2ae3b1e8 in cfree ()\n#2 0x18f2f10 in AllocSetFree (set=0x2aeca454, pointer=0x1a093c0 \"\")\n at aset.c:222\n#3 0x18f2e14 in AllocSetReset (set=0x19f8700) at aset.c:132\n#4 0x18f436c in EndPortalAllocMode () at portalmem.c:920\n#5 0x1836a44 in AtCommit_Memory () at xact.c:696\n#6 0x1836c60 in CommitTransaction () at xact.c:911\n#7 0x1836ec8 in CommitTransactionCommand () at xact.c:1137\n#8 0x18bfd70 in PostgresMain (argc=2, argv=0x1920000, real_argc=2, \n real_argv=0x7ffff8b4) at postgres.c:1645\n#9 0x186ca08 in main (argc=0, argv=0x19f8700) at main.c:103\n#10 0x1818228 in _start ()\n--\nTatsuo Ishii\[email protected]\n",
"msg_date": "Wed, 09 Sep 1998 15:41:18 +0900",
"msg_from": "Tatsuo Ishii <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Indixing problems... "
},
{
"msg_contents": "Life is good once more. :-)\n\nThanks Vadim\n\nVadim Mikheev wrote:\n\n> Please apply this patch...\n>\n> Vadim\n\n\n\n",
"msg_date": "Wed, 09 Sep 1998 08:46:28 -0400",
"msg_from": "David Hartwig <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Indixing problems..."
},
{
"msg_contents": "\"Thomas G. Lockhart\" <[email protected]> writes:\n> Sadly, that is still true also. As I mentioned earlier, the actual\n> segfault happens when memory is free'd toward the end of a query. But of\n> course there is some problem earlier when the memory was allocated...\n\nHas anyone tried building the backend with a debugging malloc library?\n\ndbmalloc, or Electric Fence, or Purify would probably help smoke out\nany remaining coding errors of this kind (using already-freed space,\nwriting past the end of a malloc'd block, etc).\n\nPurify is a commercial product, but the other two are freeware and\nshouldn't be hard to find on the net.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Wed, 09 Sep 1998 10:14:08 -0400",
"msg_from": "Tom Lane <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Indixing problems... "
},
{
"msg_contents": "> Has anyone tried building the backend with a debugging malloc library?\n\nThis has been done in the past by a couple of people who had access to\nPurify. I recall that it helped find several problems, but also\ngenerated quite a few spurious messages because of the way we\nallocate/deallocate blocks of memory during queries.\n\nOur current best debugging technique is for a bunch of us to get all in\na froth about a problem until Vadim gets fed up with our flailing around\nand fixes it himself ;-)\n\nThanks again Vadim!\n\n - Tom\n",
"msg_date": "Wed, 09 Sep 1998 15:10:28 +0000",
"msg_from": "\"Thomas G. Lockhart\" <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Indixing problems..."
},
{
"msg_contents": "> \"Thomas G. Lockhart\" <[email protected]> writes:\n> > Sadly, that is still true also. As I mentioned earlier, the actual\n> > segfault happens when memory is free'd toward the end of a query. But of\n> > course there is some problem earlier when the memory was allocated...\n> \n> Has anyone tried building the backend with a debugging malloc library?\n> \n> dbmalloc, or Electric Fence, or Purify would probably help smoke out\n> any remaining coding errors of this kind (using already-freed space,\n> writing past the end of a malloc'd block, etc).\n> \n> Purify is a commercial product, but the other two are freeware and\n> shouldn't be hard to find on the net.\n\nGood suggestion.\n\nWe did have someone use Purify six months ago, and he came up with some\nnice stuff. Electic Fence is good for over-runs and using already\nfree'ed memory, and was thinking of trying that here, but the idea that\nthis is was some type of alignment problem had me moving in another\ndirection.\n\n\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Wed, 9 Sep 1998 14:07:57 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Indixing problems..."
},
{
"msg_contents": "> > Has anyone tried building the backend with a debugging malloc library?\n> \n> This has been done in the past by a couple of people who had access to\n> Purify. I recall that it helped find several problems, but also\n> generated quite a few spurious messages because of the way we\n> allocate/deallocate blocks of memory during queries.\n> \n> Our current best debugging technique is for a bunch of us to get all in\n> a froth about a problem until Vadim gets fed up with our flailing around\n> and fixes it himself ;-)\n\nExcellent description.\n\n-- \nBruce Momjian | 830 Blythe Avenue\[email protected] | Drexel Hill, Pennsylvania 19026\n + If your life is a hard drive, | (610) 353-9879(w)\n + Christ can be your backup. | (610) 853-3000(h)\n",
"msg_date": "Wed, 9 Sep 1998 14:08:55 -0400 (EDT)",
"msg_from": "Bruce Momjian <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Indixing problems..."
},
{
"msg_contents": "Tatuso Ishii <[email protected]> wrote:\n> >Vadim\n> \n> Thanks so much. Now index problems have gone from my LinuxPPC box!\n> \n> Only remaining problem seems somewhat related to view. Still the\n> select_views test and \"select * from pg_user\" produces core dumps.\n\nHere, here...\n\nMany thanks Vadim!\n\nOn the \"select * from pg_user\" problem: UnixWare 7 does not have the problem.\n\n-- \n____ | Billy G. Allie | Domain....: [email protected]\n| /| | 7436 Hartwell | Compuserve: 76337,2061\n|-/-|----- | Dearborn, MI 48126| MSN.......: [email protected]\n|/ |LLIE | (313) 582-1540 | \n\n\n",
"msg_date": "Thu, 10 Sep 1998 00:42:44 -0400",
"msg_from": "\"Billy G. Allie\" <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] Indixing problems... "
},
{
"msg_contents": "Thomas G. Lockhart wrote:\n> \n> > Has anyone tried building the backend with a debugging malloc library?\n> \n> This has been done in the past by a couple of people who had access to\n> Purify. I recall that it helped find several problems, but also\n> generated quite a few spurious messages because of the way we\n> allocate/deallocate blocks of memory during queries.\n> \n> Our current best debugging technique is for a bunch of us to get all in\n> a froth about a problem until Vadim gets fed up with our flailing around\n> and fixes it himself ;-)\n\nThanks, Tom -:))\n\nBut it seems that Purify (etc) would be very usefull\nin pg_user bug. (Imho, Purify could also help with\nindexing bug!)\n\nI finally compiled 6.4-current on SPARC/Solaris 2.5.1\n(gcc 2.7.2.1) but unfortunately I can't reproduce\npg_user bug here -:(\n\nSo, I would like to switch to primary/foreign/unique key\ninfos...\n\nVadim\n",
"msg_date": "Thu, 10 Sep 1998 14:29:08 +0800",
"msg_from": "Vadim Mikheev <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] Indixing problems..."
}
] |
[
{
"msg_contents": "Hi David!\n\nOn Mon, 07 Sep 1998 17:48:52 -0400, David Hartwig wrote:\n\n>> >> Please help, because I would need a running system tomorrow :-( (For the moment it will do it without delete, but not for ever).\n>> >>\n>> >\n>> >It is difficult for me to figure out what your problem is. What we need is a reproducible sequence of events leading up to the \ncrash.\n>>\n>> Well, no problem :-) I can reproduce the crash. With or without the ODBC-Driver.\n>>\n>> >If you can reproduce the crash through the psql monitor, then we should work with that. No sense in adding an extra layer of \ncomplexity by working through the ODBC\n>> driver.\n>> >\n>> >The same goes for the junkfilter patch. The errors as you describe, do not point to the junkfilter patch. Admittedly, it is \npossible. See if the problem can be reproduced\n>> without the junkfilter.\n>>\n>> Ok, once again.\n>>\n>> I've installed postgresql 6.3.2 with all patches from ftp.postgresql.org/pub/patches. It worked great, but I could not use the \nODBC-Driver for stuff like order by and group by\n>> (this is the bug where the junkfilter is a workaround, i think).\n>\n>Correct. You may want to make sure you have the latest Jet Engine from M$. \n>That are serious bugs in older versions. See our FAQ at\nI've got 3.5, as far as I remember (downloaded from MS some days ago).\n\n>http://www.insightdist.com/psqlodbc This will not solve our current problem.\n\nThats right :-(\n\n>> Therefore I installed the junkfilter, compiled again, and now I was able to order/group over the ODBC-Driver.\n>> At this time I was happy :-), but than I wanted to make a destroyuser and the backend crashed. I thought it was the \ndestroyuser-script, but then I tryed to make a simple\n>> 'delete from test;' and this crashed the backend, too :-(.\n>> A few minutes ago we found out that triggers wont work, too.\n>> Ok, I hoped it was another patch that does not like the junkfilter and I tryed to recompile a completly new version (only with the \njunkfilter applied). The same error occured.\n>\n>Hmm... Something is not right here. I have not problem on either AIX or Caldera Linux and I know others are using the patch \nwithout any problems. I doubt if I are going to be\n>able to resolve this soon. I am juggling too many things right now. Our best bet may be to wait until 6.4\n\nI other words, I should try the snapshot every day or connect me to the cvs and hope for a working system... :-@\n\n>> I hope you can help me, because the only thing I could try is to get another linux-distribution and try it with eg redhat (at the \nmoment I use SuSE).\n>\n>I am not a Linux guru. So I don't have a clue a to weather this is an issue.\n\nMaybe someone could send me his working binarys to determine if it is a compiler problem, or a 'distribution' problem. It might be an \nold lib or something like this?!\n\n>> PS: Sorry for my bad english...\n>\n>It way better that my second language.\nThanks.\n\nBest regards,\nGerald Fischer\n\n",
"msg_date": "Tue, 08 Sep 1998 10:07:05 +0000",
"msg_from": "\"Gerald Fischer\" <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [INTERFACES] Re: DELETE FROM TABLE doesn't work (AGAIN)"
}
] |
[
{
"msg_contents": "Dear pgsql-hackers :\n\nIt was a good opportunity to know you and PostgreSQL\nthrough Internet. As we are researching on various kinds of DBMS, we\nfind it valuable to use for our new R&D project.\n\nFirst of all, I would like to introduce myself to you. I work for Cheil\ncomputer & communications, Inc., in Korea, which is one of sister\ncompanies of Cheiljedang Group. and Our mother company is the largest\nFood processing firm in Korea, separating from Samsung Group in 1996.\nOur company is a specialist in System Integration, VAN, Internet,\nMultimedia, Distribution and Logistics and so on.\nI'm in R&D Center as a software engineer.\n\nNowadays, I'm studying on PostgreSQL and it's migration into windowsNT.\nThe purpose of the study is for the new\napplication development and the examination of possibilities to apply\nthe PostgreSQL as DBMS on it.\n\nI'd like to check and find the way of using PostgreSQL for the new\nresearch item in the R&D Center.\n\nI would appreciate you if you give some information to me. The most\nimportant matters we want to know are as follows,\n 1. When the migration is proceeding, what kinds of the problems will\n\nhappen resulting from difference between Linux(Unix) and WindowsNT.\n 2. Is it possible ?(I think, it is possible because the most source\nwas written with ANSI-C. what about you ?)\n 3. Finally, how long it will take to complete it ?.\n\nWe have the many solutions such as search engine based on Natural\nlanguage, push technology, Intranet design and implementation , etc.\nWe are planing to use the PostgreSQL as the DBMS engine with IT fields\nmentioned above .\n\nAnyway, This will be a good chance for me and company to study on\nPostgreSQL and make useful IT solutions in use with it.\nThank for your assistance in advance.\nI'm looking forward to hearing from you soon.\n\n\nSincerely yours,\n\nGeo\n\n\n\n\n",
"msg_date": "Wed, 09 Sep 1998 15:09:29 +0900",
"msg_from": "geo <[email protected]>",
"msg_from_op": true,
"msg_subject": "Would you let me know how ?"
}
] |
[
{
"msg_contents": "It works! I can run perftest without having to keep an unaccessible index.\n\nI do have some problems with heap_delete though:\n\nsql error Error: ERROR: heap_delete: (am)invalid tid\n line 120.\nsql error Error: ERROR: heap_delete: (am)invalid tid\n line 120.\nsql error Error: ERROR: heap_delete: (am)invalid tid\n line 120.\n\nWhat does this mean? BTW line 120 is exec sql drop table perftest1;\n\nInterestingly enough I can drop both tables from psql afterwards.\n\nMichael\n-- \nMichael Meskes\t\t\[email protected], [email protected]\nGo SF49ers! Go Rhein Fire!\tUse Debian GNU/Linux! \n",
"msg_date": "Wed, 9 Sep 1998 08:52:50 +0200",
"msg_from": "Michael Meskes <[email protected]>",
"msg_from_op": true,
"msg_subject": "inx problem fixe"
}
] |
[
{
"msg_contents": ">\n>Theory: Could it be that the index is ok, but that pg_class is corrupted. This\n>is based on the earlier observation that shows the most recent inserts and\n>updated no being appended to the end of the table.\n\nNo, I don't think so, when a table gets \"lost\" there are more entries in the 2 indices\nthan in the pg_class table itself. If I do a vacuum analyze it sais 167 entries in pg_class\n200 entries in pg_class_relname_index and pg_class_oid_index.\n\nAndreas\n\n\n",
"msg_date": "Wed, 9 Sep 1998 09:13:52 +0200",
"msg_from": "Andreas Zeugswetter <[email protected]>",
"msg_from_op": true,
"msg_subject": "AW: [HACKERS] index fix report"
}
] |
[
{
"msg_contents": "Vadim wrote:\n> Please apply this patch...\n\nand guess what ? Yes, it ist true !\ncreate_index .. ok\n\non AIX 4.2.1\n\nVadim you are again a hero\n\nAndreas\n\n\n\n",
"msg_date": "Wed, 9 Sep 1998 09:27:53 +0200",
"msg_from": "Andreas Zeugswetter <[email protected]>",
"msg_from_op": true,
"msg_subject": "Re: [HACKERS] Indixing problems..."
}
] |
[
{
"msg_contents": "Hi,\n\nthe libpq-function PQfsize() now returns\nint instead of short. It looks like, that\nthis needs some adaption in the backend, \nbecause now the size of a variable length\nfield is returned as 65535 instead of -1.\n\nEdmund\n-- \nEdmund Mergl mailto:[email protected]\nIm Haldenhau 9 http://www.bawue.de/~mergl\n70565 Stuttgart fon: +49 711 747503\nGermany\n",
"msg_date": "Wed, 09 Sep 1998 16:07:05 +0300",
"msg_from": "Edmund Mergl <[email protected]>",
"msg_from_op": true,
"msg_subject": "new return value of PQfsize"
},
{
"msg_contents": "Edmund Mergl <[email protected]> writes:\n> the libpq-function PQfsize() now returns int instead of\n> short. It looks like, that this needs some adaption in the\n> backend, because now the size of a variable length field is\n> returned as 65535 instead of -1.\n\nOops. That's libpq's bug, not the backend's.\n\nI thought that the rearrangement of libpq's interface\nwould be a good time to hide the fact that field sizes are\ncurrently restricted to short --- which was visible in the\nreturn type of PQfsize, and nowhere else in libpq's API.\n\nBut I guess I forgot to ensure that sign extension would happen\ncorrectly :-(. Will fix.\n\n\t\t\tregards, tom lane\n",
"msg_date": "Wed, 09 Sep 1998 10:05:42 -0400",
"msg_from": "Tom Lane <[email protected]>",
"msg_from_op": false,
"msg_subject": "Re: [HACKERS] new return value of PQfsize "
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.