threads
listlengths
1
2.99k
[ { "msg_contents": "> \n> ------------------------------------------------------------------------\n> \n> Unable to create tables...\n> \n> ------------------------------------------------------------------------\n> \n> * From: Don Baccus <[email protected]>\n> * To: Postgres Hackers List <[email protected]>\n> * Subject: Unable to create tables...\n> * Date: Fri, 06 Aug 1999 09:42:28 -0700\n> \n> ------------------------------------------------------------------------\n> \n> I mentioned this earlier in the context of pg_dump, which fails\n> trying to create the table \"pgdump_oid\".\n> \n> After a bit, a memory jog reminded me that I've seen this\n> before, with the table \"foo\", which I once used for testing.\n> \n> After a fair number of \"create/drop\" cycles, making then\n> dropping tables for testing, pgsql now refuses to let me\n> \"create table foo...\", giving the same simple error message\n> \"can't create foo\" as pg_dump's getting on pgdump_oid.\n> \n> I can't \"drop table foo\", getting an error message telling\n> me the class doesn't exist, so that's not the problem.\n> \n> I CAN create/drop other tables, i.e. \"create table bar...\"\n> followed by \"drop table bar\" works fine.\n> \n> So it doesn't appear to be a general permissions problem,\n> i.e. it's not as though the system thinks I don't have\n> create table rights.\n> \n> It would seem as some system table is being corrupted???\n> \n> Does this sound at all familiar?\n> \n> Unfortunately, I don't know how to reproduce this other\n> than create/drop tables until eventually it fails. As\n> I mentioned in my first note, pg_dump has been running\n> nightly on this database for weeks, at least, with no\n> errors reported. Suddenly - poof! can't create pgdump_oid.\n> \n> - Don Baccus, Portland OR <[email protected]>\n> Nature photos, on-line guides, Pacific Northwest\n> Rare Bird Alert Service and other goodies at\n> http://donb.photo.net.\n> \n\nWell, this is a very old post, but I may have part of an answer.\n\nI'm using 6.5.3 on linux (redhat 6.0).\n\nI had a similar or identical problem. I could not dump a table with\noids. The error message was something like \"cannot create table -\nrelation pgdump_oid already exists.\n\nBut looking at the system table showed that it was nowhere to be found.\nAnd since it couldn't be found, when I tried to drop it, it told me it\ndid not exist.\n\nSo i vacuumed (even though it's done nightly).\n\nI found errors like:\n\nNOTICE: Index pg_class_relname_index: NUMBER OF INDEX' TUPLES (84) IS\nNOT THE SAME AS HEAP' (83)\nNOTICE: Index pg_class_oid_index: NUMBER OF INDEX' TUPLES (84) IS NOT\nTHE SAME AS HEAP' (83)\nVACUUM\n\n\nThere were 4 the first time i vacuumed, but subsequent vacuums showed\nonly these 2.\n\nSo I tried dropping and rebuilding the indexes - can't do that for\nsystem indexes.\n\nI was about to give up and post for help. But on a lark, I tried to\ndump pgdump_oid again. This time it worked.\n\nHopefully this is a rare problem. And I don't know if this will work in\nall situations where the above symtoms are found. But it worked for me,\nso I thought I'd post it in case anyone else search the archives for\nadvice on this sort of problem.\n\n-- \nKarl DeBisschop <[email protected]>\n617.832.0332 (Fax: 617.956.2696)\n\nInformation Please - your source for FREE online reference\nhttp://www.infoplease.com - Your Ultimate Fact Finder\nhttp://kids.infoplease.com - The Great Homework Helper\n\nNetsaint Plugins Development\nhttp://netsaintplug.sourceforge.net\n", "msg_date": "Fri, 21 Jan 2000 13:09:00 -0500", "msg_from": "Karl DeBisschop <[email protected]>", "msg_from_op": true, "msg_subject": "RE: Unable to create tables... " } ]
[ { "msg_contents": "\"gary.wolfe\" <[email protected]> writes:\n> Are there any disadvantages to having KSQO='on' instead\n> of the default value of \"OFF\"\n\nOther than it being a kluge, you mean ;-) ?\n\nBasically it rewrites queries with long strings of ORs into SELECT UNION\nSELECT queries, which the optimizer can cope with a little better.\nUnfortunately the semantics aren't really quite the same, since UNION\nimplies a DISTINCT pass over the output --- the UNION form will never\nemit two identical rows, whereas the original query would have if there\nwere identical input rows.\n\nI'm hoping to get rid of KSQO soon by upgrading the optimizer to\nthe point where it doesn't choke on big ORs. In the meantime, though,\nyou really don't have much choice if your application requires queries\nwith lots of ORs.\n\n\t\t\tregards, tom lane\n", "msg_date": "Fri, 21 Jan 2000 14:03:15 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: set command " } ]
[ { "msg_contents": "Is there a way to use the max aggregate on an oid field? When I try on\n6.5.3, I get the following error message:\n\ntest=> select max(uid) from user_base;\nERROR: Unable to select an aggregate function max(oid)\n\nIf there's any work-around, please let me know.\nMarc\n\n", "msg_date": "Fri, 21 Jan 2000 23:10:46 +0000 (GMT)", "msg_from": "Marc Tardif <[email protected]>", "msg_from_op": true, "msg_subject": "max(oid)" }, { "msg_contents": "> Is there a way to use the max aggregate on an oid field? When I try on\n> 6.5.3, I get the following error message:\n> \n> test=> select max(uid) from user_base;\n> ERROR: Unable to select an aggregate function max(oid)\n> \n> If there's any work-around, please let me know.\n> Marc\n> \n\nAdded to TODO:\n\n\t* allow aggregates on oid\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, 21 Jan 2000 23:29:09 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [GENERAL] max(oid)" }, { "msg_contents": "On 2000-01-21, Bruce Momjian mentioned:\n\n> > Is there a way to use the max aggregate on an oid field? When I try on\n> > 6.5.3, I get the following error message:\n> > \n> > test=> select max(uid) from user_base;\n> > ERROR: Unable to select an aggregate function max(oid)\n> > \n> > If there's any work-around, please let me know.\n> > Marc\n> > \n> \n> Added to TODO:\n> \n> \t* allow aggregates on oid\n\nWe already had a TODO item for this and came to the conclusion that\n* Make type equivalency apply to aggregates\nwill solve this.\n\nFor right now the user could do the following:\n\nINSERT INTO pg_aggregate VALUES ('max', <your user id>, 'int4larger', '-',\n'-', 26, 26, 0, 26, NULL, NULL);\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n\n", "msg_date": "Sun, 23 Jan 2000 02:28:59 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [GENERAL] max(oid)" }, { "msg_contents": "Got it. TODO updated.\n\n[Charset ISO-8859-1 unsupported, filtering to ASCII...]\n> On 2000-01-21, Bruce Momjian mentioned:\n> \n> > > Is there a way to use the max aggregate on an oid field? When I try on\n> > > 6.5.3, I get the following error message:\n> > > \n> > > test=> select max(uid) from user_base;\n> > > ERROR: Unable to select an aggregate function max(oid)\n> > > \n> > > If there's any work-around, please let me know.\n> > > Marc\n> > > \n> > \n> > Added to TODO:\n> > \n> > \t* allow aggregates on oid\n> \n> We already had a TODO item for this and came to the conclusion that\n> * Make type equivalency apply to aggregates\n> will solve this.\n> \n> For right now the user could do the following:\n> \n> INSERT INTO pg_aggregate VALUES ('max', <your user id>, 'int4larger', '-',\n> '-', 26, 26, 0, 26, NULL, NULL);\n> \n> -- \n> Peter Eisentraut Sernanders v_g 10:115\n> [email protected] 75262 Uppsala\n> http://yi.org/peter-e/ Sweden\n> \n> \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", "msg_date": "Sat, 22 Jan 2000 22:18:13 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [GENERAL] max(oid)" }, { "msg_contents": "\n\nPeter Eisentraut wrote:\n\n> On 2000-01-21, Bruce Momjian mentioned:\n>\n> > > Is there a way to use the max aggregate on an oid field? When I try on\n> > > 6.5.3, I get the following error message:\n> > >\n> > > test=> select max(uid) from user_base;\n> > > ERROR: Unable to select an aggregate function max(oid)\n> > >\n> > > If there's any work-around, please let me know.\n> > > Marc\n> > >\n> >\n> > Added to TODO:\n> >\n> > * allow aggregates on oid\n>\n> We already had a TODO item for this and came to the conclusion that\n> * Make type equivalency apply to aggregates\n> will solve this.\n>\n> For right now the user could do the following:\n>\n> INSERT INTO pg_aggregate VALUES ('max', <your user id>, 'int4larger', '-',\n> '-', 26, 26, 0, 26, NULL, NULL);\n>\n\nWe need also aggregates for data type TIME\n MAX(time)\n MIN(time)\n\n\nJos�\n\n\n", "msg_date": "Mon, 24 Jan 2000 15:45:11 +0100", "msg_from": "Jose Soares <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [GENERAL] max(oid)" }, { "msg_contents": "On 2000-01-24, Jose Soares mentioned:\n\n> We need also aggregates for data type TIME\n> MAX(time)\n> MIN(time)\n\nThomas, do you think this could be done?\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n\n\n", "msg_date": "Tue, 25 Jan 2000 00:49:43 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [GENERAL] max(oid)" }, { "msg_contents": "Btw., this is fixed now.\n\nOn 2000-01-22, Bruce Momjian mentioned:\n\n> Got it. TODO updated.\n> \n> [Charset ISO-8859-1 unsupported, filtering to ASCII...]\n> > On 2000-01-21, Bruce Momjian mentioned:\n> > \n> > > > Is there a way to use the max aggregate on an oid field? When I try on\n> > > > 6.5.3, I get the following error message:\n> > > > \n> > > > test=> select max(uid) from user_base;\n> > > > ERROR: Unable to select an aggregate function max(oid)\n> > > > \n> > > > If there's any work-around, please let me know.\n> > > > Marc\n> > > > \n> > > \n> > > Added to TODO:\n> > > \n> > > \t* allow aggregates on oid\n> > \n> > We already had a TODO item for this and came to the conclusion that\n> > * Make type equivalency apply to aggregates\n> > will solve this.\n> > \n> > For right now the user could do the following:\n> > \n> > INSERT INTO pg_aggregate VALUES ('max', <your user id>, 'int4larger', '-',\n> > '-', 26, 26, 0, 26, NULL, NULL);\n> > \n> > -- \n> > Peter Eisentraut Sernanders v_g 10:115\n> > [email protected] 75262 Uppsala\n> > http://yi.org/peter-e/ Sweden\n> > \n> > \n> > \n> \n> \n> \n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n\n", "msg_date": "Tue, 25 Jan 2000 00:49:51 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [GENERAL] max(oid)" }, { "msg_contents": "> > We need also aggregates for data type TIME\n> > MAX(time)\n> > MIN(time)\n> Thomas, do you think this could be done?\n\nSure. I'm really stacked up on the ToDo list for 7.0, but it would\nonly take a couple of hours end to end to get this done (probably less\nactually).\n\nA related topic: we should discuss having a real \"time with timezone\"\ntype for SQL92 compatibility. It is completely useless imho, since the\nSQL92 definition of time zone is so brain damaged (only a constant\nhour offset, no concept of daylight savings time, no date context\nassociated with a time field, etc etc etc). Currently, we swallow the\n\"with time zone\" without comment...\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Tue, 25 Jan 2000 02:16:23 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [GENERAL] max(oid)" } ]
[ { "msg_contents": "\n\nI've checked the format of the postgresql jdbc url I'm using for my\ngetConnection call, it acctually works when used for programs run from\nthe command line. It's only when I run an applet in a browser do I\nget the error \"No suitable driver\". I believe the jar is being loaded\nbecause until I added the statement \"archive=postgresql.jar\" to my\napplet statement, the Class.forName(\"postgresql.Driver\"); statement\nwas producing an error.\n\n\tThanks for the help, past and future.\n\n", "msg_date": "Sat, 22 Jan 2000 06:54:34 GMT", "msg_from": "[email protected] (Micheal H.)", "msg_from_op": true, "msg_subject": "No suitable driver problem" } ]
[ { "msg_contents": "Hi everyone. Awhile back I reported the elog(FATAL)/elog(ERROR) infinite\nloop and I see it marked in the TODO as done for 7.0. Is there a patch\nfor this problem for 6.5.3?\n\nThanks...\n\n- K\n\nKristofer Munn * KMI * 973-509-9414 * AIM KrMunn * http://www.munn.com/\n\n", "msg_date": "Sat, 22 Jan 2000 01:57:07 -0500 (EST)", "msg_from": "Kristofer Munn <[email protected]>", "msg_from_op": true, "msg_subject": "Patch for elog(FATAL)/elog(ERROR) infinite loop?" }, { "msg_contents": "> -----Original Message-----\n> From: [email protected]\n> [mailto:[email protected]]On Behalf Of Kristofer Munn\n> \n> Hi everyone. Awhile back I reported the elog(FATAL)/elog(ERROR) infinite\n> loop and I see it marked in the TODO as done for 7.0. Is there a patch\n> for this problem for 6.5.3?\n>\n\nIs your report [HACKERS] ERROR: infinite recursion in proc_exit ?\nIs the TODO * -spinlock stuck problem when elog(FATAL) and elog(ERROR)\ninside bufmgr ?\nThe TODO case is different from your problem.\n\nRegards.\n\nHiroshi Inoue\[email protected]\n", "msg_date": "Mon, 24 Jan 2000 10:01:36 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] Patch for elog(FATAL)/elog(ERROR) infinite loop?" }, { "msg_contents": "Hiroshi Inoue\n> Is your report [HACKERS] ERROR: infinite recursion in proc_exit ?\n\nYes.\n\n> Is the TODO * -spinlock stuck problem when elog(FATAL) and elog(ERROR)\n> inside bufmgr ?\n\nYes?\n\n> The TODO case is different from your problem.\n\nOh. (pout) Is it in the TO_DO or, preferably, the HAS_BEEN_DONE? :-)\n\n- K\n\nKristofer Munn * KMI * 973-509-9414 * AIM KrMunn * http://www.munn.com/\n\n", "msg_date": "Sun, 23 Jan 2000 23:26:01 -0500 (EST)", "msg_from": "Kristofer Munn <[email protected]>", "msg_from_op": true, "msg_subject": "RE: [HACKERS] Patch for elog(FATAL)/elog(ERROR) infinite loop?" }, { "msg_contents": "Kristofer Munn <[email protected]> writes:\n>> Is your report [HACKERS] ERROR: infinite recursion in proc_exit ?\n\n> Yes.\n\n> Oh. (pout) Is it in the TO_DO or, preferably, the HAS_BEEN_DONE? :-)\n\nAFAIR we fixed that for 7.0 ...\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 24 Jan 2000 00:26:19 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Patch for elog(FATAL)/elog(ERROR) infinite loop? " } ]
[ { "msg_contents": "I am using a c program to insert the contents of mail messages into\npostgresql. First, I copy the message from stdin into a char pointer which\nI malloc at every line, then I use the following code to insert into a\ntable:\n\nchar query[1024];\nPGresult *res;\n...\nsprint(query, \"insert into mail_msg values ('%s'), message);\nres = PQexec(conn, query);\n...\n\nThere is obviously more than one problem here, the most important being\nI'm inserting a message of undetermined length into a char array of 1024\nbytes. Second, I'm not parsing the message for apostrophes or other\ncharacters which would mess-up my query.\n\nI'd appreciate if someone could suggest a solution to either problem, or\npoint me towards sample source code I could learn from. Please do not\nsuggest using Perl, I enjoy c even though I am still not very proficient\nat it and this is a good opportunity to practice.\n\nThanks again,\nMarc\n\n", "msg_date": "Sat, 22 Jan 2000 13:17:26 +0000 (GMT)", "msg_from": "Marc Tardif <[email protected]>", "msg_from_op": true, "msg_subject": "pglib and long queries" } ]
[ { "msg_contents": "Hi, all\n\nIs it possible to get an explain to return a rowset? I've added a PERSIST\noption, and need to return the plan id as a row (if anybody thinks there are\nbetter ways, I'm open to ideas). elogging doesn't help, because with some\nclient interfaces, it's very difficult to get to an elog result. So, I\nthought that return a single row, with a single column might do the trick.\n\nIdeas...\n\n\nMikeA\n\n", "msg_date": "Sat, 22 Jan 2000 23:29:16 +0200", "msg_from": "\"Ansley, Michael\" <[email protected]>", "msg_from_op": true, "msg_subject": "Explain output" } ]
[ { "msg_contents": "I have written the attached bit of doco about the new index cost\nestimator procedure definition, but I am not sure where to put it.\nThere isn't (AFAICT) any existing documentation about how to make\na new kind of index, which would be the proper place for it.\nMay I impose on you to find/make a place for this and mark it up\nproperly?\n\nAlso, doc/src/graphics/catalogs.ag needs to be updated, but I have\nno idea how. (The amopselect and amopnpages fields of pg_amop\nare gone; pg_am has a new field amcostestimate.)\n\n\t\t\tregards, tom lane\n\n\nIndex cost estimation functions\n-------------------------------\n\nEvery index access method must provide a cost estimation function for\nuse by the planner/optimizer. The procedure OID of this function is\ngiven in the 'amcostestimate' field of the access method's pg_am entry.\n(Note: prior to Postgres 7.0, a different scheme was used for registering\nindex-specific cost estimation functions.)\n\nThe amcostestimate function is given a list of WHERE clauses that have\nbeen determined to be usable with the index. It must return estimates\nof the cost of accessing the index and the selectivity of the WHERE\nclauses (that is, the fraction of main-table tuples that will be\nretrieved during the index scan). For simple cases, nearly all the\nwork of the cost estimator can be done by calling standard routines\nin the optimizer --- the point of having an amcostestimate function is\nto allow index access methods to provide index-type-specific knowledge,\nin case it is possible to improve on the standard estimates.\n\nEach amcostestimate function must have the signature\n\nvoid\namcostestimate (Query *root,\n RelOptInfo *rel,\n IndexOptInfo *index,\n List *indexQuals,\n Cost *indexAccessCost,\n Selectivity *indexSelectivity);\n\nThe first four parameters are inputs:\n\n\troot\t\tThe query being processed\n\trel\t\tThe relation the index is on\n\tindex\t\tThe index itself\n\tindexQuals\tList of index qual clauses (implicitly ANDed);\n\t\t\tNIL list indicates no qualifiers are available\n\nThe last two parameters are pass-by-reference outputs:\n\n\t*indexAccessCost\tSet to cost of index processing\n\t*indexSelectivity\tSet to index selectivity\n\nNote that cost estimate functions must be written in C, not in SQL or\nany available procedural language, because they must access internal\ndata structures of the planner/optimizer.\n\nThe indexAccessCost should be computed in the units used by\nsrc/backend/optimizer/path/costsize.c: a disk block fetch has cost 1.0,\nand the cost of processing one index tuple should usually be taken as\ncpu_index_page_weight (which is a user-adjustable optimizer parameter).\nThe access cost should include all disk and CPU costs associated with\nscanning the index itself, but NOT the cost of retrieving or processing\nthe main-table tuples that are identified by the index.\n\nThe indexSelectivity should be set to the estimated fraction of the main\ntable tuples that will be retrieved during the index scan. In the case\nof a lossy index, this will typically be higher than the fraction of\ntuples that actually pass the given qual conditions.\n\nA typical cost estimator will proceed as follows:\n\n1. Estimate and return the fraction of main-table tuples that will be visited\nbased on the given qual conditions. In the absence of any index-type-specific\nknowledge, use the standard optimizer function clauselist_selec():\n\n *indexSelectivity = clauselist_selec(root, indexQuals);\n\n2. Estimate the number of index tuples that will be visited during the\nscan. For many index types this is the same as indexSelectivity times\nthe number of tuples in the index, but it might be more. (Note that the\nindex's size in pages and tuples is available from the IndexOptInfo struct.)\n\n3. Estimate the number of index pages that will be retrieved during the scan.\nThis might be just indexSelectivity times the index's size in pages.\n\n4. Compute the index access cost as\n\n *indexAccessCost = numIndexPages + cpu_index_page_weight * numIndexTuples;\n\nExamples of cost estimator functions can be found in\nsrc/backend/utils/adt/selfuncs.c.\n\nBy convention, the pg_proc entry for an amcostestimate function should show\n\nprorettype = 0\npronargs = 6\nproargtypes = 0 0 0 0 0 0\n\nWe use zero (\"opaque\") for all the arguments since none of them have types\nthat are known in pg_type.\n", "msg_date": "Sat, 22 Jan 2000 19:02:43 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Doc updates for index cost estimator change" }, { "msg_contents": "> There isn't (AFAICT) any existing documentation about how to make\n> a new kind of index, which would be the proper place for it.\n> May I impose on you to find/make a place for this and mark it up\n> properly?\n\nOK.\n\n> Also, doc/src/graphics/catalogs.ag needs to be updated, but I have\n> no idea how. (The amopselect and amopnpages fields of pg_amop\n> are gone; pg_am has a new field amcostestimate.)\n\nThe primary graphics files should be .cgm files, but I see that we\nonly have those for one or two cases. The .ag files are Applix\nGraphics files, which I use to embed the stuff into hardcopy.\n\nI'll see about updating them, and committing a .cgm version of each.\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Mon, 24 Jan 2000 15:12:00 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Doc updates for index cost estimator change" }, { "msg_contents": "Thomas Lockhart <[email protected]> writes:\n> The primary graphics files should be .cgm files, but I see that we\n> only have those for one or two cases. The .ag files are Applix\n> Graphics files, which I use to embed the stuff into hardcopy.\n>\n> I'll see about updating them, and committing a .cgm version of each.\n\nIf the .ag files are derived files, meseems they should not be in\nthe CVS tree at all?\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 24 Jan 2000 11:44:25 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: Doc updates for index cost estimator change " }, { "msg_contents": "> > The primary graphics files should be .cgm files, but I see that we\n> > only have those for one or two cases. The .ag files are Applix\n> > Graphics files, which I use to embed the stuff into hardcopy.\n> > I'll see about updating them, and committing a .cgm version of each.\n> If the .ag files are derived files, meseems they should not be in\n> the CVS tree at all?\n\nEasy for you to say, you're not formatting the hardcopy :)\n\nSeriously, I'm not certain that we can use .cgm format as a lossless\nway for me to get figures into the hardcopy. But it seems like it\nshould work; my recollection is that Hannu helped test out formats\nwith me and we settled on .cgm as the most likely to succeed.\n\nAs soon as we have a complete set of .cgm files, and as soon as I've\ntried generating hardcopy and jpegs or gifs for the .html, then we can\ndeep-six the .ag versions. In the meantime, it makes it easier on me\nif we keep carrying those files in cvs.\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Tue, 25 Jan 2000 01:57:53 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Doc updates for index cost estimator change" }, { "msg_contents": "Has this been dealt with?\n\n\n> I have written the attached bit of doco about the new index cost\n> estimator procedure definition, but I am not sure where to put it.\n> There isn't (AFAICT) any existing documentation about how to make\n> a new kind of index, which would be the proper place for it.\n> May I impose on you to find/make a place for this and mark it up\n> properly?\n> \n> Also, doc/src/graphics/catalogs.ag needs to be updated, but I have\n> no idea how. (The amopselect and amopnpages fields of pg_amop\n> are gone; pg_am has a new field amcostestimate.)\n> \n> \t\t\tregards, tom lane\n> \n> \n> Index cost estimation functions\n> -------------------------------\n> \n> Every index access method must provide a cost estimation function for\n> use by the planner/optimizer. The procedure OID of this function is\n> given in the 'amcostestimate' field of the access method's pg_am entry.\n> (Note: prior to Postgres 7.0, a different scheme was used for registering\n> index-specific cost estimation functions.)\n> \n> The amcostestimate function is given a list of WHERE clauses that have\n> been determined to be usable with the index. It must return estimates\n> of the cost of accessing the index and the selectivity of the WHERE\n> clauses (that is, the fraction of main-table tuples that will be\n> retrieved during the index scan). For simple cases, nearly all the\n> work of the cost estimator can be done by calling standard routines\n> in the optimizer --- the point of having an amcostestimate function is\n> to allow index access methods to provide index-type-specific knowledge,\n> in case it is possible to improve on the standard estimates.\n> \n> Each amcostestimate function must have the signature\n> \n> void\n> amcostestimate (Query *root,\n> RelOptInfo *rel,\n> IndexOptInfo *index,\n> List *indexQuals,\n> Cost *indexAccessCost,\n> Selectivity *indexSelectivity);\n> \n> The first four parameters are inputs:\n> \n> \troot\t\tThe query being processed\n> \trel\t\tThe relation the index is on\n> \tindex\t\tThe index itself\n> \tindexQuals\tList of index qual clauses (implicitly ANDed);\n> \t\t\tNIL list indicates no qualifiers are available\n> \n> The last two parameters are pass-by-reference outputs:\n> \n> \t*indexAccessCost\tSet to cost of index processing\n> \t*indexSelectivity\tSet to index selectivity\n> \n> Note that cost estimate functions must be written in C, not in SQL or\n> any available procedural language, because they must access internal\n> data structures of the planner/optimizer.\n> \n> The indexAccessCost should be computed in the units used by\n> src/backend/optimizer/path/costsize.c: a disk block fetch has cost 1.0,\n> and the cost of processing one index tuple should usually be taken as\n> cpu_index_page_weight (which is a user-adjustable optimizer parameter).\n> The access cost should include all disk and CPU costs associated with\n> scanning the index itself, but NOT the cost of retrieving or processing\n> the main-table tuples that are identified by the index.\n> \n> The indexSelectivity should be set to the estimated fraction of the main\n> table tuples that will be retrieved during the index scan. In the case\n> of a lossy index, this will typically be higher than the fraction of\n> tuples that actually pass the given qual conditions.\n> \n> A typical cost estimator will proceed as follows:\n> \n> 1. Estimate and return the fraction of main-table tuples that will be visited\n> based on the given qual conditions. In the absence of any index-type-specific\n> knowledge, use the standard optimizer function clauselist_selec():\n> \n> *indexSelectivity = clauselist_selec(root, indexQuals);\n> \n> 2. Estimate the number of index tuples that will be visited during the\n> scan. For many index types this is the same as indexSelectivity times\n> the number of tuples in the index, but it might be more. (Note that the\n> index's size in pages and tuples is available from the IndexOptInfo struct.)\n> \n> 3. Estimate the number of index pages that will be retrieved during the scan.\n> This might be just indexSelectivity times the index's size in pages.\n> \n> 4. Compute the index access cost as\n> \n> *indexAccessCost = numIndexPages + cpu_index_page_weight * numIndexTuples;\n> \n> Examples of cost estimator functions can be found in\n> src/backend/utils/adt/selfuncs.c.\n> \n> By convention, the pg_proc entry for an amcostestimate function should show\n> \n> prorettype = 0\n> pronargs = 6\n> proargtypes = 0 0 0 0 0 0\n> \n> We use zero (\"opaque\") for all the arguments since none of them have types\n> that are known in pg_type.\n> \n> ************\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", "msg_date": "Wed, 7 Jun 2000 22:34:36 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Doc updates for index cost estimator change" }, { "msg_contents": "Bruce Momjian <[email protected]> writes:\n> Has this been dealt with?\n\n>> I have written the attached bit of doco about the new index cost\n>> estimator procedure definition, but I am not sure where to put it.\n\nYes, that's chapter 44 these days.\n\n>> Also, doc/src/graphics/catalogs.ag needs to be updated, but I have\n>> no idea how. (The amopselect and amopnpages fields of pg_amop\n>> are gone; pg_am has a new field amcostestimate.)\n\nThis part is not done, though --- we still seem to have the old fields\nin the catalogs graphic.\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 07 Jun 2000 23:10:47 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: Doc updates for index cost estimator change " }, { "msg_contents": "> >> Also, doc/src/graphics/catalogs.ag needs to be updated, but I have\n> >> no idea how. (The amopselect and amopnpages fields of pg_amop\n> >> are gone; pg_am has a new field amcostestimate.)\n> This part is not done, though --- we still seem to have the old fields\n> in the catalogs graphic.\n\nI updated the graphic at least a little bit (the original Applix version\nanyway; not sure if it updated the .gif now that I think about it). But\nI suspect that I didn't fix it up enough.\n\n - Thomas\n", "msg_date": "Tue, 13 Jun 2000 05:51:33 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Doc updates for index cost estimator change" } ]
[ { "msg_contents": "With caveats, it is now possible to drop columns from tables.\n\nThe implementation is based on copying the old table to a new one minus\nthe specified column. This procedure changes the oids of everyone\ninvolved, so I was wondering if\na) this is a good reason to tell people to stop using oids as keys, or\nb) if there is some way to keep the oids on both the records and the\npg_class entry.\n\nIs it possible/safe to specify an oid to heap_insert (like tuple->...->oid\n= x) if the oid is still in use (in the old table), or would a\nheap_delete({from old table}) plus heap_insert({into new table}) work.\n\nIs it possible/safe to change to oid of the new pg_class entry back to the\nold one? In that case the trouble of moving over all the constraints, etc.\nwould be half the work.\n\nSpeaking of which, the current implementation loses all constraints,\ntriggers, rules, comments, etc. (not defaults and notnulls\nthough). Therefore\n1) did I forget anything in the above list\n2) how do I find out if the dropped column is referenced in a constraint,\ntrigger, rule (this is necessary for a correct RESTRICT/CASCADE\nimplementation)\n3) once again, is it possible/safe to do the equivalent of update pg_class\nset oid=old where oid=new to save this work?\n\nOh, btw., heaven help you if you try this on tables that are inherited\nfrom.\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n\n\n", "msg_date": "Sun, 23 Jan 2000 02:29:42 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": true, "msg_subject": "Happy column dropping" }, { "msg_contents": "\nDid I miss a discussion here on implementing this, and how? Sounds to me\nlike a week and a bit before planned beta, an *incomplete* feature has\nbeen shoved into the source tree with zero forewarning or discussion ...\n\nOkay, my turn here ... I vote for this to be *reverted*!!\n\nOn Sun, 23 Jan 2000, Peter Eisentraut wrote:\n\n> With caveats, it is now possible to drop columns from tables.\n> \n> The implementation is based on copying the old table to a new one minus\n> the specified column. This procedure changes the oids of everyone\n> involved, so I was wondering if\n> a) this is a good reason to tell people to stop using oids as keys, or\n> b) if there is some way to keep the oids on both the records and the\n> pg_class entry.\n> \n> Is it possible/safe to specify an oid to heap_insert (like tuple->...->oid\n> = x) if the oid is still in use (in the old table), or would a\n> heap_delete({from old table}) plus heap_insert({into new table}) work.\n> \n> Is it possible/safe to change to oid of the new pg_class entry back to the\n> old one? In that case the trouble of moving over all the constraints, etc.\n> would be half the work.\n> \n> Speaking of which, the current implementation loses all constraints,\n> triggers, rules, comments, etc. (not defaults and notnulls\n> though). Therefore\n> 1) did I forget anything in the above list\n> 2) how do I find out if the dropped column is referenced in a constraint,\n> trigger, rule (this is necessary for a correct RESTRICT/CASCADE\n> implementation)\n> 3) once again, is it possible/safe to do the equivalent of update pg_class\n> set oid=old where oid=new to save this work?\n> \n> Oh, btw., heaven help you if you try this on tables that are inherited\n> from.\n> \n> -- \n> Peter Eisentraut Sernanders v�g 10:115\n> [email protected] 75262 Uppsala\n> http://yi.org/peter-e/ Sweden\n> \n> \n> \n> \n> ************\n> \n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Sat, 22 Jan 2000 22:01:02 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "> Did I miss a discussion here on implementing this, and how? Sounds to me\n> like a week and a bit before planned beta, an *incomplete* feature has\n> been shoved into the source tree with zero forewarning or discussion ...\n> \n> Okay, my turn here ... I vote for this to be *reverted*!!\n\nI disagree. First, it is on the TODO list, so it is open game. Second\nit is not throughout all the code, it only gets activated if someone\nexecutes the command. Third, I don't know of any time limit that\nfeatures have to be implemented a certain number of weeks _before_ beta\nstarts.\n\nEveryone asks for this, and if it does only %70 of the job, that is fine\nas long as the manual page says so.\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": "Sat, 22 Jan 2000 22:27:11 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "[Charset ISO-8859-1 unsupported, filtering to ASCII...]\n> With caveats, it is now possible to drop columns from tables.\n> \n> The implementation is based on copying the old table to a new one minus\n> the specified column. This procedure changes the oids of everyone\n> involved, so I was wondering if\n> a) this is a good reason to tell people to stop using oids as keys, or\n> b) if there is some way to keep the oids on both the records and the\n> pg_class entry.\n\nActually CLUSTER has the same problem, I think. It may be even worse\nbecause it drops all indexes. Can you take a look at that code too. \nSome people have reported problems with it, while others are OK. There\nis a cluster TODO mail file in the source tree. It shows an actual bug\nthat still exists, plus some other issues with cluster.\n\n\n\nNot sure how to deal with this. I think our whole OID system is messed\nup because you can't update the OID column in a table. That is very\nlimiting, and some commands like cluster lose oids. I think we need a\nfull OID discussion on how to move forward with them.\n\nWhy not allow heap_insert to receive the oid as a parameter. It may\nhelp with cluster too. Seems like a great idea!\n\n> \n> Is it possible/safe to change to oid of the new pg_class entry back to the\n> old one? In that case the trouble of moving over all the constraints, etc.\n> would be half the work.\n\nI don't know. I don't see any reason we can't handle that.\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": "Sat, 22 Jan 2000 22:48:15 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "Bruce Momjian <[email protected]> writes:\n>> Okay, my turn here ... I vote for this to be *reverted*!!\n\n> I disagree. First, it is on the TODO list, so it is open game. Second\n> it is not throughout all the code, it only gets activated if someone\n> executes the command. Third, I don't know of any time limit that\n> features have to be implemented a certain number of weeks _before_ beta\n> starts.\n\nI agree with Bruce. There's no risk of this breaking anything else,\nAFAICT, so if it doesn't work there's no harm done. I hope Peter is\ngoing to clean it up more before beta, but why shouldn't he push out\nwhat he has for review and criticism?\n\nI'm busy committing changes in areas that are considerably more critical\nthan this is, so if the rule is going to be \"no risk taken for N weeks\n*before* beta\", better tell me about it...\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 22 Jan 2000 22:49:42 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "On Sat, 22 Jan 2000, Tom Lane wrote:\n\n> Bruce Momjian <[email protected]> writes:\n> >> Okay, my turn here ... I vote for this to be *reverted*!!\n> \n> > I disagree. First, it is on the TODO list, so it is open game. Second\n> > it is not throughout all the code, it only gets activated if someone\n> > executes the command. Third, I don't know of any time limit that\n> > features have to be implemented a certain number of weeks _before_ beta\n> > starts.\n> \n> I agree with Bruce. There's no risk of this breaking anything else,\n> AFAICT, so if it doesn't work there's no harm done. I hope Peter is\n> going to clean it up more before beta, but why shouldn't he push out\n> what he has for review and criticism?\n\nWhy didn't I just take Alfred's stuff and shove it into the source tree\nand let the bricks fall where they may? As far as I am/was concerned, the\nramifications of the changes were so great that *some* discussion should\nhave happened before hand ...\n\nI'm one of those that would love to have an ALTER TABLE ... DROP COLUMN\nimplementation, but how many applications will get broken because OID are\nno longer retained? If it had been brought up and discussed before being\nthrown in, like everyone else has done in the past, maybe a better\nsolution could have presented itself ...\n\n> I'm busy committing changes in areas that are considerably more critical\n> than this is, so if the rule is going to be \"no risk taken for N weeks\n> *before* beta\", better tell me about it...\n\nIts not the *risk* that bothers me, its the lack of discussions ... IMHO,\nhe should have brought up the \"I'm in the process of toasting the reliance\non OIDs\" topic *before* implementing it ... give other ppl a chance to\npossibly present alternatives ...\n\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Sun, 23 Jan 2000 00:23:16 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "> [Charset ISO-8859-1 unsupported, filtering to ASCII...]\n> > With caveats, it is now possible to drop columns from tables.\n> > \n> > The implementation is based on copying the old table to a new one minus\n> > the specified column. This procedure changes the oids of everyone\n> > involved, so I was wondering if\n> > a) this is a good reason to tell people to stop using oids as keys, or\n> > b) if there is some way to keep the oids on both the records and the\n> > pg_class entry.\n> \n> Actually CLUSTER has the same problem, I think. It may be even worse\n> because it drops all indexes. Can you take a look at that code too. \n> Some people have reported problems with it, while others are OK. There\n> is a cluster TODO mail file in the source tree. It shows an actual bug\n> that still exists, plus some other issues with cluster.\n> \n\nI wonder if we should throw out a NOTICE when we drop some\ncharacteristic of a table?\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": "Sat, 22 Jan 2000 23:26:32 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "Peter Eisentraut <[email protected]> writes:\n> With caveats, it is now possible to drop columns from tables.\n> The implementation is based on copying the old table to a new one minus\n> the specified column. This procedure changes the oids of everyone\n> involved, so I was wondering if\n> a) this is a good reason to tell people to stop using oids as keys,\n\nAFAIK there is nothing particularly magic about OIDs. You could\nperfectly well create the new table with the same OIDs as are in the\nold table (see COPY WITH OIDS if you are wondering how).\n\nUser-level stuff like referential integrity triggers might get unhappy,\nbut you're not going to let triggers see what you're doing, right ;-) ?\n\n> Is it possible/safe to change to oid of the new pg_class entry back to the\n> old one? In that case the trouble of moving over all the constraints, etc.\n> would be half the work.\n\nWrong way to think about it. You should be doing a heap_update of the\ncatalog tuples that need to change, ISTM.\n\nYou could almost get away with doing it like you describe, except that\nthere is a unique index on pg_class OIDs these days (right, Bruce?)\nand that index will kick out an error. But heap_update on the original\ntable tuple will work.\n\nI think what we may want here is something comparable to what's been\ndiscussed recently for VACUUM: build the new table as a new heap file\nand then rename the physical file into place, without really doing\nanything to the pg_class tuple --- except of course you'd need to\nheap_update it to adjust the number-of-attributes field.\n\n> 2) how do I find out if the dropped column is referenced in a constraint,\n> trigger, rule (this is necessary for a correct RESTRICT/CASCADE\n> implementation)\n\nActually it's worse than that: you need to be prepared to renumber the\ncolumns after the dropped one, too. Probably what you will need to do\nis read in and deparse all the relevant rules and triggers, then reparse\nthem against the updated table schema. Ugly. And no, I have no idea\nhow you even *find* all the relevant rules. (Jan?)\n\n> Oh, btw., heaven help you if you try this on tables that are inherited\n> from.\n\nThe whole thing should be done inside a recursive routine that applies\nthe same change to all children of the target table. See ALTER TABLE\nADD COLUMN for an example. (ADD COLUMN is pretty broken too, since it\ndoesn't preserve consistency of column numbering across child tables ---\nwant to reimplement it in this same style?)\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 22 Jan 2000 23:38:11 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "At 10:27 PM 1/22/00 -0500, Bruce Momjian wrote:\n>> Did I miss a discussion here on implementing this, and how? Sounds to me\n>> like a week and a bit before planned beta, an *incomplete* feature has\n>> been shoved into the source tree with zero forewarning or discussion ...\n>> \n>> Okay, my turn here ... I vote for this to be *reverted*!!\n>\n>I disagree. First, it is on the TODO list, so it is open game. Second\n>it is not throughout all the code, it only gets activated if someone\n>executes the command. Third, I don't know of any time limit that\n>features have to be implemented a certain number of weeks _before_ beta\n>starts.\n>\n>Everyone asks for this, and if it does only %70 of the job, that is fine\n>as long as the manual page says so.\n\nI'm sorry, but his current hack results in silent failures.\n\nPersonally, I think he should've asked for answers to his questions\nfirst - i.e., how do you find out which relations are subject to\nforeign key restraints (implemented via triggers)?\n\nAllowing one to drop columns with silent failure is hardly the \nhallmark of a professional piece of software. What has impressed me\nabout the Postgres effort in the year that I've been tracking it (though\nsadly not contributing to it), has been the concentration on professional\nimplementation of features, and the concentration on improving stability\nand reliability.\n\n\"copy to a table, drop the column, copy back\" - heck, I could do that\nwith a script file to be fed into psql. An internal implementation has\nto be far better to be considered a piece of a professional RDBMS, I'm\nafraid.\n\nI'm not saying that this isn't the proper basis for the feature, only\nthat sure, that's easy to do internally or externally, and that isn't\nthe problem.\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Sat, 22 Jan 2000 20:39:14 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "Bruce Momjian <[email protected]> writes:\n> I wonder if we should throw out a NOTICE when we drop some\n> characteristic of a table?\n\nThe problem is mostly that the code doesn't even *know* that it's\ndropping data. If we add code to find the info that's getting lost,\nit's probably little more work to add code to copy it.\n\nI'm of two minds about this. Peter is an energetic new contributor\nand we'd be really foolish to discourage him (I was there not very\nlong ago myself). And a limited DROP COLUMN capability is better\nthan none at all, so long as its limitations are well-documented.\n\nOTOH, I understand Don Baccus' concern: Postgres is on the cusp of\nbeing considered professional-grade software --- we are competing\nagainst multi-K-dollar commercial offerings --- and we jeopardize\nthat perception if we add features that are less than fully baked.\nThis is definitely in the 50%-baked category...\n\n\t\t\tregards, tom lane\n", "msg_date": "Sun, 23 Jan 2000 00:27:32 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "\nOn 23-Jan-00 Tom Lane wrote:\n> Bruce Momjian <[email protected]> writes:\n>> I wonder if we should throw out a NOTICE when we drop some\n>> characteristic of a table?\n> \n> The problem is mostly that the code doesn't even *know* that it's\n> dropping data. If we add code to find the info that's getting lost,\n> it's probably little more work to add code to copy it.\n> \n> I'm of two minds about this. Peter is an energetic new contributor\n> and we'd be really foolish to discourage him (I was there not very\n> long ago myself). And a limited DROP COLUMN capability is better\n> than none at all, so long as its limitations are well-documented.\n> \n> OTOH, I understand Don Baccus' concern: Postgres is on the cusp of\n> being considered professional-grade software --- we are competing\n> against multi-K-dollar commercial offerings --- and we jeopardize\n> that perception if we add features that are less than fully baked.\n> This is definitely in the 50%-baked category...\n\nSo why not ./configure --enable-experimental\n\nVince.\n-- \n==========================================================================\nVince Vielhaber -- KA8CSH email: [email protected] http://www.pop4.net\n 128K ISDN: $24.95/mo or less - 56K Dialup: $17.95/mo or less at Pop4\n Online Campground Directory http://www.camping-usa.com\n Online Giftshop Superstore http://www.cloudninegifts.com\n==========================================================================\n\n\n", "msg_date": "Sun, 23 Jan 2000 00:42:45 -0500 (EST)", "msg_from": "Vince Vielhaber <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "On Sun, 23 Jan 2000, Tom Lane wrote:\n\n> Bruce Momjian <[email protected]> writes:\n> > I wonder if we should throw out a NOTICE when we drop some\n> > characteristic of a table?\n> \n> The problem is mostly that the code doesn't even *know* that it's\n> dropping data. If we add code to find the info that's getting lost,\n> it's probably little more work to add code to copy it.\n> \n> I'm of two minds about this. Peter is an energetic new contributor\n> and we'd be really foolish to discourage him (I was there not very\n> long ago myself). And a limited DROP COLUMN capability is better\n> than none at all, so long as its limitations are well-documented.\n\nIMHO, put out a BIG NOTICE if someone issues the DROP COLUMN command:\n\nDo not expect your table to look like what you used to have!!\n\nThis has nothing to do with discouraging a contributor ... this has to do\nwith maintaining QA through peer-review ... it would have taken Peter *as\nlong* to send his note out 24hrs *before* commiting the changes and would\nhave at least spur'd on a possible discussion of a better way of dealign\nwith the whole OID situation ...\n\nLook at the last major patch we threw in from Alfred ... he posted and\nasked for comments ... Tom, I believe it was you that send back a few\nconcerns ... he addressed them and posted for review a *second* time\nbefore we committed it. After committing, we found a bug ... someone else\nwanted to revert that patch, but *at that point* it would have been\ninappropriate to do, since it had been reviewed twice and considered good\nfor inclusion ... if Alfred couldn't have fixed the problem adequately\nafter a few days, okay, then revert it, but at least give him a chance to\nfix that which he wrought ...\n\nIn Peter's case, there was no review ... just slap it in and pray ;(\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Sun, 23 Jan 2000 01:58:30 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "> -----Original Message-----\n> From: [email protected]\n> [mailto:[email protected]]On Behalf Of Tom Lane\n> \n> Bruce Momjian <[email protected]> writes:\n> >> Okay, my turn here ... I vote for this to be *reverted*!!\n> \n> > I disagree. First, it is on the TODO list, so it is open game. Second\n> > it is not throughout all the code, it only gets activated if someone\n> > executes the command. Third, I don't know of any time limit that\n> > features have to be implemented a certain number of weeks _before_ beta\n> > starts.\n> \n> I agree with Bruce. There's no risk of this breaking anything else,\n> AFAICT, so if it doesn't work there's no harm done. I hope Peter is\n> going to clean it up more before beta, but why shouldn't he push out\n> what he has for review and criticism?\n>\n\nI agree with Marc. \nDROP COLUMN feature should be discussed before implementing it.\n\nWe can live without DROP COLUMN feature.\nAll we have to do is to ignore the column.\nWhy should we have a complicated implementation for the feature\nwithout any discussion ?\n\nAnyway I have 2 basic questions.\n\n1) Is the * 2x disk usage * implementation really needed ?\n2) Why rename() ?\n I don't trust rename() at all in transaction control.\n The first thing we should do it to change relname -> relation file\n name mapping in order to avoid calling rename(). \n\nRegards.\n\nHiroshi Inoue\[email protected]\n", "msg_date": "Sun, 23 Jan 2000 21:38:49 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] Happy column dropping " }, { "msg_contents": "At 12:27 AM 1/23/00 -0500, Tom Lane wrote:\n\n>I'm of two minds about this. Peter is an energetic new contributor\n>and we'd be really foolish to discourage him (I was there not very\n>long ago myself). And a limited DROP COLUMN capability is better\n>than none at all, so long as its limitations are well-documented.\n>\n>OTOH, I understand Don Baccus' concern: Postgres is on the cusp of\n>being considered professional-grade software --- we are competing\n>against multi-K-dollar commercial offerings --- and we jeopardize\n>that perception if we add features that are less than fully baked.\n>This is definitely in the 50%-baked category...\n\nI certainly don't want to discourage Peter, either, and perhaps\nwas a bit too harsh. But release of a feature this half-baked\nwould fit the stereotype many people have held towards free,\nopen source software, and postgres in particular.\n\nIMHO, of course.\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Sun, 23 Jan 2000 07:26:58 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "Don Baccus wrote:\n> \n> At 12:27 AM 1/23/00 -0500, Tom Lane wrote:\n> \n> >I'm of two minds about this. Peter is an energetic new contributor\n> >and we'd be really foolish to discourage him (I was there not very\n> >long ago myself). And a limited DROP COLUMN capability is better\n> >than none at all, so long as its limitations are well-documented.\n> >\n> >OTOH, I understand Don Baccus' concern: Postgres is on the cusp of\n> >being considered professional-grade software --- we are competing\n> >against multi-K-dollar commercial offerings --- and we jeopardize\n> >that perception if we add features that are less than fully baked.\n> >This is definitely in the 50%-baked category...\n> \n> I certainly don't want to discourage Peter, either, and perhaps\n> was a bit too harsh. But release of a feature this half-baked\n\nPutting something in a development tree can hardly be called a \"release\"\nI'm sure many people would appreciate it even without \"preserving oid-s\" \nas OID's are declared deprecated for (AFAIK) >2 years, and they don't give \nany real advantage over primary key with default nextval, as there are \ncurrently no means for reasonably getting from oid to record.\n\nI agree that it could be #ifedef'ed or usable only when you do:\nset TerribleDropColumnCludge to 'ON';\n\n> would fit the stereotype many people have held towards free,\n> open source software, and postgres in particular.\n\nWhat keeps us from discussing the implementation _now_ that we have something \nto discuss. Much of the success of open source software comes from the \n\"show me the code\" mentality - you discuss what you have, not what you might\ndo.\n\nThe current \"(UN)Happy column dropping\" discussion, frankly seems to stem much \nfrom jealousy - hands off my tree, we allow only _purfect_ contributions.\n\nOTOH there are several existing features in postgresql you would not \nexpect, unless you have worked with postgresql for many years and read \nmost of traffic on hackers list (like running out of almost all resources\ndoing a seemingly innocent query (or having it done for you by a \"smart\" \napplication), or lack of most common-sense \"convenience\" optimisations,\nlike using index for max(), or being able to _partially_ rollback DDL \nstatements.\n\nNobody has demanded removing ORs (or even the optimiser ;)) from postgres \nbecause they can explode the backend.\n\nSo IMHO discouraging small usability improvements is wrong.\n\n> IMHO, of course.\n\nSure\n\n--------------------\nHannu\n", "msg_date": "Sun, 23 Jan 2000 20:53:18 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "At 08:53 PM 1/23/00 +0200, Hannu Krosing wrote:\n\n>What keeps us from discussing the implementation _now_ that we have\nsomething \n>to discuss.\n\nNothing. The argument is simply that perhaps discussion should come FIRST.\n\n> Much of the success of open source software comes from the \n>\"show me the code\" mentality - you discuss what you have, not what you might\n>do.\n\nI see a lot of pre-implementation discussion on this group. For instance,\nrecently there was public discussion of \"TOAST\" large data types. Details\nwere ironed out, now Jan will go implement it when he has time.\n\nLikewise his approach to implementing referential integrity was discussed\nhere beforehand.\n\nJust today, we're seeing discussion of the implementation of a new\nstddev aggregate function.\n\nI think this is a good process to follow.\n\n>The current \"(UN)Happy column dropping\" discussion, frankly seems to stem\nmuch \n>from jealousy - hands off my tree, we allow only _purfect_ contributions.\n\nAre you suggesting that the goal should be anything less than perfection?\n\nI guess this goes to my argument that Postgres is starting to be regarded\nas a potential competitor to expensive commercial DBs in certain application\nenvironments. If the bar is lowered for contributions, Postgres will\nquickly re-earn the image of flakiness that the current developers have\nworked so hard to shed.\n\n>OTOH there are several existing features in postgresql you would not \n>expect, unless you have worked with postgresql for many years and read \n>most of traffic on hackers list (like running out of almost all resources\n>doing a seemingly innocent query (or having it done for you by a \"smart\" \n>application), or lack of most common-sense \"convenience\" optimisations,\n>like using index for max(), or being able to _partially_ rollback DDL \n>statements.\n>\n>Nobody has demanded removing ORs (or even the optimiser ;)) from postgres \n>because they can explode the backend.\n\nNo ... but fixing ORs seems to be on the list of things to be done.\n\nPointing to the fact that the inherited code still needs a lot of work\nbefore it's really a solid, commercial-quality database engine in all\nregards doesn't convince me that weak implementations of new features\nshould be added.\n\nMy impression is that the current crop of developers are aiming higher...\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Sun, 23 Jan 2000 11:01:41 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "Hannu Krosing <[email protected]> writes:\n> The current \"(UN)Happy column dropping\" discussion, frankly seems to\n> stem much from jealousy - hands off my tree, we allow only _purfect_\n> contributions.\n\nI think this discussion could do without personal attacks, don't you?\n\n> OTOH there are several existing features in postgresql you would not \n> expect, unless you have worked with postgresql for many years and read \n> most of traffic on hackers list (like running out of almost all resources\n> doing a seemingly innocent query (or having it done for you by a \"smart\" \n> application), or lack of most common-sense \"convenience\" optimisations,\n> like using index for max(), or being able to _partially_ rollback DDL \n> statements.\n\nI see it considerably differently. Quite a few of us have been sweating\nblood for a long time to clean up those past half-baked implementation\ndecisions. We're all well aware that the list of those problems is\nstill very long. Should we be happy about the addition of another such\nproblem?\n\nI've been generally in favor of letting Peter continue with this\nprocess, but that's only because I expect him to be here for the long\nhaul and to work on refining his first cut into a robust feature.\nIf he stops here and leaves it for other folks to clean up, then I'd\nvote to remove it as well.\n\n\t\t\tregards, tom lane\n", "msg_date": "Sun, 23 Jan 2000 14:14:30 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "> I certainly don't want to discourage Peter, either, and perhaps\n> was a bit too harsh. But release of a feature this half-baked\n> would fit the stereotype many people have held towards free,\n> open source software, and postgres in particular.\n\nI again am totally confused by the reaction to this.\n\nPeter has done a lot for 7.0. Only Tom Lane and Jan have done more work\non 7.0 than Peter. He has also fixed many TODO items from the list.\n\nWe is not releasing tomorrow. He is putting in what he has and asking\nfor advise. Yes, it would have been better if he would have discussed\nthis first. However, he is writing _huge_ amounts of PostgreSQL code. \nLook at the new psql or initdb, or the other items he has done. Maybe\nhe is too busy coding to bring up issues on the list.\n\nAs long as he addresses concerns we have, I can live with some\nnon-perfect code. He is relatively new to this. Honestly, only Tom\nLane and Jan are as energetic about 7.0 as Peter, so why rock the boat.\n\nThat doesn't mean I accept bad code, only that I am patient with\npeople's styles.\n\nI can't remember the last time we all were so harsh, and I am concerned.\n\nLet me see if I can say something everyone will agree on:\n\n---------------------------------------------------------------------------\n\nFirst, Peter, I hope you have not gotten too upset while reading the\nprevious messages.\n\nSecond, I know you asked for suggestions while working on psql, and\nreally didn't get much feedback. You did a great job without much\ndirection. Let me suggest you not give up on us helping you in other\nprojects. If you get stuck or need a suggestion, just send a note to\nhackers, and we can give you ideas. Often this will make your job\neasier.\n\n---------------------------------------------------------------------------\n\nActually, when I get stuck, I post to the list and put the project down\nfor a few hours. An answer to my question usually shows up very soon. \nIn the old days, I used to ask over and over again as I learned more\nabout the problem until someone figured it out. :-)\n\nI am thinking of calling 7.0 the Lane/Wieck/Eisentraut release.\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": "Sun, 23 Jan 2000 14:43:23 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "At 02:43 PM 1/23/00 -0500, Bruce Momjian wrote:\n>> I certainly don't want to discourage Peter, either, and perhaps\n>> was a bit too harsh. But release of a feature this half-baked\n>> would fit the stereotype many people have held towards free,\n>> open source software, and postgres in particular.\n\n>I again am totally confused by the reaction to this.\n\n>Peter has done a lot for 7.0. Only Tom Lane and Jan have done more work\n>on 7.0 than Peter. He has also fixed many TODO items from the list.\n\nYes, and that's great. I'm not commenting about those things, though.\nThough I have to say, having just finally built the pre-7.0 sources,\nI like the new psql formatting.\n\nThat doesn't mean I have to like an \"alter ... drop column\" that doesn't\nreally implement \"alter ... drop column\", though, does it? :)\n\n>We is not releasing tomorrow. He is putting in what he has and asking\n>for advise.\n\nPerhaps I'm suffering from a misperception, then...my understanding\nwas that his having committed the changes meant they would be showing\nup in the upcoming V7.0 Beta release.\n\n> Yes, it would have been better if he would have discussed\n>this first. However, he is writing _huge_ amounts of PostgreSQL code. \n>Look at the new psql or initdb, or the other items he has done. Maybe\n>he is too busy coding to bring up issues on the list.\n\n>As long as he addresses concerns we have, I can live with some\n>non-perfect code. He is relatively new to this. Honestly, only Tom\n>Lane and Jan are as energetic about 7.0 as Peter, so why rock the boat.\n\nThis sounds a bit like the old management technique of measuring\nproductivity by counting lines of code! I should hope quality counts\nfor even more than quantity. Shouldn't it?\n\n(and, no, I'm not implying that Peter's contributions are of poor\nquality, I'm just reacting to your point)\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Sun, 23 Jan 2000 12:02:30 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "On Sun, 23 Jan 2000, Hannu Krosing wrote:\n\n> The current \"(UN)Happy column dropping\" discussion, frankly seems to\n> stem much from jealousy - hands off my tree, we allow only _purfect_\n> contributions.\n\nI don't expect any contribution to be perfect ... I do expect those that\nare committing code directly to the source tree to take a few minutes and\nthink before they do so. Peter *knew* there were implementation flaws to\nwhat he added, yet he implemented it anyway, without asking anyone else\nfor comments and/or suggestions on how those flaws could be avoided ... if\nPeter didn't have commit access, he would have had to submit those patches\nfor review before having them applied, just like Alfred recently went\nthrough with his libpq changes ...\n\n> OTOH there are several existing features in postgresql you would not\n> expect, unless you have worked with postgresql for many years and read\n> most of traffic on hackers list (like running out of almost all\n> resources doing a seemingly innocent query (or having it done for you\n> by a \"smart\" application), or lack of most common-sense \"convenience\"\n> optimisations, like using index for max(), or being able to\n> _partially_ rollback DDL statements.\n\nAh, but, in these cases, they lack of don't break existing applications\n*and* the running out of all resources definitely isn't \"hidden\" in the\nbackground, you find out about it quick ...\n\nThe beef I have with how Peter went about implementing this was that the\nbiggest flaw that he lists is *hidden* in the background ... \n\n> Nobody has demanded removing ORs (or even the optimiser ;)) from\n> postgres because they can explode the backend.\n\nIt is because they explode the backend that we don't ... what Peter\nimplemented silently tromps on the OIDs ...\n\n> So IMHO discouraging small usability improvements is wrong.\n\nPpl are missing the whole point here ... it isn't the improvement that I\nhave a beef against, it is the fact that, unlike every other feature\naddition (bug fixes are different), there was absolutely no discussion\nbefore implementation ... hell, if the implementation didn't come with a\n\"caveat\" afterwards, it wouldn't have been so bad, but Peter commit'd a\n\"small usability improvement\" followed up by what *I* consider to be one\nhelluva caveat, without any discussion on how to get around that before\ncommitting ... that, IMHO, is wrong ...\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Sun, 23 Jan 2000 16:08:46 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "On Sun, 23 Jan 2000, Don Baccus wrote:\n\n> I guess this goes to my argument that Postgres is starting to be\n> regarded as a potential competitor to expensive commercial DBs in\n> certain application environments. If the bar is lowered for\n> contributions, Postgres will quickly re-earn the image of flakiness\n> that the current developers have worked so hard to shed.\n\nI'm not so much beef'd about 'lowering any bar', I'm beef'd that the bar\napparently is being set at different hits for contributors vs committers\n... \n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Sun, 23 Jan 2000 16:11:04 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "> At 02:43 PM 1/23/00 -0500, Bruce Momjian wrote:\n> >> I certainly don't want to discourage Peter, either, and perhaps\n> >> was a bit too harsh. But release of a feature this half-baked\n> >> would fit the stereotype many people have held towards free,\n> >> open source software, and postgres in particular.\n> \n> >I again am totally confused by the reaction to this.\n> \n> >Peter has done a lot for 7.0. Only Tom Lane and Jan have done more work\n> >on 7.0 than Peter. He has also fixed many TODO items from the list.\n> \n> Yes, and that's great. I'm not commenting about those things, though.\n> Though I have to say, having just finally built the pre-7.0 sources,\n> I like the new psql formatting.\n> \n> That doesn't mean I have to like an \"alter ... drop column\" that doesn't\n> really implement \"alter ... drop column\", though, does it? :)\n\nBut is this really a bad thing. I think it is acceptible as is. We\ncurrently tell people in the FAQ that do drop a column, do a SELECT INTO\n... ALTER RENAME. That loses more than Peter's version.\n\n> \n> >We is not releasing tomorrow. He is putting in what he has and asking\n> >for advise.\n> \n> Perhaps I'm suffering from a misperception, then...my understanding\n> was that his having committed the changes meant they would be showing\n> up in the upcoming V7.0 Beta release.\n\nWell, my assumption is that either Peter will add the missing\nfunctionality, or we will vote on whether to enable/disable it in 7.0. \nOne line in gram.y and it is disabled.\n\nI can tell you that I certainly will vote for it as enabled, even with\nthe limitations, because CLUSTER has a bigger problem. Maybe we just\nadd a NOTICE to CLUSTER and DROP COLUMN and be done with it.\n\nI can also say I would never have thought about the items Peter asked\nabout. I would have just implemented it as he did and maybe never even\nconsidered the limitations.\n\n> \n> > Yes, it would have been better if he would have discussed\n> >this first. However, he is writing _huge_ amounts of PostgreSQL code. \n> >Look at the new psql or initdb, or the other items he has done. Maybe\n> >he is too busy coding to bring up issues on the list.\n> \n> >As long as he addresses concerns we have, I can live with some\n> >non-perfect code. He is relatively new to this. Honestly, only Tom\n> >Lane and Jan are as energetic about 7.0 as Peter, so why rock the boat.\n> \n> This sounds a bit like the old management technique of measuring\n> productivity by counting lines of code! I should hope quality counts\n> for even more than quantity. Shouldn't it?\n> \n> (and, no, I'm not implying that Peter's contributions are of poor\n> quality, I'm just reacting to your point)\n\nWhen I say huge amount of code, I mean huge rewrites of terriblily\nunstuctured code into nice neat code. Look at the new psql vs. the old\ncode.\n\nWe can't expect people to just walk up and produce portable,\nstyle-conforming, totally functional code from day 1 or even year 1.\nWe work with people and point them in the right direction.\n\nYou know why ANALYZE is part of VACUUM? Because at the time I didn't\nknow how to scan a table. Vacuum already did that, so I piggybacked on\nthat code.\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": "Sun, 23 Jan 2000 15:18:14 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "> On Sun, 23 Jan 2000, Hannu Krosing wrote:\n> \n> > The current \"(UN)Happy column dropping\" discussion, frankly seems to\n> > stem much from jealousy - hands off my tree, we allow only _purfect_\n> > contributions.\n> \n> I don't expect any contribution to be perfect ... I do expect those that\n> are committing code directly to the source tree to take a few minutes and\n> think before they do so. Peter *knew* there were implementation flaws to\n> what he added, yet he implemented it anyway, without asking anyone else\n> for comments and/or suggestions on how those flaws could be avoided ... if\n> Peter didn't have commit access, he would have had to submit those patches\n> for review before having them applied, just like Alfred recently went\n> through with his libpq changes ...\n\nBut he is not done. What does it matter if he does 1/2 now and 1/2 in a\nweek, as long as it is done before beta? As long as the tree still\ncompiles, does it matter?\n\nLet him fix 50 TODO items 1/2 way. If he finishes them by beta, great.\nIf not, we can vote on a ripout/disable before beta begins.\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": "Sun, 23 Jan 2000 15:26:38 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "On Sun, 23 Jan 2000, Bruce Momjian wrote:\n\n> You know why ANALYZE is part of VACUUM? Because at the time I didn't\n> know how to scan a table. Vacuum already did that, so I piggybacked on\n> that code.\n\nBig difference ... what you did didn't run the risk of breaking existing\napplications ... *maybe* there is no choice in this, *maybe* the way that\nPeter implemented is the only way it *could* be implemented ... all I'm\narguing is that there should have been a discussion *before* it was\nimplemented to hammer that point out ...\n\n... just like we've done for the past 4 years now ...\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Sun, 23 Jan 2000 16:41:03 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "On Sun, 23 Jan 2000, Bruce Momjian wrote:\n\n> > On Sun, 23 Jan 2000, Hannu Krosing wrote:\n> > \n> > > The current \"(UN)Happy column dropping\" discussion, frankly seems to\n> > > stem much from jealousy - hands off my tree, we allow only _purfect_\n> > > contributions.\n> > \n> > I don't expect any contribution to be perfect ... I do expect those that\n> > are committing code directly to the source tree to take a few minutes and\n> > think before they do so. Peter *knew* there were implementation flaws to\n> > what he added, yet he implemented it anyway, without asking anyone else\n> > for comments and/or suggestions on how those flaws could be avoided ... if\n> > Peter didn't have commit access, he would have had to submit those patches\n> > for review before having them applied, just like Alfred recently went\n> > through with his libpq changes ...\n> \n> But he is not done. What does it matter if he does 1/2 now and 1/2 in a\n> week, as long as it is done before beta? As long as the tree still\n> compiles, does it matter?\n> \n> Let him fix 50 TODO items 1/2 way. If he finishes them by beta, great.\n> If not, we can vote on a ripout/disable before beta begins.\n\nAnd if 5 of those 50 that he does finish rely on 45 that he doesn't? I'm\njust saying that 24hr of discussion before implementation might have come\nup with a cleaner solution to the problem ...\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Sun, 23 Jan 2000 16:43:22 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "At 03:18 PM 1/23/00 -0500, Bruce Momjian wrote:\n\n>> That doesn't mean I have to like an \"alter ... drop column\" that doesn't\n>> really implement \"alter ... drop column\", though, does it? :)\n>\n>But is this really a bad thing. I think it is acceptible as is. We\n>currently tell people in the FAQ that do drop a column, do a SELECT INTO\n>... ALTER RENAME. That loses more than Peter's version.\n\nAgain I'm missing not having Date here, I just called and it will\nbe mailed to me next week.\n\nBut I've been under the assumption that \"alter table drop column\" is\npart of SQL 92. \n\nIf I'm wrong, then I suppose PostgreSQL can do whatever it wants.\n\nIf it is part of SQL 92, though, shouldn't there at least be discussion\nof what's needed to actually implement the real, live standard semantics?\n\nIsn't the user who picks up PostgreSQL from, say, a Red Hat distribution\ngoing to be a bit surprised that \"drop column\" drops integrity constraints\nfor the whole table?\n\nAssuming, of course, the feature as is were to go into release.\n\n>I can also say I would never have thought about the items Peter asked\n>about. I would have just implemented it as he did and maybe never even\n>considered the limitations.\n\nHmmm...if it's part of SQL 92 I certainly would've looked at the \ndefined semantics first. At least, that's what people pay me to do\nwhen I hack compilers...\n\n>We can't expect people to just walk up and produce portable,\n>style-conforming, totally functional code from day 1 or even year 1.\n>We work with people and point them in the right direction.\n\nAnd if I get organized to the point of being able to make contributions\nI would hope for tough, objective criticism of my efforts.\n\n>You know why ANALYZE is part of VACUUM? Because at the time I didn't\n>know how to scan a table. Vacuum already did that, so I piggybacked on\n>that code.\n\nThis doesn't break standard semantics - again, if I'm wrong about\nalter table ... drop column being part of SQL 92 then I'll back off\nthe suggestion that an implementation of standard semantics be\nexplored.\n\nMaybe we should just drop this thread, I'm certainly not out to make\nany enemies. I've become fond of Postgres, and I guess my expectations\nand standards are just very high. Not that I'm always able to live\nup to them! :)\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Sun, 23 Jan 2000 12:45:18 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "> > But he is not done. What does it matter if he does 1/2 now and 1/2 in a\n> > week, as long as it is done before beta? As long as the tree still\n> > compiles, does it matter?\n> > \n> > Let him fix 50 TODO items 1/2 way. If he finishes them by beta, great.\n> > If not, we can vote on a ripout/disable before beta begins.\n> \n> And if 5 of those 50 that he does finish rely on 45 that he doesn't? I'm\n> just saying that 24hr of discussion before implementation might have come\n> up with a cleaner solution to the problem ...\n\nSure, that is preferable.\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": "Sun, 23 Jan 2000 15:46:47 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "On Sun, 23 Jan 2000, Bruce Momjian wrote:\n\n> > > But he is not done. What does it matter if he does 1/2 now and 1/2 in a\n> > > week, as long as it is done before beta? As long as the tree still\n> > > compiles, does it matter?\n> > > \n> > > Let him fix 50 TODO items 1/2 way. If he finishes them by beta, great.\n> > > If not, we can vote on a ripout/disable before beta begins.\n> > \n> > And if 5 of those 50 that he does finish rely on 45 that he doesn't? I'm\n> > just saying that 24hr of discussion before implementation might have come\n> > up with a cleaner solution to the problem ...\n> \n> Sure, that is preferable.\n\n*head pounding against a wall* that was my *whole* point :)\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Sun, 23 Jan 2000 16:58:20 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "> Maybe we should just drop this thread, I'm certainly not out to make\n> any enemies. I've become fond of Postgres, and I guess my expectations\n> and standards are just very high. Not that I'm always able to live\n> up to them! :)\n\nIt's like watching hot dogs or legislation being made. You don't want\nto watch.\n\nWe get everything working in the end. It can be ugly getting there and\nseeing all the warts along the way.\n\nI think we are spoiled with Tom, Jan, and Vadim who just show up and\nproduce 100% functional patches the first time. Some people go at it in\ndifferent ways. Eventually it all gets working. I can't tell you how\nmany times I have added a feature or fixed something, and then had Tom\nLane or Vadim come along and fix my fixes.\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": "Sun, 23 Jan 2000 15:59:38 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "> On Sun, 23 Jan 2000, Bruce Momjian wrote:\n> \n> > > > But he is not done. What does it matter if he does 1/2 now and 1/2 in a\n> > > > week, as long as it is done before beta? As long as the tree still\n> > > > compiles, does it matter?\n> > > > \n> > > > Let him fix 50 TODO items 1/2 way. If he finishes them by beta, great.\n> > > > If not, we can vote on a ripout/disable before beta begins.\n> > > \n> > > And if 5 of those 50 that he does finish rely on 45 that he doesn't? I'm\n> > > just saying that 24hr of discussion before implementation might have come\n> > > up with a cleaner solution to the problem ...\n> > \n> > Sure, that is preferable.\n> \n> *head pounding against a wall* that was my *whole* point :)\n\nYes, but if wants to put what he has done so far, and then discuss it,\nwhy give him grief about it? Maybe that's how he likes to do things.\n\nI tried to get Jan to assist Vince in the way CVS is used for the web\npages. Vince was happy with his system and my interference in Vince's\nsystem made for hurt feelings all around.\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": "Sun, 23 Jan 2000 16:06:28 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "\nOn 23-Jan-00 Bruce Momjian wrote:\n>> On Sun, 23 Jan 2000, Bruce Momjian wrote:\n> I tried to get Jan to assist Vince in the way CVS is used for the web\n> pages. Vince was happy with his system and my interference in Vince's\n> system made for hurt feelings all around.\n\nWater under the bridge. Jan and I have down and had a few beers \ntogether.\n\nVince.\n-- \n==========================================================================\nVince Vielhaber -- KA8CSH email: [email protected] http://www.pop4.net\n 128K ISDN: $24.95/mo or less - 56K Dialup: $17.95/mo or less at Pop4\n Online Campground Directory http://www.camping-usa.com\n Online Giftshop Superstore http://www.cloudninegifts.com\n==========================================================================\n\n\n", "msg_date": "Sun, 23 Jan 2000 16:19:20 -0500 (EST)", "msg_from": "Vince Vielhaber <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "> \n> On 23-Jan-00 Bruce Momjian wrote:\n> >> On Sun, 23 Jan 2000, Bruce Momjian wrote:\n> > I tried to get Jan to assist Vince in the way CVS is used for the web\n> > pages. Vince was happy with his system and my interference in Vince's\n> > system made for hurt feelings all around.\n> \n> Water under the bridge. Jan and I have down and had a few beers \n> together.\n\nWell, that's very good news. \n\nNow, I guess I can ask abou the new developers page. It would be nice\nto have that for the start of Beta.\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": "Sun, 23 Jan 2000 16:21:11 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "On Sun, 23 Jan 2000, Bruce Momjian wrote:\n\n> I think we are spoiled with Tom, Jan, and Vadim who just show up and\n> produce 100% functional patches the first time. Some people go at it in\n> different ways. Eventually it all gets working. I can't tell you how\n> many times I have added a feature or fixed something, and then had Tom\n> Lane or Vadim come along and fix my fixes.\n\n2 points:\n\n\ta) 100% functional patches *after* extensive discussion\n\tb) Peter's change wasn't a fix\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Sun, 23 Jan 2000 17:22:47 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "> On Sun, 23 Jan 2000, Bruce Momjian wrote:\n> \n> > I think we are spoiled with Tom, Jan, and Vadim who just show up and\n> > produce 100% functional patches the first time. Some people go at it in\n> > different ways. Eventually it all gets working. I can't tell you how\n> > many times I have added a feature or fixed something, and then had Tom\n> > Lane or Vadim come along and fix my fixes.\n> \n> 2 points:\n> \n> \ta) 100% functional patches *after* extensive discussion\n> \tb) Peter's change wasn't a fix\n\nUsually some one cleans me up. :-) Even with discussion, my stuff is\nnot 100%.\n\nI did code to extend the number of index columns >8, but broke the\nsystem in several ways. Tom Lane fixed it for me. I think I even\ncommitted it with a broken initdb, but figured out how to disable it\nwhile Tom and I worked on it.\n\nYes, but even my feature additions have problems. :-)\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": "Sun, 23 Jan 2000 16:27:00 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "On Sun, 23 Jan 2000, Bruce Momjian wrote:\n\n> > On Sun, 23 Jan 2000, Bruce Momjian wrote:\n> > \n> > > I think we are spoiled with Tom, Jan, and Vadim who just show up and\n> > > produce 100% functional patches the first time. Some people go at it in\n> > > different ways. Eventually it all gets working. I can't tell you how\n> > > many times I have added a feature or fixed something, and then had Tom\n> > > Lane or Vadim come along and fix my fixes.\n> > \n> > 2 points:\n> > \n> > \ta) 100% functional patches *after* extensive discussion\n> > \tb) Peter's change wasn't a fix\n> \n> Usually some one cleans me up. :-) Even with discussion, my stuff is\n> not 100%.\n> \n> I did code to extend the number of index columns >8, but broke the\n> system in several ways. Tom Lane fixed it for me. I think I even\n> committed it with a broken initdb, but figured out how to disable it\n> while Tom and I worked on it.\n> \n> Yes, but even my feature additions have problems. :-)\n\nThere is a key factor involved in all of this ... how many of these\n\"bugs\" were things that ppl would think about before it is\nimplemented? \n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Sun, 23 Jan 2000 17:42:56 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "> > Usually some one cleans me up. :-) Even with discussion, my stuff is\n> > not 100%.\n> > \n> > I did code to extend the number of index columns >8, but broke the\n> > system in several ways. Tom Lane fixed it for me. I think I even\n> > committed it with a broken initdb, but figured out how to disable it\n> > while Tom and I worked on it.\n> > \n> > Yes, but even my feature additions have problems. :-)\n> \n> There is a key factor involved in all of this ... how many of these\n> \"bugs\" were things that ppl would think about before it is\n> implemented? \n\nNo idea. I just know I didn't think of them.\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": "Sun, 23 Jan 2000 16:48:10 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "At 12:04 AM 1/24/00 +0200, Hannu Krosing wrote:\n\n>It could possibly be done by marking the column deleted and doing the \n>compression/renumbering during vacuum , or by locking the table and \n>compressing each page in-place if space is a concern or maybe several \n>other ways. \n>The existence of several ways to do it should not discourage people \n>from actually adding the drop column feature to postgres\n\nIt should provide even more encouragement to discuss the proposed\nimplementation *first*.\n\nIMHO, again.\n\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Sun, 23 Jan 2000 14:03:55 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "The Hermit Hacker wrote:\n> \n> On Sun, 23 Jan 2000, Bruce Momjian wrote:\n> \n> > I think we are spoiled with Tom, Jan, and Vadim who just show up and\n> > produce 100% functional patches the first time. Some people go at it in\n> > different ways. Eventually it all gets working. I can't tell you how\n> > many times I have added a feature or fixed something, and then had Tom\n> > Lane or Vadim come along and fix my fixes.\n> \n> 2 points:\n> \n> a) 100% functional patches *after* extensive discussion\n\nIt assumes that you do all your actual coding and code reviewing yourself \nwhile hiding the code, i.e. the (alledged) *BSD way. \n\nThe \"release often, release early\" school of OS tells people to show even \npremature code in hope of getting more/faster eyballing.\n\nHe could have done it by posting patches for discussion, but I can't see \nthe real difference here.\n\nWhat I think he is doing here is one-to-one move the FAQ recommendation \nfor drop column to backend. And then move on from that to cover the areas \nof renumbering colums and keeping related constraints intact the FAQ \nglossed over.\n\nIt could possibly be done by marking the column deleted and doing the \ncompression/renumbering during vacuum , or by locking the table and \ncompressing each page in-place if space is a concern or maybe several \nother ways. \nThe existence of several ways to do it should not discourage people \nfrom actually adding the drop column feature to postgres\n\n> b) Peter's change wasn't a fix\n\nI was'nt a _bug_ fix, it was a usability fix and likely SQL 92 \ncompatibility fix.\n\n-------------\nHannu\n", "msg_date": "Mon, 24 Jan 2000 00:04:39 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "At 12:19 AM 1/24/00 +0200, Hannu Krosing wrote:\n>Don Baccus wrote:\n\n>> It should provide even more encouragement to discuss the proposed\n>> implementation *first*.\n>\n>Judging from the length of this thread it is much more effective to get \n>a discussion *after* ;)\n\nNot at all...thus far there's no discussion of HOW to implement the\ncorrect semantics at all. \n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Sun, 23 Jan 2000 14:17:39 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "Don Baccus wrote:\n> \n> At 12:04 AM 1/24/00 +0200, Hannu Krosing wrote:\n> \n> >It could possibly be done by marking the column deleted and doing the\n> >compression/renumbering during vacuum , or by locking the table and\n> >compressing each page in-place if space is a concern or maybe several\n> >other ways.\n> >The existence of several ways to do it should not discourage people\n> >from actually adding the drop column feature to postgres\n> \n> It should provide even more encouragement to discuss the proposed\n> implementation *first*.\n\nJudging from the length of this thread it is much more effective to get \na discussion *after* ;)\n\n---------------\nHannu\n", "msg_date": "Mon, 24 Jan 2000 00:19:25 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "Does anyone know why this thread is called, \"Happy column dropping\"?\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": "Sun, 23 Jan 2000 17:20:04 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "On Sun, 23 Jan 2000, Bruce Momjian wrote:\n\n> > \n> > On 23-Jan-00 Bruce Momjian wrote:\n> > >> On Sun, 23 Jan 2000, Bruce Momjian wrote:\n> > > I tried to get Jan to assist Vince in the way CVS is used for the web\n> > > pages. Vince was happy with his system and my interference in Vince's\n> > > system made for hurt feelings all around.\n> > \n> > Water under the bridge. Jan and I have down and had a few beers \n> > together.\n> \n> Well, that's very good news. \n> \n> Now, I guess I can ask abou the new developers page. It would be nice\n> to have that for the start of Beta.\n\nYou volunteering? :) When I said earlier that it was on the back\nburner, it is because I'm extremely busy right now. If Jan wants to\ndo it or if you do, I have no problem with that - but I suspect Jan's\na little on the busy side right now as well. With luck perhaps I can\nhave it online by late spring.\n\nVince.\n-- \n==========================================================================\nVince Vielhaber -- KA8CSH email: [email protected] http://www.pop4.net\n 128K ISDN: $24.95/mo or less - 56K Dialup: $17.95/mo or less at Pop4\n Online Campground Directory http://www.camping-usa.com\n Online Giftshop Superstore http://www.cloudninegifts.com\n==========================================================================\n\n\n\n", "msg_date": "Sun, 23 Jan 2000 17:21:07 -0500 (EST)", "msg_from": "Vince Vielhaber <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "On Sun, 23 Jan 2000, Don Baccus wrote:\n\n> At 12:19 AM 1/24/00 +0200, Hannu Krosing wrote:\n> >Don Baccus wrote:\n> \n> >> It should provide even more encouragement to discuss the proposed\n> >> implementation *first*.\n> >\n> >Judging from the length of this thread it is much more effective to get \n> >a discussion *after* ;)\n> \n> Not at all...thus far there's no discussion of HOW to implement the\n> correct semantics at all. \n\nActually, I like the fact that Hannu suggested a way of implemented that\nBruce and I have been discussing in private :)\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Sun, 23 Jan 2000 18:27:26 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "> > Now, I guess I can ask abou the new developers page. It would be nice\n> > to have that for the start of Beta.\n> \n> You volunteering? :) When I said earlier that it was on the back\n> burner, it is because I'm extremely busy right now. If Jan wants to\n> do it or if you do, I have no problem with that - but I suspect Jan's\n> a little on the busy side right now as well. With luck perhaps I can\n> have it online by late spring.\n> \n\nJan's version looked done to me. Can't we just put that up until we\nhave something better.\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": "Sun, 23 Jan 2000 17:30:04 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "Don Baccus wrote:\n> \n> At 12:19 AM 1/24/00 +0200, Hannu Krosing wrote:\n> >Don Baccus wrote:\n> \n> >> It should provide even more encouragement to discuss the proposed\n> >> implementation *first*.\n> >\n> >Judging from the length of this thread it is much more effective to get\n> >a discussion *after* ;)\n> \n> Not at all...thus far there's no discussion of HOW to implement the\n> correct semantics at all.\n\nSuch is the human nature. Instead of discussing how to implement it we \ndiscuss someone else not discussing it at proper time...\n\nSeems to be much more important topic.\n\n-----------\nHannu\n", "msg_date": "Mon, 24 Jan 2000 00:37:21 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "Bruce Momjian wrote:\n> \n> Does anyone know why this thread is called, \"Happy column dropping\"?\n\nBecause Peter thought everyone would be happy being able to drop\ncolumns.\n\nOf course, more discussion should have happened. I have found out the\nhard way about some of this in keeping up the RPM's. However, I have\nfound most of the RPM issues settle out from end users -- not from the\ndevelopment team. Thus, I am in an 'in between' position -- which is an\nideal place for a packager, anyway.\n\n--\nLamar Owen\nWGCR Internet Radio\n1 Peter 4:11\n", "msg_date": "Sun, 23 Jan 2000 22:23:24 -0500", "msg_from": "Lamar Owen <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "Hannu Krosing wrote:\n\n> Putting something in a development tree can hardly be called a \"release\"\n> I'm sure many people would appreciate it even without \"preserving oid-s\"\n> as OID's are declared deprecated for (AFAIK) >2 years, \n\nI've never seen or heard of any mention of oids being \"deprecated\". Some\npeople don't like them much, other people like them. Myself, I think\nthey will be great when a few issues with them are cleaned up (e.g.\nbackup with preservation of oids and full INSERT statements).\n\n> and they don't give\n> any real advantage over primary key with default nextval, as there are\n> currently no means for reasonably getting from oid to record.\n\nNot sure what you mean by \"no means\". They are queried and indexed like\nother fields. No advantage? Well it takes one less pg call to get the\nlast value, and it takes less storage since they are there anyway. They\nwill also be very important if and when postgres makes more moves toward\nbeing an ODBMS.\n\nBTW, if someone implememnted INSERT where you may optionally specify the\noid, would this solve the problem, as I take it this patch is all about\nimplementing drop column in terms of a CREATE/SELECT INTO.\n", "msg_date": "Mon, 24 Jan 2000 14:50:07 +1100", "msg_from": "Chris Bitmead <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": ">>>> I think we are spoiled with Tom, Jan, and Vadim who just show up and\n>>>> produce 100% functional patches the first time.\n\nWho, me? Go back and read the CVS logs for all my \"oops...\" messages.\n\n>> a) 100% functional patches *after* extensive discussion\n>\n> Usually some one cleans me up. :-) Even with discussion, my stuff is\n> not 100%.\n\nAssuming that Peter is still listening and hasn't given up in disgust,\nI think the take-home point here is \"discuss first, implement second\".\nEven the guys who have been working with Postgres the longest are\nkeenly aware that they don't know all there is to know about the\nsystem. *That's* why we have developed a tradition of sending proposals\nto the list before doing anything major. Very often there's someone\nwho knows a little more than you do about one aspect or another, and\nwill be able to save you from a mistake.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 24 Jan 2000 00:21:08 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "> >>>> I think we are spoiled with Tom, Jan, and Vadim who just show up and\n> >>>> produce 100% functional patches the first time.\n> \n> Who, me? Go back and read the CVS logs for all my \"oops...\" messages.\n\nBut you fix your own oops. Sometimes I throw in the towel.\n\n> \n> >> a) 100% functional patches *after* extensive discussion\n> >\n> > Usually some one cleans me up. :-) Even with discussion, my stuff is\n> > not 100%.\n> \n> Assuming that Peter is still listening and hasn't given up in disgust,\n> I think the take-home point here is \"discuss first, implement second\".\n> Even the guys who have been working with Postgres the longest are\n> keenly aware that they don't know all there is to know about the\n> system. *That's* why we have developed a tradition of sending proposals\n> to the list before doing anything major. Very often there's someone\n> who knows a little more than you do about one aspect or another, and\n> will be able to save you from a mistake.\n\nYes. We certainly have driven that point home.\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": "Mon, 24 Jan 2000 00:27:23 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "On Sun, 23 Jan 2000, The Hermit Hacker wrote:\n\n> Its not the *risk* that bothers me, its the lack of discussions ... IMHO,\n> he should have brought up the \"I'm in the process of toasting the reliance\n> on OIDs\" topic *before* implementing it ... give other ppl a chance to\n> possibly present alternatives ...\n\n\nFrom: Bruce Momjian <[email protected]> \nTo: Alain TESIO <[email protected]> \nSubject: Re: [GENERAL] A script which drops a column \nDate: Thu, 25 Nov 1999 23:36:42 -0500 (EST) \n\n> Hello,\n> \n> You may be interested by a script which drops a column as this\n> feature isn't supported by Postgresql. I guess it could be easier\n> and nice in Perl or something similar but I'm using what I know.\n> \n> The parameters are in that order :\n> \n> the name of the database\n> the table\n> the column to drop\n> \n> Alain\n> \n> #!/bin/sh\n> \n> psql -d $1 -c \"\\d $2\" | awk 'BEGIN { keep=1 } /+-/ { keep=1-keep } { if\n> (keep) { print } }' | grep -v \"\\-\\-\" | grep -v \"Table *=\" | grep -v \" $3\n\" |\n> sed \"s/| \\([^ ]*\\).*/\\1/\" | tr -s \\\\012 \",\" | sed \"s/,$//\" | sed\n> \"s/\\(.*\\)/select \\1 into temp tmp_drop_column from $2 ; drop table $2 ;\n> select * into $2 from tmp_drop_column;/\" > tmp_sql_drop_column\n> psql -d $1 -f tmp_sql_drop_column\n> rm tmp_sql_drop_column\n\nThe fact is that internally this is exactly what we would have to do to\ndrop a column. Now that we have temp tables, maybe someone could code\nup some C to do this, or just an pg_exec_query_dest() call to do the\njob.\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\nI think what I did is significantly better than that, and of course it\nwill be cleaned up by next week.\n\n-- \nPeter Eisentraut Sernanders vaeg 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Mon, 24 Jan 2000 13:15:27 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "On Mon, 24 Jan 2000, Peter Eisentraut wrote:\n\n> I think what I did is significantly better than that, and of course it\n> will be cleaned up by next week.\n\n>From a discussion with Bruce over the past 24hrs, as well as was mentioned\nby Hannu on this list ... we effectively do this with VACUUM, so \"copying\"\nthat logic should be, I imagine, relatively easy, *and* it preserves OIDs\n*and* it doesn't require 2x the space...\n\nI imagine that DROP COLUMN isn't used that often, so the time it takes to\ndo this isn't an issue ... \n\n=================\n> > \n> > One thing I've never been able to figure out ... why isn't implementing\n> > DROP COLUMN a simple matter of \"lock table;remove field from pg_*;rebuild\n> > table\", similar to the way that we do when we vacuum?\n> \n> Because the column is still in the table, just invisible after removing\n> from pg_attribute. You need to remove the column from the heap, and\n> that requires creating a new version of the table. Vacuum moves tuples\n> but does not make them shorter.\n\nThat I understand ... excuse my ignorance, but what would it take to\ndo that? The way I envision a table 'on disk':\n\ncol1col2col3col4col5|col1col2col3col4col5|col1col2col3col4col5|\n\nBasically, you have X tuples per page, where a page is 8192bytes,\ncorrect? If you were to remove, let's say, col2 out of the table, why\ncan't you do:\n\nlock table\nread page 1 into memory\nrewrite page1 to disk as:\ncol1col3col4col5|col1col3col4col5|col1col3col4col5|\nadd one to page and goto 'read page n to memory'\nunlock table\n\nI'm making an assumption here ... first one being that each 'tuples' has\nsome sort of endoftuple marker in the table ...\n\nIf we're removing a column, the resultant 'page size' from the modified\npage is going to be smaller then the original, so I would think it would\nbe a relatively simple thing, considering that its a read/re-write from\nthe same part of the 'on disk file' ...\n\n... and it wouldn't require 2X the space used by the table ...\n===================\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Mon, 24 Jan 2000 09:00:58 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "The Hermit Hacker wrote:\n> \n> > Because the column is still in the table, just invisible after removing\n> > from pg_attribute. You need to remove the column from the heap, and\n> > that requires creating a new version of the table. Vacuum moves tuples\n> > but does not make them shorter.\n> \n> That I understand ... excuse my ignorance, but what would it take to\n> do that? The way I envision a table 'on disk':\n> \n> col1col2col3col4col5|col1col2col3col4col5|col1col2col3col4col5|\n\nI recently did a small python script to salvage deleted tuples and I can say \nthat current docs on the layout of storage are very incomplete ant partially \nwrong.\n\n> Basically, you have X tuples per page, where a page is 8192bytes,\n> correct? If you were to remove, let's say, col2 out of the table, why\n> can't you do:\n> \n> lock table\n> read page 1 into memory\n> rewrite page1 to disk as:\n> col1col3col4col5|col1col3col4col5|col1col3col4col5|\n> add one to page and goto 'read page n to memory'\n> unlock table\n> \n> I'm making an assumption here ... first one being that each 'tuples' has\n> some sort of endoftuple marker in the table ...\n\nyou do have startoftuple/startoffreespace (as a offset inside the page)\nbut getting at the starts of col2 and col3 is not that easy - you must use \nall the accessor functions from pg_attribute and count null-bits (and \nshift null-bitmap) if present \n\nThat's why I actually like the idea of just hiding the column (and setting \nit to DEFAULT NULL) - you don't automatically reclaim space, but you don't \nneed much any extra space either. And it's very fast.\n\nAnd as a practical person I like the current implementation too, mainly\nbecause \nit's there and it does not break anything, at least when you don't use it ;)\n\nAs it is not a feature anyone would use in scripts very often (except Don\nBaccus ;)\n\n> If we're removing a column, the resultant 'page size' from the modified\n> page is going to be smaller then the original, so I would think it would\n> be a relatively simple thing, considering that its a read/re-write from\n> the same part of the 'on disk file' ...\n> \n> ... and it wouldn't require 2X the space used by the table ...\n\nBut a system crash while doing it would do really bad things, not to mention \nthe fact that it bypasses storage manager making future changes to storage \nmanagers very hard.\n\nVACUUMs bypassing of storage manager is understandable as it is a part of \nstorage manager and not a general SQL thing - a garbage-collecting\nall-in-memory \nsigning-while-working storage manager will not need vacuum, analyse it may\nneed, \nperhaps.\n\n-----------------\nHannu\n", "msg_date": "Tue, 25 Jan 2000 00:43:41 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "On 2000-01-23, Hiroshi Inoue mentioned:\n\n> Anyway I have 2 basic questions.\n> \n> 1) Is the * 2x disk usage * implementation really needed ?\n\nYes, unless you bypass all transaction logic and do a get a row, change\nthe row, delete the old row, write the new row, and silently hope that no\nproblems come up down the line. If you do an SQL update of all the rows in\na 10GB table you temporarily need 20GB in case there is a rollback.\n\n> 2) Why rename() ?\n> I don't trust rename() at all in transaction control.\n> The first thing we should do it to change relname -> relation file\n> name mapping in order to avoid calling rename(). \n\nThat's a good point. The alter table / rename code makes free use of this,\nwhich is just waiting to kick somebody in the head. If you think this\ncould be addressed in the next release, I'm even for dropping my\nbusiness and wait for a cleaner solution.\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n\n\n", "msg_date": "Tue, 25 Jan 2000 00:48:06 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": true, "msg_subject": "RE: [HACKERS] Happy column dropping " }, { "msg_contents": "On 2000-01-22, Tom Lane mentioned:\n\n> AFAIK there is nothing particularly magic about OIDs. You could\n> perfectly well create the new table with the same OIDs as are in the\n> old table (see COPY WITH OIDS if you are wondering how).\n\nOkay, the oids of the user data are safe.\n\n> > Is it possible/safe to change to oid of the new pg_class entry back to the\n> > old one? In that case the trouble of moving over all the constraints, etc.\n> > would be half the work.\n> \n> Wrong way to think about it. You should be doing a heap_update of the\n> catalog tuples that need to change, ISTM.\n> \n> You could almost get away with doing it like you describe, except that\n> there is a unique index on pg_class OIDs these days (right, Bruce?)\n> and that index will kick out an error. But heap_update on the original\n> table tuple will work.\n> \n> I think what we may want here is something comparable to what's been\n> discussed recently for VACUUM: build the new table as a new heap file\n> and then rename the physical file into place, without really doing\n> anything to the pg_class tuple --- except of course you'd need to\n> heap_update it to adjust the number-of-attributes field.\n\nI've tried to do that but it messed me up big time. If I drop the column\nand do a select * from tablename it segfaults. The same happens on vacuum\nanalyze (but not plain vacuum). For the analyze part I traced it down to\nthe tuple that gets passed to nocachegetattr() still has t_data->t_natts\nset at the old value put the data itself is no longer there, hence\nsegfault. Vacuum does some Page and MemoryContext things to get that\ntuple, so I'm lost there, but I figure select has the same problem. Seems\nlike not all the buffers have been flushed, but there aren't any more I\ncould think of. Because when I reconnect, everything is fine. Help!\n\nWhat more needs to be done?\n\nnewrel = heap_create(...);\n{ copy data from oldrel to newrel }\n{ update pg_class.relnatts }\n{ update pg_attribute }\n{ update pg_attrdef }\n/* get rid of old one */\nReleaseRelationBuffers(oldrel);\nsmgrunlink(..., oldrelname);\nRelationForgetRelation(oldrel_oid);\n/* Rename the new one */\nFlushRelationBuffers(tempname, (BlockNumber) 0, true);\nsmgrclose(..., tempname);\nheap_close(newrel);\nrename(tempname, oldrelname);\n\nThis is pretty much what it does. Not enough flushing? Too much flushing?\n\nHowever, the more severe problem with this approach is this: If for some\nreason whatsoever the rename() call fails you've already deleted the\noriginal table on disk and now you're stuck with a heap file that you\ncan't rename plus a catalog entry to a table that doesn't exist on disk.\nPanic. Any reordering of the above suggested? Of course, rename would\nnormally be able to atomically overwrite the old table, but since the\ndisk representation might be split over several files we lose. The table\nrenaming code makes some pretty dangerous assumptions in this regard, I\njust noticed. Perhaps we should forbid this kind of messing with big\ntables, at least until we come up with a better scheme. And that's leaving\nalone the fact that calling rename in the first place is a pretty bad\nviolation of the storage manager encapsulation. Darn it.\n\n> \n> > 2) how do I find out if the dropped column is referenced in a constraint,\n> > trigger, rule (this is necessary for a correct RESTRICT/CASCADE\n> > implementation)\n> \n> Actually it's worse than that: you need to be prepared to renumber the\n> columns after the dropped one, too. Probably what you will need to do\n> is read in and deparse all the relevant rules and triggers, then reparse\n> them against the updated table schema. Ugly. And no, I have no idea\n> how you even *find* all the relevant rules. (Jan?)\n\nI think this will be postponed. This is not even done on DROP TABLE, so it\nwill be consistent. ;)\n\n> \n> > Oh, btw., heaven help you if you try this on tables that are inherited\n> > from.\n> \n> The whole thing should be done inside a recursive routine that applies\n> the same change to all children of the target table. See ALTER TABLE\n> ADD COLUMN for an example. (ADD COLUMN is pretty broken too, since it\n> doesn't preserve consistency of column numbering across child tables ---\n> want to reimplement it in this same style?)\n\nYes I saw that. I'm just going to forbid use of this on inheritance trees\nuntil all of this gets fixed in one run.\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n\n", "msg_date": "Tue, 25 Jan 2000 00:48:22 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "On 2000-01-22, Tom Lane mentioned:\n\n> > 2) how do I find out if the dropped column is referenced in a constraint,\n> > trigger, rule (this is necessary for a correct RESTRICT/CASCADE\n> > implementation)\n> \n> Actually it's worse than that: you need to be prepared to renumber the\n> columns after the dropped one, too. Probably what you will need to do\n> is read in and deparse all the relevant rules and triggers, then reparse\n> them against the updated table schema. Ugly. And no, I have no idea\n> how you even *find* all the relevant rules. (Jan?)\n\nPerhaps their should be a pg_attribute.attisusedbytrigger::oid,\npg_attribute.attisconstrainedbyconstr::oid, etc. Eventually, I think, this\nis unavoidable if you want DROP TABLE to do the right thing as well, and\nscanning and decoding possibly hundreds of rules, triggers, and\nconstraints won't get you far.\n\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n\n", "msg_date": "Tue, 25 Jan 2000 00:48:47 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "On 2000-01-23, Don Baccus mentioned:\n\n> I certainly don't want to discourage Peter, either, and perhaps\n> was a bit too harsh. But release of a feature this half-baked\n> would fit the stereotype many people have held towards free,\n> open source software, and postgres in particular.\n\nWho said something of a release? Whatever happened to release early,\nrelease often?\n\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n\n", "msg_date": "Tue, 25 Jan 2000 00:48:59 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "At 12:48 AM 1/25/00 +0100, Peter Eisentraut wrote:\n>On 2000-01-23, Don Baccus mentioned:\n>\n>> I certainly don't want to discourage Peter, either, and perhaps\n>> was a bit too harsh. But release of a feature this half-baked\n>> would fit the stereotype many people have held towards free,\n>> open source software, and postgres in particular.\n>\n>Who said something of a release? Whatever happened to release early,\n>release often?\n\nIs \"release early, release often\" why RH 6.1 doesn't seem to recognize\nmemory > 64 MB on a wide variety of x86 systems, the exact same boxes\non which RH 6.0 properly detected memory? (kernel 2.2.*)\n\nSometimes I wonder...it leaves the impression that RH 6.1 left the house\nwith little QA testing.\n\nI was unaware that other folks had pointed to the copy/rename approach\nearlier as being a possible means of implementation. I thought you'd\npulled that one out of your hat. Still, more advance discussion would've\nperhaps led to other approaches to investigate, just as discussion\nnow is doing.\n\nI'm going to be blunt: implementation of \"drop column\" by doing a copy/rename\nisn't something one expects of a competitive commercial-quality RDBMS.\n\nPerhaps it's the best we can expect of Postgres, though. If so, so be it.\n\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Mon, 24 Jan 2000 15:53:37 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "Peter Eisentraut <[email protected]> writes:\n> Perhaps their should be a pg_attribute.attisusedbytrigger::oid,\n> pg_attribute.attisconstrainedbyconstr::oid, etc. Eventually, I think, this\n> is unavoidable if you want DROP TABLE to do the right thing as well, and\n> scanning and decoding possibly hundreds of rules, triggers, and\n> constraints won't get you far.\n\nWouldn't help much: when you do a DROP TRIGGER, do you turn off the\nattisusedbytrigger, or not? You'd still end up scanning everything,\njust at a different time.\n\nMaybe if it were a reference count, and not just a bit --- but I'd sure\nhate to try to guarantee that we maintain the reference count\naccurately.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 24 Jan 2000 19:00:16 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "Peter Eisentraut <[email protected]> writes:\n>> I certainly don't want to discourage Peter, either, and perhaps\n>> was a bit too harsh. But release of a feature this half-baked\n>> would fit the stereotype many people have held towards free,\n>> open source software, and postgres in particular.\n\n> Who said something of a release?\n\nUm, you do recall that we are one week from feature-freeze for 7.0 beta,\ndon't you? It's mighty late in the cycle to be committing code that you\nare not expecting to release in more or less its current form. The\nreason the howls have been so loud is that because of the calendar,\neveryone is assuming that you intend to release this code more or less\nas it stands.\n\nIf that was *not* your intent, perhaps you had better pull the code out\nuntil after we fork the tree for 7.1 development.\n\n\n> Whatever happened to release early, release often?\n\nThe Postgres project has generally adopted a more conservative approach\nto releases, because we know that people entrust critical data to\nDBMSes. We don't have anything that corresponds to a development\nrelease series; *all* our releases are supposed to be \"stable releases\".\nOf course we don't always get there, but that's the idea.\n\nJan has been muttering that we ought to have some means of dealing with\ncode development that spans multiple release cycles, ie, CVS branches\nfor work that is not expected to be part of the very next release.\nI've found it hard enough to keep track of tip vs. last release branch,\nbut maybe something like that is needed. It would let people push code\nout for review without implying that they think it's good enough to go\ninto the next release.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 24 Jan 2000 19:19:31 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "> -----Original Message-----\n> From: Peter Eisentraut [mailto:[email protected]]On Behalf Of Peter\n> Eisentraut\n>\n> On 2000-01-23, Hiroshi Inoue mentioned:\n>\n> > Anyway I have 2 basic questions.\n> >\n> > 1) Is the * 2x disk usage * implementation really needed ?\n>\n> Yes, unless you bypass all transaction logic and do a get a row, change\n> the row, delete the old row, write the new row, and silently hope that no\n> problems come up down the line. If you do an SQL update of all the rows in\n> a 10GB table you temporarily need 20GB in case there is a rollback.\n>\n\nI have already proposed another idea.\nIt only changes pg_attribute not touching relation files at all.\nProbably it isn't the best solution but would be better than 2x disk usage\nimplementation.\n\n> > 2) Why rename() ?\n> > I don't trust rename() at all in transaction control.\n> > The first thing we should do it to change relname -> relation file\n> > name mapping in order to avoid calling rename().\n>\n> That's a good point. The alter table / rename code makes free use of this,\n> which is just waiting to kick somebody in the head. If you think this\n> could be addressed in the next release, I'm even for dropping my\n> business and wait for a cleaner solution.\n>\n\nI wonder that no one but me has complained about this.\nCLUSTER/ALTER TABLE RENAME TO already have the same flaw.\nAnd maybe restructuring VACUUM also.\nAs far as I see,fixed mapping relname to relation filename is the\nproblem. This doesn't allow the coexistence of old and new relation\nfiles. If old and new relation files could coexist we would be able to\nupdate the relation_file_name attribute(we should add this kind of\natribute) of pg_class. Of cource,there must be the standard\nmechanism to remove old files after commit.\n\nRegards.\n\nHiroshi Inoue\[email protected]\n\n", "msg_date": "Tue, 25 Jan 2000 09:21:15 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] Happy column dropping " }, { "msg_contents": "\"Hiroshi Inoue\" <[email protected]> writes:\n> As far as I see,fixed mapping relname to relation filename is the\n> problem. This doesn't allow the coexistence of old and new relation\n> files.\n\nYes, and Vadim has proposed using relation OIDs as filenames for\nreasons of his own, IIRC.\n\nIf we did that we could also solve the problems we have now with\nrolling back table deletion/rename inside an aborted transaction.\n\nI've been resisting this idea, but maybe it's time to bite the bullet\nand accept that relation filenames can't be the same as the logical\nnames of the relations.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 24 Jan 2000 19:25:43 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "> -----Original Message-----\n> From: Tom Lane [mailto:[email protected]]\n> \n> \"Hiroshi Inoue\" <[email protected]> writes:\n> > As far as I see,fixed mapping relname to relation filename is the\n> > problem. This doesn't allow the coexistence of old and new relation\n> > files.\n> \n> Yes, and Vadim has proposed using relation OIDs as filenames for\n> reasons of his own, IIRC.\n>\n\nYes,I know it.\nBut I'm now inclined to generate unique relation file name each time\nin order to have different file names for different versions of a same\nrelation oid. Without chainging relation oids,we would be to do \nnothing about their attributes/constraints etc.\n\nAnyway this must be decided after sufficient discussion.\nIt's not the time to do it now.\n\nRegards.\n\nHiroshi Inoue\[email protected]\n", "msg_date": "Tue, 25 Jan 2000 10:58:43 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] Happy column dropping " }, { "msg_contents": "\"Hiroshi Inoue\" <[email protected]> writes:\n> But I'm now inclined to generate unique relation file name each time\n> in order to have different file names for different versions of a same\n> relation oid. Without chainging relation oids,we would be to do \n> nothing about their attributes/constraints etc.\n\nI was thinking about adding a \"version number\" to the pg_class entry\nfor a relation, and then having its actual filename look like\n\n\tRELATIONOID_vVERSION.SEGMENT\n\nThen we have:\n\n\t* Table rename: doesn't change the filename at all\n\n\t* VACUUM with rebuild or ADD/DROP COLUMN: write new data into\n\t files with an incremented version number. Also heap_update\n\t the pg_class tuple with new version number. At instant of\n\t commit, voila: the new files are valid, the old ones aren't.\n\t Works for indexes, too.\n\n> Anyway this must be decided after sufficient discussion.\n> It's not the time to do it now.\n\nAgreed. I think we are too close to 7.0 beta to consider doing this.\nWe can start thinking about it for 7.1 though.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 24 Jan 2000 21:12:32 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "[Charset ISO-8859-1 unsupported, filtering to ASCII...]\n> On 2000-01-23, Don Baccus mentioned:\n> \n> > I certainly don't want to discourage Peter, either, and perhaps\n> > was a bit too harsh. But release of a feature this half-baked\n> > would fit the stereotype many people have held towards free,\n> > open source software, and postgres in particular.\n> \n> Who said something of a release? Whatever happened to release early,\n> release often?\n\nWe don't do that here. :-)\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": "Mon, 24 Jan 2000 21:17:49 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "At 09:12 PM 1/24/00 -0500, Tom Lane wrote:\n\n>\t* VACUUM with rebuild or ADD/DROP COLUMN: write new data into\n>\t files with an incremented version number.\n\nJust a reality check for my learning of the internals. Out of curiousity\nI coincidently have spent the last hour looking to see how add column's\nimplemented. It doesn't appear to do anything other than the new attribute\nto the proper system table. heap_getattr() just returns null if you ask\nfor an attribute past the end of the tuple. \n\nThis would appear to be (at least one reason) why you can't add a \"not null\"\nconstraint to a column you're adding to an existing relation, or set the\nnew column to some non-null default value.\n\nCorrect? (again, to see if my eyeballs and brain are working in synch\ntonight)\n\nDoes your comment imply that it's planned to change this, i.e. actually\nadd the new column to each tuple in the relation rather than use the\nexisting, somewhat elegant hack?\n\nJust curious...\n\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Mon, 24 Jan 2000 18:41:37 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "> I was unaware that other folks had pointed to the copy/rename approach\n> earlier as being a possible means of implementation. I thought you'd\n> pulled that one out of your hat. Still, more advance discussion would've\n> perhaps led to other approaches to investigate, just as discussion\n> now is doing.\n> \n> I'm going to be blunt: implementation of \"drop column\" by doing a copy/rename\n> isn't something one expects of a competitive commercial-quality RDBMS.\n> \n> Perhaps it's the best we can expect of Postgres, though. If so, so be it.\n\nMaybe that is true. Having phantom column all over the code is going to\nbe a mess, and hardly worth it considering how many developers there are\nand how many _big_ items still have to be done.\n\nMessing up code for one feature is rarely worth it.\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": "Mon, 24 Jan 2000 21:48:46 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "Tom Lane wrote:\n> \n> \"Hiroshi Inoue\" <[email protected]> writes:\n> > But I'm now inclined to generate unique relation file name each time\n> > in order to have different file names for different versions of a same\n> > relation oid. Without chainging relation oids,we would be to do\n> > nothing about their attributes/constraints etc.\n> \n> I was thinking about adding a \"version number\" to the pg_class entry\n> for a relation, and then having its actual filename look like\n\nWell, if you are going to re-write the files in place on update, a\nversion number seems like overkill. All you need is version \"a\" and\n\"b\". Every time you do a change it swaps from version RELATIONOID_a to\nRELATIONOID_b , or RELATIONOID_b to RELATIONOID_a. Or you could just go\nfor RELATIONOID and RELATIONOID_new and do a rename (although I guess\nyou're trying to avoid that).\n\n\n> \n> RELATIONOID_vVERSION.SEGMENT\n> \n> Then we have:\n> \n> * Table rename: doesn't change the filename at all\n> \n> * VACUUM with rebuild or ADD/DROP COLUMN: write new data into\n> files with an incremented version number. Also heap_update\n> the pg_class tuple with new version number. At instant of\n> commit, voila: the new files are valid, the old ones aren't.\n> Works for indexes, too.\n> \n> > Anyway this must be decided after sufficient discussion.\n> > It's not the time to do it now.\n> \n> Agreed. I think we are too close to 7.0 beta to consider doing this.\n> We can start thinking about it for 7.1 though.\n> \n> regards, tom lane\n> \n> ************\n", "msg_date": "Tue, 25 Jan 2000 13:50:30 +1100", "msg_from": "Chris Bitmead <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "> \"Hiroshi Inoue\" <[email protected]> writes:\n> > As far as I see,fixed mapping relname to relation filename is the\n> > problem. This doesn't allow the coexistence of old and new relation\n> > files.\n> \n> Yes, and Vadim has proposed using relation OIDs as filenames for\n> reasons of his own, IIRC.\n> \n> If we did that we could also solve the problems we have now with\n> rolling back table deletion/rename inside an aborted transaction.\n> \n> I've been resisting this idea, but maybe it's time to bite the bullet\n> and accept that relation filenames can't be the same as the logical\n> names of the relations.\n> \n\nYes, that is going to happen, clearly. New file names will be\ntable_name+oid. Solves many problems.\n\nNew file name will not be just oid. Too hard to administer.\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": "Mon, 24 Jan 2000 21:51:51 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "Chris Bitmead <[email protected]> writes:\n> Tom Lane wrote:\n>> I was thinking about adding a \"version number\" to the pg_class entry\n>> for a relation, and then having its actual filename look like\n\n> Well, if you are going to re-write the files in place on update, a\n> version number seems like overkill. All you need is version \"a\" and\n> \"b\". Every time you do a change it swaps from version RELATIONOID_a to\n> RELATIONOID_b ,\n\nAnd what happens when I do two (or more) DROP COLUMNs within a single\ntransaction? Nope, you need an open-ended counter.\n\n> ... Or you could just go\n> for RELATIONOID and RELATIONOID_new and do a rename (although I guess\n> you're trying to avoid that).\n\nPrecisely. If we can avoid renaming the files, then we aren't at the\nmercy of the OS while moving from \"uncommitted\" to \"committed\" state;\nthe only thing that matters is marking the transaction committed in\npg_log, and that's as atomic as we can make it.\n\nIf there's no rename, the worst that can happen is that no-longer-needed\nfiles get left around (if the backend dies between committing and\nremoving dead files, or if it dies after making the files but before\ncommitting the transaction). We could arrange for VACUUM to remove such\nfiles.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 24 Jan 2000 22:18:29 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "> -----Original Message-----\n> From: Don Baccus [mailto:[email protected]]\n> \n> At 09:12 PM 1/24/00 -0500, Tom Lane wrote:\n> \n> >\t* VACUUM with rebuild or ADD/DROP COLUMN: write new data into\n> >\t files with an incremented version number.\n> \n> Just a reality check for my learning of the internals. Out of curiousity\n> I coincidently have spent the last hour looking to see how add column's\n> implemented. It doesn't appear to do anything other than the new \n> attribute\n> to the proper system table. heap_getattr() just returns null if you ask\n> for an attribute past the end of the tuple. \n> \n> This would appear to be (at least one reason) why you can't add a \n> \"not null\"\n> constraint to a column you're adding to an existing relation, or set the\n> new column to some non-null default value.\n>\n> Correct? (again, to see if my eyeballs and brain are working in synch\n> tonight)\n>\n \nProbably yes.\nAdding NOT NULL constraints to new column needs to apply default\nvalue to existent rows and this would need either implicit updation of\nexistent rows or to copy into different version of the relation file. .\n\nDo other DBMSs allow such things ?\nFor example,in Oracle NOT NULL constraint could be specified for new\ncolumn only when there's no row in the table AFAIK.\n\nI couldn't judge it's worth the work.\n\nRegards.\n\nHiroshi Inoue\[email protected]\n", "msg_date": "Tue, 25 Jan 2000 12:22:44 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] Happy column dropping " }, { "msg_contents": "Hiroshi Inoue wrote:\n> > Correct? (again, to see if my eyeballs and brain are working in synch\n> > tonight)\n> >\n> \n> Probably yes.\n> Adding NOT NULL constraints to new column needs to apply default\n> value to existent rows and this would need either implicit updation of\n> existent rows or to copy into different version of the relation file. .\n> \n> Do other DBMSs allow such things ?\n> For example,in Oracle NOT NULL constraint could be specified for new\n> column only when there's no row in the table AFAIK.\n> \n> I couldn't judge it's worth the work.\n> \n> Regards.\n> \n> Hiroshi Inoue\n> [email protected]\n> \n\nBut the times when I've found it would be nice to use ALTER TABLE\nADD COLUMN with NOT NULL constraints is in development mode when\nthe schema is changing rapidly and there actually isn't any data\nyet in the tables. Otherwise, to add a new NOT NULL column during\na development cycle, one has to drop and recreate the table, all\ntriggers, comments, etc. Its just a real pain. :-(\n\nMike Mascari\n", "msg_date": "Mon, 24 Jan 2000 22:31:37 -0500", "msg_from": "Mike Mascari <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "Don Baccus <[email protected]> writes:\n> Just a reality check for my learning of the internals. Out of curiousity\n> I coincidently have spent the last hour looking to see how add column's\n> implemented. It doesn't appear to do anything other than the new attribute\n> to the proper system table. heap_getattr() just returns null if you ask\n> for an attribute past the end of the tuple. \n\n> This would appear to be (at least one reason) why you can't add a \"not null\"\n> constraint to a column you're adding to an existing relation, or set the\n> new column to some non-null default value.\n\n> Correct? (again, to see if my eyeballs and brain are working in synch\n> tonight)\n\nYup, that's about the size of it. ADD COLUMN doesn't actually touch the\ntable itself, so it can only add a column that's initially all NULLs.\nAnd even this depends on some uncomfortable assumptions about the\nrobustness of heap_getattr(). I have always wondered whether it works\nif you ADD COLUMN a 33'rd column (or anything that is just past the\nnext padding boundary for the null-values bitmap).\n\nAnother problem with it is seen when you do a recursive ADD COLUMN in\nan inheritance tree. The added column has the first free column number\nin each table, which generally means that it has different numbers in\nthe children than in the parent. There are some kluges to make this\nsort-of-work for simple cases, but a lot of stuff fails unpleasantly\n--- Chris Bitmead can show you some scars from that, IIRC.\n\n> Does your comment imply that it's planned to change this, i.e. actually\n> add the new column to each tuple in the relation rather than use the\n> existing, somewhat elegant hack?\n\nThat's what I would like to see: all the children should have the\nsame column numbers for all columns that they inherit from the parent.\n\n(Now, this would mean not only physically altering the tuples of\nthe children, but also renumbering their added columns, which has\nimplications on stored rules and triggers and so forth. It'd be\npainful, no doubt about it. Still, I'd rather pay the price in the\nseldom-used ADD COLUMN case than try to deal with out-of-sync column\nnumbers in many other, more commonly exercised, code paths.)\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 24 Jan 2000 22:57:12 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "Bruce Momjian <[email protected]> writes:\n> New file name will not be just oid. Too hard to administer.\n\nBut if it contains the table name, you still have the problem we'd\nlike to avoid: renaming the file(s) is a critical part of committing\na table-renaming transaction.\n\nThe debugging and administrative convenience of using table names as\nfilenames is exactly why we've resisted this for so long. But I am\nstarting to think that we have to give that up. It's nice, but\nhaving robust DDL commands is nicer.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 24 Jan 2000 23:00:04 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "> The debugging and administrative convenience of using table names as\n> filenames is exactly why we've resisted this for so long. But I am\n> starting to think that we have to give that up. It's nice, but\n> having robust DDL commands is nicer.\n\nBecause you want to have multiple versions of a table with the same name\nand table oid. We don't have to have the oid equal the oid of the\ntable. Just use any oid to append to the table name for versioning.\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": "Mon, 24 Jan 2000 23:35:31 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "At 09:48 PM 1/24/00 -0500, Bruce Momjian wrote:\n\n>Maybe that is true. Having phantom column all over the code is going to\n>be a mess, and hardly worth it considering how many developers there are\n>and how many _big_ items still have to be done.\n\nWorks for Oracle...I guess Postgres is just an obviously more robust,\nfaster, more reliable, and altogether more brilliant RDBMS than this\nloser commercial DB? It's really hard to understand why Postgres has\nhad such a poor reputation over the years when faced with such facts,\nisn't it?\n\n>Messing up code for one feature is rarely worth it.\n\nDropping constraints on a table just because you drop a column is\njust butt-ugly.\n\nSorry if you disagree.\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Mon, 24 Jan 2000 20:44:31 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "Bruce Momjian <[email protected]> writes:\n> Because you want to have multiple versions of a table with the same name\n> and table oid. We don't have to have the oid equal the oid of the\n> table. Just use any oid to append to the table name for versioning.\n\nThat'd do for versioning, but what about a plain table-renaming\noperation? We aren't making a new file in that case, and we still\nwant to avoid rename().\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 24 Jan 2000 23:46:28 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "At 12:22 PM 1/25/00 +0900, Hiroshi Inoue wrote:\n>> -----Original Message-----\n>> From: Don Baccus [mailto:[email protected]]\n\n>> This would appear to be (at least one reason) why you can't add a \n>> \"not null\"\n>> constraint to a column you're adding to an existing relation, or set the\n>> new column to some non-null default value.\n>>\n>> Correct? (again, to see if my eyeballs and brain are working in synch\n>> tonight)\n\n>Probably yes.\n>Adding NOT NULL constraints to new column needs to apply default\n>value to existent rows and this would need either implicit updation of\n>existent rows or to copy into different version of the relation file. .\n\nRight...and my reading says neither happens.\n\n(and I'm not arguing that either should, I posed my question as a reality\ncheck as to whether or not a pedantic, lame-brain like myself is actually\ncapable of reading and understanding the code)\n\n>Do other DBMSs allow such things ?\n\nDon't know, haven't researched it. I think it's a reasonable restriction,\nthough.\n\n>For example,in Oracle NOT NULL constraint could be specified for new\n>column only when there's no row in the table AFAIK.\n\nI think that's right.\n\n>I couldn't judge it's worth the work.\n\nGosh, and I hope you didn't think I was suggesting it was. I was simply\nresponding to Tom's saying that \"ADD/DROP column\" would require a new\nfile for the updated relation, and asking if the current situation was\nslated for change (because the current situation doesn't require that\nthe relation be copied to a new file after a \"alter table add column\",\nif I read the code right).\n\nThat's all...I just wasn't able to relate Tom's point to how things \nappear to work, and wondered if I was missing something crucial in my\nreading of the code.\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Mon, 24 Jan 2000 20:50:03 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] Happy column dropping " }, { "msg_contents": "> Bruce Momjian <[email protected]> writes:\n> > Because you want to have multiple versions of a table with the same name\n> > and table oid. We don't have to have the oid equal the oid of the\n> > table. Just use any oid to append to the table name for versioning.\n> \n> That'd do for versioning, but what about a plain table-renaming\n> operation? We aren't making a new file in that case, and we still\n> want to avoid rename().\n\nI see. Hard to see how the advantage of fixing that would be worth\nlosing table names as files.\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": "Tue, 25 Jan 2000 00:00:56 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "At 10:57 PM 1/24/00 -0500, Tom Lane wrote:\n>Don Baccus <[email protected]> writes:\n\n>> Correct? (again, to see if my eyeballs and brain are working in synch\n>> tonight)\n\n>Yup, that's about the size of it.\n\nPhew! I'm sane! \n\n> ADD COLUMN doesn't actually touch the\n>table itself, so it can only add a column that's initially all NULLs.\n>And even this depends on some uncomfortable assumptions about the\n>robustness of heap_getattr().\n\nYeah...that was my thought...you did notice I included the word\n\"kludge\", yeah? \n\n> I have always wondered whether it works\n>if you ADD COLUMN a 33'rd column (or anything that is just past the\n>next padding boundary for the null-values bitmap).\n\nWay beyond my knowledge of things today, but if you REALLY CARE, I\ncould probably figure it out :)\n\n>Another problem with it is seen when you do a recursive ADD COLUMN in\n>an inheritance tree. The added column has the first free column number\n>in each table, which generally means that it has different numbers in\n>the children than in the parent. There are some kluges to make this\n>sort-of-work for simple cases, but a lot of stuff fails unpleasantly\n>--- Chris Bitmead can show you some scars from that, IIRC.\n\nI think this probably explains some of the editorial comments about the\ncode. There seem to be some added by \"XXX\" - is that person part of the\ncurrent clan of developers? Comments like \"This code is a crock because...\"\n\n>> Does your comment imply that it's planned to change this, i.e. actually\n>> add the new column to each tuple in the relation rather than use the\n>> existing, somewhat elegant hack?\n>\n>That's what I would like to see: all the children should have the\n>same column numbers for all columns that they inherit from the parent.\n\n>(Now, this would mean not only physically altering the tuples of\n>the children, but also renumbering their added columns, which has\n>implications on stored rules and triggers and so forth. It'd be\n>painful, no doubt about it. Still, I'd rather pay the price in the\n>seldom-used ADD COLUMN case than try to deal with out-of-sync column\n>numbers in many other, more commonly exercised, code paths.)\n\nYeah...though I don't know the code well enough to comment on the pain,\nin the wider, more general sense I totally agree. I don't think \nefficiency of ADD COLUMN (or DROP for that matter) should be of paramount\nconcern, even though Oracle gives a separate quick DROP option similar to\nwhat's being discussed as an alternative to COPY/RENAME.\n\nMy discomfort with the latter has more to do with the dropping of \nconstraints (and I've read enough of the code to see that rebuilding\nthem might be a worthy subject for a Hitchcock film)\n\nCool...please be patient with me as I work my way through this stuff\nin my spare time. \n\nAnd, Peter, if you're reading this, please be assured that my criticisms\nare meant only in the context of wanting to see this open source database\nbecome an Oracle (or other) slayer in at least a segment of the marketplace.\nOn its merits, not the price differential. If I'm harsh on things that I\nfeel don't quite meet the mark, please don't take it personally.\n\nAnd if I'm proven wrong, I'm always more than willing to admit it far\nand wide, and to apologize in public. \n\nI just want to see debate over the \"howtos\" based on merit, that's it.\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Mon, 24 Jan 2000 21:01:43 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "> At 09:48 PM 1/24/00 -0500, Bruce Momjian wrote:\n> \n> >Maybe that is true. Having phantom column all over the code is going to\n> >be a mess, and hardly worth it considering how many developers there are\n> >and how many _big_ items still have to be done.\n> \n> Works for Oracle...I guess Postgres is just an obviously more robust,\n> faster, more reliable, and altogether more brilliant RDBMS than this\n> loser commercial DB? It's really hard to understand why Postgres has\n> had such a poor reputation over the years when faced with such facts,\n> isn't it?\n> \n> >Messing up code for one feature is rarely worth it.\n> \n> Dropping constraints on a table just because you drop a column is\n> just butt-ugly.\n\nWe aren't charging 100k either. We do what we can, and spend time where\nit is most valuable.\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": "Tue, 25 Jan 2000 00:08:01 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "At 12:08 AM 1/25/00 -0500, Bruce Momjian wrote:\n\n>> Dropping constraints on a table just because you drop a column is\n>> just butt-ugly.\n\n>We aren't charging 100k either. We do what we can, and spend time where\n>it is most valuable.\n\nPerhaps I've misunderstood, then...I'd thought part of the goal was to\ncompete with the 100K model without charging 100K...\n\nIf not, OK.\n\n(BTW, Oracle for development is free and you can actually cruise with\nthat for some time. A five-user license for non-internet use costs\n$1450 for Linux)\n\nAnd further BTW...some folks recently went through a little handwringing\nupon hearing the Interbase will be released in free, open source form.\n\nAnd there's a recent, though not current, Sybase version available for\nLinux users for free, too...\n\nIf the point's not to be competitive with other free or low cost options,\nis there any point at all?\n\nIs it time for me to apologize for having high standards? \n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Mon, 24 Jan 2000 21:17:28 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "> If the point's not to be competitive with other free or low cost options,\n> is there any point at all?\n> \n> Is it time for me to apologize for having high standards? \n\nWe have to be realistic. It is no good to have one command that has 100\nfancy capabilities while 100 other commands are broken or are more\nimportant.\n\nDoesn't mean we don't do a great job, but that sometimes it is not worth\nit considering the other things we can be doing.\n\nIf you are suggesting we don't follow that plan, I have to disagree.\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": "Tue, 25 Jan 2000 00:29:20 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "Don Baccus <[email protected]> writes:\n> And, Peter, if you're reading this, please be assured that my criticisms\n> are meant only in the context of wanting to see this open source database\n> become an Oracle (or other) slayer in at least a segment of the marketplace.\n> On its merits, not the price differential. If I'm harsh on things that I\n> feel don't quite meet the mark, please don't take it personally.\n\nNot pretending to speak for Peter, but --- I don't think there's anybody\nhere who hasn't got the highest standards in mind as an end goal. Yet\nwe have many miles to go, and we seldom agree on whether a particular\nproblem is the most critical next thing to work on. Each of us is doing\nwhat comes to hand to be done. Sometimes we can fix a problem properly,\nand sometimes we can only put a finger in the dike, or apply triage and\nsay \"that's going to have to go unfixed a while longer\".\n\nYup, it's a little disorganized, but that's both the curse and the\nblessing of open-source development. Anybody who's *really* annoyed\nby a particular problem is welcome to come and work on it.\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 25 Jan 2000 00:29:26 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "Don Baccus <[email protected]> writes:\n> I think this probably explains some of the editorial comments about the\n> code. There seem to be some added by \"XXX\" - is that person part of the\n> current clan of developers? Comments like \"This code is a crock because...\"\n\nXXX isn't a signature, it's a conventional marker for a \"Hey! This is\nbroken! FIX ME!\" kind of comment. I think the original idea was you\ncould do \"grep XXX *.c\" if you were idly looking for problems to work\non. Some projects use \"FIXME\" in the same way.\n\nThe only signatures I've seen in the Postgres code are initials at the\nends of comments. XXX usually goes at the front of a gripe.\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 25 Jan 2000 00:39:14 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Oh btw, about XXX" }, { "msg_contents": "On Mon, 24 Jan 2000, Don Baccus wrote:\n\n> At 09:48 PM 1/24/00 -0500, Bruce Momjian wrote:\n> \n> >Maybe that is true. Having phantom column all over the code is going to\n> >be a mess, and hardly worth it considering how many developers there are\n> >and how many _big_ items still have to be done.\n> \n> Works for Oracle...I guess Postgres is just an obviously more robust,\n> faster, more reliable, and altogether more brilliant RDBMS than this\n> loser commercial DB? It's really hard to understand why Postgres has\n> had such a poor reputation over the years when faced with such facts,\n> isn't it?\n\nWoah ... pull back here ... I haven't got a *clue* where this response\ncame from, but, from what I can tell, it was *totally* uncalled\nfor. Oracle makes how many *millions* of dollars a year to sink into\nprogrammers dedicated to it? We have how many developers in comparison,\nwho don't get paid and who work on things they feel is important ... and,\nthere are alot bigger items on the TODO list ...\n\nIf we had unlimited (or near so) monetary resourses, fine, but we don't,\nwe have alot of volunteers who spend alot of *personal* time advancing\nthis project ... we are *not* trying to compete directly with Oracle, we\nare trying to create a product that ppl *trust* and can *rely* on\n... Bruce's comment above about \"going to be a mess\", to me, interpretes\nas \"there has gotta be a cleaner way of doing it that we haven't come up\nwith yet\" ... \n\n> >Messing up code for one feature is rarely worth it.\n> \n> Dropping constraints on a table just because you drop a column is\n> just butt-ugly.\n> \n> Sorry if you disagree.\n\nAnd yes, I do agree here ... I like the solution that one person presented\nthat had it so that you couldn't drop the column unless as constraints and\nrequirements were removed first ...\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Tue, 25 Jan 2000 02:39:53 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "> -----Original Message-----\n> From: [email protected]\n> [mailto:[email protected]]On Behalf Of Tom Lane\n> \n> robustness of heap_getattr(). I have always wondered whether it works\n> if you ADD COLUMN a 33'rd column (or anything that is just past the\n> next padding boundary for the null-values bitmap).\n>\n\nIf so,it's very serious.\nADD COLUMN feature is much more important than other ALTER TABLE\noptions and it's also important to implement it without touching the table\nas possible.\nIt seems to me that each tuple has t_natts and t_hoff for the change of\ntable definition. \n\nRegards.\n\nHiroshi Inoue\[email protected]\n", "msg_date": "Tue, 25 Jan 2000 15:46:43 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] Happy column dropping " }, { "msg_contents": "On Mon, 24 Jan 2000, Don Baccus wrote:\n\n> At 12:08 AM 1/25/00 -0500, Bruce Momjian wrote:\n> \n> >> Dropping constraints on a table just because you drop a column is\n> >> just butt-ugly.\n> \n> >We aren't charging 100k either. We do what we can, and spend time where\n> >it is most valuable.\n> \n> Perhaps I've misunderstood, then...I'd thought part of the goal was to\n> compete with the 100K model without charging 100K...\n> \n> If not, OK.\n> \n> (BTW, Oracle for development is free and you can actually cruise with\n> that for some time. A five-user license for non-internet use costs\n> $1450 for Linux)\n> \n> And further BTW...some folks recently went through a little handwringing\n> upon hearing the Interbase will be released in free, open source form.\n> \n> And there's a recent, though not current, Sybase version available for\n> Linux users for free, too...\n> \n> If the point's not to be competitive with other free or low cost options,\n> is there any point at all?\n> \n> Is it time for me to apologize for having high standards? \n\nNot necessarily ... only for expecting more from volunteers then they are\nwilling, or have time, to put forth ... \n\nWhere does Sybase make its money? Oracle? Inbase? In Oracle's case, it\nis what we work with *heavily* at my *real* job, and I know where they\nmake their money ... support contracts that we never use ...\n\nPostgreSQL, Inc was created 6+ months ago to provide a means of clients\ngetting commerical support, and it does enough to keep things afloat, but\nrich we are not getting ... my *hope* when forming this was that we could\ngenerate enough revenues to go out and hire someone to deal with features\nthat are so time-consuming that they are difficult to implement ... its a\nslow growth ... maybe in 6mos we'll be able to do this ... we keep coming\nup with new ways of increasing revenues and we dedicate a certain\npercentage of each to a 'kitty' to be used for PostgreSQL related projects\n... that kitty is small, but growing ...\n\nWe try with those resources we have ...\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Tue, 25 Jan 2000 02:50:57 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "> -----Original Message-----\n> From: Mike Mascari [mailto:[email protected]]\n> \n> > \n> > Do other DBMSs allow such things ?\n> > For example,in Oracle NOT NULL constraint could be specified for new\n> > column only when there's no row in the table AFAIK.\n> > \n> > I couldn't judge it's worth the work.\n> > \n> \n> But the times when I've found it would be nice to use ALTER TABLE\n> ADD COLUMN with NOT NULL constraints is in development mode when\n> the schema is changing rapidly and there actually isn't any data\n> yet in the tables. Otherwise, to add a new NOT NULL column during\n> a development cycle, one has to drop and recreate the table, all\n> triggers, comments, etc. Its just a real pain. :-(\n>\n\nI don't know details about constraints.\nProbably you could implement it better than me.\n\nEven default is not allowed in ADD COLUMN now. \nThere may be other reasons why they aren't allowed.\n\nRegards.\n\nHiroshi Inoue\[email protected] \n", "msg_date": "Tue, 25 Jan 2000 16:18:22 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] Happy column dropping" }, { "msg_contents": "The Hermit Hacker wrote:\n> \n> On Mon, 24 Jan 2000, Don Baccus wrote:\n> \n> > At 09:48 PM 1/24/00 -0500, Bruce Momjian wrote:\n> >\n> > >Maybe that is true. Having phantom column all over the code is going to\n> > >be a mess, and hardly worth it considering how many developers there are\n> > >and how many _big_ items still have to be done.\n> >\n> > Works for Oracle...I guess Postgres is just an obviously more robust,\n> > faster, more reliable, and altogether more brilliant RDBMS than this\n> > loser commercial DB? It's really hard to understand why Postgres has\n> > had such a poor reputation over the years when faced with such facts,\n> > isn't it?\n> \n> Woah ... pull back here ... I haven't got a *clue* where this response\n> came from, but, from what I can tell, it was *totally* uncalled\n> for. Oracle makes how many *millions* of dollars a year to sink into\n ^^^^^^^^\nBillions. Oracle had 8.82 billion in sales in FY 1999, 1.2\nbillion in earnings (profit). \n\n> programmers dedicated to it? \n\nOracle has 43,800 employees.\n\n> We have how many developers in comparison,\n> who don't get paid and who work on things they feel is important ... and,\n> there are alot bigger items on the TODO list ...\n\nThe market capitalization of Oracle before the split a week ago\nwas $147 billion dollars. Larry Ellison owns 24% of the company\nand is thus worth $35 billion dollars alone. The least Don could\ndo is buy a T-shirt or a key ring or something... ;-)\n\nMike Mascari\n", "msg_date": "Tue, 25 Jan 2000 02:24:10 -0500", "msg_from": "Mike Mascari <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "* Tom Lane <[email protected]> [000124 22:10] wrote:\n> Don Baccus <[email protected]> writes:\n> > I think this probably explains some of the editorial comments about the\n> > code. There seem to be some added by \"XXX\" - is that person part of the\n> > current clan of developers? Comments like \"This code is a crock because...\"\n> \n> XXX isn't a signature, it's a conventional marker for a \"Hey! This is\n> broken! FIX ME!\" kind of comment. I think the original idea was you\n> could do \"grep XXX *.c\" if you were idly looking for problems to work\n> on. Some projects use \"FIXME\" in the same way.\n\nIt can also mean 'blech, this should be cleaner' such as the use\nof 'curproc' in the FreeBSD kernel do figure out which process is\nusing the current codepath, sometimes you need it and the API\ndoesn't pass it down to you, hence\n struct proc *p = curproc; /* XXX */ \nwhich is strewn about the code.\n\n> The only signatures I've seen in the Postgres code are initials at the\n> ends of comments. XXX usually goes at the front of a gripe.\n\ngvim even highlights them in bright inverse yellow. :)\n\n-- \n-Alfred Perlstein - [[email protected]|[email protected]]\n", "msg_date": "Tue, 25 Jan 2000 00:42:00 -0800", "msg_from": "Alfred Perlstein <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Oh btw, about XXX" }, { "msg_contents": "On Mon, 24 Jan 2000, Bruce Momjian wrote:\n\n> New file name will not be just oid. Too hard to administer.\n\nHow exactly does this play into administration? You don't actually do a cp\n/usr/local/pgsql/data/base/testdb/mytable /some/where to back up? ;)\n\nWhat did the Unix kernel programmers think when they first introduced\ninodes? The wrote the readdir() library call. We have that too, it's\ncalled pg_class.\n\n-- \nPeter Eisentraut Sernanders vaeg 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Tue, 25 Jan 2000 11:38:26 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "On Mon, 24 Jan 2000, Don Baccus wrote:\n\n> Dropping constraints on a table just because you drop a column is\n> just butt-ugly.\n\nHey, nobody said that this was the final version. Keeping the constraints\nwas a trivial step from what there was. I guess the lesson I learned was\nthat around here you Release Late, Release Rarely, and that's fine, but I\ndidn't know that. Sorry. -> next time ;)\n\n-- \nPeter Eisentraut Sernanders vaeg 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Tue, 25 Jan 2000 11:41:55 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "On Tue, 25 Jan 2000, Hiroshi Inoue wrote:\n\n> Even default is not allowed in ADD COLUMN now. \n> There may be other reasons why they aren't allowed.\n\nIt's not a matter of *allowed*, it's a parsing deficiency. The fact that\nthere was a default declared gets silently ignored. If y'all allow ;) I\nwould like to fix that (have already started a bit) by perusing the code\nin parse_func.c:transformCreateStmt and do the same for the alter table\nadd column part. Maybe and add/drop constraint will come out in the end as\nwell.\n\n-- \nPeter Eisentraut Sernanders vaeg 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Tue, 25 Jan 2000 11:55:23 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Happy column adding (was RE: [HACKERS] Happy column dropping)" }, { "msg_contents": "> On Mon, 24 Jan 2000, Bruce Momjian wrote:\n> \n> > New file name will not be just oid. Too hard to administer.\n> \n> How exactly does this play into administration? You don't actually do a cp\n> /usr/local/pgsql/data/base/testdb/mytable /some/where to back up? ;)\n> \n> What did the Unix kernel programmers think when they first introduced\n> inodes? The wrote the readdir() library call. We have that too, it's\n> called pg_class.\n> \n\nIngres has table names as numbered files. It is a pain to figure out\nwhich files match which tables. If you need to restore a table from\ntape, the pg_class entry is gone and you have no way to figure out the\nright table. When analyzing disk space, figuring who is using the space\nis a pain.\n\nEvery Ingre admin I ever talked to agreed file numbers are a pain.\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": "Tue, 25 Jan 2000 09:14:29 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "> On Mon, 24 Jan 2000, Don Baccus wrote:\n> \n> > Dropping constraints on a table just because you drop a column is\n> > just butt-ugly.\n> \n> Hey, nobody said that this was the final version. Keeping the constraints\n> was a trivial step from what there was. I guess the lesson I learned was\n> that around here you Release Late, Release Rarely, and that's fine, but I\n> didn't know that. Sorry. -> next time ;)\n\nI probably lead you astray on that one.\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": "Tue, 25 Jan 2000 09:15:04 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "Then <[email protected]> spoke up and said:\n> Ingres has table names as numbered files. It is a pain to figure out\n> which files match which tables. If you need to restore a table from\n> tape, the pg_class entry is gone and you have no way to figure out the\n> right table. When analyzing disk space, figuring who is using the space\n> is a pain.\n> \n> Every Ingre admin I ever talked to agreed file numbers are a pain.\n\nI, too, found the Ingres naming scheme to be a pain, especially since\nthe numbers change when you drop/recreate a table (but not for\ntruncation). In my case, I wrote a fairly trivial script that runs as\npart of the backup job that lists all tables and filenames. This give\nme an accurate map of whats out there. It has the added advantage\nthat I can use this list to remove tables/database owned by users who\nno longer exist (although, in truth, I hesitate to do that\nautomatically).\n\nOn the other hand, I *hate* the Oracle tablespace scheme. At least\nwith Ingres, when I update a table, I *don't* have to backup all of\nthe other tables in that database (barring Oracle's hot-backup mode,\nof course).\n\n-- \n=====================================================================\n| JAVA must have been developed in the wilds of West Virginia. |\n| After all, why else would it support only single inheritance?? |\n=====================================================================\n| Finger [email protected] for my public key. |\n=====================================================================", "msg_date": "Tue, 25 Jan 2000 09:53:34 -0500 (EST)", "msg_from": "Brian E Gallew <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "At 12:29 AM 1/25/00 -0500, Tom Lane wrote:\n\n>Not pretending to speak for Peter, but --- I don't think there's anybody\n>here who hasn't got the highest standards in mind as an end goal. Yet\n>we have many miles to go, and we seldom agree on whether a particular\n>problem is the most critical next thing to work on. Each of us is doing\n>what comes to hand to be done. Sometimes we can fix a problem properly,\n>and sometimes we can only put a finger in the dike, or apply triage and\n>say \"that's going to have to go unfixed a while longer\".\n\nYes, I know, and I'm probably being a bit over-obnoxious.\n\n>Yup, it's a little disorganized, but that's both the curse and the\n>blessing of open-source development. Anybody who's *really* annoyed\n>by a particular problem is welcome to come and work on it.\n\nWell...I'm trying to spend about four hours a week reading code, maybe\nsomeday I'll get there :) Once we're done porting the arsDigita Community\nSystem from Oracle to Posgres and once I'm done with my current contract,\nI'll have more time to play.\n\nI realize that at some point I need to do more than just whine about\nthings.\n\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Tue, 25 Jan 2000 07:24:32 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping " }, { "msg_contents": "At 12:29 AM 1/25/00 -0500, Bruce Momjian wrote:\n\n>We have to be realistic. It is no good to have one command that has 100\n>fancy capabilities while 100 other commands are broken or are more\n>important.\n>\n>Doesn't mean we don't do a great job, but that sometimes it is not worth\n>it considering the other things we can be doing.\n>\n>If you are suggesting we don't follow that plan, I have to disagree.\n\nIn general, I don't disagree with this. But a drop column command that\nkills all constraints on a table won't be terribly useful to folks. I'm\nthinking of the fact that this same version will have referential \nintegrity constraints, which will be used by many. These will be dropped,\ntoo, if I understand things correctly.\n\nI think my emotional reaction is mostly to the fact that it was \nput into sources that I presumed were to be released in beta form\njust a few days afterwards. With no prior discussion.\n\n>From Peter's notes, it is clear that his perception of a beta version\nmight differ somewhat from that which has been traditional with the\npostgres group. And that makes me very nervous, since I'm planning\nto try to base further porting work on that beta. Obviously, I\ndon't need to use \"drop column\", but if the release model drifts more\ntowards the \"break often, break early\" model then then I'll have to\nrethink my usage of Postgres betas.\n\n(no, we won't release our port on the beta, we're just hoping that\nthe beta will be solid enough that we can work with it, and release\nour beta on top of the resulting version of PG).\n\nNow, couple this with all the problems associated with some apparently\nbelow-par changes to libpq - which I absolutely depend on - and I start\nworrying that the excellent stability of the 6.5 beta and subsequent\nfull releases might become an abberration rather than the norm.\n\nI know folks don't want that...\n\nAnyway, this perhaps is mostly a communication problem, as Peter\napparently thought that the Postgres group follows the \"release early,\nrelease often\" model.\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Tue, 25 Jan 2000 07:35:52 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "At 11:41 AM 1/25/00 +0100, Peter Eisentraut wrote:\n>On Mon, 24 Jan 2000, Don Baccus wrote:\n>\n>> Dropping constraints on a table just because you drop a column is\n>> just butt-ugly.\n>\n>Hey, nobody said that this was the final version. Keeping the constraints\n>was a trivial step from what there was. I guess the lesson I learned was\n>that around here you Release Late, Release Rarely, and that's fine, but I\n>didn't know that. Sorry. -> next time ;)\n\nYes, I've thought about this and as I mentioned in another note a few\nminutes ago, realize now that you believed that to be the release model.\n\nI now understand why you were willing to dump a change like this into\nthe sources a few days before a planned beta release. Perfectly\nreasonable under the more agressive release early, release often\nmodel.\n\nI'll back off now.\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Tue, 25 Jan 2000 07:53:53 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "At 11:55 AM 1/25/00 +0100, Peter Eisentraut wrote:\n>On Tue, 25 Jan 2000, Hiroshi Inoue wrote:\n>\n>> Even default is not allowed in ADD COLUMN now. \n>> There may be other reasons why they aren't allowed.\n>\n>It's not a matter of *allowed*, it's a parsing deficiency. The fact that\n>there was a default declared gets silently ignored. If y'all allow ;) I\n>would like to fix that (have already started a bit) by perusing the code\n>in parse_func.c:transformCreateStmt and do the same for the alter table\n>add column part. Maybe and add/drop constraint will come out in the end as\n>well.\n\nHowever, heap_getattr still won't see the default since it simply\nchecks to see of the attribute number falls off the end of the\ntuple and then returns null.\n\nThere's no provision for then pulling out the default value and\nreturning it instead.\n\nI think this is why Tom was implying that add column should really\nalter the table?\n\nA fully-featured \"add column\" feature would be very nice, indeed.\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Tue, 25 Jan 2000 08:01:25 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding (was RE: [HACKERS] Happy column\n dropping)" }, { "msg_contents": "> -----Original Message-----\n> From: Peter Eisentraut [mailto:[email protected]]\n>\n> On Tue, 25 Jan 2000, Hiroshi Inoue wrote:\n>\n> > Even default is not allowed in ADD COLUMN now.\n> > There may be other reasons why they aren't allowed.\n>\n> It's not a matter of *allowed*, it's a parsing deficiency. The fact that\n> there was a default declared gets silently ignored. If y'all allow ;) I\n> would like to fix that (have already started a bit) by perusing the code\n> in parse_func.c:transformCreateStmt and do the same for the alter table\n> add column part. Maybe and add/drop constraint will come out in the end as\n> well.\n>\n\nIIRC,there were some reason that default for new column had been rejected.\nIt may be possible now.\nProbably Tom knows it.\n\nRegards.\n\nHiroshi Inoue\[email protected]\n\n", "msg_date": "Wed, 26 Jan 2000 01:06:22 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: Happy column adding (was RE: [HACKERS] Happy column dropping)" }, { "msg_contents": "> At 11:41 AM 1/25/00 +0100, Peter Eisentraut wrote:\n> >On Mon, 24 Jan 2000, Don Baccus wrote:\n> >\n> >> Dropping constraints on a table just because you drop a column is\n> >> just butt-ugly.\n> >\n> >Hey, nobody said that this was the final version. Keeping the constraints\n> >was a trivial step from what there was. I guess the lesson I learned was\n> >that around here you Release Late, Release Rarely, and that's fine, but I\n> >didn't know that. Sorry. -> next time ;)\n> \n> Yes, I've thought about this and as I mentioned in another note a few\n> minutes ago, realize now that you believed that to be the release model.\n> \n> I now understand why you were willing to dump a change like this into\n> the sources a few days before a planned beta release. Perfectly\n> reasonable under the more agressive release early, release often\n> model.\n\nMaybe I have to get that into the developers FAQ.\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": "Tue, 25 Jan 2000 11:35:20 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "> Now, couple this with all the problems associated with some apparently\n> below-par changes to libpq - which I absolutely depend on - and I start\n> worrying that the excellent stability of the 6.5 beta and subsequent\n> full releases might become an abberration rather than the norm.\n> \n> I know folks don't want that...\n> \n> Anyway, this perhaps is mostly a communication problem, as Peter\n> apparently thought that the Postgres group follows the \"release early,\n> release often\" model.\n\nThere are no plans to change the way we release -- release rarely,\nrelease stable.\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": "Tue, 25 Jan 2000 11:36:09 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "On Tue, Jan 25, 2000 at 09:14:29AM -0500, Bruce Momjian wrote:\n> > On Mon, 24 Jan 2000, Bruce Momjian wrote:\n> > \n> > > New file name will not be just oid. Too hard to administer.\n> > \n> \n> Ingres has table names as numbered files. It is a pain to figure out\n> which files match which tables. If you need to restore a table from\n> tape, the pg_class entry is gone and you have no way to figure out the\n> right table. When analyzing disk space, figuring who is using the space\n> is a pain.\n> \n\nHmm, how about a map file, of conventional name, kept in the pgsql/data\ndir, that contains filename -> db/tablename mappings? It would be\nessentially a pretty printed dump of pg_class. That way, the admin\nhas access to the mapping even when the postmaster is down. Even to\nrestore from tape: grab pg_class_map from the tape (you did dump it\nto the beginning, right?) and then grab the file you need. I don't see\nthis as being a particularly large file, in any case, and DDL isn't a\nspeed critical path, so rewriting the pg_class_map file wouldn't hurt.\nAnd, since it's just for human/admin consumption, so major problem if\nit gets out of sync: just regenerate it from pg_class. Could even be\nused to sanity check the DBMS on start up: generate a new pg_class_map,\ncompare it to the old: if they don't match, fire a warning/die?\n\nI'd suggest a format that's easily machine by awk/sed/grep (perl, etc.)\nfor those db admin tasks Bruce is talking about (space, etc.) Heck, \nit'd be easy to whip up a 'generate a bunch of symlinks' script\nto get the tablenames back, if you really need them.\n\nRoss\n-- \nRoss J. Reedstrom, Ph.D., <[email protected]> Tel. 713-348-6166\nNSBRI Research Scientist/Programmer Fax 713-348-6182\nComputer and Information Technology Institute\nRice University, 6100 S. Main St., Houston, TX 77005\n", "msg_date": "Tue, 25 Jan 2000 10:37:11 -0600", "msg_from": "\"Ross J. Reedstrom\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "\"Hiroshi Inoue\" <[email protected]> writes:\n>>>> Even default is not allowed in ADD COLUMN now.\n>> \n>> It's not a matter of *allowed*, it's a parsing deficiency. The fact that\n>> there was a default declared gets silently ignored.\n\n> IIRC,there were some reason that default for new column had been rejected.\n\nWell, yeah: wouldn't you expect that \"ADD COLUMN x DEFAULT 42\" would\ncause every row currently existing in the table to acquire x = 42,\nrather than x = NULL? In fact that would *have* to happen to allow\nconstraints to be added; consider ADD COLUMN x DEFAULT 42 NOT NULL.\n\nThe only way to make that happen is for ADD COLUMN to switch over to\nan implementation that rewrites all the tuples. Which I think is the\nright way to go ... but per this discussion, it's not a trivial fix.\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 25 Jan 2000 12:23:15 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding (was RE: [HACKERS] Happy column dropping) " }, { "msg_contents": "Don Baccus <[email protected]> writes:\n> However, heap_getattr still won't see the default since it simply\n> checks to see of the attribute number falls off the end of the\n> tuple and then returns null.\n\nRight.\n\n> There's no provision for then pulling out the default value and\n> returning it instead.\n\nWould it even be possible to do that? I'm not sure that heap_getattr\nhas any way to find the default. It only has a TupleDesc, not a\nreference to the relation itself...\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 25 Jan 2000 12:39:25 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding (was RE: [HACKERS] Happy column dropping) " }, { "msg_contents": "On Tue, Jan 25, 2000 at 08:01:25AM -0800, Don Baccus wrote:\n> At 11:55 AM 1/25/00 +0100, Peter Eisentraut wrote:\n> >On Tue, 25 Jan 2000, Hiroshi Inoue wrote:\n> >\n> >> Even default is not allowed in ADD COLUMN now. \n> >> There may be other reasons why they aren't allowed.\n> >\n> >It's not a matter of *allowed*, it's a parsing deficiency. The fact that\n> >there was a default declared gets silently ignored. If y'all allow ;) I\n> >would like to fix that (have already started a bit) by perusing the code\n> >in parse_func.c:transformCreateStmt and do the same for the alter table\n> >add column part. Maybe and add/drop constraint will come out in the end as\n> >well.\n> \n> However, heap_getattr still won't see the default since it simply\n> checks to see of the attribute number falls off the end of the\n> tuple and then returns null.\n> \n\nRight, but that just means that existing tuples would not get the\ndefault, but all new tuples would, right? So, while it does leave the\ndata inconsistent with the schema definition, it is fixable, and in a\ncontrolled manner. A simple\n\nUPDATE my_table SET new_field='default' WHERE new_field IS NULL;\n\nshould do it, right? \n\nIn fact, that's something I liked about the 'make invisible' strategy\nfor the ALTER DROP COLUMN case: it allows the DBA to control the\nbackends activity. If the DBA needs to drop a column from a large table,\nbut doesn't have space for 2X that table, what does she do? With the\ninvisible column, she could ALTER DROP, then do a series of updates,\nsimilar to what Tom suggested:\n\nUPDATE my_table SET otherfield=otherfield where table_id>0 and table_id<=100;\nVACUUM mytable;\nUPDATE my_table SET otherfield=otherfield where table_id>100 and table_id<=200;\nVACUUM mytable;\n\netc.\n\nSimilarly, the aftermath of the ADD DEFAULT case could be handled in a\ncontrolled manner, without forcing a 2X table size disk usage. I _like_\nimplementations that give the user (in this case, the DBA) control over\nwhat happens, and when. I think this may answer Marc Fournier's desire\nfor a 'rewrite in place' version of these, since it would allow the\nDBA, at their option, to update one tuple at a time (well, it'd be a royal\npain, but could be done...)\n\n> There's no provision for then pulling out the default value and\n> returning it instead.\n\nRight, we don't want to special case it. What's wrong with returning a\nNULL, for any tuple that hasn't been updated yet? \n\n> \n> I think this is why Tom was implying that add column should really\n> alter the table?\n> \n> A fully-featured \"add column\" feature would be very nice, indeed.\n> \n\nI agree, where full-featured means adding constraints. I disagree that\nrewriting the entire table is a good idea. This isn't even only an edge \ncase for admins with little disk space. I could very easily imagine\na schema chamge on existing data, where one has a 'flatfile' sort of\ntable in the tens of gigabytes range, and you want to remove a column,\nin order to normalize the table (get rid of address2, zip2, state2,\n..., for example). Requiring transient diskspace of 2X the table,\nand a complete rewrite, _as each column is dropped_ whould be really\nannoying. Yes, I know, dump/restore, but what about 24/7 systems? Hey,\nit's dangerous to do surgery on a live system, but sometimes, you have\nlittle choice.\n\nI realize I just slipped over from the ADD COLUMN to the DROP COLUMN\ncase, but I think fundamentally, they're very similar, and will probably\nget implemented with the same mechanism.\n\nSo Bruce, would the inviso-columns really be a mess in the source? We've\nalready got the 'virtual column' case, with the ADD COLUMN aftermath. \n\nPerhaps Oliver's suggestion of removing the link between logical and\nphysical field ordering might help. That could lead to some interesting\nstorage optimizations, as well. Collecting all variable types to the\nend of a tuple, for example, might be a win.\n\nRoss\n-- \nRoss J. Reedstrom, Ph.D., <[email protected]> \nNSBRI Research Scientist/Programmer\nComputer and Information Technology Institute\nRice University, 6100 S. Main St., Houston, TX 77005\n", "msg_date": "Tue, 25 Jan 2000 11:44:53 -0600", "msg_from": "\"Ross J. Reedstrom\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding (was RE: [HACKERS] Happy column dropping)" }, { "msg_contents": "On Tue, Jan 25, 2000 at 12:23:15PM -0500, Tom Lane wrote:\n> \"Hiroshi Inoue\" <[email protected]> writes:\n> >>>> Even default is not allowed in ADD COLUMN now.\n> >> \n> >> It's not a matter of *allowed*, it's a parsing deficiency. The fact that\n> >> there was a default declared gets silently ignored.\n> \n> > IIRC,there were some reason that default for new column had been rejected.\n> \n> Well, yeah: wouldn't you expect that \"ADD COLUMN x DEFAULT 42\" would\n> cause every row currently existing in the table to acquire x = 42,\n> rather than x = NULL? In fact that would *have* to happen to allow\n> constraints to be added; consider ADD COLUMN x DEFAULT 42 NOT NULL.\n\nActually, no I wouldn't expect it. That's mixing DDL and DML in one\nstatement. I expect the ALTER command to be pure DDL, and the UPDATE\nto be pure DML.\n\nFor a detailed brain dump as I thought about this, see my reply to Don Baccus,\none message up. ;-)\n\nYes, I know the standard isn't that pure: SELECT INTO, for example. Hmm,\nis SELECT INTO standard? <FX: Ross grovels through the draft standard text...>\n\nOuch, reading standards always makes my brain hurt. Especially how you\nhave to read them upside down. Turns out SELECT INTO is in the standard,\nbut not the way we implement it.\n\n\n 13.5 <select statement: single row>\n\n Function\n\n Retrieve values from a specified row of a table.\n\n Format\n\n <select statement: single row> ::=\n SELECT [ <set quantifier> ] <select list>\n INTO <select target list>\n <table expression>\n\n <select target list> ::=\n <target specification> [ { <comma> <target specification> }... ]\n\nand in section 6.2:\n\n <target specification> ::=\n <parameter specification>\n | <variable specification>\n\n <simple target specification> ::=\n <parameter name>\n | <embedded variable name>\n\n <parameter specification> ::=\n <parameter name> [ <indicator parameter> ]\n\nand in section 5.4:\n\n <parameter name> ::= <colon> <identifier>\n\nSo, it looks like SELECT INTO is a single row query that fills variables,\neither parameters or embedded, not a combined 'create this table and\nfill it' command. Oops!\n\n\nRoss\n\n-- \nRoss J. Reedstrom, Ph.D., <[email protected]> \nNSBRI Research Scientist/Programmer\nComputer and Information Technology Institute\nRice University, 6100 S. Main St., Houston, TX 77005\n", "msg_date": "Tue, 25 Jan 2000 12:29:07 -0600", "msg_from": "\"Ross J. Reedstrom\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding (was RE: [HACKERS] Happy column dropping)" }, { "msg_contents": "\"Ross J. Reedstrom\" <[email protected]> writes:\n> Perhaps Oliver's suggestion of removing the link between logical and\n> physical field ordering might help. That could lead to some interesting\n> storage optimizations, as well. Collecting all variable types to the\n> end of a tuple, for example, might be a win.\n\nI recall seeing comments in the source to the effect that this was\nconsidered (but never implemented) long ago. It does seem like a\nvery clean solution to some aspects of the add/drop column problem;\nbut implementation would be a pain in the neck. We'd have to go through\nall of the source code and decide whether each use of an attribute\nnumber should be using logical or physical number. It'd be a long slog.\n\nIt occurs to me that in at least some of the places where attribute\nnumbers are currently used, we ought to use *neither* logical nor\nphysical column position, but rather a permanent unique ID --- the\nattribute tuple's OID would work, if it's assigned soon enough to be\nused for constraints given in CREATE TABLE. (Otherwise we could assign\n\"column serial numbers\" that count from 1 for each relation, but are\nnever changed or recycled within the relation.)\n\nIn particular, if parsetrees for stored rules and constraints worked\nthat way, renumbering attributes that follow the added/dropped column\nwould become a lot less painful.\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 25 Jan 2000 13:49:01 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding (was RE: [HACKERS] Happy column dropping) " }, { "msg_contents": "At 11:36 AM 1/25/00 -0500, Bruce Momjian wrote:\n\n>There are no plans to change the way we release -- release rarely,\n>release stable.\n\nYes, I understand that now, etc etc.\n\nI'm ready to put this thread to bed, myself. Peter, I didn't mean\nmy criticisms to be personal in any way. My apologies if they\ncame off that way.\n\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Tue, 25 Jan 2000 10:55:42 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Happy column dropping" }, { "msg_contents": "At 12:23 PM 1/25/00 -0500, Tom Lane wrote:\n\n>The only way to make that happen is for ADD COLUMN to switch over to\n>an implementation that rewrites all the tuples. Which I think is the\n>right way to go ... but per this discussion, it's not a trivial fix.\n\nMight it be possible to keep the current (ummm) hack for simple\nadd column name type and only rewrite for fancy cases? The current\nimplementation is awfully fast and there's the advantage of not\nneeding sufficient disk storage to duplicate the table.\n\n\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Tue, 25 Jan 2000 11:03:15 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding (was RE: [HACKERS] Happy column\n dropping)" }, { "msg_contents": "At 12:39 PM 1/25/00 -0500, Tom Lane wrote:\n\n>> There's no provision for then pulling out the default value and\n>> returning it instead.\n>\n>Would it even be possible to do that? I'm not sure that heap_getattr\n>has any way to find the default. It only has a TupleDesc, not a\n>reference to the relation itself...\n\nIn that case, then presumably not. You've just pushed me beyond\nthe limits of my understanding of that code, I'm afraid!\n\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Tue, 25 Jan 2000 11:05:43 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding (was RE: [HACKERS] Happy column\n dropping)" }, { "msg_contents": "At 12:29 PM 1/25/00 -0600, Ross J. Reedstrom wrote:\n>On Tue, Jan 25, 2000 at 12:23:15PM -0500, Tom Lane wrote:\n\n>> Well, yeah: wouldn't you expect that \"ADD COLUMN x DEFAULT 42\" would\n>> cause every row currently existing in the table to acquire x = 42,\n>> rather than x = NULL? In fact that would *have* to happen to allow\n>> constraints to be added; consider ADD COLUMN x DEFAULT 42 NOT NULL.\n\n>Actually, no I wouldn't expect it. That's mixing DDL and DML in one\n>statement. I expect the ALTER command to be pure DDL, and the UPDATE\n>to be pure DML.\n\nHmmm...interesting...is alter table in the standard? Again, my copy\nof Date's SQL 92 primer is somewhere 'wteen Boston, MA and Portland, OR,\nso I can't look myself. Since you've got the standard available you\ncan answer perhaps?\n\n>Ouch, reading standards always makes my brain hurt. Especially how you\n>have to read them upside down. Turns out SELECT INTO is in the standard,\n>but not the way we implement it.\n\nScary!!! :) :)\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Tue, 25 Jan 2000 11:20:01 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding (was RE: [HACKERS] Happy column\n dropping)" }, { "msg_contents": "At 01:49 PM 1/25/00 -0500, Tom Lane wrote:\n\n>It occurs to me that in at least some of the places where attribute\n>numbers are currently used, we ought to use *neither* logical nor\n>physical column position, but rather a permanent unique ID --- the\n>attribute tuple's OID would work, if it's assigned soon enough to be\n>used for constraints given in CREATE TABLE. (Otherwise we could assign\n>\"column serial numbers\" that count from 1 for each relation, but are\n>never changed or recycled within the relation.)\n\n>In particular, if parsetrees for stored rules and constraints worked\n>that way, renumbering attributes that follow the added/dropped column\n>would become a lot less painful.\n\nYes...I see what you're driving at. Very interesting idea. The stored\nrules and constraints would in this case would still refer to the remaining\ncolumns after a drop, right?\n\nAs far as moving from phsyical to logical attribute numbering, and\nthe long slog involved, it might be possible to work towards this\ngoal in background mode by providing two sets of access macros/functions\nwith the same semantics, and as folks have time to slowly work through the\ncode. This wouldn't break anything. Nor would it substitute for\nan intense push to finish the job before switching to such a scheme,\nand of course there would be many errors.\n\nIt might slowly lower the barrier towards switching, though. The cost\nwould be a confusing and incomplete separation during the transition\nperiod.\n\nOf course, moving along this path would be something to consider only\nif it were decided that eventually such a switch will be made. And I'm\nnot at all sure I like it.\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Tue, 25 Jan 2000 11:30:01 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding (was RE: [HACKERS] Happy column\n dropping)" }, { "msg_contents": "> At 11:55 AM 1/25/00 +0100, Peter Eisentraut wrote:\n> >On Tue, 25 Jan 2000, Hiroshi Inoue wrote:\n> >\n> >> Even default is not allowed in ADD COLUMN now. \n> >> There may be other reasons why they aren't allowed.\n> >\n> >It's not a matter of *allowed*, it's a parsing deficiency. The fact that\n> >there was a default declared gets silently ignored. If y'all allow ;) I\n> >would like to fix that (have already started a bit) by perusing the code\n> >in parse_func.c:transformCreateStmt and do the same for the alter table\n> >add column part. Maybe and add/drop constraint will come out in the end as\n> >well.\n> \n> However, heap_getattr still won't see the default since it simply\n> checks to see of the attribute number falls off the end of the\n> tuple and then returns null.\n> \n> There's no provision for then pulling out the default value and\n> returning it instead.\n> \n> I think this is why Tom was implying that add column should really\n> alter the table?\n> \n> A fully-featured \"add column\" feature would be very nice, indeed.\n\nOh, so that is why ALTER TABLE can't have a NOT NULLL default. Makes\ntotal sense.\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": "Tue, 25 Jan 2000 15:08:15 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding (was RE: [HACKERS] Happy column dropping)" }, { "msg_contents": "On Tue, Jan 25, 2000 at 11:20:01AM -0800, Don Baccus wrote:\n> At 12:29 PM 1/25/00 -0600, Ross J. Reedstrom wrote:\n> >On Tue, Jan 25, 2000 at 12:23:15PM -0500, Tom Lane wrote:\n> \n> >> Well, yeah: wouldn't you expect that \"ADD COLUMN x DEFAULT 42\" would\n> >> cause every row currently existing in the table to acquire x = 42,\n> >> rather than x = NULL? In fact that would *have* to happen to allow\n> >> constraints to be added; consider ADD COLUMN x DEFAULT 42 NOT NULL.\n> \n> >Actually, no I wouldn't expect it. That's mixing DDL and DML in one\n> >statement. I expect the ALTER command to be pure DDL, and the UPDATE\n> >to be pure DML.\n> \n> Hmmm...interesting...is alter table in the standard? Again, my copy\n> of Date's SQL 92 primer is somewhere 'wteen Boston, MA and Portland, OR,\n> so I can't look myself. Since you've got the standard available you\n> can answer perhaps?\n\nGee, Don, that's a good idea, I should have thought of it myself! BTW,\nwhat I have is labelled \"Second Informal Review Draft\" and is dated July\n30, 1992. I don't know how it differs from the final standard, if at all.\nI orginally got it from someone on this list, I forget who. Anyone\nwant a copy, I'll happily email it to you, or throw it on a website:\nit's 1.6M of ASCII, ready for the line printer ;-) (273K gzipped.)\n\nThat said, ALTER is in fact described, and the ADD COLUMN case agrees\nwith Tom's expectations, rather than mine, see General Rule 2, below:\n\n 11.11 <add column definition>\n\n Function\n\n Add a column to a table.\n\n Format\n\n <add column definition> ::=\n ADD [ COLUMN ] <column definition>\n\n\n Syntax Rules\n\n None.\n\n Access Rules\n\n\n None.\n\n General Rules\n\n 1) The column defined by the <column definition> is added to T.\n\n 2) Let C be the column added to T. Every value in C is the default\n value for C.\n\n Note: The default value of a column is defined in Subclause 11.5,\n \"<default clause>\".\n\n Note: The addition of a column to a table has no effect on any\n existing <query expression> included in a view descriptor or\n <search condition> included in constraint descriptor because\n any implicit <column reference>s in these clauses are replaced\n by explicit <column reference>s when the clause is originally\n evaluated. See the Syntax Rules of Subclause 7.10, \"<query ex-\n pression>\".\n\n\nFor what it's worth, here's what it says about DROP COLUMN. Note that\nthe question of what to do about references to columns: standard says,\nthrow and error, unless the DBA really means it, with the CASCADE option,\nexcept for VIEWs, which get dropped, unless the DBA is careful to say\nRESTRICT.\n\n\n 11.15 <drop column definition>\n\n Function\n\n Destroy a column.\n\n Format\n\n <drop column definition> ::=\n DROP [ COLUMN ] <column name> <drop behavior>\n\n <drop behavior> ::= CASCADE | RESTRICT\n\n Syntax Rules\n\n 1) Let T be the table identified by the <table name> in the con-\n taining <alter table statement> and let TN be the name of T.\n\n 2) Let C be the column identified by the <column name> CN.\n\n 3) C shall be a column of T and C shall not be the only column of\n T.\n\n 4) If RESTRICT is specified, then C shall not be referenced in\n the <query expression> of any view descriptor or in the <search\n condition> of any constraint descriptor other than a table con-\n straint descriptor that contains references to no other column\n and that is included in the table descriptor of T.\n\n Note: A <drop column definition> that does not specify CASCADE\n will fail if there are any references to that column resulting\n from the use of CORRESPONDING, NATURAL, SELECT * (except where\n contained in an exists predicate>), or REFERENCES without a\n <reference column list> in its <referenced table and columns>.\n\n Note: If CASCADE is specified, then any such dependent object\n will be dropped by the execution of the <revoke statement> spec-\n ified in the General Rules of this Subclause.\n\n Access Rules\n\n None.\n\n General Rules\n\n 1) Let A be the current <authorization identifier>. The following\n <revoke statement> is effectively executed with a current <au-\n thorization identifier> of \"_SYSTEM\" and without further Access\n Rule checking:\n\n REVOKE INSERT(CN), UPDATE(CN), REFERENCES(CN) ON TABLE TN\n FROM A CASCADE\n\n 2) Let VN be the name of any view that contains a reference to\n column C of table T. The following <drop view statement> is\n effectively executed with a current <authorization identifier>\n of \"_SYSTEM\" and without further Access Rule checking:\n\n DROP VIEW VN CASCADE\n\n 3) If the column is not based on a domain, then its data type de-\n scriptor is destroyed.\n\n 4) The data associated with C is destroyed and the descriptor of C\n is removed from the descriptor of T.\n\n 5) The identified column and its descriptor are destroyed.\n\n 6) The degree of T is reduced by 1. The ordinal position of all\n columns having an ordinal position greater than the ordinal\n position of C is reduced by 1.\n", "msg_date": "Tue, 25 Jan 2000 14:22:19 -0600", "msg_from": "\"Ross J. Reedstrom\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding and dropping" }, { "msg_contents": "At 02:22 PM 1/25/00 -0600, Ross J. Reedstrom wrote:\n\n>Gee, Don, that's a good idea, I should have thought of it myself! BTW,\n>what I have is labelled \"Second Informal Review Draft\" and is dated July\n>30, 1992. I don't know how it differs from the final standard, if at all.\n\n>From the date, it should be quite close. From my experience, by this\npoint in the process changes are mostly editorial, not substantial\nin the sense of adding or dropping columns...I mean features. :)\n\n>I orginally got it from someone on this list, I forget who. Anyone\n>want a copy, I'll happily email it to you, or throw it on a website:\n>it's 1.6M of ASCII, ready for the line printer ;-) (273K gzipped.)\n\nI'd love a copy and have a DSL line, so the size doesn't bother me.\n\nAs far as putting it on a web site, Ansi drafts are generally available\nfor public comment so it might be OK to do so. Is there a copyright\nstatement attached?\n\n>That said, ALTER is in fact described, and the ADD COLUMN case agrees\n>with Tom's expectations, rather than mine, see General Rule 2, below:\n\nSo it goes :)\n\n>For what it's worth, here's what it says about DROP COLUMN. Note that\n>the question of what to do about references to columns: standard says,\n>throw and error, unless the DBA really means it, with the CASCADE option,\n>except for VIEWs, which get dropped, unless the DBA is careful to say\n>RESTRICT.\n\n> Note: A <drop column definition> that does not specify CASCADE\n> will fail if there are any references to that column resulting\n> from the use of CORRESPONDING, NATURAL, SELECT * (except where\n> contained in an exists predicate>), or REFERENCES without a\n> <reference column list> in its <referenced table and columns>.\n\nThis is interesting, because it implies that select * can or should\nbe expanded when a view is created, rather than when a view is queried.\nExcept for \"exists\" where the \"*\" target list can be thought of as being\na dummy as sorts.\n\nAlso, the \"natural\" refers to a \"natural join\". A \"natural join\", you'll\nrecall, is one where you supply two table names and the tables are joined\nby those columns they share in common. \"drop column\" is supposed to\ncatch such cases.\n\nDitto the form \"references tablename\" where the foreign key is determined\nby inspecting \"tablename\".\n\nCool! They don't expect much, do they? :)\n\nAll the above with the caveat \"if I'm reading this correctly\".\n\n> Note: If CASCADE is specified, then any such dependent object\n> will be dropped by the execution of the <revoke statement> spec-\n> ified in the General Rules of this Subclause.\n\n...\n\n> 1) Let A be the current <authorization identifier>. The following\n> <revoke statement> is effectively executed with a current <au-\n> thorization identifier> of \"_SYSTEM\" and without further Access\n> Rule checking:\n>\n> REVOKE INSERT(CN), UPDATE(CN), REFERENCES(CN) ON TABLE TN\n> FROM A CASCADE\n\nI don't know exactly what this sez offhand...\n\n>\n> 2) Let VN be the name of any view that contains a reference to\n> column C of table T. The following <drop view statement> is\n> effectively executed with a current <authorization identifier>\n> of \"_SYSTEM\" and without further Access Rule checking:\n>\n> DROP VIEW VN CASCADE\n\nThis is clear enough.\n\n...\n\n\n> 6) The degree of T is reduced by 1. The ordinal position of all\n> columns having an ordinal position greater than the ordinal\n> position of C is reduced by 1.\n\nDoes the standard give a way to access the ordinal position of \ncolumns?\n\nMy guess is that any preliminary implementation of drop column won't\nbe implementing everything spelled out in the standard!\n\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Tue, 25 Jan 2000 12:42:54 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding and dropping" }, { "msg_contents": "On Tue, Jan 25, 2000 at 12:42:54PM -0800, Don Baccus wrote:\n> At 02:22 PM 1/25/00 -0600, Ross J. Reedstrom wrote:\n> \n> I'd love a copy and have a DSL line, so the size doesn't bother me.\n> \n> As far as putting it on a web site, Ansi drafts are generally available\n> for public comment so it might be OK to do so. Is there a copyright\n> statement attached?\n\nHmm, the string 'copyright' (cas insensitive search) does not appear in \nthe text at all. This draft was done at DEC, according to the title page.\n\nSo, grab it from \n\n http://wallace.ece.rice.edu/sql1992.txt \nor\n http://wallace.ece.rice.edu/sql1992.txt.gz \n\n(hmm, Netscape just decompressed that, and showed me the text!)\n\nPerhaps this could go on postgresql.org, in the developers info section,\nif, as I believe, we may act in the good-faith belief that the drafts of\nthe ANSI standards are actually in the public domain. Hmm, I just realized,\nthis is actually a draft of the ISO standard. s/ANSI/ISO/\n\n> \n> > Note: If CASCADE is specified, then any such dependent object\n> > will be dropped by the execution of the <revoke statement> spec-\n> > ified in the General Rules of this Subclause.\n> \n> ...\n> \n> > 1) Let A be the current <authorization identifier>. The following\n> > <revoke statement> is effectively executed with a current <au-\n> > thorization identifier> of \"_SYSTEM\" and without further Access\n> > Rule checking:\n> >\n> > REVOKE INSERT(CN), UPDATE(CN), REFERENCES(CN) ON TABLE TN\n> > FROM A CASCADE\n> \n> I don't know exactly what this sez offhand...\n\nI think it says: make these items disappear, for the current user, by\nrevoking all privileges for this column (CN :== column name) on this table.\n\nErr, are privileges supposed to be granular to the _column_? The syntax for\nGRANT and REVOKE don't imply it, but some of the Rules in each do.\n\n> \n> \n> > 6) The degree of T is reduced by 1. The ordinal position of all\n> > columns having an ordinal position greater than the ordinal\n> > position of C is reduced by 1.\n> \n> Does the standard give a way to access the ordinal position of \n> columns?\n\nYou mean go from <column name> to <ordinal>? I don't think so, but I\nhaven't grovelled through the standard enough... O.K., now I have. It's\nin the defined system tables, in particular the COLUMNS table, which I\nwon't duplicate here, since it runs to more than a printed page! It's\nin clause 21.3.10, page 580, and defines a table that includes fields\n\n[...]\n TABLE_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER,\n COLUMN_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER,\n ORDINAL_POSITION INFORMATION_SCHEMA.CARDINAL_NUMBER\n CONSTRAINT COLUMN_POSITION_NOT_NULL NOT NULL,\n[...]\n\nSo, yes, there is a standard way to get from <table name> + <ordinal> to\n<column name>, if that's what you meant (since getting at the _contents_\nis trivial: SELECT <ordinal> from <table name> Gack, look what you've\ndone, I'm starting to type in <standard complient markup> ;-)\n\n> \n> My guess is that any preliminary implementation of drop column won't\n> be implementing everything spelled out in the standard!\n> \n\nI wouldn't think so! But it might help to plan for future implementation,\nor at least be sure not to implement something that makes it harder to\nimplement the rest in the future.\n\nRoss\n-- \nRoss J. Reedstrom, Ph.D., <[email protected]> \nNSBRI Research Scientist/Programmer\nComputer and Information Technology Institute\nRice University, 6100 S. Main St., Houston, TX 77005\n", "msg_date": "Tue, 25 Jan 2000 15:48:39 -0600", "msg_from": "\"Ross J. Reedstrom\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding and dropping" }, { "msg_contents": "At 03:48 PM 1/25/00 -0600, Ross J. Reedstrom wrote:\n\n> http://wallace.ece.rice.edu/sql1992.txt.gz \n\nThanks! Now I have my own copy...\n...\n\n>> Does the standard give a way to access the ordinal position of \n>> columns?\n>\n>You mean go from <column name> to <ordinal>? I don't think so, but I\n>haven't grovelled through the standard enough... O.K., now I have. It's\n>in the defined system tables, in particular the COLUMNS table, which I\n>won't duplicate here, since it runs to more than a printed page! It's\n>in clause 21.3.10, page 580, and defines a table that includes fields\n>\n>[...]\n> TABLE_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER,\n> COLUMN_NAME INFORMATION_SCHEMA.SQL_IDENTIFIER,\n> ORDINAL_POSITION INFORMATION_SCHEMA.CARDINAL_NUMBER\n> CONSTRAINT COLUMN_POSITION_NOT_NULL NOT NULL,\n>[...]\n>\n>So, yes, there is a standard way to get from <table name> + <ordinal> to\n><column name>, if that's what you meant (since getting at the _contents_\n>is trivial: SELECT <ordinal> from <table name> Gack, look what you've\n>done, I'm starting to type in <standard complient markup> ;-)\n\nOK, I asked because someone earlier said that Postgres should probably\neventually provide SQL92 standard ways to get at table information.\n\nInteresting...\n\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Tue, 25 Jan 2000 13:57:15 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding and dropping" }, { "msg_contents": "> It occurs to me that in at least some of the places where attribute\n> numbers are currently used, we ought to use *neither* logical nor\n> physical column position, but rather a permanent unique ID --- the\n> attribute tuple's OID would work, if it's assigned soon enough to be\n> used for constraints given in CREATE TABLE. (Otherwise we could assign\n> \"column serial numbers\" that count from 1 for each relation, but are\n> never changed or recycled within the relation.)\n> \n> In particular, if parsetrees for stored rules and constraints worked\n> that way, renumbering attributes that follow the added/dropped column\n> would become a lot less painful.\n\nI am going to object to any use of invisible columns just to get a nice\nALTER DROP COLUMN capability. It doesn't seeem with the added code\ncomplexity. Our code is complex enough. Why add more to it just for\none feature.\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": "Tue, 25 Jan 2000 17:38:22 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding (was RE: [HACKERS] Happy column dropping)" }, { "msg_contents": "Don Baccus <[email protected]> writes:\n>> In particular, if parsetrees for stored rules and constraints worked\n>> that way, renumbering attributes that follow the added/dropped column\n>> would become a lot less painful.\n\n> Yes...I see what you're driving at. Very interesting idea. The stored\n> rules and constraints would in this case would still refer to the remaining\n> columns after a drop, right?\n\nRight. You'd still need to scan through all the rules/constraints to\nlook for references to a column-to-be-dropped (and then either drop that\nrule/constraint or kick out an error, as appropriate). But you wouldn't\nhave to *change* any surviving rules/constraints, because they'd still\nbe referring to the same permanent IDs of the remaining columns.\n\nAlso, inherited ADD COLUMN would become far easier, because it wouldn't\nchange the rules/constraints of child tables at all --- even though the\nnew column would change the logical numbering of child-table columns,\nit wouldn't change their permanent IDs and thus we wouldn't have to\nupdate rules/constraints.\n\nIf we were willing to hardwire the assumption that DROP COLUMN never\nphysically drops a column, but only hides it and adjusts logical column\nnumbers, then the physical column numbers could serve as permanent IDs;\nso we'd only need two numbers not three. This might be good, or not.\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 25 Jan 2000 18:01:36 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding (was RE: [HACKERS] Happy column dropping) " }, { "msg_contents": "At 06:01 PM 1/25/00 -0500, Tom Lane wrote:\n>Don Baccus <[email protected]> writes:\n>>> In particular, if parsetrees for stored rules and constraints worked\n>>> that way, renumbering attributes that follow the added/dropped column\n>>> would become a lot less painful.\n>\n>> Yes...I see what you're driving at. Very interesting idea. The stored\n>> rules and constraints would in this case would still refer to the remaining\n>> columns after a drop, right?\n>\n>Right. You'd still need to scan through all the rules/constraints to\n>look for references to a column-to-be-dropped (and then either drop that\n>rule/constraint or kick out an error, as appropriate). But you wouldn't\n>have to *change* any surviving rules/constraints, because they'd still\n>be referring to the same permanent IDs of the remaining columns.\n\nGood, I understand then.\n\n>Also, inherited ADD COLUMN would become far easier, because it wouldn't\n>change the rules/constraints of child tables at all --- even though the\n>new column would change the logical numbering of child-table columns,\n>it wouldn't change their permanent IDs and thus we wouldn't have to\n>update rules/constraints.\n\nAhhh...yes. I haven't looked at the inheritance code, yet, but I see\nwhat you're saying. I think. Do child-table columns follow parent-table\ncolumns by some chance (in today's absolute column number scheme)?\n\n>If we were willing to hardwire the assumption that DROP COLUMN never\n>physically drops a column, but only hides it and adjusts logical column\n>numbers, then the physical column numbers could serve as permanent IDs;\n>so we'd only need two numbers not three. This might be good, or not.\n\nYes. But if I'm right about how child-table columns are numbered, \nwouldn't add column still cause a problem, i.e. you'd still have to\nchange their physical column number?\n\nI'm probably misunderstanding here because I've not looked at the \ninheritance mechanism at all. Maybe I'll do that for a little evening\nentertainment.\n\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Tue, 25 Jan 2000 15:10:22 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding (was RE: [HACKERS] Happy column\n dropping)" }, { "msg_contents": "Bruce Momjian <[email protected]> writes:\n> I am going to object to any use of invisible columns just to get a nice\n> ALTER DROP COLUMN capability. It doesn't seeem with the added code\n> complexity. Our code is complex enough. Why add more to it just for\n> one feature.\n\nI'm not convinced about it either --- but at this point the discussion\nis just a gedanken-experiment to see what problems would be solved\nor created if we did something like this. It could be that having\ninvisible columns (or more likely, separate logical and physical\ncolumn numbers) would solve enough nagging problems with ADD COLUMN\nand DROP COLUMN and inherited tables that it'd be worth doing.\nOr not. But let's not shut off the discussion before we see where\nit leads.\n\nFollowing on to my comment about logical column numbers, physical\ncolumn positions, and permanent column IDs being conceptually\ndistinct: one thing that needs careful consideration is just how\nwe identify inherited columns in child tables as being the \"same\ncolumn\" as the original column in the parent. Right now, because\nADD COLUMN doesn't guarantee to assign the same column number in\neach child, the parser/planner handles this by looking for the\nsame column name in each child table, which it does on-the-fly\nwhile setting up a \"SELECT table*\" operation. That's pretty much\nof a kluge in my opinion. My guess is that we ought to use either\nlogical column number or permanent ID as the key that tells us which\nchild column is the inherited one. To use permanent ID, we'd have\nto ensure that permanent IDs are inheritable, which would complicate\nassignment of permanent IDs considerably --- they'd probably have to\nbecome OIDs, but not the same OIDs as are assigned to the pg_attribute\nrows themselves. Logical column number might work OK for this purpose\nthough. It seems a little shaky to me intuitively, but I can't actually\nthink of a reason that it wouldn't work.\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 25 Jan 2000 18:55:59 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding (was RE: [HACKERS] Happy column dropping) " }, { "msg_contents": "Don Baccus wrote:\n> \n> Ahhh...yes. I haven't looked at the inheritance code, yet, but I see\n> what you're saying. I think. Do child-table columns follow parent-table\n> columns by some chance (in today's absolute column number scheme)?\n> \n> >If we were willing to hardwire the assumption that DROP COLUMN never\n> >physically drops a column, but only hides it and adjusts logical column\n> >numbers, then the physical column numbers could serve as permanent IDs;\n> >so we'd only need two numbers not three. This might be good, or not.\n> \n> Yes. But if I'm right about how child-table columns are numbered,\n> wouldn't add column still cause a problem, i.e. you'd still have to\n> change their physical column number?\n\nIf we allow deleted column as a basic feature of postgres,\nit could be like that \n\nbase: COL1 | COL2 | COL3 \nchild: COL1 | COL2 | COL3 | COL4\n\nafter add column 5 to base table\n\nbase: COL1 | COL2 | COL3 | del4 | COL5 \nchild: COL1 | COL2 | COL3 | COL4 | COL5\n\nafter add column 6 to child\n\nbase: COL1 | COL2 | COL3 | del4 | COL5 \nchild: COL1 | COL2 | COL3 | COL4 | COL5 | COL6\n\nafter drop column 2 from base table\n\nbase: COL1 | del2 | COL3 | del4 | COL5 \nchild: COL1 | del2 | COL3 | COL4 | COL5 | COL6\n\ndropping column from child table that is not a deleted column in \nparent is not allowed.\n\nThe delN columns are always NULLed on reading tuple and are written as proper \nnull columns (taking up space only in NULL bitmask)\n\nmultiple inheritance is tricky and _requires_ unique column ids maybe oids\nfrom pg_attribute to be doable.\n\n-----------------\nHannu\n", "msg_date": "Wed, 26 Jan 2000 02:25:13 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding (was RE: [HACKERS] Happy columndropping)" }, { "msg_contents": "Tom Lane wrote:\n> \n> Don Baccus <[email protected]> writes:\n> > However, heap_getattr still won't see the default since it simply\n> > checks to see of the attribute number falls off the end of the\n> > tuple and then returns null.\n> \n> Right.\n> \n> > There's no provision for then pulling out the default value and\n> > returning it instead.\n> \n> Would it even be possible to do that? I'm not sure that heap_getattr\n> has any way to find the default. It only has a TupleDesc, not a\n> reference to the relation itself...\n\nbut could it not return a special value, say COLUMN_DEFAULT, that upper \nlevels know to replace with the real default. Of course it get's funny if \nif the default is nextval('myseq') or CURRENT_TIME.\n\nanother way to approach the whole problem is to have something like \ngeneration_id in each tuple that tells which version of TupleDesc applies \nto this tuple, but it seems to complicate things even further.\n\n-----------------\nHannu\n", "msg_date": "Wed, 26 Jan 2000 02:31:34 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding (was RE: [HACKERS] Happy column dropping)" }, { "msg_contents": "At 02:25 AM 1/26/00 +0200, Hannu Krosing wrote:\n\n>multiple inheritance is tricky and _requires_ unique column ids maybe oids\n>from pg_attribute to be doable.\n\nHaving worked on a C++ compiler (one of the first, actually) I \nsuspect that this might be one of the lesser problems associated\nwith implementing a multiple inheritance scheme :)\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Tue, 25 Jan 2000 16:38:04 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding (was RE: [HACKERS] Happy\n columndropping)" }, { "msg_contents": "Don Baccus wrote:\n> \n> At 02:25 AM 1/26/00 +0200, Hannu Krosing wrote:\n> \n> >multiple inheritance is tricky and _requires_ unique column ids maybe oids\n> >from pg_attribute to be doable.\n> \n> Having worked on a C++ compiler (one of the first, actually) I\n> suspect that this might be one of the lesser problems associated\n> with implementing a multiple inheritance scheme :)\n>\n\nI was aiming at a more loose way of doing multiple inheritance, something like\nis used in python - you don't check too many things at compile time and\ndynamically \nlookup them when needed.\n\nfor this the most_basic_column_oid scheme might work.\n\nhaving unique indexes that span multiple tables would of course be tricky too, \nas would triggers and rules and ...\n\ntable a (oidA1, oidA2)\ntable b (oidB1, oidB2)\ntable c (oidC1) inherits(a,b)\nalter table a drop column oidA2\nalter table b add column oidB3\n-->\ntable a - (oidA1,delA2)\ntable b - (oidB1,oidB2,oidB3)\ntable c - (oidA1,delA2,oidB1,oidB2,oidC1,oidB3)\n\nseems the only sensible way for multiple inheritance to work with ADD/DROP\nCOLUMN \nis going with column oids for storage.\n\nHidden columns only would work for single inheritance. \n\n------------\nHannu\n", "msg_date": "Wed, 26 Jan 2000 03:08:27 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding (was RE: [HACKERS] Happycolumndropping)" }, { "msg_contents": "> > As far as putting it on a web site, Ansi drafts are generally available\n> > for public comment so it might be OK to do so. Is there a copyright\n> > statement attached?\n> Hmm, the string 'copyright' (cas insensitive search) does not appear in\n> the text at all. This draft was done at DEC, according to the title page.\n\nRight. I picked it up from a late, great DEC ftp site somewhere, and\nmight have been the one to forward it to you.\n\nafaik, the drafts are in the public domain, or have a copyright which\nallows distribution. They make their money from the final version...\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Wed, 26 Jan 2000 03:03:17 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Happy column adding and dropping" }, { "msg_contents": "> > > As far as putting it on a web site, Ansi drafts are generally available\n> > > for public comment so it might be OK to do so. Is there a copyright\n> > > statement attached?\n> > Hmm, the string 'copyright' (cas insensitive search) does not appear in\n> > the text at all. This draft was done at DEC, according to the title page.\n> \n> Right. I picked it up from a late, great DEC ftp site somewhere, and\n> might have been the one to forward it to you.\n> \n> afaik, the drafts are in the public domain, or have a copyright which\n> allows distribution. They make their money from the final version...\n\nI have to admit, I was hoping for a nice PDF version with bookmarks.\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": "Tue, 25 Jan 2000 22:04:17 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Happy column adding and dropping" }, { "msg_contents": "At 10:04 PM 1/25/00 -0500, Bruce Momjian wrote:\n\n>I have to admit, I was hoping for a nice PDF version with bookmarks.\n\n1992? Not likely :) I mean, not in its original form.\n\nWe live in a fast-changing world, don't we?\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Tue, 25 Jan 2000 20:39:34 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Happy column adding and dropping" }, { "msg_contents": "> At 10:04 PM 1/25/00 -0500, Bruce Momjian wrote:\n> \n> >I have to admit, I was hoping for a nice PDF version with bookmarks.\n> \n> 1992? Not likely :) I mean, not in its original form.\n> \n> We live in a fast-changing world, don't we?\n> \n\nI was usually a paper manuals guy, but with PDF and bookmarks so you can\njump to the section you want, I like PDF better.\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": "Wed, 26 Jan 2000 00:27:39 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Happy column adding and dropping" }, { "msg_contents": "> -----Original Message-----\n> From: [email protected]\n> [mailto:[email protected]]On Behalf Of Don Baccus\n> \n> At 11:55 AM 1/25/00 +0100, Peter Eisentraut wrote:\n> >On Tue, 25 Jan 2000, Hiroshi Inoue wrote:\n> >\n> >> Even default is not allowed in ADD COLUMN now. \n> >> There may be other reasons why they aren't allowed.\n> >\n> >It's not a matter of *allowed*, it's a parsing deficiency. The fact that\n> >there was a default declared gets silently ignored. If y'all allow ;) I\n> >would like to fix that (have already started a bit) by perusing the code\n> >in parse_func.c:transformCreateStmt and do the same for the alter table\n> >add column part. Maybe and add/drop constraint will come out in \n> the end as\n> >well.\n> \n> However, heap_getattr still won't see the default since it simply\n> checks to see of the attribute number falls off the end of the\n> tuple and then returns null.\n>\n\nSorry,the following question might be already answered but too\nmany postings for me.\n\nDo we have to refer default value for already inserted rows ?\nDoesn't 'default' have its meaning only when rows are about to be\ninserted ?\n\nRegards.\n\nHiroshi Inoue\[email protected] \n\n", "msg_date": "Wed, 26 Jan 2000 14:32:16 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: Happy column adding (was RE: [HACKERS] Happy column dropping)" }, { "msg_contents": "Hiroshi Inoue wrote:\n> \n> > However, heap_getattr still won't see the default since it simply\n> > checks to see of the attribute number falls off the end of the\n> > tuple and then returns null.\n> >\n> \n> Sorry,the following question might be already answered but too\n> many postings for me.\n> \n> Do we have to refer default value for already inserted rows ?\n> Doesn't 'default' have its meaning only when rows are about to be\n> inserted ?\n\nI think the case was about adding a NOT NULL column and setting current NULL \ncolumns to DEFAULT seemed like a natural thing to do.\n\nBut, considering the fact that DEFAULT can be something reaaly complex, like\nfunction that does a lot of things, it may be better to have the constraints\nchecked at the end of transaction, like\n\nBEGIN;\nALTER TABLE T1 ADD COLUMN C1 TEXT NOT NULL;\nUPDATE T1 SET C1='MYDEFAULTVALUE';\nCOMMIT;\n\nonly IIRC we have quite poor support for DDL statements inside transactions.\n\n---------------\nHannu\n", "msg_date": "Wed, 26 Jan 2000 10:45:42 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding (was RE: [HACKERS] Happy column dropping)" }, { "msg_contents": "> -----Original Message-----\n> From: [email protected] [mailto:[email protected]]On Behalf Of Hannu Krosing\n> \n> Hiroshi Inoue wrote:\n> > \n> > > However, heap_getattr still won't see the default since it simply\n> > > checks to see of the attribute number falls off the end of the\n> > > tuple and then returns null.\n> > >\n> > \n> > Sorry,the following question might be already answered but too\n> > many postings for me.\n> > \n> > Do we have to refer default value for already inserted rows ?\n> > Doesn't 'default' have its meaning only when rows are about to be\n> > inserted ?\n>\n\nOh,I found it from Ross's posting.\n\n General Rules\n\n 1) The column defined by the <column definition> is added to T.\n\n 2) Let C be the column added to T. Every value in C is the default\n value for C.\n\n Note: The default value of a column is defined in Subclause 11.5,\n \"<default clause>\"\n\nIs this reasonable ?\n. \n> I think the case was about adding a NOT NULL column and setting \n> current NULL \n> columns to DEFAULT seemed like a natural thing to do.\n>\n> But, considering the fact that DEFAULT can be something reaaly \n> complex, like\n> function that does a lot of things, it may be better to have the \n> constraints\n> checked at the end of transaction, like\n> \n> BEGIN;\n> ALTER TABLE T1 ADD COLUMN C1 TEXT NOT NULL;\n\nIsn't 'iNITIALLY DEFERRED' needed ?\nALTER TABLE T1 ADD COLUMN C1 TEXT NOT NULL INITIALLY DEFERRED;\n\n> UPDATE T1 SET C1='MYDEFAULTVALUE';\n> COMMIT;\n>\n\nIt seems more reasonable than standard.\nBut is it worth breaking SQL standard ?\n\nRegards.\n\nHiroshi Inoue\[email protected]\n", "msg_date": "Wed, 26 Jan 2000 20:05:00 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: Happy column adding (was RE: [HACKERS] Happy column dropping)" }, { "msg_contents": "\n\nHiroshi Inoue wrote:\n\n> > -----Original Message-----\n> > From: [email protected]\n> > [mailto:[email protected]]On Behalf Of Don Baccus\n> >\n> > At 11:55 AM 1/25/00 +0100, Peter Eisentraut wrote:\n> > >On Tue, 25 Jan 2000, Hiroshi Inoue wrote:\n> > >\n> > >> Even default is not allowed in ADD COLUMN now.\n> > >> There may be other reasons why they aren't allowed.\n> > >\n> > >It's not a matter of *allowed*, it's a parsing deficiency. The fact that\n> > >there was a default declared gets silently ignored. If y'all allow ;) I\n> > >would like to fix that (have already started a bit) by perusing the code\n> > >in parse_func.c:transformCreateStmt and do the same for the alter table\n> > >add column part. Maybe and add/drop constraint will come out in\n> > the end as\n> > >well.\n> >\n> > However, heap_getattr still won't see the default since it simply\n> > checks to see of the attribute number falls off the end of the\n> > tuple and then returns null.\n> >\n>\n> Sorry,the following question might be already answered but too\n> many postings for me.\n>\n> Do we have to refer default value for already inserted rows ?\n> Doesn't 'default' have its meaning only when rows are about to be\n> inserted ?\n>\n\nOf course yes.\nfrom \"A guide to SQL Standard\" page 106:\n\n\"ALTER TABLE S ADD COLUMN DISCOUNT SMALLINT DEFAULT -1\n\nthis statement adds a new fifth column called DISCOUNT to base table S. All\nexisting S rows are extended to include a value for new column; that value is\n-1 in every such row....\"\n\nThe problem is when we define a constraint for the column like:\n\nALTER TABLE S ADD COLUMN DISCOUNT SMALLINT NOT NULL\n\nIn such case IMO this should be refused because it violates data integrity,\nan less you define also a default value for the column as in:\n\nALTER TABLE S ADD COLUMN DISCOUNT SMALLINT NOT NULL DEFAULT -1\n\nJos�\n\n\n\n\n\n\n>\n> Regards.\n>\n> Hiroshi Inoue\n> [email protected]\n>\n> ************\n\n", "msg_date": "Wed, 26 Jan 2000 14:24:14 +0100", "msg_from": "Jose Soares <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding (was RE: [HACKERS] Happy column dropping)" }, { "msg_contents": "\n\nDon Baccus wrote:\n\n> At 12:29 PM 1/25/00 -0600, Ross J. Reedstrom wrote:\n> >On Tue, Jan 25, 2000 at 12:23:15PM -0500, Tom Lane wrote:\n>\n> >> Well, yeah: wouldn't you expect that \"ADD COLUMN x DEFAULT 42\" would\n> >> cause every row currently existing in the table to acquire x = 42,\n> >> rather than x = NULL? In fact that would *have* to happen to allow\n> >> constraints to be added; consider ADD COLUMN x DEFAULT 42 NOT NULL.\n>\n> >Actually, no I wouldn't expect it. That's mixing DDL and DML in one\n> >statement. I expect the ALTER command to be pure DDL, and the UPDATE\n> >to be pure DML.\n>\n> Hmmm...interesting...is alter table in the standard?\n\nYes, of course.\n...\n <alter table statement> ::=\n ALTER TABLE <table name> <alter table action>\n\n <alter table action> ::=\n <add column definition>\n | <alter column definition>\n | <drop column definition>\n | <add table constraint definition>\n | <drop table constraint definition>\n...\n\n> Again, my copy\n> of Date's SQL 92 primer is somewhere 'wteen Boston, MA and Portland, OR,\n> so I can't look myself. Since you've got the standard available you\n> can answer perhaps?\n\n>\n> >Ouch, reading standards always makes my brain hurt. Especially how you\n> >have to read them upside down. Turns out SELECT INTO is in the standard,\n> >but not the way we implement it.\n>\n> Scary!!! :) :)\n>\n> - Don Baccus, Portland OR <[email protected]>\n> Nature photos, on-line guides, Pacific Northwest\n> Rare Bird Alert Service and other goodies at\n> http://donb.photo.net.\n>\n> ************\n\nJos�\n\n", "msg_date": "Wed, 26 Jan 2000 14:39:19 +0100", "msg_from": "Jose Soares <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding (was RE: [HACKERS] Happy columndropping)" }, { "msg_contents": "At 10:45 AM 1/26/00 +0200, Hannu Krosing wrote:\n\n>> Do we have to refer default value for already inserted rows ?\n>> Doesn't 'default' have its meaning only when rows are about to be\n>> inserted ?\n>\n>I think the case was about adding a NOT NULL column and setting current NULL \n>columns to DEFAULT seemed like a natural thing to do.\n\netc...\n\nIt depends on whether we want to be SQL92 compliant. The SQL92 standard\nseems to make it clear that \"add column ... default\" is supposed to \nset the column in ALL the rows in the table to that value.\n\nI think it's actually much more useful this way. If you set a default\nvalue, it is normal to write application code that depends on its \nexistence. If you're going to write your application to work with\nthe column set to NULL, then you probably don't need the default\nanyway.\n\nAnd...if you don't want to pay the penalty of having to set default\nvalues for all the rows when you add a column with a default value,\nyou can always add the column without the default value and use a\ntrigger to set new rows to a default value. This would give the\nfunctionality you want, no?\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Wed, 26 Jan 2000 10:07:50 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Happy column adding (was RE: [HACKERS] Happy column\n dropping)" }, { "msg_contents": "On 2000-01-25, Tom Lane mentioned:\n\n> > IIRC,there were some reason that default for new column had been rejected.\n> \n> Well, yeah: wouldn't you expect that \"ADD COLUMN x DEFAULT 42\" would\n> cause every row currently existing in the table to acquire x = 42,\n\nSure. But whatever happened to\npg_exec_query_dest(\"update <tablename> set <newcolname> = <default>\")\n\nThis is what users would have to execute anyway, right?\n\nLook at this:\n\n=> create table test1 (a text);\n=> insert into test1 values ('blah');\n=> insert into test1 values ('blah');\n=> insert into test1 values ('blah');\n=> alter table test1 add column b serial;\n=> select * from test1;\n a | b\n------+---\n blah | 1\n blah | 2\n blah | 3\n(3 rows)\n\nNot good?\n\n> rather than x = NULL? In fact that would *have* to happen to allow\n> constraints to be added; consider ADD COLUMN x DEFAULT 42 NOT NULL.\n\nOr how about (continuing the above):\n\n=> alter table test1 add column c int not null;\nERROR: ALTER TABLE: adding NOT NULL attribute to non-empty table requires\na non-NULL default value \n\n> The only way to make that happen is for ADD COLUMN to switch over to\n> an implementation that rewrites all the tuples. Which I think is the\n> right way to go ... but per this discussion, it's not a trivial fix.\n\nSo what's the above doing? Seriously, is there silently creeping heap\ncorruption I'm not seeing?\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n\n", "msg_date": "Wed, 26 Jan 2000 19:35:28 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": true, "msg_subject": "Re: Happy column adding" } ]
[ { "msg_contents": "Does anyone know to what extent we do/should support Not-a-number,\nInfinity, and the like for our floating point types? Are we at the mercy\nof the operating system? If so, how could we ever offer this functionality\nacross the board on the backend level?\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n\n", "msg_date": "Sun, 23 Jan 2000 02:30:59 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": true, "msg_subject": "Not a number" } ]
[ { "msg_contents": "I've built current sources on my brand new linux box,\nthought I'd try foreign key constraints since the datamodel for\nthe ArsDigita Community System contains hundreds of them.\nFigured this might provide a bit of a stress test for the\nimplementation.\n\nSo...what's wrong with the following?\n\ndonb=> create table foo(i integer);\nCREATE\ndonb=> create table bar(i integer references foo);\nERROR: FOREIGN KEY match type UNSPECIFIED not implemented yet\ndonb=> \n\nThis is how I'm used to doing it in Oracle. I've tried a few\npermutations, what am I missing? My copy of Date is still in\nBoston...\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Sat, 22 Jan 2000 18:04:28 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": true, "msg_subject": "foreign keys?" }, { "msg_contents": "\n>I've built current sources on my brand new linux box,\n>thought I'd try foreign key constraints since the datamodel for\n>the ArsDigita Community System contains hundreds of them.\n>Figured this might provide a bit of a stress test for the\n>implementation.\n>\n>So...what's wrong with the following?\n>\n>donb=> create table foo(i integer);\n>CREATE\n>donb=> create table bar(i integer references foo);\n>ERROR: FOREIGN KEY match type UNSPECIFIED not implemented yet\n>donb=> \n>\n>This is how I'm used to doing it in Oracle. I've tried a few\n>permutations, what am I missing? My copy of Date is still in\n>Boston...\n\nAs of the last snapshot I downloaded, only MATCH FULL was \nimplemented fully and I think postgres will only be happy \nif you specify the column list or table foo has a primary key.\n\ncreate table bar(i integer references foo(i) match full);\n\nThat seems to work, although by the way I read the spec, I'm\nnot sure that it should since there is no unique constraint \nspecified on foo(i).\n", "msg_date": "Sun, 23 Jan 2000 03:17:03 -0500", "msg_from": "[email protected]", "msg_from_op": false, "msg_subject": "Re: [HACKERS] foreign keys? " }, { "msg_contents": "At 03:17 AM 1/23/00 -0500, [email protected] wrote:\n\n>As of the last snapshot I downloaded, only MATCH FULL was \n>implemented fully and I think postgres will only be happy \n>if you specify the column list or table foo has a primary key.\n\nI actually tried creating table foo with and without a primary\nkey, with no effect.\n\n>create table bar(i integer references foo(i) match full);\n>\n>That seems to work, although by the way I read the spec, I'm\n>not sure that it should since there is no unique constraint \n>specified on foo(i).\n\nGood point, I wonder? Maybe I should get my girlfriend to\nsnail-mail me my copy of Date, since I won't be back to Boston\nuntil March. \n\nAnyway, the following works:\n\ncreate table foo(i integer primary key);\ncreate table bar(i integer references foo match full);\n\nIt finds the primary key within foo to match upon.\n\nThanks for the help.\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Sun, 23 Jan 2000 07:35:59 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] foreign keys? " } ]
[ { "msg_contents": "You might recall that I reported that this failed in \n6.5.3 on RH 5.2. Tom Lane indicated that it rang a bell, possibly\nbeing due to an endian error and asked if Jan remembered.\nI don't recall Jan answering (though I might've missed an\nanswer).\n\nWhatever.\n\nI've tried this with the current sources and it works fine.\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Sat, 22 Jan 2000 18:20:57 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": true, "msg_subject": "FWIW department - select avg(numeric_value)" } ]
[ { "msg_contents": "Installed the binaries with pkgadd -d <...>\nWhen I try to run I get:\n$ bin/pg_version\nld.so.1: bin/pg_version: fatal: libgen.so.1: open failed: No such file\nor directory\nKilled\n$ uname -a\nSunOS namsb 5.6 Generic_105181-16 sun4u sparc SUNW,Ultra-4\n$ env\nHOME=/usr/local/pgsql\nHZ=100\nLOGNAME=pgsql\nPATH=/usr/bin::/usr/local/bin:/usr/opt/SUNWmd/sbin\nSHELL=/bin/sh\nTERM=vt100\nTZ=US/Eastern\nWhat am I missing?\n-- \nPrivileged/Confidential Information may be contained in this message. \nIf you are not the addressee indicated in this message \n(or responsible for delivery of the message to such person), \nyou may not copy or deliver this message to anyone. \nIn such case, you should destroy this message and kindly notify the\nsender by reply email. \nPlease advise immediately if you or your employer does not consent to\nemail\nfor messages of this kind. Opinions, conclusions and other information\nin this message \nthat do not relate to the official business of New Age Media Systems\nshall be understood \nas neither given nor endorsed by it.\n", "msg_date": "Sat, 22 Jan 2000 22:35:55 -0500", "msg_from": "D Herssein <[email protected]>", "msg_from_op": true, "msg_subject": "[HELP] - Installing Postgres " } ]
[ { "msg_contents": "I have noticed some people are complaining about patches being applied. \nI feel this is very discouraging to the people who submit them.\n\nI apply patches as soon as I seem them, assuming they look OK. We\nalways have the ability to back them out later.\n\nWhat I am seeing is people voting for people to reverse out patches\nwithout giving the patch submitter a chance to address any concerns. I\nthink we owe our patch submitters the dignity of having a chance to\nrespond to criticism of the patches before anyone suggests yanking a\npatch.\n\nI have rejected patches in the past, but I usually tell the person what\nI don't like about the patch, and encourage them to resubmit the patch\nwith the suggested changes. \n\nSometime, I even apply the patch, but tell the submitter they have to\ngive me the fixes I requested. If they don't arrive in a few days, then\nI reverse out the patch. Sometimes it is easier for people to fix what\nthey have already done than to submit a totally new patch.\n\nOf course, this is all my personal opinion.\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": "Sat, 22 Jan 2000 22:41:15 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Refusing patches" } ]
[ { "msg_contents": "char_length()/octet_length() for char() datatype returns a character\nlength *except* the trailing blanks. Is this what the standard\nexpects? Oracle's length() returns 3 in the case below.\n\ntest=> create table t2 (c char(3));\nCREATE\ntest=> insert into t2 values('c');\nINSERT 277385 1\ntest=> select * from t2;\n c \n-----\n c \n(1 row)\n\ntest=> select char_length(c) from t2;\n length \n--------\n 1\n(1 row)\n\ntest=> select octet_length(c) from t2;\n octet_length \n--------------\n 1\n(1 row)\n--\nTatsuo Ishii\n", "msg_date": "Sun, 23 Jan 2000 12:47:47 +0900", "msg_from": "Tatsuo Ishii <[email protected]>", "msg_from_op": true, "msg_subject": "char_length()?" }, { "msg_contents": "Tatsuo Ishii <[email protected]> writes:\n> char_length()/octet_length() for char() datatype returns a character\n> length *except* the trailing blanks. Is this what the standard\n> expects? Oracle's length() returns 3 in the case below.\n\nAFAICT Oracle is right --- the spec just says\n\n i) If the data type of S is a character data type, then the\n result is the number of characters in the value of S.\n\nand I can't see anything there about stripping pad characters. You\ncould ask for length(trim(S)) if you don't want to count blanks.\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 22 Jan 2000 23:16:17 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] char_length()? " }, { "msg_contents": "> Tatsuo Ishii <[email protected]> writes:\n> > char_length()/octet_length() for char() datatype returns a character\n> > length *except* the trailing blanks. Is this what the standard\n> > expects? Oracle's length() returns 3 in the case below.\n> \n> AFAICT Oracle is right --- the spec just says\n> \n> i) If the data type of S is a character data type, then the\n> result is the number of characters in the value of S.\n> \n> and I can't see anything there about stripping pad characters. You\n> could ask for length(trim(S)) if you don't want to count blanks.\n\nOk, I have committed fixes for this. Maybe we should add this\nincompatible changes to the release note:\n\nchar_length()/octet_length() for the char() datatype now returns a\ncharacter length (or byte length) including the trailing blanks.\n--\nTatsuo Ishii\n", "msg_date": "Sun, 23 Jan 2000 17:16:35 +0900", "msg_from": "Tatsuo Ishii <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] char_length()? " } ]
[ { "msg_contents": "I am defining a table t1 with a NOT NULL field f1 and UNIQUE field f2.\n(it automatically defines t1_f2_key unique index)\n\nI am defining now a new table t2 that inherits t1 table and add some\ncolumns.\n\nThe NOT NULL constraint is preserved for f1 field, the UNIQUE for f2 not\n(the index t2_f2_key) is not defined.\n\nWouldn't be normal that the unique constraint to be inherited also in\nt2?\n\nConstantin Teodorescu\nFLEX Consulting Braila, ROMANIA\n", "msg_date": "Sun, 23 Jan 2000 11:33:51 +0200", "msg_from": "Constantin Teodorescu <[email protected]>", "msg_from_op": true, "msg_subject": "Unique constraint for inherited tables?" }, { "msg_contents": "> I am defining a table t1 with a NOT NULL field f1 and UNIQUE field f2.\n> (it automatically defines t1_f2_key unique index)\n> \n> I am defining now a new table t2 that inherits t1 table and add some\n> columns.\n> \n> The NOT NULL constraint is preserved for f1 field, the UNIQUE for f2 not\n> (the index t2_f2_key) is not defined.\n> \n> Wouldn't be normal that the unique constraint to be inherited also in\n> t2?\n\nThis is on the TODO list:\n\n* Unique index on base column not honored on inserts from inherited\ntable\n INSERT INTO inherit_table (unique_index_col) VALUES (dup) should fail\n [inherit] \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": "Sun, 23 Jan 2000 05:04:37 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Unique constraint for inherited tables?" } ]
[ { "msg_contents": "Can someone explain this to me? When I use the alias p, should a\nreference to pg_language.oid create a new instance of pg_language in the\nrange table. Seems it does not. Does the standard say the first query\nis legal?\n\n---------------------------------------------------------------------------\n\n\ntest=> select * from pg_language p where p.oid = pg_language.oid;\n lanname | lanispl | lanpltrusted | lanplcallfoid | lancompiler \n----------+---------+--------------+---------------+-------------\n internal | f | f | 0 | n/a\n C | f | f | 0 | /bin/cc\n sql | f | f | 0 | postgres\n(3 rows)\n\ntest=> select * from pg_language p, pg_language q where p.oid = q.oid;\n lanname | lanispl | lanpltrusted | lanplcallfoid | lancompiler | lanname | lanispl | lanpltrusted | lanplcallfoid | lancompiler \n----------+---------+--------------+---------------+-------------+----------+---------+--------------+---------------+-------------\n internal | f | f | 0 | n/a | internal | f | f | 0 | n/a\n C | f | f | 0 | /bin/cc | C | f | f | 0 | /bin/cc\n sql | f | f | 0 | postgres | sql | f | f | 0 | postgres\n(3 rows)\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": "Sun, 23 Jan 2000 04:40:17 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "column aliases" }, { "msg_contents": "Bruce Momjian <[email protected]> writes:\n> test=> select * from pg_language p where p.oid = pg_language.oid;\n> lanname | lanispl | lanpltrusted | lanplcallfoid | lancompiler \n> ----------+---------+--------------+---------------+-------------\n> internal | f | f | 0 | n/a\n> C | f | f | 0 | /bin/cc\n> sql | f | f | 0 | postgres\n> (3 rows)\n\nOh, this is interesting! According to Postgres' view of the world,\nyou have written a join between \"pg_language p\" and\n\"pg_language pg_language\", where the latter is an implicitly added\nFROM clause. If you do an EXPLAIN you can see that a join is indeed\nbeing done:\n\nregression=# explain\nregression-# select * from pg_language p where p.oid = pg_language.oid;\nNOTICE: QUERY PLAN:\n\nHash Join (cost=2.60 rows=4 width=58)\n -> Seq Scan on pg_language p (cost=1.13 rows=4 width=54)\n -> Hash (cost=1.13 rows=4 width=4)\n -> Seq Scan on pg_language (cost=1.13 rows=4 width=4)\n\nEXPLAIN\n\nand a more graphic demonstration is had by using a WHERE clause that\ncan produce multiple matches:\n\nregression=# select * from pg_language p where p.oid < pg_language.oid;\n lanname | lanispl | lanpltrusted | lanplcallfoid | lancompiler\n----------+---------+--------------+---------------+-------------\n internal | f | f | 0 | n/a\n internal | f | f | 0 | n/a\n C | f | f | 0 | /bin/cc\n internal | f | f | 0 | n/a\n C | f | f | 0 | /bin/cc\n sql | f | f | 0 | postgres\n(6 rows)\n\nWhat it looks like to me is that we have a bug in the expansion of '*'.\nIt should be generating columns for both the explicit and the implicit\nFROM clause, but it's evidently deciding that it should only produce\noutput columns for the first one.\n\nThis may go a long way towards explaining why people have been so\nreadily confused by the implicit-FROM-clause business! If they saw\ntwo sets of columns coming out, it'd be more obvious that they were\ngetting a join.\n\n> Does the standard say the first query is legal?\n\nI believe it is not strict SQL92 --- we've been around on that question\nbefore.\n\n\t\t\tregards, tom lane\n", "msg_date": "Sun, 23 Jan 2000 11:12:09 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] column aliases " }, { "msg_contents": "At 11:12 AM 1/23/00 -0500, Tom Lane wrote:\n\n>What it looks like to me is that we have a bug in the expansion of '*'.\n>It should be generating columns for both the explicit and the implicit\n>FROM clause, but it's evidently deciding that it should only produce\n>output columns for the first one.\n\nYes, since it is joining the two tables it should be returning all\ncolumns of the join.\n\n>This may go a long way towards explaining why people have been so\n>readily confused by the implicit-FROM-clause business! \n\nIt *is* confusing, that's for sure!\n\n> If they saw\n>two sets of columns coming out, it'd be more obvious that they were\n>getting a join.\n>\n>> Does the standard say the first query is legal?\n>\n>I believe it is not strict SQL92 --- we've been around on that question\n>before.\n\nIs this feature something many folks depend upon? It appears that at\nleast some of the folks who hang out on this list aren't entirely\nclear on this implicit \"from\" clause thing - if that's true, how\nmany users who are out of the loop understand it?\n\nIt isn't that burdensome to explictly list a table again in the from\nlist. The query's certainly more readable and portable for folks who\nare (say) trying to port PostgreSQL-based stuff to (say) Oracle.\n\nOn the other hand, if a lot of folks depend on this (somewhat dubious,\nIMHO) feature then I suppose it should be preserved - with \"*\" expansion\nfixed, presumably!\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Sun, 23 Jan 2000 09:45:07 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] column aliases " }, { "msg_contents": ">> What it looks like to me is that we have a bug in the expansion of '*'.\n>> It should be generating columns for both the explicit and the implicit\n>> FROM clause, but it's evidently deciding that it should only produce\n>> output columns for the first one.\n\nI thought that the behavior had something to do with the fact that\nthe underlying table was the same for both the explicit and the implicit\nrangetable entry, but not so. In fact, ExpandAllTables() deliberately\nrefrains from expanding implicit entries, and always has AFAICT:\n\n /*\n * we only expand those listed in the from clause. (This will\n * also prevent us from using the wrong table in inserts: eg.\n * tenk2 in \"insert into tenk2 select * from tenk1;\")\n */\n if (!rte->inFromCl)\n continue;\n\nI think the comment in parentheses is no longer applicable, but there\nare other sources of implicit rangetable entries besides this particular\nfeature --- rules and set functions both seem to add them. So I'm not\nsure what we might break by changing it.\n\nI'm inclined to leave this behavior alone, and go back to the idea of\nemitting warning notices when an implicit FROM clause is added.\n\n\t\t\tregards, tom lane\n", "msg_date": "Sun, 23 Jan 2000 13:46:29 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] column aliases " }, { "msg_contents": "Did this get resolved somehow?\n\n> Bruce Momjian <[email protected]> writes:\n> > test=> select * from pg_language p where p.oid = pg_language.oid;\n> > lanname | lanispl | lanpltrusted | lanplcallfoid | lancompiler \n> > ----------+---------+--------------+---------------+-------------\n> > internal | f | f | 0 | n/a\n> > C | f | f | 0 | /bin/cc\n> > sql | f | f | 0 | postgres\n> > (3 rows)\n> \n> Oh, this is interesting! According to Postgres' view of the world,\n> you have written a join between \"pg_language p\" and\n> \"pg_language pg_language\", where the latter is an implicitly added\n> FROM clause. If you do an EXPLAIN you can see that a join is indeed\n> being done:\n> \n> regression=# explain\n> regression-# select * from pg_language p where p.oid = pg_language.oid;\n> NOTICE: QUERY PLAN:\n> \n> Hash Join (cost=2.60 rows=4 width=58)\n> -> Seq Scan on pg_language p (cost=1.13 rows=4 width=54)\n> -> Hash (cost=1.13 rows=4 width=4)\n> -> Seq Scan on pg_language (cost=1.13 rows=4 width=4)\n> \n> EXPLAIN\n> \n> and a more graphic demonstration is had by using a WHERE clause that\n> can produce multiple matches:\n> \n> regression=# select * from pg_language p where p.oid < pg_language.oid;\n> lanname | lanispl | lanpltrusted | lanplcallfoid | lancompiler\n> ----------+---------+--------------+---------------+-------------\n> internal | f | f | 0 | n/a\n> internal | f | f | 0 | n/a\n> C | f | f | 0 | /bin/cc\n> internal | f | f | 0 | n/a\n> C | f | f | 0 | /bin/cc\n> sql | f | f | 0 | postgres\n> (6 rows)\n> \n> What it looks like to me is that we have a bug in the expansion of '*'.\n> It should be generating columns for both the explicit and the implicit\n> FROM clause, but it's evidently deciding that it should only produce\n> output columns for the first one.\n> \n> This may go a long way towards explaining why people have been so\n> readily confused by the implicit-FROM-clause business! If they saw\n> two sets of columns coming out, it'd be more obvious that they were\n> getting a join.\n> \n> > Does the standard say the first query is legal?\n> \n> I believe it is not strict SQL92 --- we've been around on that question\n> before.\n> \n> \t\t\tregards, tom lane\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", "msg_date": "Wed, 7 Jun 2000 22:55:43 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: column aliases" }, { "msg_contents": "OK, seems it is resolved. We now throw a warning for the query.\n\n\n> >> What it looks like to me is that we have a bug in the expansion of '*'.\n> >> It should be generating columns for both the explicit and the implicit\n> >> FROM clause, but it's evidently deciding that it should only produce\n> >> output columns for the first one.\n> \n> I thought that the behavior had something to do with the fact that\n> the underlying table was the same for both the explicit and the implicit\n> rangetable entry, but not so. In fact, ExpandAllTables() deliberately\n> refrains from expanding implicit entries, and always has AFAICT:\n> \n> /*\n> * we only expand those listed in the from clause. (This will\n> * also prevent us from using the wrong table in inserts: eg.\n> * tenk2 in \"insert into tenk2 select * from tenk1;\")\n> */\n> if (!rte->inFromCl)\n> continue;\n> \n> I think the comment in parentheses is no longer applicable, but there\n> are other sources of implicit rangetable entries besides this particular\n> feature --- rules and set functions both seem to add them. So I'm not\n> sure what we might break by changing it.\n> \n> I'm inclined to leave this behavior alone, and go back to the idea of\n> emitting warning notices when an implicit FROM clause is added.\n> \n> \t\t\tregards, tom lane\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", "msg_date": "Wed, 7 Jun 2000 22:58:53 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: column aliases" }, { "msg_contents": "Bruce Momjian <[email protected]> writes:\n> Did this get resolved somehow?\n>> \n>> ... a more graphic demonstration is had by using a WHERE clause that\n>> can produce multiple matches:\n>> \n>> regression=# select * from pg_language p where p.oid < pg_language.oid;\n>> lanname | lanispl | lanpltrusted | lanplcallfoid | lancompiler\n>> ----------+---------+--------------+---------------+-------------\n>> internal | f | f | 0 | n/a\n>> internal | f | f | 0 | n/a\n>> C | f | f | 0 | /bin/cc\n>> internal | f | f | 0 | n/a\n>> C | f | f | 0 | /bin/cc\n>> sql | f | f | 0 | postgres\n>> (6 rows)\n>> \n>> What it looks like to me is that we have a bug in the expansion of '*'.\n>> It should be generating columns for both the explicit and the implicit\n>> FROM clause, but it's evidently deciding that it should only produce\n>> output columns for the first one.\n\nLooks like the behavior is still the same (except now it says\nNOTICE: Adding missing FROM-clause entry for table pg_language\nas well). I'm inclined to say we should change it, and am willing\nto do the work if no one objects...\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 07 Jun 2000 23:43:25 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: column aliases " }, { "msg_contents": "> >> What it looks like to me is that we have a bug in the expansion of '*'.\n> >> It should be generating columns for both the explicit and the implicit\n> >> FROM clause, but it's evidently deciding that it should only produce\n> >> output columns for the first one.\n> \n> Looks like the behavior is still the same (except now it says\n> NOTICE: Adding missing FROM-clause entry for table pg_language\n> as well). I'm inclined to say we should change it, and am willing\n> to do the work if no one objects...\n\nWhich part, the expansion of * or the warning code?\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": "Wed, 7 Jun 2000 23:51:52 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: column aliases" }, { "msg_contents": "Bruce Momjian <[email protected]> writes:\n>> Looks like the behavior is still the same (except now it says\n>> NOTICE: Adding missing FROM-clause entry for table pg_language\n>> as well). I'm inclined to say we should change it, and am willing\n>> to do the work if no one objects...\n\n> Which part, the expansion of * or the warning code?\n\nChanging expansion of * to include the implicit FROM clause entries\nwas what I was thinking of. However, given that we have the NOTICE,\nmaybe it's not necessary to do it. Let's leave the code as it is\nfor now and see what people think of it in actual use.\n\n\t\t\tregards, tom lane\n", "msg_date": "Thu, 08 Jun 2000 09:54:19 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: column aliases " } ]
[ { "msg_contents": "I have modified STATRELID cache lookup for Tom Lane and the optimizer. \ninitdb everyone. A system index has changed.\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": "Sun, 23 Jan 2000 21:10:04 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "initdb everyone" } ]
[ { "msg_contents": "\nAlways something that confuses me ... I have a query that looks like:\n\nSELECT count(counter_id) \\\n FROM referrer_link \\\n WHERE counter_id = ? \\\n AND referrer_id = ? \\\n AND stat_date = ?;\n\nThere is an index on all three conditions in the WHERE clause:\n\nYet EXPLAIN shows:\n\nAggregate (cost=2.05 rows=1 width=4)\n -> Index Scan using referrer_link_counter_id on referrer_link (cost=2.05 rows=1 width=4)\n\nEXPLAIN\n\nTable looks like:\n\nwebcounter=> \\d referrer_link\nTable = referrer_link\n+----------------------------------+----------------------------------+-------+\n| Field | Type | Length|\n+----------------------------------+----------------------------------+-------+\n| counter_id | int4 | 4 |\n| stat_date | datetime | 8 |\n| referrer_id | int4 | 4 |\n| referrer_hits | int8 | 8 |\n+----------------------------------+----------------------------------+-------+\nIndices: referrer_link_counter_id\n referrer_link_referrer_id\n referrer_link_stat_date\n\nWhy does EXPLAIN only show the use of one of the indices, why counter_id\nand why not all three?\n\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Sun, 23 Jan 2000 23:06:13 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "Use of Indicies ..." }, { "msg_contents": "The Hermit Hacker <[email protected]> writes:\n> There is an index on all three conditions in the WHERE clause:\n> Yet EXPLAIN shows:\n> Aggregate (cost=2.05 rows=1 width=4)\n-> Index Scan using referrer_link_counter_id on referrer_link (cost=2.05 rows=1 width=4)\n\n> Why does EXPLAIN only show the use of one of the indices, why counter_id\n> and why not all three?\n\nIndexscans only know how to use one index at a time.\n\nThe optimizer picked the counter_id index out of the three available\nchoices because it thought that would be the cheapest (most selective)\nalternative --- or, if the computed selectivities were all the same,\njust because it happened to try that one first.\n\nDo you have reason to think that one of the other indexes would have\nbeen cheaper?\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 24 Jan 2000 00:58:38 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Use of Indicies ... " }, { "msg_contents": "Tom Lane wrote:\n> \n> The Hermit Hacker <[email protected]> writes:\n> > There is an index on all three conditions in the WHERE clause:\n> > Yet EXPLAIN shows:\n> > Aggregate (cost=2.05 rows=1 width=4)\n> -> Index Scan using referrer_link_counter_id on referrer_link (cost=2.05 rows=1 width=4)\n> \n> > Why does EXPLAIN only show the use of one of the indices, why counter_id\n> > and why not all three?\n> \n> Indexscans only know how to use one index at a time.\n\nwould it make sense to implement a new (?) \"join\" strategy for evaluating\nAND's \nthat gets just tids from affected indices and then performs a multiset AND on\nthem\nsorts the result and then uses the it to access the actual rows.\n\n> \n> Do you have reason to think that one of the other indexes would have\n> been cheaper?\n> \n\nIt could be faster if one could actually do the above.\n\nIt's just another of these unintuitive things I mentioned in the \"Happy\ndropping\" \nthread - common sense guess of optimiser behaviour is not what it actually\ndone. \n\n--------------\nHannu\n", "msg_date": "Mon, 24 Jan 2000 12:03:42 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Use of Indicies ..." }, { "msg_contents": "On Mon, 24 Jan 2000, Tom Lane wrote:\n\n> The Hermit Hacker <[email protected]> writes:\n> > There is an index on all three conditions in the WHERE clause:\n> > Yet EXPLAIN shows:\n> > Aggregate (cost=2.05 rows=1 width=4)\n> -> Index Scan using referrer_link_counter_id on referrer_link (cost=2.05 rows=1 width=4)\n> \n> > Why does EXPLAIN only show the use of one of the indices, why counter_id\n> > and why not all three?\n> \n> Indexscans only know how to use one index at a time.\n> \n> The optimizer picked the counter_id index out of the three available\n> choices because it thought that would be the cheapest (most selective)\n> alternative --- or, if the computed selectivities were all the same,\n> just because it happened to try that one first.\n> \n> Do you have reason to think that one of the other indexes would have\n> been cheaper?\n\nNope, just looked weird that not all three were used, that's all\n... someone else responded to me on this with a similar response\n... basically, that it didn't make sense to use all three indices since it\nthere would be no 'index' on the result of the first condition ...\n\nIe. if 'counter_id = ?' returned 4 tuples out of 40000, why look at those\n40000 again for 'referrer_url = ?', when you already know that only 4\nmatch the first condition ...\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Mon, 24 Jan 2000 09:04:37 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Use of Indicies ... " } ]
[ { "msg_contents": "\n> As best I can measure on my hardware, the cost of a nonsequential\n> disk read should be estimated at 4 to 5 times the cost of a sequential\n> one --- \n\nSame experience here with RS6000 AIX hardware. \n450k/s random versus 4Mb/s sequential (16kb block readahead)\nCompared with 256kb readahead the factor is even worse. \nLike 10Mb/s sequential.\n\nAndreas\n", "msg_date": "Mon, 24 Jan 2000 10:47:23 +0100", "msg_from": "Zeugswetter Andreas SB <[email protected]>", "msg_from_op": true, "msg_subject": "AW: [HACKERS] Some notes on optimizer cost estimates" } ]
[ { "msg_contents": "\n> 2. I am proposing the names stddev(x) and variance(x) for \n> population and \n> samplestddev(x) and\n> samplevariance(x) for sample statistics. Any comments?\n\nOther db's have:\n\nstdev() for standard deviation sample (N-1)\nvariance() for variance computed from a sample (N-1)\n\n> 3. I'm planning to implement this for types float4, float8 \n> and numeric. Any \n> other types also? int[2,4,8] don't seem logical, as these \n> would introduce \n> serious rounding errors.\n\nInteger would be good also. Do the arithmetic in numeric \nto avoid loss of precision.\n\nAndreas\n", "msg_date": "Mon, 24 Jan 2000 11:53:45 +0100", "msg_from": "Zeugswetter Andreas SB <[email protected]>", "msg_from_op": true, "msg_subject": "AW: [HACKERS] Implementing STDDEV and VARIANCE" } ]
[ { "msg_contents": "\n> >What it looks like to me is that we have a bug in the \n> expansion of '*'.\n> >It should be generating columns for both the explicit and \n> the implicit\n> >FROM clause, but it's evidently deciding that it should only produce\n> >output columns for the first one.\n> \n> Yes, since it is joining the two tables it should be returning all\n> columns of the join.\n> \n> >This may go a long way towards explaining why people have been so\n> >readily confused by the implicit-FROM-clause business! \n> \n> It *is* confusing, that's for sure!\n\nIMHO, if there exists a from clause, we could insist,\nthat all tables are listed (no implicitly added table),\nsince it is really too error prone.\n\nWhat I would not like to see removed is the ability to \navoid the from clause alltogether. Like in:\n\nselect xor.eval;\n\nAndreas\n", "msg_date": "Mon, 24 Jan 2000 12:00:08 +0100", "msg_from": "Zeugswetter Andreas SB <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] column aliases " }, { "msg_contents": "> > >This may go a long way towards explaining why people have been so\n> > >readily confused by the implicit-FROM-clause business! \n> > \n> > It *is* confusing, that's for sure!\n> \n> IMHO, if there exists a from clause, we could insist,\n> that all tables are listed (no implicitly added table),\n> since it is really too error prone.\n> \n> What I would not like to see removed is the ability to \n> avoid the from clause alltogether. Like in:\n> \n> select xor.eval;\n\nThis is an interesting suggestion. I wonder if we can do this. We can\navoid producing NOTICE messages in this case.\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": "Mon, 24 Jan 2000 11:29:20 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] column aliases" }, { "msg_contents": "Bruce Momjian <[email protected]> writes:\n>> What I would not like to see removed is the ability to \n>> avoid the from clause alltogether. Like in:\n>> \n>> select xor.eval;\n\n> This is an interesting suggestion. I wonder if we can do this. We can\n> avoid producing NOTICE messages in this case.\n\nSure --- only emit the notice if there is at least one RTE that *is*\nmarked inFromCl.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 24 Jan 2000 11:49:20 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] column aliases " }, { "msg_contents": "> Bruce Momjian <[email protected]> writes:\n> >> What I would not like to see removed is the ability to \n> >> avoid the from clause alltogether. Like in:\n> >> \n> >> select xor.eval;\n> \n> > This is an interesting suggestion. I wonder if we can do this. We can\n> > avoid producing NOTICE messages in this case.\n> \n> Sure --- only emit the notice if there is at least one RTE that *is*\n> marked inFromCl.\n\nSeems like this would avoid most annoying messages.\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": "Mon, 24 Jan 2000 12:03:06 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] column aliases" }, { "msg_contents": "[ Charset ISO-8859-1 unsupported, converting... ]\n> \n> > >What it looks like to me is that we have a bug in the \n> > expansion of '*'.\n> > >It should be generating columns for both the explicit and \n> > the implicit\n> > >FROM clause, but it's evidently deciding that it should only produce\n> > >output columns for the first one.\n> > \n> > Yes, since it is joining the two tables it should be returning all\n> > columns of the join.\n> > \n> > >This may go a long way towards explaining why people have been so\n> > >readily confused by the implicit-FROM-clause business! \n> > \n> > It *is* confusing, that's for sure!\n> \n> IMHO, if there exists a from clause, we could insist,\n> that all tables are listed (no implicitly added table),\n> since it is really too error prone.\n\nSeems this is exactly what I implemented.\n\n\n> \n> What I would not like to see removed is the ability to \n> avoid the from clause alltogether. Like in:\n> \n> select xor.eval;\n> \n> Andreas\n> \n> ************\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", "msg_date": "Wed, 7 Jun 2000 23:05:46 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: column aliases" } ]
[ { "msg_contents": "Do this:\n\n testdb=> create table foo (word varchar(30));\n CREATE\n testdb=> insert into foo values ('\\217\\210');\n INSERT 2337289 1\n testdb=> copy \"foo\" to '/usr/local/pgsql/foo.out';\n COPY\n testdb=> \\q\n % od -c foo.out\n 0000000 217 210 \\0 \\n \n 0000004\n\nOne run produced:\n 0000000 217 210 \\0 \\b \\n \n\nIn all cases, though, it emits a null. This, of course, causes \"copy from\" to\nfail when it tries to parse a null-containing field in a multi-field record.\n\nAs for what the sequence \"\\217\\210\" represents, that's not really relevant\n(it's not even a valid Chinese character, so far as I can tell). Someone \njust entered this into our web interface and broke our database.\n\n\t-Michael Robinson\n\nP.S. As an aside, if \"copy from\" recognizes the \\xxx octal convention, why\ndoesn't \"copy to\" use it to represent everything outside of \\040..\\176?\n", "msg_date": "Mon, 24 Jan 2000 19:12:46 +0800 (+0800)", "msg_from": "Michael Robinson <[email protected]>", "msg_from_op": true, "msg_subject": "fatal copy in/out error (6.5.3)" }, { "msg_contents": "Michael Robinson <[email protected]> writes:\n> testdb=> create table foo (word varchar(30));\n> CREATE\n> testdb=> insert into foo values ('\\217\\210');\n> INSERT 2337289 1\n> testdb=> copy \"foo\" to '/usr/local/pgsql/foo.out';\n> COPY\n> testdb=> \\q\n> % od -c foo.out\n> 0000000 217 210 \\0 \\n \n> 0000004\n\nHmm. I get\n\t0000000 217 210 \\n\n\t0000003\nwith either current sources or 6.5.3. I don't have MULTIBYTE nor\nUSE_LOCALE turned on, though. What is your configuration exactly?\n\nThis looks to me like something is deciding that \\217 must be the\nstart of a 3-byte multibyte character... in which case, it should have\nappeared that way in your database, I think.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 24 Jan 2000 11:06:55 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] fatal copy in/out error (6.5.3) " }, { "msg_contents": "Tom Lane <[email protected]> writes:\n>Hmm. I get\n>\t0000000 217 210 \\n\n>\t0000003\n>with either current sources or 6.5.3. I don't have MULTIBYTE nor\n>USE_LOCALE turned on, though. What is your configuration exactly?\n\nMy config line:\n\t./configure --with-mb=EUC_CN\n\nI can forward my include/config.h if that would be helpful.\n\nThe OS is FreeBSD 3.4-RELEASE.\n\n>This looks to me like something is deciding that \\217 must be the\n>start of a 3-byte multibyte character... in which case, it should have\n>appeared that way in your database, I think.\n\nThat would be very weird, if true. \\217 is certainly not the beginning of\na UTF-8 three-byte sequence, and EUC doesn't have three-byte codes.\n\n\t-Michael Robinson\n\n", "msg_date": "Tue, 25 Jan 2000 01:12:28 +0800 (+0800)", "msg_from": "Michael Robinson <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] fatal copy in/out error (6.5.3)" }, { "msg_contents": ">> This looks to me like something is deciding that \\217 must be the\n>> start of a 3-byte multibyte character... in which case, it should have\n>> appeared that way in your database, I think.\n\n> That would be very weird, if true. \\217 is certainly not the beginning of\n> a UTF-8 three-byte sequence, and EUC doesn't have three-byte codes.\n\nHmm. And I don't suppose it's real likely that \\217 is a one-byte code\nand \\210 starts a two-byte code?\n\nI'm out of my depth here --- it seems this is almost certainly a\nMULTIBYTE issue, but I know very little about MULTIBYTE. I'm going\nto punt and hope some of our MULTIBYTE experts pick it up.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 24 Jan 2000 12:34:19 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] fatal copy in/out error (6.5.3) " }, { "msg_contents": "> My config line:\n> \t./configure --with-mb=EUC_CN\n> \n> I can forward my include/config.h if that would be helpful.\n> \n> The OS is FreeBSD 3.4-RELEASE.\n> \n> >This looks to me like something is deciding that \\217 must be the\n> >start of a 3-byte multibyte character... in which case, it should have\n> >appeared that way in your database, I think.\n\nI suspect that too.\n\n> That would be very weird, if true. \\217 is certainly not the beginning of\n> a UTF-8 three-byte sequence, and EUC doesn't have three-byte codes.\n\nNo. some EUC's (EUC_TW and EUC_JP) has three-byte or even four-byte\ncodes. But you said your database has been configured as EUC_CN. As\nfar as I know, it only uses 1 or 2 byte-code. Another thing I am\nconfused is that ' \\217\\210' is not a valid EUC_CN data at all. \\217\n(0x8f) specifies code set 3 which does not exist in EUC_CN. In this\ncase, it is assumed that the multi-byte word to be consisted of 3-byte\ncode in the current implementation of PostgreSQL.\n\nIn short, the problem you have is caused by:\n\n1) wrong data submitted into the table\n2) PostgreSQL assumes the data is consisted of 3 bytes data\n\nI would recommend you delete the data since it's not correct anyway.\nIn the mean time I'm going to fix 2) so that it assumes data be\nconsisted of 2 bytes even if wrong data sequence is submitted\n(needless to say, except ascii).\nDo you want the backpatch for 6.5.3?\n--\nTatsuo Ishii\n", "msg_date": "Tue, 25 Jan 2000 11:06:35 +0900", "msg_from": "Tatsuo Ishii <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] fatal copy in/out error (6.5.3)" }, { "msg_contents": "Tatsuo Ishii <[email protected]> writes:\n>No. some EUC's (EUC_TW and EUC_JP) has three-byte or even four-byte\n>codes. But you said your database has been configured as EUC_CN. As\n>far as I know, it only uses 1 or 2 byte-code. Another thing I am\n>confused is that ' \\217\\210' is not a valid EUC_CN data at all. \\217\n>(0x8f) specifies code set 3 which does not exist in EUC_CN. In this\n>case, it is assumed that the multi-byte word to be consisted of 3-byte\n>code in the current implementation of PostgreSQL.\n\nIt could be that one of our users had their input method set to produce\nEUC_TW or Big5.\n\n>In short, the problem you have is caused by:\n>1) wrong data submitted into the table\n\nKind of hard to control that when data is submitted by random users on\nthe Internet.\n\n>I would recommend you delete the data since it's not correct anyway.\n>In the mean time I'm going to fix 2) so that it assumes data be\n>consisted of 2 bytes even if wrong data sequence is submitted\n>(needless to say, except ascii).\n>Do you want the backpatch for 6.5.3?\n\nVery much so. Thank you.\n\n\t-Michael\n\n", "msg_date": "Tue, 25 Jan 2000 11:04:12 +0800 (+0800)", "msg_from": "Michael Robinson <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] fatal copy in/out error (6.5.3)" }, { "msg_contents": "> It could be that one of our users had their input method set to produce\n> EUC_TW or Big5.\n>\n> >In short, the problem you have is caused by:\n> >1) wrong data submitted into the table\n> \n> Kind of hard to control that when data is submitted by random users on\n> the Internet.\n\nYes, it's not a PostgreSQL's business but is a really big problem in\nthe real world. Maybe some HTML gurus might have good suggestions on\nthese issues (something like using a language tag?)\n\n> >I would recommend you delete the data since it's not correct anyway.\n> >In the mean time I'm going to fix 2) so that it assumes data be\n> >consisted of 2 bytes even if wrong data sequence is submitted\n> >(needless to say, except ascii).\n> >Do you want the backpatch for 6.5.3?\n> \n> Very much so. Thank you.\n\nHere it is. With this patch, copy out should be happy even with the\nwrong data. I'm not sure if it could be displayed correctly, though.\n--\nTatsuo Ishii\n------------------------------- cut here ------------------------------------\n*** postgresql-6.5.3/src/backend/utils/mb/wchar.c.orig\tTue Jan 25 13:37:21 2000\n--- postgresql-6.5.3/src/backend/utils/mb/wchar.c\tTue Jan 25 13:37:33 2000\n***************\n*** 166,176 ****\n {\n \tint\t\t\tlen;\n \n! \tif (*s == SS2)\n! \t\tlen = 3;\n! \telse if (*s == SS3)\n! \t\tlen = 3;\n! \telse if (*s & 0x80)\n \t\tlen = 2;\n \telse\n \t\tlen = 1;\n--- 166,172 ----\n {\n \tint\t\t\tlen;\n \n! \tif (*s & 0x80)\n \t\tlen = 2;\n \telse\n \t\tlen = 1;\n", "msg_date": "Tue, 25 Jan 2000 14:00:04 +0900", "msg_from": "Tatsuo Ishii <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] fatal copy in/out error (6.5.3)" }, { "msg_contents": "Tatsuo Ishii <[email protected]> writes:\n>Yes, it's not a PostgreSQL's business but is a really big problem in\n>the real world. Maybe some HTML gurus might have good suggestions on\n>these issues (something like using a language tag?)\n\nThe only solution is defensive programming. Even if there were a standard\nthat everyone followed, if malicious people could break things by not\nfollowing the standard, then you can be certain that somebody would do so.\n\n>Here it is. With this patch, copy out should be happy even with the\n>wrong data. I'm not sure if it could be displayed correctly, though.\n\nThank you very much. However, I think even this is too optimistic:\n\n>! \tif (*s & 0x80)\n\nShouldn't it be something like:\n\n if ((*s & 0x80) && (*(s+1) & 0x80))\n\nEven though \"\\242\\242\\242\\0\" is an invalid EUC sequence, it still shouldn't be\nallowed to break the software.\n\n\t-Michael Robinson\n\n", "msg_date": "Tue, 25 Jan 2000 14:05:36 +0800 (+0800)", "msg_from": "Michael Robinson <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] fatal copy in/out error (6.5.3)" }, { "msg_contents": "> Tatsuo Ishii <[email protected]> writes:\n> >Yes, it's not a PostgreSQL's business but is a really big problem in\n> >the real world. Maybe some HTML gurus might have good suggestions on\n> >these issues (something like using a language tag?)\n> \n> The only solution is defensive programming. Even if there were a standard\n> that everyone followed, if malicious people could break things by not\n> following the standard, then you can be certain that somebody would do so.\n\nDefensive programming saves the system but does not user. Once\ncorrupted data is stored in the system, it's totally useless for the\nuser anyway. What about validating data *before* inserting it into a\ntable? You expect EUC_CN data, and it should be possible to determine\nif the data is valid or not by doing some simple checking in most\ncases. Maybe I could provide a new libpq function something like:\n\n\tbool pg_validate_euc_cn(const unsigned char *euc_str);\n\nIf it returns false, then euc_str is not a valid EUC_CN.\nSo you show a message:\n\"Sorry, but we only accepts EUC_CN data. Please try another input\nmethod...\" or jump to other pages for EUC_TW or Big5 or whatever...\n\nOf course the function does not guarantee the string is 100% correct\nEUC_CN (on the other hand it can tell that the string is not\nvalid) because:\n\n1) there are chances that, for example, a EUC_CN string and a EUC_JP\nstring has same bit patterns accidently.\n\n2) I do not have enough information to implement it perfectly. At this\npoint I could only perform minimal checking. However, it can be good\na start point for someone who has more knowledge (on the other hand, I\ncould implement pg_validate_euc_jp in much better way, since I have\nprecise info for EUC_JP).\n\n> >Here it is. With this patch, copy out should be happy even with the\n> >wrong data. I'm not sure if it could be displayed correctly, though.\n> \n> Thank you very much. However, I think even this is too optimistic:\n> \n> >! \tif (*s & 0x80)\n> \n> Shouldn't it be something like:\n> \n> if ((*s & 0x80) && (*(s+1) & 0x80))\n> \n> Even though \"\\242\\242\\242\\0\" is an invalid EUC sequence, it still shouldn't be\n> allowed to break the software.\n\nThanks for the suggestion. More robust code is always good.\n--\nTatsuo Ishii\n\n", "msg_date": "Wed, 26 Jan 2000 10:23:51 +0900", "msg_from": "Tatsuo Ishii <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] fatal copy in/out error (6.5.3)" } ]
[ { "msg_contents": "While populating a table using PQputline(), I have encountered a\nPQputline() error (PQputline() returns none 0). It seems ok until it\nputs 6664 records. I've never seen this in 6.5.*, and am wondering if\nthis is related to the recent changes made to libpq. Have I found a\nnew problem or it is just a known one with the current source tree?\n\nFYI, to reproduce the problem, do followings:\n\ncd pgsql/contrib/pgbench\nmake\n(create fresh DB)\n./pgbench -i the_DB_just_created\n--\nTatsuo Ishii\n", "msg_date": "Mon, 24 Jan 2000 22:29:38 +0900", "msg_from": "Tatsuo Ishii <[email protected]>", "msg_from_op": true, "msg_subject": "PQputline failed" } ]
[ { "msg_contents": "Let me thank all of those that spoke up in my support and let me tell of\nthose that were unhappy that I _will_ be here tomorrow as well. To\nsummarize the points and add a few of my own:\n\n1) This is a TODO item.\n\n2) I have reviewed several mutterings about how to implement this in the\narchives and followed the consensus that you need to copy the table over\nsomehow. It's not like I made this up.\n\n2a) Does anyone have a better idea? (Btw., I'm not too excited about\nby-passing the storage manager and writing around in the table file on\ndisk. If vacuum does that, that doesn't mean it's the right thing to do.)\n\n3) This isn't release software.\n\n4) This isn't done. (But it will be.)\n\n4a) If it won't get done then I add one line and it's disabled. I'm not\nthat dumb.\n\n5) This isn't documented, so if you don't call the command then your life\ngoes on.\n\n6) Users have been begging for this but nobody else has moved a finger.\n\n7) If you are concerned about \"perfect\" implementation, then I invite you\nto take a look at the create/drop user and create/drop database code from\n6.5 and thank whomever you do thank that your database isn't fried yet.\n\n8) Now that I know how to keep the oids around, they will be kept around.\n(Thanks to those that interpreted my message as a starting point for a\ndiscussion and not me laying down the law.)\n\n9) What really gets me though is what your problem is. This is a nearly\nSQL-compliant implementation of a very important feature. It doesn't\naffect the rest of the code. It doesn't break the regression tests. It\nchecks for permissions, validity of parameters, etc. and even if it goes\nwrong, it doesn't fry your database or any part of it.\n\n\nUm, anyway, I'm open for implementation specific suggestions. I don't like\nthe coying either but it works.\n\n-- \nPeter Eisentraut Sernanders vaeg 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n\n\n", "msg_date": "Mon, 24 Jan 2000 15:51:41 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": true, "msg_subject": "Well, then you keep your darn columns" }, { "msg_contents": "As a user let me just say that I have been waiting for all the\n'ALTER TABLE..' commands for a long time (changing constraints would be great\ntoo!) and it has been mentioned many times that one should not use oids in\napplication code. The way I do it at the moment is to copy the table, so I\nthink all users are used to losing their oids when remocing a column from a\ntable. So while it is certainly better to keep the oids, Peter's code is a\nbig improvement on the current situation.\n\nWhile I do understand and subscribe to the concerns about database\nreliability, I would very much not like to keep my darn columns and thank\nPeter for helping me get rid of them.\n\nAdriaan\n\n", "msg_date": "Mon, 24 Jan 2000 15:47:44 +0000", "msg_from": "Adriaan Joubert <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns" }, { "msg_contents": "On Mon, 24 Jan 2000, Adriaan Joubert wrote:\n\n> As a user let me just say that I have been waiting for all the\n> 'ALTER TABLE..' commands for a long time (changing constraints would be great\n> too!) and it has been mentioned many times that one should not use oids in\n> application code. The way I do it at the moment is to copy the table, so I\n> think all users are used to losing their oids when remocing a column from a\n> table. So while it is certainly better to keep the oids, Peter's code is a\n> big improvement on the current situation.\n\nExcept, as Chris Bitmead brought up, OIDs appear to be a key requirement\nin ODBMSs ... so, if we want to go what I *think* is 'next generation',\nOIDs have to be kept ...\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Mon, 24 Jan 2000 12:34:22 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns" }, { "msg_contents": "> Let me thank all of those that spoke up in my support and let me tell of\n> those that were unhappy that I _will_ be here tomorrow as well. To\n> summarize the points and add a few of my own:\n> \n> 1) This is a TODO item.\n> \n> 2) I have reviewed several mutterings about how to implement this in the\n> archives and followed the consensus that you need to copy the table over\n> somehow. It's not like I made this up.\n\nYes, as Peter pointed out, he did exactly what I suggested in my e-mail\nwhen he brought up the issue. I don't even remember sending the\ne-mail, so it must have been some time ago, 25 Nov 1999.\n\n> \n> 2a) Does anyone have a better idea? (Btw., I'm not too excited about\n> by-passing the storage manager and writing around in the table file on\n> disk. If vacuum does that, that doesn't mean it's the right thing to do.)\n\nI totally agree that bypassing the storage manager is the wrong way to\ngo with this. All the command/*.c stuff is make to be clean, not fast. \nIt is better to put something together that works rather than optimize\nthings like add user or create database.\n\nNow, I will admit the ALTER DROP is going take much longer than most\ncommand/*.c, so it may be worth it some day to try and do this, but I\ndon't see this as a priority at this point. We have many other items to\nwork on that are more important.\n\n\n> 6) Users have been begging for this but nobody else has moved a finger.\n\nTotally true.\n\n> \n> 7) If you are concerned about \"perfect\" implementation, then I invite you\n> to take a look at the create/drop user and create/drop database code from\n> 6.5 and thank whomever you do thank that your database isn't fried yet.\n\nYes, that stuff is a mess, and Peter has cleaned it up quite a bit. And\nI have already asked him about CLUSTER, which has serious problems.\n\n\n> 8) Now that I know how to keep the oids around, they will be kept around.\n> (Thanks to those that interpreted my message as a starting point for a\n> discussion and not me laying down the law.)\n\nYes, it seems passing in the oid as part of heap_insert will do a good\njob for us in a few other areas like when we want to modify the oid of a\ntuple. Withouth that, we if you delete a tuple, you can't add it back\nin with the same oid. That is pretty bad.\n\n> \n> 9) What really gets me though is what your problem is. This is a nearly\n> SQL-compliant implementation of a very important feature. It doesn't\n> affect the rest of the code. It doesn't break the regression tests. It\n> checks for permissions, validity of parameters, etc. and even if it goes\n> wrong, it doesn't fry your database or any part of it.\n\nYes, I am still totally confused. Let's hope it is just an aberation.\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": "Mon, 24 Jan 2000 11:48:41 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns" }, { "msg_contents": "> As a user let me just say that I have been waiting for all the\n> 'ALTER TABLE..' commands for a long time (changing constraints would be great\n> too!) and it has been mentioned many times that one should not use oids in\n> application code. The way I do it at the moment is to copy the table, so I\n> think all users are used to losing their oids when remocing a column from a\n> table. So while it is certainly better to keep the oids, Peter's code is a\n> big improvement on the current situation.\n> \n\nWhat happens if the dropped column is part of an index? Just curious.\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": "Mon, 24 Jan 2000 11:50:21 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns" }, { "msg_contents": "> -----Original Message-----\n> From: [email protected] \n> [mailto:[email protected]]On Behalf Of Peter Eisentraut\n> \n> Let me thank all of those that spoke up in my support and let me tell of\n> those that were unhappy that I _will_ be here tomorrow as well. To\n> summarize the points and add a few of my own:\n> \n> 1) This is a TODO item.\n> \n> 2) I have reviewed several mutterings about how to implement this in the\n> archives and followed the consensus that you need to copy the table over\n> somehow. It's not like I made this up.\n> \n> 2a) Does anyone have a better idea? (Btw., I'm not too excited about\n> by-passing the storage manager and writing around in the table file on\n> disk. If vacuum does that, that doesn't mean it's the right thing to do.)\n>\n\nI propose another implementation here. I don't think this is so\nimportant a feature. I'm only afraid of forced implementation\nespecially using copy() and rename() for such a feature. \n\nMy idea is as follows.\n\n1)add a visibile/invisible flag to pg_attribute\n2)DROP COLUMN marks the column as invisible\n3)user interface ignores the columns which are marked invisible\n4)heap_formtuple() etc treats the column as NULL internally\n\nRegards.\n\nHiroshi Inoue\[email protected]\n", "msg_date": "Tue, 25 Jan 2000 02:12:25 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] Well, then you keep your darn columns" }, { "msg_contents": "> My idea is as follows.\n> \n> 1)add a visibile/invisible flag to pg_attribute\n> 2)DROP COLUMN marks the column as invisible\n> 3)user interface ignores the columns which are marked invisible\n> 4)heap_formtuple() etc treats the column as NULL internally\n> \n\nYes, but how much code is that going to hit? Seems it would be a lot.\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": "Mon, 24 Jan 2000 12:33:34 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns" }, { "msg_contents": "\"Hiroshi Inoue\" <[email protected]> writes:\n> My idea is as follows.\n\n> 1)add a visibile/invisible flag to pg_attribute\n> 2)DROP COLUMN marks the column as invisible\n> 3)user interface ignores the columns which are marked invisible\n> 4)heap_formtuple() etc treats the column as NULL internally\n\nThat could be a really good idea. I don't think you'd even need to\ntouch heap_formtuple (and it'd be better not to mess with the guts\nof the system to implement this feature, for both speed and reliability\nreasons).\n\nLet's see: DROP COLUMN would have to mark the column invisible, remove\nany associated constraints (particularly NOT NULL) and indexes, and\nit'd be done. The parser would then have to ignore the column when\ndoing column name lookups or expansion of '*', and it would have to\ninsert a NULL value for the column when transforming INSERT or UPDATE.\nAnd that'd be just about it. I like it.\n\nThe only drawback of this scheme is that the space occupied by the\ndeleted column wouldn't go away immediately (in any given tuple,\nit'd be reclaimed on the next UPDATE of the tuple). On the other hand,\nyou could construe that as a feature --- you don't have to wait around\nfor a DROP COLUMN to finish. Anyone who did want to reclaim space\nimmediately could do\n\tUPDATE table SET someothercolumn = someothercolumn;\nfollowed by a VACUUM. But I bet a lot of people would be just as\nhappy to let it happen in background.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 24 Jan 2000 12:53:49 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns " }, { "msg_contents": "Tom Lane wrote:\n\n> Let's see: DROP COLUMN would have to mark the column invisible, remove\n> any associated constraints (particularly NOT NULL) and indexes, and\n> it'd be done. The parser would then have to ignore the column when\n> doing column name lookups or expansion of '*', and it would have to\n> insert a NULL value for the column when transforming INSERT or UPDATE.\n> And that'd be just about it. I like it.\n\nHow would you handle multi-column indices that included the column\nbeing dropped? E.g.,\n\n\tcreate unique index foobar on mytable(foo,bar);\n\nwhere the 'bar' column is then dropped...\n\nDropping all of that index would seem to be problematic.\n\nCheers,\nEd Loehr\n", "msg_date": "Mon, 24 Jan 2000 12:13:56 -0600", "msg_from": "Ed Loehr <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns" }, { "msg_contents": "Ed Loehr <[email protected]> writes:\n> How would you handle multi-column indices that included the column\n> being dropped? E.g.,\n> \tcreate unique index foobar on mytable(foo,bar);\n> where the 'bar' column is then dropped...\n\nGood question, but I don't think we had an answer for it in the other\nscheme either.\n\nIn Hiroshi's scheme it seems like it might \"just work\" anyway: the index\nwould still be there, it'd just start filling with all nulls in the bar\ncolumn. AFAIR, a unique index won't complain about that under SQL92\nrules.\n\nOn the whole it might be better to refuse to do the DROP COLUMN until\nthe user gets rid of such an index. It would certainly be wrong for\nus to try to replace the index with\n\tcreate unique index foobar on mytable(foo);\nsince the original index did *not* imply uniqueness on foo alone.\n\nSimilarly, I'd be very strongly inclined to punt if we find any\nconstraints that mention both the target column and other columns.\nWe cannot fix those automatically, and silently dropping them doesn't\nsound good either. Make the user do something with them, instead.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 24 Jan 2000 13:30:21 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns " }, { "msg_contents": "> Let's see: DROP COLUMN would have to mark the column invisible, remove\n> any associated constraints (particularly NOT NULL) and indexes, and\n> it'd be done. The parser would then have to ignore the column when\n> doing column name lookups or expansion of '*', and it would have to\n> insert a NULL value for the column when transforming INSERT or UPDATE.\n> And that'd be just about it. I like it.\n\nOn further reflection I can think of a few other places that would have\nto be taught to skip over \"invisible\" columns: COPY and pg_dump would,\nand probably there are some others. But it still seems like this is\na simple and robust scheme with considerable advantages, and many\nfewer \"I'm not sure how to do that\" gaps in it.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 24 Jan 2000 13:45:43 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns " }, { "msg_contents": "At 11:48 AM 1/24/00 -0500, Bruce Momjian wrote:\n\n>> 2a) Does anyone have a better idea? (Btw., I'm not too excited about\n>> by-passing the storage manager and writing around in the table file on\n>> disk. If vacuum does that, that doesn't mean it's the right thing to do.)\n\n>I totally agree that bypassing the storage manager is the wrong way to\n>go with this. All the command/*.c stuff is make to be clean, not fast. \n>It is better to put something together that works rather than optimize\n>things like add user or create database.\n\n>Now, I will admit the ALTER DROP is going take much longer than most\n>command/*.c, so it may be worth it some day to try and do this, but I\n>don't see this as a priority at this point. We have many other items to\n>work on that are more important.\n\nAlso, by-passing the storage manager would make it more difficult to\nreplace it with another, for instance a storage manager based on raw\ndisk I/O, which some folks seem interested in. Though I don't count\nmyself in that class, it seems like the storage manager abstraction\nhas been preserved in order to simplify alternative approaches if\nfolks want to add them in the future, and it seems wrong to by-pass\nthat layer of abstraction.\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Mon, 24 Jan 2000 11:18:57 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns" }, { "msg_contents": "At 12:53 PM 1/24/00 -0500, Tom Lane wrote:\n>\"Hiroshi Inoue\" <[email protected]> writes:\n>> My idea is as follows.\n>\n>> 1)add a visibile/invisible flag to pg_attribute\n>> 2)DROP COLUMN marks the column as invisible\n>> 3)user interface ignores the columns which are marked invisible\n>> 4)heap_formtuple() etc treats the column as NULL internally\n>\n>That could be a really good idea.\n\nI'd been thinking along these lines as a possibility, too, but \ndidn't want to rock the boat any more than I've done already. Now\nthat it's on the table, though...\n\n>Let's see: DROP COLUMN would have to mark the column invisible, remove\n>any associated constraints (particularly NOT NULL) and indexes, and\n>it'd be done. The parser would then have to ignore the column when\n>doing column name lookups or expansion of '*', and it would have to\n>insert a NULL value for the column when transforming INSERT or UPDATE.\n>And that'd be just about it. I like it.\n\nYep. \n\n>The only drawback of this scheme is that the space occupied by the\n>deleted column wouldn't go away immediately (in any given tuple,\n>it'd be reclaimed on the next UPDATE of the tuple). On the other hand,\n>you could construe that as a feature --- you don't have to wait around\n>for a DROP COLUMN to finish. Anyone who did want to reclaim space\n>immediately could do\n>\tUPDATE table SET someothercolumn = someothercolumn;\n>followed by a VACUUM.\n\nOr perhaps vacuum could be made smart enough to remove deleted columns?\nPerhaps optionally?\n\n> But I bet a lot of people would be just as happy to let it happen\n> in background.\n\nWell...one reason why this idea arose in my mind is because I'm actually\ndoing it for a web-based table definer that's part of the (tiresomely\novermentioned) arsDigita Community System. It lets you add and drop\ncolumns via the web (you're actually defining auxillary tables used\nby some canned code so it's not quite as weird as it may sound). I\nsimply enforce that user-defined table names begin with a character,\nand when a user \"drops\" a column rename it to an \"illegal\" name in\na special form, which the rest of the web interface simply doesn't\ndisplay. The user can't tell that the columns not really dropped,\nmaintaining the illusion that the system's 100% compatible with the\nOracle-based version.\n\nIt works just great for this application, though it's a royal kludge.\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Mon, 24 Jan 2000 11:35:37 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns " }, { "msg_contents": "On Mon, 24 Jan 2000, Tom Lane wrote:\n\n> \"Hiroshi Inoue\" <[email protected]> writes:\n> > My idea is as follows.\n> \n> > 1)add a visibile/invisible flag to pg_attribute\n> > 2)DROP COLUMN marks the column as invisible\n> > 3)user interface ignores the columns which are marked invisible\n> > 4)heap_formtuple() etc treats the column as NULL internally\n> \n> That could be a really good idea. I don't think you'd even need to\n> touch heap_formtuple (and it'd be better not to mess with the guts\n> of the system to implement this feature, for both speed and reliability\n> reasons).\n> \n> Let's see: DROP COLUMN would have to mark the column invisible, remove\n> any associated constraints (particularly NOT NULL) and indexes, and\n> it'd be done. The parser would then have to ignore the column when\n> doing column name lookups or expansion of '*', and it would have to\n> insert a NULL value for the column when transforming INSERT or UPDATE.\n> And that'd be just about it. I like it.\n> \n> The only drawback of this scheme is that the space occupied by the\n> deleted column wouldn't go away immediately (in any given tuple,\n> it'd be reclaimed on the next UPDATE of the tuple). On the other hand,\n> you could construe that as a feature --- you don't have to wait around\n> for a DROP COLUMN to finish. Anyone who did want to reclaim space\n> immediately could do\n> \tUPDATE table SET someothercolumn = someothercolumn;\n> followed by a VACUUM. But I bet a lot of people would be just as\n> happy to let it happen in background.\n\nHey Bruce ... Look here ^^^^ :)\n\nOh, there is a second drawback to it though ...\n\nDROP COLUMN name\nADD COLUMN name <of a different type>\n\nThen what? :(\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Mon, 24 Jan 2000 15:44:20 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns " }, { "msg_contents": "At 12:13 PM 1/24/00 -0600, Ed Loehr wrote:\n>Tom Lane wrote:\n>\n>> Let's see: DROP COLUMN would have to mark the column invisible, remove\n>> any associated constraints (particularly NOT NULL) and indexes, and\n>> it'd be done. The parser would then have to ignore the column when\n>> doing column name lookups or expansion of '*', and it would have to\n>> insert a NULL value for the column when transforming INSERT or UPDATE.\n>> And that'd be just about it. I like it.\n>\n>How would you handle multi-column indices that included the column\n>being dropped? E.g.,\n>\n>\tcreate unique index foobar on mytable(foo,bar);\n>\n>where the 'bar' column is then dropped...\n>\n>Dropping all of that index would seem to be problematic.\n\nHmmm...dropping the index is what Oracle does, or so claims their\ndocumentation. It makes sense because getting rid of \"bar\"\nmay well mean that the uniquness constraint will no longer be\nsatisfied, right? In fact, odds are it won't for a multi-column\nindex. Anyway, Oracle drops all indices which reference the \ncolumn.\n\nAlso, it turns out that \"drop column\" in Oracle does reclaim the\nspace occupied by the data, but there's a \"set unused\" variant that\ndoes EXACTLY what's being talked about - i.e. marks the column as\nunused and makes it invisible to queries.\n\nInteresting.\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Mon, 24 Jan 2000 11:53:33 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns" }, { "msg_contents": "At 03:44 PM 1/24/00 -0400, The Hermit Hacker wrote:\n\n>Oh, there is a second drawback to it though ...\n>\n>DROP COLUMN name\n>ADD COLUMN name <of a different type>\n>\n>Then what? :(\n\nI don't understand...the idea is to make the old column name\ninvisible, and therefore \"add column\" won't see it either.\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Mon, 24 Jan 2000 12:02:20 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns " }, { "msg_contents": "On Mon, 24 Jan 2000, Don Baccus wrote:\n\n> At 03:44 PM 1/24/00 -0400, The Hermit Hacker wrote:\n> \n> >Oh, there is a second drawback to it though ...\n> >\n> >DROP COLUMN name\n> >ADD COLUMN name <of a different type>\n> >\n> >Then what? :(\n> \n> I don't understand...the idea is to make the old column name\n> invisible, and therefore \"add column\" won't see it either.\n\nso the pg_* file that maintains the 'fields' in a table would have two\nfields of the same name, one enabled, one disabled?\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Mon, 24 Jan 2000 16:23:16 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns " }, { "msg_contents": "At 04:23 PM 1/24/00 -0400, The Hermit Hacker wrote:\n\n>so the pg_* file that maintains the 'fields' in a table would have two\n>fields of the same name, one enabled, one disabled?\n\nOr perhaps the name is set to null, whatever.\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Mon, 24 Jan 2000 12:24:11 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns " }, { "msg_contents": "On Mon, 24 Jan 2000, Don Baccus wrote:\n\n> >you could construe that as a feature --- you don't have to wait around\n> >for a DROP COLUMN to finish. Anyone who did want to reclaim space\n> >immediately could do\n> >\tUPDATE table SET someothercolumn = someothercolumn;\n> >followed by a VACUUM.\n> \n> Or perhaps vacuum could be made smart enough to remove deleted columns?\n> Perhaps optionally?\n\nwhen bruce and I discussed this, that was one thing we both agreed upon\n... Vacuum is too slow as it is, let alone adding in more things for it to\ndo :(\n\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Mon, 24 Jan 2000 16:24:26 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns " }, { "msg_contents": "Don Baccus wrote:\n> \n> >How would you handle multi-column indices that included the column\n> >being dropped? E.g.,\n> >\n> > create unique index foobar on mytable(foo,bar);\n> >\n> >where the 'bar' column is then dropped...\n> \n> ... Oracle drops all indices which reference the column.\n\nSeems like a new 'gotcha'... either way, informative warnings/notices\nwould be nice.\n\nAlong these same lines, how would pre-existing functions that\nreferenced the just-dropped column be handled? I'm thinking of\nPL/pgSQL...\n\n\nCheers,\nEd Loehr\n", "msg_date": "Mon, 24 Jan 2000 14:26:40 -0600", "msg_from": "Ed Loehr <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns" }, { "msg_contents": "At 02:26 PM 1/24/00 -0600, Ed Loehr wrote:\n>Don Baccus wrote:\n>> \n>> >How would you handle multi-column indices that included the column\n>> >being dropped? E.g.,\n>> >\n>> > create unique index foobar on mytable(foo,bar);\n>> >\n>> >where the 'bar' column is then dropped...\n>> \n>> ... Oracle drops all indices which reference the column.\n\n>Seems like a new 'gotcha'... either way, informative warnings/notices\n>would be nice.\n\nI'm not saying that Oracle's \"right\", I just offer it as one datapoint.\nI have access to an Oracle installation, so it's easy enough for me to\ntry things out.\n\nIf dropping the index were decided upon, a notice would be nice, yes.\nOr, as Tom suggested, making the user drop relevant indices by hand\nfirst as a safeguard.\n\n>Along these same lines, how would pre-existing functions that\n>referenced the just-dropped column be handled? I'm thinking of\n>PL/pgSQL...\n\nI presume they'd fail just like any client software accessing those\ncolumns via libpq queries, query files fed to psql, etc. Dropping\na column is something you don't want to do blithely in an existing,\ncomplex application, that's for sure!\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Mon, 24 Jan 2000 12:29:48 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns" }, { "msg_contents": "> > The only drawback of this scheme is that the space occupied by the\n> > deleted column wouldn't go away immediately (in any given tuple,\n> > it'd be reclaimed on the next UPDATE of the tuple). On the other hand,\n> > you could construe that as a feature --- you don't have to wait around\n> > for a DROP COLUMN to finish. Anyone who did want to reclaim space\n> > immediately could do\n> > \tUPDATE table SET someothercolumn = someothercolumn;\n> > followed by a VACUUM. But I bet a lot of people would be just as\n> > happy to let it happen in background.\n> \n> Hey Bruce ... Look here ^^^^ :)\n> \n> Oh, there is a second drawback to it though ...\n> \n> DROP COLUMN name\n> ADD COLUMN name <of a different type>\n> \n> Then what? :(\n\nDouble-yikes. There goes that idea, or does it? Attributes are\nnumbered. How does a missing attribute get handled for new rows?\nMy guess is that we have to keep this thing around forever. Can you\nimagine having all those user apps tha query pg_attribute supress that\ncolumn. Sound like too much work to me.\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": "Mon, 24 Jan 2000 15:37:02 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns" }, { "msg_contents": "The Hermit Hacker wrote:\n> \n> On Mon, 24 Jan 2000, Adriaan Joubert wrote:\n> \n> > As a user let me just say that I have been waiting for all the\n> > 'ALTER TABLE..' commands for a long time (changing constraints would be great\n> > too!) and it has been mentioned many times that one should not use oids in\n> > application code. The way I do it at the moment is to copy the table, so I\n> > think all users are used to losing their oids when remocing a column from a\n> > table. So while it is certainly better to keep the oids, Peter's code is a\n> > big improvement on the current situation.\n> \n> Except, as Chris Bitmead brought up, OIDs appear to be a key requirement\n> in ODBMSs ... so, if we want to go what I *think* is 'next generation',\n> OIDs have to be kept ...\n\nBut the decision was (from Vadim IIRC) to drop them, at least in non system\ntables.\nThe cited reasons were:\n* crappy implementation that taxed performance (probably fixed by now)\n* nobody else seemed to have them and the push then was to the direction of\n mainstream bean-counting DB with main objective of getting that base\n functionality right.\n* they take up \"too much\" space (probably a non-issue in current world of\n dropping disk/memory prices)\n* you can always re-implement them at the application level (the same was\ncited\n for dropping time travel) \n\nIf it is now a general opinion that OIDs will remain, it should be stated\nsomewhere,\nas I suspect that much of pg community operates under the impression that they\nare \ngoing away in future as have some other nice but not fully developed features\nlike\ntime travel.\n\nI do understand that time travel could be implemented using a bunch of\nrules+views\nbut to be really useful rules views should be much more developed and\nintegrated \nwith inheritance, up to the level where you could say:\n\ncreate table stock(\n item_id int,\n quantity int,\n price numeric(15,2)\n) inherits (time_travel);\n\nand then have all the needed tables/rules/views produced automatically.\n\nIf we had that level of sofistication we could also safely drop OIDs as a\nbuilt-in \nsystem feature and still have it by changing the last line to\n\n) inherits (time_travel,odbms_table);\n\n\n\n-----------------\nHannu\n", "msg_date": "Mon, 24 Jan 2000 23:52:07 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns" }, { "msg_contents": "Bruce Momjian wrote:\n> \n> > > The only drawback of this scheme is that the space occupied by the\n> > > deleted column wouldn't go away immediately (in any given tuple,\n> > > it'd be reclaimed on the next UPDATE of the tuple). On the other hand,\n> > > you could construe that as a feature --- you don't have to wait around\n> > > for a DROP COLUMN to finish. Anyone who did want to reclaim space\n> > > immediately could do\n> > > UPDATE table SET someothercolumn = someothercolumn;\n> > > followed by a VACUUM. But I bet a lot of people would be just as\n> > > happy to let it happen in background.\n> >\n> > Hey Bruce ... Look here ^^^^ :)\n> >\n> > Oh, there is a second drawback to it though ...\n> >\n> > DROP COLUMN name\n> > ADD COLUMN name <of a different type>\n\nor the same type, it will be added at the end anyway.\n\npart of making it invisible should be making its _name_ invisible in pg_*\n\none way would be to rename it to '\\n'+str(next_available_oid) or sone other \ninvalid column name.\n\n> >\n> > Then what? :(\n> \n> Double-yikes. There goes that idea, or does it? Attributes are\n> numbered. How does a missing attribute get handled for new rows?\n\nThe proposition was to set it always to NULL (takes no additional storage\nif there are other null columns, (fieldcnt+31)/8 bytes else.\n\nBTW, the current handling of nulls in storage is a bit weird - the bitvector\nfor \nnull/not null starts at position 31, but if there is a bitmap space is\nallocated \nin 4-byte chunks starting at position 32 (at least on linux/x86)\n\n> My guess is that we have to keep this thing around forever.\n\nOr until dump/reload, the renumbering will be automatic there.\n\n> Can you\n> imagine having all those user apps tha query pg_attribute supress that\n> column. Sound like too much work to me.\n\nTo me it sounds like a thing that _must_ be done at major number change, \nso 7.0 is a good place.\n\nOTOH, we could provide SQL92 ways for getting the info that current user \napps get by querying pg_attribute.\n\nIIRC it requires a bunch of views on system tables, some of which could be \nlifted straight from psql's \\d* commands.\n\n-----------------------------\nHannu\n", "msg_date": "Tue, 25 Jan 2000 00:18:07 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns" }, { "msg_contents": "At 11:52 PM 1/24/00 +0200, Hannu Krosing wrote:\n\n>But the decision was (from Vadim IIRC) to drop them, at least in non system\n>tables.\n>The cited reasons were:\n>* crappy implementation that taxed performance (probably fixed by now)\n>* nobody else seemed to have them and the push then was to the direction of\n> mainstream bean-counting DB with main objective of getting that base\n> functionality right.\n\nRegarding this last, Oracle has an equivalent - rowid. In the web\ntoolkit I'm helping port, it's used somewhat often, and having oid\navailable has been a convenience.\n\nHaving said that, its use in this toolkit's could be replaced by \nsimply creating a sequence and numbering rows by hand. Their loss\nwouldn't bother me particularly even though it would add a little\nwork (not much) to this project.\n\n>* they take up \"too much\" space (probably a non-issue in current world of\n> dropping disk/memory prices)\n>* you can always re-implement them at the application level (the same was\n>cited\n> for dropping time travel) \n\nYep!\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Mon, 24 Jan 2000 14:30:19 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns" }, { "msg_contents": "> > Can you\n> > imagine having all those user apps tha query pg_attribute supress that\n> > column. Sound like too much work to me.\n> \n> To me it sounds like a thing that _must_ be done at major number change, \n> so 7.0 is a good place.\n> \n> OTOH, we could provide SQL92 ways for getting the info that current user \n> apps get by querying pg_attribute.\n> \n> IIRC it requires a bunch of views on system tables, some of which could be \n> lifted straight from psql's \\d* commands.\n\nIf this is going to require any significant backend baggage, I say drop\nit. Things are complicated enough. I did temp tables in one file so we\nwould not have \"I am a temp\" and \"I am not a temp\" floating all over the\nbackend. I don't really want \"I am not an attribute\" around either.\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": "Mon, 24 Jan 2000 17:34:33 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns" }, { "msg_contents": "Don Baccus wrote:\n> \n> At 11:52 PM 1/24/00 +0200, Hannu Krosing wrote:\n> \n> >But the decision was (from Vadim IIRC) to drop them, at least in non system\n> >tables.\n> >The cited reasons were:\n> >* crappy implementation that taxed performance (probably fixed by now)\n> >* nobody else seemed to have them and the push then was to the direction of\n> > mainstream bean-counting DB with main objective of getting that base\n> > functionality right.\n> \n> Regarding this last, Oracle has an equivalent - rowid. In the web\n> toolkit I'm helping port, it's used somewhat often, and having oid\n> available has been a convenience.\n\nMy impression was thet Oracles ROWID is more like our TID - i.e. not a very \nstable thing. I may be wrong of course, as last time I used oracle seriously \nwas more than 3 years ago.\n\n> Having said that, its use in this toolkit's could be replaced by\n> simply creating a sequence and numbering rows by hand.\n\nOr using 'default nextid()' which seems to be the recommended and portable (?)\nway.\n\n----------------\nHannu\n", "msg_date": "Tue, 25 Jan 2000 01:02:41 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns" }, { "msg_contents": "At 15:44 24/01/00 -0400, The Hermit Hacker wrote:\n>On Mon, 24 Jan 2000, Tom Lane wrote:\n>\n>> \"Hiroshi Inoue\" <[email protected]> writes:\n>> > My idea is as follows.\n>> \n>> > 1)add a visibile/invisible flag to pg_attribute\n>> > 2)DROP COLUMN marks the column as invisible\n>> > 3)user interface ignores the columns which are marked invisible\n>> > 4)heap_formtuple() etc treats the column as NULL internally\n>> \n...etc..\n>\n>Oh, there is a second drawback to it though ...\n>\n>DROP COLUMN name\n>ADD COLUMN name <of a different type>\n>\n>Then what? :(\n\nAren't there two separate issues to be resolved:\n\n1. What happens with meta-data referential integrity - a problem for all\nimplementations.\n\n2. How is it implemeneted.\n\nFor my 0.02c, the meta data integrity issue should be resolved by saying\n'drop column' is not allowed if there is any (non-system-generated)\nmetadata that refers to it. Most people (I think) drop columns because they\nhave no use for them any longer. If they have indexes, constraints,\ntriggers etc based on those columns, then the drop should fail, since these\nitems are a prima-facie case that there is a use for them. Cascading\ndeletes are a nice thing, but for meta-data they can be quite dangerous.\n\nAs far as the implementation is concerned, I like the idea of 'hiding' the\ndeleted column, but am curious: can it be hidden more effectively so that\nthe only thing that ever sees it is the part of the code that reads it from\ndisk?\n\n\n----------------------------------------------------------------\nPhilip Warner | __---_____\nAlbatross Consulting Pty. Ltd. |----/ - \\\n(A.C.N. 008 659 498) | /(@) ______---_\nTel: +61-03-5367 7422 | _________ \\\nFax: +61-03-5367 7430 | ___________ |\nHttp://www.rhyme.com.au | / \\|\n | --________--\nPGP key available upon request, | /\nand from pgp5.ai.mit.edu:11371 |/\n", "msg_date": "Tue, 25 Jan 2000 10:08:56 +1100", "msg_from": "Philip Warner <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns " }, { "msg_contents": "Bruce Momjian wrote:\n> \n> > OTOH, we could provide SQL92 ways for getting the info that current user\n> > apps get by querying pg_attribute.\n> >\n> > IIRC it requires a bunch of views on system tables, some of which could be\n> > lifted straight from psql's \\d* commands.\n> \n> If this is going to require any significant backend baggage, I say drop\n> it. Things are complicated enough. I did temp tables in one file so we\n> would not have \"I am a temp\" and \"I am not a temp\" floating all over the\n> backend. I don't really want \"I am not an attribute\" around either.\n\nPossible valid complain true for hidden attributes.\n\nBut the ANSI/ISO system table views gould probably done even as a add-on \npackage that just creates the views - with nothing in backend.\n\nAnd promoting them as the default way for finding out about schema would free\nus \nfrom concerns about user-level apps when we need to change internal system\ntable\nstructures.\n\nIt could at least be added to TODO for 7.x \n\n-----------------\nHannu\n", "msg_date": "Tue, 25 Jan 2000 01:09:31 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns" }, { "msg_contents": "At 01:02 AM 1/25/00 +0200, Hannu Krosing wrote:\n\n>> Regarding this last, Oracle has an equivalent - rowid. In the web\n>> toolkit I'm helping port, it's used somewhat often, and having oid\n>> available has been a convenience.\n>\n>My impression was thet Oracles ROWID is more like our TID - i.e. not a very \n>stable thing. I may be wrong of course, as last time I used oracle seriously \n>was more than 3 years ago.\n\nHmmm...maybe so. I'm not sure, either...porting existing Oracle code\nto PostgreSQL by no means makes me an Oracle expert.\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Mon, 24 Jan 2000 15:17:44 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns" }, { "msg_contents": "Hiroshi Inoue wrote:\n> I propose another implementation here. I don't think this is so\n> important a feature. I'm only afraid of forced implementation\n> especially using copy() and rename() for such a feature.\n\nHi all....\n\nCan I just point out that the above is THE RIGHT THING(tm). I havn't\nfollowed this thread from the beginning, but can I point out that\nimplementing drop column as a copy/rename is not good (better than\nnothing I guess).\n\nTake a cue from a database like VERSANT (http://www.versant.com). You\ncan change the database's schema while the database is running. Time\ntaken to delete a column is roughly 0.0 seconds no matter how large the\ntable. Going the whole hog, you keep the old schema available so that\nwhen you retrieve an old tuple it can be updated the next time that\ntuple is updated.\n\n\n> \n> My idea is as follows.\n> \n> 1)add a visibile/invisible flag to pg_attribute\n> 2)DROP COLUMN marks the column as invisible\n> 3)user interface ignores the columns which are marked invisible\n> 4)heap_formtuple() etc treats the column as NULL internally\n> \n> Regards.\n> \n> Hiroshi Inoue\n> [email protected]\n> \n> ************\n", "msg_date": "Tue, 25 Jan 2000 10:20:49 +1100", "msg_from": "Chris Bitmead <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns" }, { "msg_contents": "\n> Double-yikes. There goes that idea, or does it? Attributes are\n> numbered. How does a missing attribute get handled for new rows?\n> My guess is that we have to keep this thing around forever. Can you\n> imagine having all those user apps tha query pg_attribute supress that\n> column. Sound like too much work to me.\n\nI don't know the intimate details of the postgres implementation, but I\nwould have thought every row would need a version number and you would\nneed to somehow store how the table looked at each version.\n\nBecause you could\nCREATE TABLE\nINSERT\nALTER DROP\nINSERT/DELETE\nALTER DROP/ADD\nINSERT/DELETE\n\nand you would end up with rows with 5 or 6 different formats.\n", "msg_date": "Tue, 25 Jan 2000 10:37:00 +1100", "msg_from": "Chris Bitmead <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns" }, { "msg_contents": "On Mon, 24 Jan 2000, Bruce Momjian wrote:\n\n> > > The only drawback of this scheme is that the space occupied by the\n> > > deleted column wouldn't go away immediately (in any given tuple,\n> > > it'd be reclaimed on the next UPDATE of the tuple). On the other hand,\n> > > you could construe that as a feature --- you don't have to wait around\n> > > for a DROP COLUMN to finish. Anyone who did want to reclaim space\n> > > immediately could do\n> > > \tUPDATE table SET someothercolumn = someothercolumn;\n> > > followed by a VACUUM. But I bet a lot of people would be just as\n> > > happy to let it happen in background.\n> > \n> > Hey Bruce ... Look here ^^^^ :)\n> > \n> > Oh, there is a second drawback to it though ...\n> > \n> > DROP COLUMN name\n> > ADD COLUMN name <of a different type>\n> > \n> > Then what? :(\n> \n> Double-yikes. There goes that idea, or does it? Attributes are\n\nnot necessarily, just playing devil's advocate ... :)\n\n\n> numbered. How does a missing attribute get handled for new rows?\n> My guess is that we have to keep this thing around forever. Can you\n> imagine having all those user apps tha query pg_attribute supress that\n> column. Sound like too much work to me.\n\nI *still* think the best is the \"re-write the table in place\" method\n... we already have most of the logic, I would think, from VACUUM ...\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Mon, 24 Jan 2000 21:34:48 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns" }, { "msg_contents": "> -----Original Message-----\n> From: The Hermit Hacker [mailto:[email protected]]\n> \n> > numbered. How does a missing attribute get handled for new rows?\n> > My guess is that we have to keep this thing around forever. Can you\n> > imagine having all those user apps tha query pg_attribute supress that\n> > column. Sound like too much work to me.\n> \n> I *still* think the best is the \"re-write the table in place\" method\n> ... we already have most of the logic, I would think, from VACUUM ...\n>\n\nAFAIK,there's no such logic in VACUUM. \nBecause PostgreSQL has no rollback data separately,we must keep\nvalid old tuples somewhere(of cource the original place is most natural)\nin the table until commit at least.\n\nRegards.\n\nHiroshi Inoue\[email protected]\n\n", "msg_date": "Tue, 25 Jan 2000 11:05:35 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] Well, then you keep your darn columns" }, { "msg_contents": "On Mon, 24 Jan 2000, The Hermit Hacker wrote:\n\n> On Mon, 24 Jan 2000, Don Baccus wrote:\n> \n> > At 03:44 PM 1/24/00 -0400, The Hermit Hacker wrote:\n> > \n> > >Oh, there is a second drawback to it though ...\n> > >\n> > >DROP COLUMN name\n> > >ADD COLUMN name <of a different type>\n> > >\n> > >Then what? :(\n> > \n> > I don't understand...the idea is to make the old column name\n> > invisible, and therefore \"add column\" won't see it either.\n> \n> so the pg_* file that maintains the 'fields' in a table would have two\n> fields of the same name, one enabled, one disabled?\n\nThe entries in pg_attribute have oids as well ...\n\n-- \nPeter Eisentraut Sernanders vaeg 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Tue, 25 Jan 2000 12:01:22 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns " }, { "msg_contents": "The Hermit Hacker wrote:\n> \n> > numbered. How does a missing attribute get handled for new rows?\n> > My guess is that we have to keep this thing around forever. Can you\n> > imagine having all those user apps tha query pg_attribute supress that\n> > column. Sound like too much work to me.\n> \n> I *still* think the best is the \"re-write the table in place\" method\n> ... we already have most of the logic, I would think, from VACUUM ...\n\nIt is much safer with vacuum, as there is no way for vacuum to crash and have \ntwo different tuple formats left behind (i hope ;-p)\n\n-------------\nHannu\n", "msg_date": "Wed, 26 Jan 2000 02:56:12 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns" }, { "msg_contents": "On 2000-01-24, The Hermit Hacker mentioned:\n\n> Except, as Chris Bitmead brought up, OIDs appear to be a key requirement\n> in ODBMSs ... so, if we want to go what I *think* is 'next generation',\n> OIDs have to be kept ...\n\nIndependent of everything else I would like to point out that although\noids do appear in a central role in the theory of object oriented\ndatabases they are still not a user-level feature. The system uses them to\nin essence do what some people already do with them now: use them as links\nin foreign key settings. This sort of scheme is supposed to eliminate the\nneed for costly joins, since you already know the location of the data\n(assuming that you have a scheme to map the oid to the storage location).\n\nThis past summer this sort of idea was discussed around these parts and\nmost of us came to the conclusion that a) OODBs are a pipe-dream at this\npoint in time, and b) this is not worth doing in PostgreSQL as it stands.\nIf we wanna become an OODBs we might as well say that now so we can start\nby dropping SQL and the optimizer and the storage manager -- okay, I'm\nbeing sarcastic (about OODBs).\n\nHowever, once again, users would have no knowledge of these \"oids\". The\nsystem is free to do whatever it wants in order to do its thing, in\nparticular it is free to *change* oids when it needs it (because when it\ncopies the data elsewhere it presumably needs to tag the location\ndifferently).\n\nOur oids are something different (though not sure what), PostgreSQL is\nsomething different. I am by all means against breaking what oids\nrepresent now, but incidentally I am also against them becoming (being) a\nuser-level feature.\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n\n", "msg_date": "Wed, 26 Jan 2000 19:34:20 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "OIDS (Re: [HACKERS] Well, then you keep your darn columns)" }, { "msg_contents": "Peter,\n\nAre you talking about make OID invisible ?\nPlease, don't do this. I have a good use of them to move backward and\nforward in a set of rows\nselected by interactive forms of any table.\n\nRegards,\n\nRicardo Coelho.\n\n----- Original Message -----\nFrom: Peter Eisentraut <[email protected]>\nTo: The Hermit Hacker <[email protected]>\nCc: Adriaan Joubert <[email protected]>; <[email protected]>\nSent: Wednesday, January 26, 2000 4:34 PM\nSubject: OIDS (Re: [HACKERS] Well, then you keep your darn columns)\n\n\n> On 2000-01-24, The Hermit Hacker mentioned:\n>\n> > Except, as Chris Bitmead brought up, OIDs appear to be a key requirement\n> > in ODBMSs ... so, if we want to go what I *think* is 'next generation',\n> > OIDs have to be kept ...\n>\n> Independent of everything else I would like to point out that although\n> oids do appear in a central role in the theory of object oriented\n> databases they are still not a user-level feature. The system uses them to\n> in essence do what some people already do with them now: use them as links\n> in foreign key settings. This sort of scheme is supposed to eliminate the\n> need for costly joins, since you already know the location of the data\n> (assuming that you have a scheme to map the oid to the storage location).\n>\n> This past summer this sort of idea was discussed around these parts and\n> most of us came to the conclusion that a) OODBs are a pipe-dream at this\n> point in time, and b) this is not worth doing in PostgreSQL as it stands.\n> If we wanna become an OODBs we might as well say that now so we can start\n> by dropping SQL and the optimizer and the storage manager -- okay, I'm\n> being sarcastic (about OODBs).\n>\n> However, once again, users would have no knowledge of these \"oids\". The\n> system is free to do whatever it wants in order to do its thing, in\n> particular it is free to *change* oids when it needs it (because when it\n> copies the data elsewhere it presumably needs to tag the location\n> differently).\n>\n> Our oids are something different (though not sure what), PostgreSQL is\n> something different. I am by all means against breaking what oids\n> represent now, but incidentally I am also against them becoming (being) a\n> user-level feature.\n>\n> --\n> Peter Eisentraut Sernanders v�g 10:115\n> [email protected] 75262 Uppsala\n> http://yi.org/peter-e/ Sweden\n>\n>\n>\n> ************\n\n", "msg_date": "Wed, 26 Jan 2000 18:46:52 -0200", "msg_from": "\"Ricardo Coelho\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: OIDS (Re: [HACKERS] Well, then you keep your darn columns)" }, { "msg_contents": "Peter Eisentraut wrote:\n> \n> On 2000-01-24, The Hermit Hacker mentioned:\n> \n> > Except, as Chris Bitmead brought up, OIDs appear to be a key requirement\n> > in ODBMSs ... so, if we want to go what I *think* is 'next generation',\n> > OIDs have to be kept ...\n> \n> Independent of everything else I would like to point out that although\n> oids do appear in a central role in the theory of object oriented\n> databases they are still not a user-level feature. The system uses them to\n> in essence do what some people already do with them now: use them as links\n> in foreign key settings. This sort of scheme is supposed to eliminate the\n> need for costly joins, since you already know the location of the data\n> (assuming that you have a scheme to map the oid to the storage location).\n\nAFAIK we currently don't. We have the (volatile) tids for that.\n\n> Our oids are something different (though not sure what), PostgreSQL is\n> something different. I am by all means against breaking what oids\n> represent now, but incidentally I am also against them becoming (being) a\n> user-level feature.\n\nIt would go at least half-way if we had a reasonably fast function that can \ngive either the type of objest (the relation) or the tuple itself if given\nit's oid.\n\nselect tuple_for_oif(myoid);\n\nor\n\nselect relation_containing_oid(myoid);\n\nor even \n\nselect * from relation_containing_oid(myoid) where oid = myoid; \nmaybe spelled as\nselect * from * where oid = myoid; ;)\n\nAn we could re-introduce the ability to get full tuples for select * from\nbase*;\n\nWe used to have it but cuurently it is at lest discouraged and probably\nunsupported \nin libpq;\n\n---------\nHannu\n", "msg_date": "Thu, 27 Jan 2000 01:46:45 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: OIDS (Re: [HACKERS] Well, then you keep your darn columns)" }, { "msg_contents": "Peter Eisentraut wrote:\n> \n> Independent of everything else I would like to point out that although\n> oids do appear in a central role in the theory of object oriented\n> databases they are still not a user-level feature.\n\nYes and no. Any useful ODBMS will allow you to get at the oid. This\nallows you to say, pass it over a network as a key that you can use\nlater to get at the object.\n\n> This past summer this sort of idea was discussed around these parts and\n> most of us came to the conclusion that a) OODBs are a pipe-dream at this\n> point in time, \n\nWhat does that mean?\n\n> and b) this is not worth doing in PostgreSQL as it stands.\n\nWhy?\n\n> If we wanna become an OODBs we might as well say that now so we can start\n> by dropping SQL and the optimizer and the storage manager -- okay, I'm\n> being sarcastic (about OODBs).\n\nThe big hope I see for postgresql is to someday be a true combination of\nODBMS and RDBMS. Current commercial ODBMSes suck because their querying\nsucks. Current commercial (O)RDBMS suck because their object features\nreally suck. There is no fundamental reason that this must be so.\n\n> However, once again, users would have no knowledge of these \"oids\". The\n> system is free to do whatever it wants in order to do its thing, in\n> particular it is free to *change* oids when it needs it (because when it\n> copies the data elsewhere it presumably needs to tag the location\n> differently).\n\nActually no. The whole point of oids is that they don't change. Ok, some\nODBMSes fudge this sometimes, but the whole point is if you have 100\nobjects pointing to one object, you don't want to have to change the oid\nand go patch those other 100 objects. In particular Versant uses an 8\nbyte oid that NEVER changes. You can even move an object from one\ndatabase to another and it STILL doesn't change. This is rather cool.\n\n> Our oids are something different (though not sure what), \n\nWhy?\n\n> PostgreSQL is\n> something different. I am by all means against breaking what oids\n> represent now, but incidentally I am also against them becoming (being) a\n> user-level feature.\n\nOIDs are a pseudo user level feature in an ODBMS. They are something you\ndon't think about most of the time, but you DO need to be able to get at\nthem.\n", "msg_date": "Thu, 27 Jan 2000 11:13:26 +1100", "msg_from": "Chris Bitmead <[email protected]>", "msg_from_op": false, "msg_subject": "Re: OIDS (Re: [HACKERS] Well, then you keep your darn columns)" }, { "msg_contents": "On Thu, 27 Jan 2000, Chris Bitmead wrote:\n\n> > This past summer this sort of idea was discussed around these parts and\n> > most of us came to the conclusion that a) OODBs are a pipe-dream at this\n> > point in time, \n> \n> What does that mean?\n\nNot sure, I missed that conversation ...\n\n> > If we wanna become an OODBs we might as well say that now so we can start\n> > by dropping SQL and the optimizer and the storage manager -- okay, I'm\n> > being sarcastic (about OODBs).\n> \n> The big hope I see for postgresql is to someday be a true combination of\n> ODBMS and RDBMS. Current commercial ODBMSes suck because their querying\n> sucks. Current commercial (O)RDBMS suck because their object features\n> really suck. There is no fundamental reason that this must be so.\n\nI've asked this one before, I believe, some ppl have referred to us as\nalready being ORDBMS \"material\", but am not quite sure what that means in\nour case ... how \"ORDBMS\" are we, and what is required to extend that?\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Wed, 26 Jan 2000 21:14:52 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "ORDBMS (Was: Re: OIDS (Re: [HACKERS] Well, then you keep your darn\n\tcolumns))" }, { "msg_contents": "Hannu Krosing wrote:\n\n> select * from relation_containing_oid(myoid) where oid = myoid;\n> maybe spelled as\n> select * from * where oid = myoid; ;)\n> \n> An we could re-introduce the ability to get full tuples for select * from\n> base*;\n> \n> We used to have it but cuurently it is at lest discouraged and probably\n> unsupported\n> in libpq;\n\nYou are saying that you used to be able to get full tuples from postgres\nif you selected from base* ??? In other words I select * from base, and\nI can get back the fields in an inherited class too?\n\nI have followed postgres from way back before the 'net started hacking\non it, and I've never come across this (but I desperately want it).\n\nBTW, I think the relation_containing_oid logically belongs in the WHERE\nclause. Then you need some syntax for specifying to get all the fields\nfrom subclasses too. If you have no idea the type of object then you\nhave some logical \"Object\" relation which is the logical parent of all\nrelations. Suggesting the syntax \"**\" for meaning all columns including\nsub-columns, I have suggested...\n\nSELECT ** FROM object WHERE oid = 12345;\n", "msg_date": "Thu, 27 Jan 2000 12:47:36 +1100", "msg_from": "Chris Bitmead <[email protected]>", "msg_from_op": false, "msg_subject": "Re: OIDS (Re: [HACKERS] Well, then you keep your darn columns)" }, { "msg_contents": "The Hermit Hacker wrote:\n\n> > The big hope I see for postgresql is to someday be a true combination of\n> > ODBMS and RDBMS. Current commercial ODBMSes suck because their querying\n> > sucks. Current commercial (O)RDBMS suck because their object features\n> > really suck. There is no fundamental reason that this must be so.\n> \n> I've asked this one before, I believe, some ppl have referred to us as\n> already being ORDBMS \"material\", but am not quite sure what that means in\n> our case ... how \"ORDBMS\" are we, and what is required to extend that?\n\nAs I mentioned, I wrote a web page a long time ago where I try to\nexpress the\nminimum enhancments required to turn postgres into an ODBMS.\nhttp://www.tech.com.au/postgres\n", "msg_date": "Thu, 27 Jan 2000 13:03:25 +1100", "msg_from": "Chris Bitmead <[email protected]>", "msg_from_op": false, "msg_subject": "Re: ORDBMS (Was: Re: OIDS (Re: [HACKERS] Well, then you keep your\n\tdarncolumns))" }, { "msg_contents": "At 5:47 PM -0800 1/26/00, Chris Bitmead wrote:\n>Hannu Krosing wrote:\n>\n>> An we could re-introduce the ability to get full tuples for select * from\n>> base*;\n>>\n>> We used to have it but cuurently it is at lest discouraged and probably\n>> unsupported\n>> in libpq;\n>\n>You are saying that you used to be able to get full tuples from postgres\n>if you selected from base* ??? In other words I select * from base, and\n>I can get back the fields in an inherited class too?\n>\n>I have followed postgres from way back before the 'net started hacking\n>on it, and I've never come across this (but I desperately want it).\n\nI could swear that this was one of the examples given to distinguish\nPostgres from an ordinary RDBMS. I never tried the feature though.\n\nSignature failed Preliminary Design Review.\nFeasibility of a new signature is currently being evaluated.\[email protected], or [email protected]\n", "msg_date": "Wed, 26 Jan 2000 18:09:14 -0800", "msg_from": "\"Henry B. Hotz\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: OIDS (Re: [HACKERS] Well, then you keep your darn columns)" }, { "msg_contents": "Chris Bitmead wrote:\n\n> Peter Eisentraut wrote:\n> >\n> > Independent of everything else I would like to point out that although\n> > oids do appear in a central role in the theory of object oriented\n> > databases they are still not a user-level feature.\n>\n> Yes and no. Any useful ODBMS will allow you to get at the oid. This\n> allows you to say, pass it over a network as a key that you can use\n> later to get at the object.\n\nI'm starting to think that an oid is totally the wrong key to use for an\nODBMS. As objects\nare only accessed via a client library there is no reason why this could not\nadd a key field.\nYou could then have a new system table that maps key fields on physical\nlocations, specific\ntypes and whatever else you may need.\n\nThat would also make it easier to ensure keys being consistent between dumps.\nImagine wanting\nto load some tables into an existing database and some of the oids of your\nobjects have been used already.\nIf you have overlapping key sets it is much easier to update those with an\nincrement to make them\nunique rather than to try to get all your oids consistent, isn't it?\n\nAnd a lot of the OO work on postgres would then depend on providing efficient\nways of handling\nthese keys.\n\n[Please flame when talking rubbish]\n\nAdriaan\n\n", "msg_date": "Thu, 27 Jan 2000 06:56:13 +0000", "msg_from": "Adriaan Joubert <[email protected]>", "msg_from_op": false, "msg_subject": "Re: OIDS (Re: [HACKERS] Well, then you keep your darn columns)" }, { "msg_contents": "Chris Bitmead wrote:\n> \n> Hannu Krosing wrote:\n> \n> > select * from relation_containing_oid(myoid) where oid = myoid;\n> > maybe spelled as\n> > select * from * where oid = myoid; ;)\n> >\n> > An we could re-introduce the ability to get full tuples for select * from\n> > base*;\n> >\n> > We used to have it but cuurently it is at lest discouraged and probably\n> > unsupported\n> > in libpq;\n> \n> You are saying that you used to be able to get full tuples from postgres\n> if you selected from base* ??? In other words I select * from base, and\n> I can get back the fields in an inherited class too?\n> \n> I have followed postgres from way back before the 'net started hacking\n> on it, and I've never come across this (but I desperately want it).\n\nHere is how I remember it:\n\nAt least the wire protocol supports it and also libpq used to support it, \nuntil at about time of postgres95/postgreSQL it was removed from libpq as\n\"unneeded\" (by Bruce IIRC).\n\nuntil that time it should have theoretically been possible to return tuples \nof several types and sizes, either by using \"select * from base* \" or unions \nor functions in backend.\n\nPostgreSQLs moving to SQL92 has dropped most of OO features as non-compliant\n;(\n\nFor example inheritance is used my some as a convienient means of creating \ntables with some shared column names/types and adding anything to make it \nmore has met vocal resiostance on this net as being incompatible with current \nusage.\n\n> BTW, I think the relation_containing_oid logically belongs in the WHERE\n> clause. Then you need some syntax for specifying to get all the fields\n> from subclasses too. If you have no idea the type of object then you\n> have some logical \"Object\" relation which is the logical parent of all\n> relations. Suggesting the syntax \"**\" for meaning all columns including\n> sub-columns, I have suggested...\n> \n> SELECT ** FROM object WHERE oid = 12345;\n>\nWe could define object as a relation with no attributes (columns) that all\nother \ninherits from, so \n\nSELECT ** FROM object* WHERE oid = 12345;\n\nwould be valid query for getting all objects with oid=12345;\n\nactually there could be more than one currently as you can input new ones by \ndoing a \"load from ...\" \n\nMy suggestion for using * for all tables would imply a relation called \"\" \n(i.e. empty string) as the universal base.\n\nSome systems use a keyword ALL .\n\n---------------\nHannu\n", "msg_date": "Thu, 27 Jan 2000 12:09:55 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: OIDS (Re: [HACKERS] Well, then you keep your darn columns)" }, { "msg_contents": "Adriaan Joubert wrote:\n> \n> Chris Bitmead wrote:\n> \n> > Peter Eisentraut wrote:\n> > >\n> > > Independent of everything else I would like to point out that although\n> > > oids do appear in a central role in the theory of object oriented\n> > > databases they are still not a user-level feature.\n> >\n> > Yes and no. Any useful ODBMS will allow you to get at the oid. This\n> > allows you to say, pass it over a network as a key that you can use\n> > later to get at the object.\n> \n> I'm starting to think that an oid is totally the wrong key to use for an\n> ODBMS. As objects\n> are only accessed via a client library there is no reason why this could not\n> add a key field.\n> You could then have a new system table that maps key fields on physical\n> locations, specific\n> types and whatever else you may need.\n> \n> That would also make it easier to ensure keys being consistent between dumps.\n\nThis could be fixe by going to Mariposa-style double-length oids, that have \nfirst 4 bytes as \"site-id\" and the rest is our conventional oid.\n\nand then just maintain an /etc/postgresql-max-oid file that holds the site-id\nwhich is incremented at each initdb.\n\nIf you are gong to do real distributed DBs you have to set up some registry\nfor \nallocating site-id ranges, so format for /etc/postgresql-max-oid might be\n\nmax-used-site-id max-site-id\n\n> And a lot of the OO work on postgres would then depend on providing efficient\n> ways of handling these keys.\n\nYes, but these keys _are_ currently the oids\n\n--------------\nHannu\n", "msg_date": "Thu, 27 Jan 2000 12:27:05 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: OIDS (Re: [HACKERS] Well, then you keep your darn columns)" }, { "msg_contents": "On Wed, 26 Jan 2000, The Hermit Hacker wrote:\n\n> I've asked this one before, I believe, some ppl have referred to us as\n> already being ORDBMS \"material\", but am not quite sure what that means in\n> our case ... how \"ORDBMS\" are we, and what is required to extend that?\n\nI think putting some work and thought into inheritance and making it work\nright would make a lot of people very happy, and inheritance is one of the\nmajor ideas behind OO in any context. Another thing to expand upon would\nbe using classes (\"tables\") as datatypes. I believe this is doesn't work\nall that well. But we're surely \"ORDBMS material\", if you like.\n\nPure object-oriented databases (which is where the oid thing comes from)\nare somewhat separate though, they represent a paradigm shift similar to\nmoving from, say, hierarchical or network databases to relational ones.\nThe research in that area is not at all complete and it lacks a\nstandardized query language and a whole bunch of other stuff. Since a\nmajor goal of this project is moving ever closer to SQL compliance,\nbecoming an \"OODB\" is not in the near future.\n\n-- \nPeter Eisentraut Sernanders vaeg 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Thu, 27 Jan 2000 13:50:00 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": true, "msg_subject": "Re: ORDBMS" }, { "msg_contents": "Adriaan Joubert wrote:\n\n> I'm starting to think that an oid is totally the wrong key to use for an \n> ODBMS. As objects\n> are only accessed via a client library there is no reason why this could not\n> add a key field.\n> You could then have a new system table that maps key fields on physical\n> locations, specific\n> types and whatever else you may need.\n\nI don't know what that means.\n\n> That would also make it easier to ensure keys being consistent between dumps.\n> Imagine wanting\n> to load some tables into an existing database and some of the oids of your\n> objects have been used already.\n> If you have overlapping key sets it is much easier to update those with an\n> increment to make them\n> unique rather than to try to get all your oids consistent, isn't it?\n\nIn general, moving objects between databases depends what you want. One\napproach is that the oid contains some bits related to the database it \nwas first created in. The other approach is to re-link all the objects\nwhen they are imported. (By incrementing them by a fixed amount given\nthe current max(oid) is one way).\n \n> And a lot of the OO work on postgres would then depend on providing efficient\n> ways of handling\n> these keys.\n\n??\n", "msg_date": "Fri, 28 Jan 2000 11:03:53 +1100", "msg_from": "Chris Bitmead <[email protected]>", "msg_from_op": false, "msg_subject": "Re: OIDS (Re: [HACKERS] Well, then you keep your darn columns)" }, { "msg_contents": "Hannu Krosing wrote:\n\n> > You are saying that you used to be able to get full tuples from postgres\n> > if you selected from base* ??? In other words I select * from base, and\n> > I can get back the fields in an inherited class too?\n> >\n> > I have followed postgres from way back before the 'net started hacking\n> > on it, and I've never come across this (but I desperately want it).\n> \n> Here is how I remember it:\n> \n> At least the wire protocol supports it and also libpq used to support it,\n> until at about time of postgres95/postgreSQL it was removed from libpq as\n> \"unneeded\" (by Bruce IIRC).\n\nBruce, you scoundrel! :-)\n\n> until that time it should have theoretically been possible to return tuples\n> of several types and sizes, either by using \"select * from base* \" or unions\n> or functions in backend.\n\nI wonder how this would have worked. How would the backend know if you\nwanted the \nsub-class columns or just the table? Did psql ever print different types\nin the one\ntable? At least the current PQ interface doesn't seem to have this in\nmind\nsince the interface seems to assume every tuple will have the same\nnumber\nof columns.\n\nHow much of this logic has been destroyed in the back end I wonder?\n\n> For example inheritance is used my some as a convienient means of creating\n> tables with some shared column names/types and adding anything to make it\n> more has met vocal resiostance on this net as being incompatible with current\n> usage.\n\nHmm. Damned useful though. Every time I design a data model, I feel\nmyself\nyearning for this feature. In fact I can see precious little point in\nhaving\nan ORDBMS without this feature.\n\n> > SELECT ** FROM object WHERE oid = 12345;\n> >\n> We could define object as a relation with no attributes (columns) that all\n> other\n> inherits from, so\n> \n> SELECT ** FROM object* WHERE oid = 12345;\n> \n> would be valid query for getting all objects with oid=12345;\n> \n> actually there could be more than one currently as you can input new ones by\n> doing a \"load from ...\"\n> \n> My suggestion for using * for all tables would imply a relation called \"\"\n> (i.e. empty string) as the universal base.\n\nInteresting thought.\n\n> Some systems use a keyword ALL .\n> \n> ---------------\n> Hannu\n", "msg_date": "Fri, 28 Jan 2000 11:08:00 +1100", "msg_from": "Chris Bitmead <[email protected]>", "msg_from_op": false, "msg_subject": "Re: OIDS (Re: [HACKERS] Well, then you keep your darn columns)" }, { "msg_contents": "Peter Eisentraut wrote:\n\n> I think putting some work and thought into inheritance and making it work\n> right would make a lot of people very happy, and inheritance is one of the\n> major ideas behind OO in any context. Another thing to expand upon would\n> be using classes (\"tables\") as datatypes. I believe this is doesn't work\n> all that well. But we're surely \"ORDBMS material\", if you like.\n\nYes, postgres pretends that classes as datatypes work, but if I remember\nright it doesn't work in practice.\n\n> Pure object-oriented databases (which is where the oid thing comes from)\n> are somewhat separate though, they represent a paradigm shift similar to\n> moving from, say, hierarchical or network databases to relational ones.\n\nYeh, but this need not be so. There is no necessary conflict between\nthe requirements of RDBMS and ODBMS. Postgres plus a couple of features\nwould quite fulfill both paradigms. Why no commercial vendor seems\nto have done this very well I don't know.\n\n> The research in that area is not at all complete and it lacks a\n> standardized query language and a whole bunch of other stuff. \n\nNot really true. There IS a standard object query language called OQL,\nwhich\nis supported by some ODBMSes. OQL is basicly SQL, except you don't have\nto\nspecify WHERE criteria when it's obvious and a few bits and pieces.\nThere\nis no reason you couldn't support SQL+OQL because they don't really\ncontradict.\n\n> Since a\n> major goal of this project is moving ever closer to SQL compliance,\n> becoming an \"OODB\" is not in the near future.\n\nI would have thought what was in the near future, is whatever people\nchoose to hack on. I take it no-one is going to reject sensible patches\nalong this line?\n", "msg_date": "Fri, 28 Jan 2000 12:03:13 +1100", "msg_from": "Chris Bitmead <[email protected]>", "msg_from_op": false, "msg_subject": "Re: ORDBMS" }, { "msg_contents": "Chris Bitmead <[email protected]> writes:\n> Yes, postgres pretends that classes as datatypes work, but if I remember\n> right it doesn't work in practice.\n\nI imagine it did work, at least partly, back in the Berkeley days.\nBut as someone's already pointed out in this thread, ever since the\ncode left Berkeley the main development thrust has been on achieving\nSQL compliance (not to mention robustness). POSTQUEL had a lot of\nnon-SQL features, many of which are now suffering from bit rot...\nthis is one.\n\nFor a lot of this older stuff, there isn't even any documentation\n(that I know of) on what it's *supposed* to do, let alone on how\nthorough the original implementation was. For instance, I have\nno idea what \"classes as datatypes\" actually means, in the sense\nof what you could do with them in POSTQUEL. Anyone remember?\n\n> I would have thought what was in the near future, is whatever people\n> choose to hack on. I take it no-one is going to reject sensible patches\n> along this line?\n\nFirst problem is to figure out what it should be doing ;-). If you\ncan get consensus on that, I doubt anyone will object to making it\nwork again.\n\n\t\t\tregards, tom lane\n", "msg_date": "Thu, 27 Jan 2000 22:43:59 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: ORDBMS " }, { "msg_contents": "> Hannu Krosing wrote:\n> \n> > > You are saying that you used to be able to get full tuples from postgres\n> > > if you selected from base* ??? In other words I select * from base, and\n> > > I can get back the fields in an inherited class too?\n> > >\n> > > I have followed postgres from way back before the 'net started hacking\n> > > on it, and I've never come across this (but I desperately want it).\n> > \n> > Here is how I remember it:\n> > \n> > At least the wire protocol supports it and also libpq used to support it,\n> > until at about time of postgres95/postgreSQL it was removed from libpq as\n> > \"unneeded\" (by Bruce IIRC).\n> \n> Bruce, you scoundrel! :-)\n> \n> > until that time it should have theoretically been possible to return tuples\n> > of several types and sizes, either by using \"select * from base* \" or unions\n> > or functions in backend.\n> \n\nI have no idea what this was. I could have removed it, but I don't\nremember anything about this.\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": "Thu, 27 Jan 2000 23:48:23 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: OIDS (Re: [HACKERS] Well, then you keep your darn columns)" }, { "msg_contents": "Tom Lane wrote:\n\n> For a lot of this older stuff, there isn't even any documentation\n> (that I know of) on what it's *supposed* to do, let alone on how\n> thorough the original implementation was. For instance, I have\n> no idea what \"classes as datatypes\" actually means, in the sense\n> of what you could do with them in POSTQUEL. Anyone remember?\n\nI thought that the original berkeley doco covered this to some extent.\nBasicly I think you're supposed to be able to go...\n\nCREATE TABLE address (street TEXT, number TEXT, suburb TEXT, zip TEXT);\nCREATE TABLE person (name TEXT, address ADDRESS);\n\nSELECT name, address FROM person WHERE person.address.suburb = 'New\nYork';\n\nAnd last time I bothered to look postgresql wouldn't reject these SQL\nout of\nhand, but I don't think it works properly. You should also be able to\nwrite\nconstraints I guess for address so that it applies to any class that\nhas an address.\n\n> First problem is to figure out what it should be doing ;-). If you\n> can get consensus on that, I doubt anyone will object to making it\n> work again.\n\nHmm. My guess is the original researchers didn't do too much wrong,\nso getting the old stuff working shouldn't be too much controversy\nif it's documented in the old papers. I\nsuspect they forgot a few things (like the doubt over getting\ncolumns of sub-classes), but for that I don't think there's that much\ncontroversy, either it does it or not.\n", "msg_date": "Fri, 28 Jan 2000 16:15:36 +1100", "msg_from": "Chris Bitmead <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: ORDBMS" }, { "msg_contents": "Bruce Momjian <[email protected]> writes:\n>>>> At least the wire protocol supports it and also libpq used to support it,\n>>>> until at about time of postgres95/postgreSQL it was removed from libpq as\n>>>> \"unneeded\" (by Bruce IIRC).\n>> \n>> Bruce, you scoundrel! :-)\n>> \n>>>> until that time it should have theoretically been possible to\n>>>> return tuples of several types and sizes, either by using \"select *\n>>>> from base* \" or unions or functions in backend.\n\n> I have no idea what this was. I could have removed it, but I don't\n> remember anything about this.\n\nActually I might be the guilty party. I recall having seen that libpq\nwas willing to accept multiple T (tuple descriptor) messages\ninterspersed in the data returned by a query. But the API that libpq\npresents to the application cannot support this, and I concluded after\ndigging around in the backend that the backend couldn't do it either.\nI think I broke libpq's support for it during the rewrite for 6.4.\n\nThis is something that might have worked once upon a time, long ago\nand far away. But making it work again will take considerably more\nthan just patching libpq...\n\n\t\t\tregards, tom lane\n", "msg_date": "Fri, 28 Jan 2000 00:26:11 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: OIDS (Re: [HACKERS] Well, then you keep your darn columns) " }, { "msg_contents": "Chris Bitmead <[email protected]> writes:\n> Tom Lane wrote:\n>> For a lot of this older stuff, there isn't even any documentation\n>> (that I know of) on what it's *supposed* to do, let alone on how\n>> thorough the original implementation was.\n\n> I thought that the original berkeley doco covered this to some extent.\n\nWhere would I find that?\n\n> Basicly I think you're supposed to be able to go...\n\n> CREATE TABLE address (street TEXT, number TEXT, suburb TEXT, zip TEXT);\n> CREATE TABLE person (name TEXT, address ADDRESS);\n\n> SELECT name, address FROM person WHERE person.address.suburb = 'New\n> York';\n\nHmm. This looks like a CREATE TABLE implicitly creates a datatype\nthat acts more or less like a C 'struct' declaration, ie, it's just a\ncollection of subfields. OK, a struct-making declaration is certainly\nuseful. What I don't understand yet is whether the contents of table\n\"address\" have any connection to the data stored in table \"person\".\nIf not, why must I create a table in order to define a datatype? Seems\nlike a separate CREATE DATATYPE command would make more sense...\n\n\t\t\tregards, tom lane\n", "msg_date": "Fri, 28 Jan 2000 01:16:40 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: ORDBMS " }, { "msg_contents": "On Fri, 28 Jan 2000, Chris Bitmead wrote:\n\n> Peter Eisentraut wrote:\n> \n> > I think putting some work and thought into inheritance and making it work\n> > right would make a lot of people very happy, and inheritance is one of the\n> > major ideas behind OO in any context. Another thing to expand upon would\n> > be using classes (\"tables\") as datatypes. I believe this is doesn't work\n> > all that well. But we're surely \"ORDBMS material\", if you like.\n> \n> Yes, postgres pretends that classes as datatypes work, but if I remember\n> right it doesn't work in practice.\n> \n> > Pure object-oriented databases (which is where the oid thing comes from)\n> > are somewhat separate though, they represent a paradigm shift similar to\n> > moving from, say, hierarchical or network databases to relational ones.\n> \n> Yeh, but this need not be so. There is no necessary conflict between\n> the requirements of RDBMS and ODBMS. Postgres plus a couple of features\n> would quite fulfill both paradigms. Why no commercial vendor seems\n> to have done this very well I don't know.\n> \n> > The research in that area is not at all complete and it lacks a\n> > standardized query language and a whole bunch of other stuff. \n> \n> Not really true. There IS a standard object query language called OQL,\n> which\n> is supported by some ODBMSes. OQL is basicly SQL, except you don't have\n> to\n> specify WHERE criteria when it's obvious and a few bits and pieces.\n> There\n> is no reason you couldn't support SQL+OQL because they don't really\n> contradict.\n> \n> > Since a\n> > major goal of this project is moving ever closer to SQL compliance,\n> > becoming an \"OODB\" is not in the near future.\n> \n> I would have thought what was in the near future, is whatever people\n> choose to hack on. I take it no-one is going to reject sensible patches\n> along this line?\n\nAs long as a patch doesnt' break current functionality, definitely not\n... if implementing OOL meant removign SQL, forget it ... if it can be\nadded to augment what w already have, patch away ...\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Fri, 28 Jan 2000 10:51:36 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: ORDBMS" }, { "msg_contents": "On Fri, 28 Jan 2000, Tom Lane wrote:\n\n> Chris Bitmead <[email protected]> writes:\n> > Tom Lane wrote:\n> >> For a lot of this older stuff, there isn't even any documentation\n> >> (that I know of) on what it's *supposed* to do, let alone on how\n> >> thorough the original implementation was.\n> \n> > I thought that the original berkeley doco covered this to some extent.\n> \n> Where would I find that?\n> \n> > Basicly I think you're supposed to be able to go...\n> \n> > CREATE TABLE address (street TEXT, number TEXT, suburb TEXT, zip TEXT);\n> > CREATE TABLE person (name TEXT, address ADDRESS);\n> \n> > SELECT name, address FROM person WHERE person.address.suburb = 'New\n> > York';\n> \n> Hmm. This looks like a CREATE TABLE implicitly creates a datatype\n> that acts more or less like a C 'struct' declaration, ie, it's just a\n> collection of subfields. OK, a struct-making declaration is certainly\n> useful. What I don't understand yet is whether the contents of table\n> \"address\" have any connection to the data stored in table \"person\".\n> If not, why must I create a table in order to define a datatype? Seems\n> like a separate CREATE DATATYPE command would make more sense...\n\nNot quite an answer to your question, but my guess is that 'address\nADDRESS' would contain a pointer (OID) to the address table ... so the\nperson table would be realtively small in comparison to the address table\n...\n\nThe way I look at the above, its a 'JOIN' at table create time, based on a\nunique value, the OID ... \n\nHow 'dep' can you go with this? ie:\n\nCREATE TABLE address (street TEXT, number TEXT, suburb TEXT, zip TEXT);\nCREATE TABLE telephone ( home TEXT, business TEXT, fax TEXT );\nCREATE TABLE person (name TEXT, address ADDRESS, telephone TELEPHONE);\n\nQuestion, if I did an INSERT person VALUES ('myname');\n\nWhat happens to the address table? a row gets created with all NULL? Or?\n\nThe reason I ask is the way it was taught to me was that an RDBMS gains\nits benefit through normalization and joins ...with the outer join syntax\ncoming up, if you had a table of 'person' fully populated, but only\naddress info for 1/2 of them, you could still get all 'people', while your\n'address' table has 1/2 the tuples of the person one ... space savings ...\n\nHSorry, rambling thoughts out o fmy head without putting them together\nvery well :)\n\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Fri, 28 Jan 2000 11:02:32 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: ORDBMS " }, { "msg_contents": "The Hermit Hacker <[email protected]> writes:\n>> What I don't understand yet is whether the contents of table\n>> \"address\" have any connection to the data stored in table \"person\".\n>> If not, why must I create a table in order to define a datatype? Seems\n>> like a separate CREATE DATATYPE command would make more sense...\n\n> Not quite an answer to your question, but my guess is that 'address\n> ADDRESS' would contain a pointer (OID) to the address table ... so the\n> person table would be realtively small in comparison to the address table\n> ...\n> The way I look at the above, its a 'JOIN' at table create time, based on a\n> unique value, the OID ... \n\nHmm. OK, that makes sense, because I know I've seen places in the code\nthat think that any \"set type\" is represented as an OID. I never\nunderstood what that was all about, but in this context that would be\nwhat would happen. Assuming that this facility is the same as what\nthe code calls a set, that is.\n\nSo, if I looked into table address, presumably I'd find rows\ncorresponding to each value that is (ever has been?) stored in another\ntable with an ADDRESS column. How do no-longer-useful values get\ncleaned out of the address table, do you suppose?\n\n\t\t\tregards, tom lane\n", "msg_date": "Fri, 28 Jan 2000 10:08:16 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: ORDBMS " }, { "msg_contents": "On Fri, 28 Jan 2000, Tom Lane wrote:\n\n> The Hermit Hacker <[email protected]> writes:\n> >> What I don't understand yet is whether the contents of table\n> >> \"address\" have any connection to the data stored in table \"person\".\n> >> If not, why must I create a table in order to define a datatype? Seems\n> >> like a separate CREATE DATATYPE command would make more sense...\n> \n> > Not quite an answer to your question, but my guess is that 'address\n> > ADDRESS' would contain a pointer (OID) to the address table ... so the\n> > person table would be realtively small in comparison to the address table\n> > ...\n> > The way I look at the above, its a 'JOIN' at table create time, based on a\n> > unique value, the OID ... \n> \n> Hmm. OK, that makes sense, because I know I've seen places in the code\n> that think that any \"set type\" is represented as an OID. I never\n> understood what that was all about, but in this context that would be\n> what would happen. Assuming that this facility is the same as what\n> the code calls a set, that is.\n> \n> So, if I looked into table address, presumably I'd find rows\n> corresponding to each value that is (ever has been?) stored in another\n> table with an ADDRESS column. How do no-longer-useful values get\n> cleaned out of the address table, do you suppose?\n\nAn internal trigger? 'ON DELETE FROM person DELETE FROM address where\nOID=?' ?\n\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Fri, 28 Jan 2000 11:40:20 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: ORDBMS " }, { "msg_contents": "> Hmm. This looks like a CREATE TABLE implicitly creates a datatype\n> that acts more or less like a C 'struct' declaration, ie, it's just a\n> collection of subfields. OK, a struct-making declaration is certainly\n> useful. What I don't understand yet is whether the contents of table\n> \"address\" have any connection to the data stored in table \"person\".\n> If not, why must I create a table in order to define a datatype? Seems\n> like a separate CREATE DATATYPE command would make more sense...\n\nI'm pretty sure that they were going for symmetry between simple data\ntypes and more complex objects. Another example of this is creating an\nempty table to be inherited by other tables, just to get a common\ndefinition of fields.\n\nChris, one major reason why we run the risk of damaging the OR\nfeatures is that we don't have good coverage of these in the\nregression tests. And as Tom pointed out, we aren't sure how to get at\nthe original Postgres papers and docs which might cover this in more\ndetail; the only thing we had directly was the old Postgres95 User's\nGuide, which may not cover all of the possible features (in fact I\nknow it doesn't, since I made sure that all info in that guide\nappeared somewhere in the newer docs).\n\nI know that there are at least a few people with an interest in this\n(including me, but I'm suffering from, among other things, a lack of\nknowledge of what used to be there and what could be done). A great\nfirst step would be documenting the behaviors one would expect in a\nregression test, even if parts of that test currently fails.\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Fri, 28 Jan 2000 15:42:18 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: ORDBMS" }, { "msg_contents": "On Fri, Jan 28, 2000 at 11:02:32AM -0400, The Hermit Hacker wrote:\n> On Fri, 28 Jan 2000, Tom Lane wrote:\n> \n> > Chris Bitmead <[email protected]> writes:\n> > > Tom Lane wrote:\n> > >> For a lot of this older stuff, there isn't even any documentation\n> > >> (that I know of) on what it's *supposed* to do, let alone on how\n> > >> thorough the original implementation was.\n> > \n> > > I thought that the original berkeley doco covered this to some extent.\n> > \n> > Where would I find that?\n> > \n> > > Basicly I think you're supposed to be able to go...\n> > \n> > > CREATE TABLE address (street TEXT, number TEXT, suburb TEXT, zip TEXT);\n> > > CREATE TABLE person (name TEXT, address ADDRESS);\n> > \n> > > SELECT name, address FROM person WHERE person.address.suburb = 'New\n> > > York';\n> > \n> > Hmm. This looks like a CREATE TABLE implicitly creates a datatype\n> > that acts more or less like a C 'struct' declaration, ie, it's just a\n> > collection of subfields. OK, a struct-making declaration is certainly\n> > useful. What I don't understand yet is whether the contents of table\n> > \"address\" have any connection to the data stored in table \"person\".\n> > If not, why must I create a table in order to define a datatype? Seems\n> > like a separate CREATE DATATYPE command would make more sense...\n> \n> Not quite an answer to your question, but my guess is that 'address\n> ADDRESS' would contain a pointer (OID) to the address table ... so the\n> person table would be realtively small in comparison to the address table\n> ...\n> \n> The way I look at the above, its a 'JOIN' at table create time, based on a\n> unique value, the OID ... \n> \n\nAh, so attribute inheritance implements \"is-a\" relationships, and classes\nas datatypes implements \"has-a\"?\n\n\n> How 'dep' can you go with this? ie:\n> \n> CREATE TABLE address (street TEXT, number TEXT, suburb TEXT, zip TEXT);\n> CREATE TABLE telephone ( home TEXT, business TEXT, fax TEXT );\n> CREATE TABLE person (name TEXT, address ADDRESS, telephone TELEPHONE);\n> \n> Question, if I did an INSERT person VALUES ('myname');\n> \n> What happens to the address table? a row gets created with all NULL? Or?\n\nNothing, the address attribute for that person is NULL. At least, That's\nwhat I'd want it to do.\n\nRoss\n-- \nRoss J. Reedstrom, Ph.D., <[email protected]> \nNSBRI Research Scientist/Programmer\nComputer and Information Technology Institute\nRice University, 6100 S. Main St., Houston, TX 77005\n", "msg_date": "Fri, 28 Jan 2000 11:51:24 -0600", "msg_from": "\"Ross J. Reedstrom\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: ORDBMS" }, { "msg_contents": "Tom Lane wrote:\n\n> > I thought that the original berkeley doco covered this to some extent.\n> \n> Where would I find that?\n\nNo offence intended guys, but I'm a bit shocked that you're all hacking\non\npostgres without having read the design docs. The design docs are\nextremely cool and I'd personally like to see the database return\nto the glory days of all this cool technology, features and ideas.\n(Hey wouldn't even mind if it went back to postquel hey hey :)\n\nOk, the postgres 4.2 distribution is at \nhttp://s2k-ftp.cs.berkeley.edu:8000:8000/postgres/postgres-v4r2/\nand it has the design docs inside it.\n\nHere is a little excert from one doc...\n\n\nIn addition to the Retrieve-portal command, portals can be defined by an\nExecute\ncommand.\nFor example, suppose the EMP relation had a field of type POSTQUEL\nnamed ``hobbies''\n\nEMP (name, salary, age, hobbies)\nthat contained commands to retrieve a person's hobbies from the\nfollowing\nrelations:\nSOFTBALL (name, position, batting-avg)\nCOMPUTERS (name, isowner, brand, interest)\nAn application program can define a portal that will range over the\ntuples\ndescribing a person's hobbies as follows:\nexecute portal H(EMP.hobbies)\nwhere EMP.name = ``Smith''\nThis command defines a portal, named ``H,'' that is bound to Smith's\nhobby records.\nSince a person can have several hobbies, represented by more than on\nRetrieve\ncommand in the ``hobbies'' field, the records in the\nbuffer may have different types.\nConsequently,\nHITCHING POST must provide routines that allow the program\nto determine the number of fields, and the type, name,\nand value of each field in each record fetched into the buffer.\n", "msg_date": "Mon, 31 Jan 2000 11:11:12 +1100", "msg_from": "Chris Bitmead <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: ORDBMS" }, { "msg_contents": "Tom Lane wrote:\n\n> Hmm. This looks like a CREATE TABLE implicitly creates a datatype\n> that acts more or less like a C 'struct' declaration, ie, it's just a\n> collection of subfields. OK, a struct-making declaration is certainly\n> useful. What I don't understand yet is whether the contents of table\n> \"address\" have any connection to the data stored in table \"person\".\n> If not, why must I create a table in order to define a datatype? Seems\n> like a separate CREATE DATATYPE command would make more sense...\n\nI think the idea is like in C++ if you create a \nclass Address {\n...\n}\n\nand a class\nclass Person {\n\tAddress address;\n}\n\nThen you can create both standalone Addresses as well as addresses\nembedded\ninside the Person.\n\nCREATE DATATYPE might be a thought, but it's probably not very\nessential.\n", "msg_date": "Mon, 31 Jan 2000 11:13:35 +1100", "msg_from": "Chris Bitmead <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: ORDBMS" }, { "msg_contents": "The Hermit Hacker wrote:\n\n> Not quite an answer to your question, but my guess is that 'address\n> ADDRESS' would contain a pointer (OID) to the address table ... so the\n> person table would be realtively small in comparison to the address table\n\nI'm 99% sure that this is not the case. Rather the address is embedded\ninside\nthe person object. I think this is basicly what Oracle has done with 8i\ntoo.\nI think then if you do SELECT * from person it flattens out all the\nfields.\n(This might even still work).\n\nNot that the idea of relating to oid as another feature is bad. My last\nmessage I gave the example of how postquel could do this. I think\nthat design had the advantage that you could construct 1:M relationships\nthis way too.\n\nJust a trade off a bit like in C++\nclass Person {\n\tAddress address;\n}\n\nvs\n\nclass Person {\n\tAddress *address;\n}\n\nvs \n\nclass Person {\n\tList<Address> addresses;\n}\n\npros and cons for each one.\n\n> The way I look at the above, its a 'JOIN' at table create time, based on a\n> unique value, the OID ...\n> \n> How 'dep' can you go with this? ie:\n> \n> CREATE TABLE address (street TEXT, number TEXT, suburb TEXT, zip TEXT);\n> CREATE TABLE telephone ( home TEXT, business TEXT, fax TEXT );\n> CREATE TABLE person (name TEXT, address ADDRESS, telephone TELEPHONE);\n> \n> Question, if I did an INSERT person VALUES ('myname');\n> \n> What happens to the address table? a row gets created with all NULL? Or?\n> \n> The reason I ask is the way it was taught to me was that an RDBMS gains\n> its benefit through normalization and joins ...with the outer join syntax\n> coming up, if you had a table of 'person' fully populated, but only\n> address info for 1/2 of them, you could still get all 'people', while your\n> 'address' table has 1/2 the tuples of the person one ... space savings ...\n> \n> HSorry, rambling thoughts out o fmy head without putting them together\n> very well :)\n> \n> Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy\n> Systems Administrator @ hub.org\n> primary: [email protected] secondary: scrappy@{freebsd|postgresql}.org\n", "msg_date": "Mon, 31 Jan 2000 11:32:19 +1100", "msg_from": "Chris Bitmead <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: ORDBMS" }, { "msg_contents": "Thomas Lockhart wrote:\n\n> Chris, one major reason why we run the risk of damaging the OR\n> features is that we don't have good coverage of these in the\n> regression tests. And as Tom pointed out, we aren't sure how to get at\n> the original Postgres papers and docs which might cover this in more\n> detail; \n\nWhy not include the original Postgres papers in the postgresql \ndistribution? While it's not all applicable now, at least it would\nhelp keep in people's minds what was there.\n\n> the only thing we had directly was the old Postgres95 User's\n> Guide, which may not cover all of the possible features (in fact I\n> know it doesn't, since I made sure that all info in that guide\n> appeared somewhere in the newer docs).\n> \n> I know that there are at least a few people with an interest in this\n> (including me, but I'm suffering from, among other things, a lack of\n> knowledge of what used to be there and what could be done). A great\n> first step would be documenting the behaviors one would expect in a\n> regression test, even if parts of that test currently fails.\n> \n> - Thomas\n> \n> --\n> Thomas Lockhart [email protected]\n> South Pasadena, California\n", "msg_date": "Mon, 31 Jan 2000 11:34:36 +1100", "msg_from": "Chris Bitmead <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: ORDBMS" }, { "msg_contents": "> Tom Lane wrote:\n> \n> > > I thought that the original berkeley doco covered this to some extent.\n> > \n> > Where would I find that?\n> \n> No offence intended guys, but I'm a bit shocked that you're all hacking\n> on\n> postgres without having read the design docs. The design docs are\n> extremely cool and I'd personally like to see the database return\n> to the glory days of all this cool technology, features and ideas.\n> (Hey wouldn't even mind if it went back to postquel hey hey :)\n\nSuppy and demand. We little demand for fancy features, and huge demand\nfor SQL standard features.\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": "Sun, 30 Jan 2000 20:11:14 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: ORDBMS" }, { "msg_contents": "Bruce Momjian wrote:\n> \n> > Tom Lane wrote:\n> >\n> > > > I thought that the original berkeley doco covered this to some extent.\n> > >\n> > > Where would I find that?\n> >\n> > No offence intended guys, but I'm a bit shocked that you're all hacking\n> > on\n> > postgres without having read the design docs. The design docs are\n> > extremely cool and I'd personally like to see the database return\n> > to the glory days of all this cool technology, features and ideas.\n> > (Hey wouldn't even mind if it went back to postquel hey hey :)\n> \n> Suppy and demand. We little demand for fancy features, and huge demand\n> for SQL standard features.\n\nAnd even bigger demand for stability and speed (in this order);)\n\nOnce we have both to some high level (which we mostly have now) the demand\nfor fancyness will no doubt return.\n\n----------\nHannu\n", "msg_date": "Mon, 31 Jan 2000 12:32:53 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: ORDBMS" } ]
[ { "msg_contents": "\n> > Couldn't we test some of these parameters inside configure and set\n> > them there?\n> \n> If we could figure out a reasonably cheap way of estimating these\n> numbers, it'd be worth setting up custom values at installation time.\n\nImho this whole idea is not so good. (Sorry)\n\nMy points are:\n1. even if it is good for an optimizer to be smart,\n\tit is even more important, that it is predictable\n2. I compile on test machine, production is completely different\n\t(more processors, faster disks and controllers)\n\nAndreas\n", "msg_date": "Mon, 24 Jan 2000 18:58:02 +0100", "msg_from": "Zeugswetter Andreas SB <[email protected]>", "msg_from_op": true, "msg_subject": "AW: [HACKERS] Some notes on optimizer cost estimates " }, { "msg_contents": "Zeugswetter Andreas SB <[email protected]> writes:\n> My points are:\n> 1. even if it is good for an optimizer to be smart,\n> \tit is even more important, that it is predictable\n\nA good point indeed. And unless we find that there is a huge range in\nthe ratios across different machines, we'd be wasting our time trying to\ncalibrate the numbers for a particular machine --- we could just as well\nuse an average value. The optimizer has many other, far worse, sources\nof error than that.\n\n> 2. I compile on test machine, production is completely different\n> \t(more processors, faster disks and controllers)\n\nIn practice we'd do this at initdb time, not configure time, so I'm\nnot sure that that's really an issue. But your other point is\nwell taken.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 24 Jan 2000 13:17:57 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: [HACKERS] Some notes on optimizer cost estimates " }, { "msg_contents": "At 13:17 24/01/00 -0500, Tom Lane wrote:\n>Zeugswetter Andreas SB <[email protected]> writes:\n>> My points are:\n>> 1. even if it is good for an optimizer to be smart,\n>> \tit is even more important, that it is predictable\n>\n>A good point indeed. And unless we find that there is a huge range in\n>the ratios across different machines, we'd be wasting our time trying to\n>calibrate the numbers for a particular machine --- we could just as well\n>use an average value. The optimizer has many other, far worse, sources\n>of error than that.\n>\n>> 2. I compile on test machine, production is completely different\n>> \t(more processors, faster disks and controllers)\n>\n>In practice we'd do this at initdb time, not configure time, so I'm\n>not sure that that's really an issue. But your other point is\n>well taken.\n\nI would guess it would become an issue if a server is upgraded (better/more\ndisks, faster CPU etc). This could be fixed by storing the optimizer\nsettings in a system table in the DB, and reading them the first time a\nbackend opens it. Just an idea.\n\nIf you *do* go with the 'store them in the DB' solution, then you also need\nto provide an way of updating them (SQL, presumably), and a utility to\nrefresh them based on the current hardware.\n\nWhat this then amounts to is 'hand-tuning' of optimizer settings, which is\nan old chestnut that I would like to see reconsidered - sometimes, for\nspecific important queries, it is very good to be able to tell the DB how\nto go about satisfying the query (or at least, what join order to use and\nwhich indices to scan). Is this so far removed from the above,\nphilosophically? Is it worth considering?\n\n\nBye for now,\n\nPhilip Warner.\n\n----------------------------------------------------------------\nPhilip Warner | __---_____\nAlbatross Consulting Pty. Ltd. |----/ - \\\n(A.C.N. 008 659 498) | /(@) ______---_\nTel: +61-03-5367 7422 | _________ \\\nFax: +61-03-5367 7430 | ___________ |\nHttp://www.rhyme.com.au | / \\|\n | --________--\nPGP key available upon request, | /\nand from pgp5.ai.mit.edu:11371 |/\n", "msg_date": "Tue, 25 Jan 2000 10:00:05 +1100", "msg_from": "Philip Warner <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: [HACKERS] Some notes on optimizer cost estimates " }, { "msg_contents": "On 2000-01-24, Zeugswetter Andreas SB mentioned:\n\n> \n> > > Couldn't we test some of these parameters inside configure and set\n> > > them there?\n> > \n> > If we could figure out a reasonably cheap way of estimating these\n> > numbers, it'd be worth setting up custom values at installation time.\n> \n> Imho this whole idea is not so good. (Sorry)\n> \n> My points are:\n> 1. even if it is good for an optimizer to be smart,\n> \tit is even more important, that it is predictable\n\nISTM that by the nature of things the most important capability of an\noptimizer is to yield optimal results. This, however, does not have to be\nmutually exclusive with predictability. If you estimate some CPU and disk\nparameters and write them into a config file, then you can always give\nthis config file to a bug fixer. It will still work on his machine, just\nless than optimally.\n\n> 2. I compile on test machine, production is completely different\n> \t(more processors, faster disks and controllers)\n\nYou're completely right. This has no place in configure. It will have to\nbe a separate tool which you can run after building and installing.\n\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Wed, 26 Jan 2000 00:16:01 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: [HACKERS] Some notes on optimizer cost estimates " }, { "msg_contents": "At 12:16 AM 1/26/00 +0100, Peter Eisentraut wrote:\n>On 2000-01-24, Zeugswetter Andreas SB mentioned:\n\n>> My points are:\n>> 1. even if it is good for an optimizer to be smart,\n>> \tit is even more important, that it is predictable\n>\n>ISTM that by the nature of things the most important capability of an\n>optimizer is to yield optimal results.\n\nOne problem, though, is that the optimization problem's even more\nintractable for database systems than it is for compilers. Large and\ngrowing database installations go through an evolutionary process of\nadding memory, spindles, partioning of data, etc. Changing from the\n\"-B\" default to \"-B 2000\", as I've done on my web site, causes the\ndatabase to live in shared memory even when other activity on the\nsystem would tend to cause some of it to be flushed from the filesystem\ncache. This changes how long, on average, it takes to read a block.\n\nAnd the first time a table's referenced is always going to take longer\nthan subsequent references if there's caching involved...so in \ntheory the optimizer should take that into account if it makes presumptions\nabout cache hit ratios.\n\nSo forth and so forth.\n\nI'm not disagreeing in the least with the spirit of your comment. There\nare all sorts of practical barriers...\n\nThankfully, for the particular problem of choosing between and index\nvs. sequential scan, the optimizer only has two choices to make. Thus\na rough-and-ready heuristic based on certain assumptions might work well,\nwhich is essentially what the optimizer does today. In fact, it does\nwork quite well, come to think of it!\n\nFiddling the numbers underlying the assumptions may be good enough for\nthis task.\n\n> This, however, does not have to be\n>mutually exclusive with predictability. If you estimate some CPU and disk\n>parameters and write them into a config file, then you can always give\n>this config file to a bug fixer. It will still work on his machine, just\n>less than optimally.\n>\n>> 2. I compile on test machine, production is completely different\n>> \t(more processors, faster disks and controllers)\n>\n>You're completely right. This has no place in configure. It will have to\n>be a separate tool which you can run after building and installing.\n\nBased perhaps on statistics gathered while the system is running...\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Tue, 25 Jan 2000 15:38:04 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: [HACKERS] Some notes on optimizer cost estimates " } ]
[ { "msg_contents": "At 12:00 PM 1/24/00 +0100, Zeugswetter Andreas SB wrote:\n\n>IMHO, if there exists a from clause, we could insist,\n>that all tables are listed (no implicitly added table),\n>since it is really too error prone.\n>\n>What I would not like to see removed is the ability to \n>avoid the from clause alltogether. Like in:\n>\n>select xor.eval;\n\nYeah...in porting the arsDigita Community System over from \nOracle, we created a dummy table called \"dual\" because of\nthe clunky Oracle-ism involving that table.\n\nIn other words, in Oracle you can't say:\n\nselect sydate();\n\nbecause you must have a \"from\" clause. By convention you\nuse a dummy built-in table called \"dual\" which has one row:\n\nselect sysdate() from dual;\n\nUgh. I agree that being able to exclude the from clause\naltogether is nice.\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Mon, 24 Jan 2000 10:56:05 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] column aliases " }, { "msg_contents": "> At 12:00 PM 1/24/00 +0100, Zeugswetter Andreas SB wrote:\n> \n> >IMHO, if there exists a from clause, we could insist,\n> >that all tables are listed (no implicitly added table),\n> >since it is really too error prone.\n> >\n> >What I would not like to see removed is the ability to \n> >avoid the from clause alltogether. Like in:\n> >\n> >select xor.eval;\n> \n> Yeah...in porting the arsDigita Community System over from \n> Oracle, we created a dummy table called \"dual\" because of\n> the clunky Oracle-ism involving that table.\n> \n> In other words, in Oracle you can't say:\n> \n> select sydate();\n> \n> because you must have a \"from\" clause. By convention you\n> use a dummy built-in table called \"dual\" which has one row:\n> \n> select sysdate() from dual;\n> \n> Ugh. I agree that being able to exclude the from clause\n> altogether is nice.\n\nYes, with INFORMIX, we use 'tab1' as a one-row table.\n\nThe cool part is SELECT pg_class.* is the same as SELECT * FROM\npg_class.\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": "Mon, 24 Jan 2000 14:29:29 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] column aliases" } ]
[ { "msg_contents": "At 03:51 PM 1/24/00 +0100, Peter Eisentraut wrote:\n\n>9) What really gets me though is what your problem is. This is a nearly\n>SQL-compliant implementation of a very important feature.\n\nReally? Dropping constraints fits the definition of \"nearly compliant\"?\nNot sure I'd agree with that. It makes it fairly useless for a very wide\nrange\nof users coming from a commercial db environment, because such users tend\nto use referential integrity very heavily.\n\nRegarding the rest of your note, I should hope that what's clear is that\nfolks don't really have a beef with your stepping up to the plate to\nimplement an important feature, but rather the fait-accompli approach\nyou took rather than raising the issue for discussion beforehand.\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Mon, 24 Jan 2000 11:09:53 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns" }, { "msg_contents": "> At 03:51 PM 1/24/00 +0100, Peter Eisentraut wrote:\n> \n> >9) What really gets me though is what your problem is. This is a nearly\n> >SQL-compliant implementation of a very important feature.\n> \n> Really? Dropping constraints fits the definition of \"nearly compliant\"?\n> Not sure I'd agree with that. It makes it fairly useless for a very wide\n> range\n> of users coming from a commercial db environment, because such users tend\n> to use referential integrity very heavily.\n> \n> Regarding the rest of your note, I should hope that what's clear is that\n> folks don't really have a beef with your stepping up to the plate to\n> implement an important feature, but rather the fait-accompli approach\n> you took rather than raising the issue for discussion beforehand.\n\nMaybe I am to blame for this. He asked on the list in November, and I\ntold him to do it the way he did it. I did not mention anything about\noids or constraints, and suggested a \"something is better than nothing\"\napproach to the problem.\n\nSeems most people do not agree with that suggestion I made.\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": "Mon, 24 Jan 2000 14:25:34 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns" } ]
[ { "msg_contents": "All the databases that I've worked on (that actually have the ability to\ndrop columns) generate an error if the column to be dropped is part of a\nkey, and I think that is sound behaviour.\n\nMikeA\n\n\n-----Original Message-----\nFrom: Ed Loehr\nTo: Tom Lane\nCc: Hiroshi Inoue; Peter Eisentraut; [email protected]\nSent: 00/01/24 08:13\nSubject: Re: [HACKERS] Well, then you keep your darn columns\n\nTom Lane wrote:\n\n> Let's see: DROP COLUMN would have to mark the column invisible, remove\n> any associated constraints (particularly NOT NULL) and indexes, and\n> it'd be done. The parser would then have to ignore the column when\n> doing column name lookups or expansion of '*', and it would have to\n> insert a NULL value for the column when transforming INSERT or UPDATE.\n> And that'd be just about it. I like it.\n\nHow would you handle multi-column indices that included the column\nbeing dropped? E.g.,\n\n\tcreate unique index foobar on mytable(foo,bar);\n\nwhere the 'bar' column is then dropped...\n\nDropping all of that index would seem to be problematic.\n\nCheers,\nEd Loehr\n\n************\n", "msg_date": "Mon, 24 Jan 2000 23:39:27 +0200", "msg_from": "\"Ansley, Michael\" <[email protected]>", "msg_from_op": true, "msg_subject": "RE: [HACKERS] Well, then you keep your darn columns" } ]
[ { "msg_contents": "If I don't hear loud hollers very soon, I'm going to eliminate the\nDISTINCT ON \"feature\" for 7.0. As previously discussed, this feature\nis not standard SQL and has no clear semantic interpretation.\n\nI hadn't been planning to touch DISTINCT before 7.0, but changed my\nmind when I noticed this little gem:\n\ncreate table foo1 (f1 int, f2 int, f3 int);\ninsert into foo1 values(1,2,3);\ninsert into foo1 values(1,2,null);\ninsert into foo1 values(1,null,2);\ninsert into foo1 values(1,2,4);\ninsert into foo1 values(1,2,4);\n\nselect * from foo1;\n f1 | f2 | f3\n----+----+----\n 1 | 2 | 3\n 1 | 2 |\n 1 | | 2\n 1 | 2 | 4\n 1 | 2 | 4\n(5 rows)\n\nselect distinct * from foo1;\n f1 | f2 | f3\n----+----+----\n 1 | 2 | 3\n 1 | 2 | 4\n 1 | 2 |\n(3 rows)\n\nDidn't know that (NULL, 2) == (2, NULL), did you? The problem here\nis that nodeUnique is doing a bitwise comparison of the tuple contents\n(which is bad enough --- not all datatypes think equality is bitwise),\nand it's neglecting to include the null-field bitmap in what it\ncompares. Rather than just band-aid the null-field problem, I'm\ngoing to fix it right. As long as I have to touch it, I'll deal\nwith DISTINCT ON too.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 24 Jan 2000 20:50:15 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "DISTINCT ON: speak now or forever hold your peace" }, { "msg_contents": "Tom Lane wrote:\n> \n> If I don't hear loud hollers very soon, I'm going to eliminate the\n> DISTINCT ON \"feature\" for 7.0. As previously discussed, this feature\n> is not standard SQL and has no clear semantic interpretation.\n\nI don't feel overly strongly about this, but if I remember right you can\ndo some pretty cool things with this feature, provided you do define\nsome semantics clearly. Like I think you can find the first tuple\n(given some ORDER BY clause) that fulfills some criteria. I think it is\n\nSELECT DISTINCT ON name name, age ORDER BY age;\n\nwill get the youngest person. This might not be clearly specified now,\nbut\nas long as it's useful, how about clearly defining it? I don't know that\nthere is an easy way of doing this in standard SQL. I don't see any\nproblems with useful extensions to SQL. If people want standards, they\ndon't have to use it.\n", "msg_date": "Tue, 25 Jan 2000 13:41:25 +1100", "msg_from": "Chris Bitmead <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace" }, { "msg_contents": "Tom Lane wrote:\n> \n> If I don't hear loud hollers very soon, I'm going to eliminate the\n> DISTINCT ON \"feature\" for 7.0. As previously discussed, this feature\n> is not standard SQL and has no clear semantic interpretation.\n> \n\nI grepped our source code and found this query:\n\nINSERT INTO temp_sales\nSELECT DISTINCT on key supplysources.supplysource, \nincharges.supply, targets.target, incharges.saledate, \nincharges.supplyunit, '', incharges.quantity, incharges.company, \nincharges.costcntr, 'Replenish', incharges.price, '','','', 0, \ntext(supplysources.supplysource)||\ntext(incharges.supply)||\ntext(targets.target)||\ntext(incharges.saledate) as key \nFROM supplysources, incharges, targets WHERE \nsupplysources.warehouse = incharges.warehouse AND \n(targets.site,targets.area) = (incharges.site,incharges.area);\n\nWhat happens is that a large charges file which is transferred to\na mainframe ERP application is first brought into PostgreSQL.\nDepending upon certain race conditions, duplicate \"sales\" records\ncan appear in the data file. We use DISTINCT ON to pick (as you\npoint out) an arbitrary record when duplicates appear. I suppose\nwe could do a DELETE ... WHERE NOT EXISTS after the import. Using\nDISTINCT ON just saves a step. I don't have any arguments beyond\nthe grounds that we're using it in existing code as a duplicate\nrecord filter - :-(\n\nJust FYI, \n\nMike Mascari\n", "msg_date": "Mon, 24 Jan 2000 21:50:45 -0500", "msg_from": "Mike Mascari <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace" }, { "msg_contents": "At 13:41 25/01/00 +1100, Chris Bitmead wrote:\n>Tom Lane wrote:\n>> \n>> If I don't hear loud hollers very soon, I'm going to eliminate the\n>> DISTINCT ON \"feature\" for 7.0. As previously discussed, this feature\n>> is not standard SQL and has no clear semantic interpretation.\n>\n>I don't feel overly strongly about this, but if I remember right you can\n>do some pretty cool things with this feature, provided you do define\n>some semantics clearly. Like I think you can find the first tuple\n>(given some ORDER BY clause) that fulfills some criteria. I think it is\n>\n>SELECT DISTINCT ON name name, age ORDER BY age;\n>\n>will get the youngest person. This might not be clearly specified now,\n>but\n>as long as it's useful, how about clearly defining it? I don't know that\n>there is an easy way of doing this in standard SQL. \n\nI don't know about PGSQL, but in other systems, I use:\n\n Select <whatever> from <wherever> order by age asc limit to 1 row;\n\nI *think* the PGSQL syntax is:\n\n Select <whatever> from <wherever> order by age asc limit 1;\n\nI have no idea if the optimizer does 'fast first' optimizations, so I don't\nknow how quick this would be on a large table.\n\n\n\n----------------------------------------------------------------\nPhilip Warner | __---_____\nAlbatross Consulting Pty. Ltd. |----/ - \\\n(A.C.N. 008 659 498) | /(@) ______---_\nTel: +61-03-5367 7422 | _________ \\\nFax: +61-03-5367 7430 | ___________ |\nHttp://www.rhyme.com.au | / \\|\n | --________--\nPGP key available upon request, | /\nand from pgp5.ai.mit.edu:11371 |/\n", "msg_date": "Tue, 25 Jan 2000 14:03:49 +1100", "msg_from": "Philip Warner <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace" }, { "msg_contents": "> INSERT INTO temp_sales\n> SELECT DISTINCT on key supplysources.supplysource, \n> incharges.supply, targets.target, incharges.saledate, \n> incharges.supplyunit, '', incharges.quantity, incharges.company, \n> incharges.costcntr, 'Replenish', incharges.price, '','','', 0, \n> text(supplysources.supplysource)||\n> text(incharges.supply)||\n> text(targets.target)||\n> text(incharges.saledate) as key \n> FROM supplysources, incharges, targets WHERE \n> supplysources.warehouse = incharges.warehouse AND \n> (targets.site,targets.area) = (incharges.site,incharges.area);\n> \n> What happens is that a large charges file which is transferred to\n> a mainframe ERP application is first brought into PostgreSQL.\n> Depending upon certain race conditions, duplicate \"sales\" records\n> can appear in the data file. We use DISTINCT ON to pick (as you\n> point out) an arbitrary record when duplicates appear. I suppose\n> we could do a DELETE ... WHERE NOT EXISTS after the import. Using\n> DISTINCT ON just saves a step. I don't have any arguments beyond\n> the grounds that we're using it in existing code as a duplicate\n> record filter - :-(\n\nWhy not just throw a NOTICE and keep the feature.\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": "Mon, 24 Jan 2000 22:09:42 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace" }, { "msg_contents": "Philip Warner wrote:\n> >I don't feel overly strongly about this, but if I remember right you can\n> >do some pretty cool things with this feature, provided you do define\n> >some semantics clearly. Like I think you can find the first tuple\n> >(given some ORDER BY clause) that fulfills some criteria. I think it is\n> >\n> >SELECT DISTINCT ON name name, age ORDER BY age;\n> >\n> >will get the youngest person. This might not be clearly specified now,\n> >but\n> >as long as it's useful, how about clearly defining it? I don't know that\n> >there is an easy way of doing this in standard SQL.\n> \n> I don't know about PGSQL, but in other systems, I use:\n> \n> Select <whatever> from <wherever> order by age asc limit to 1 row;\n> \n> I *think* the PGSQL syntax is:\n> \n> Select <whatever> from <wherever> order by age asc limit 1;\n\nI think what I really meant was...\n\nSELECT DISTINCT ON firstname firstname, age ORDER BY age.\n\nWhich would find the youngest person called \"fred\", the youngest person\ncalled \"paul\", the youngest person called \"jim\" etc etc. which your\nlimit example wouldn't do.\n", "msg_date": "Tue, 25 Jan 2000 14:09:50 +1100", "msg_from": "Chris Bitmead <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace" }, { "msg_contents": "Chris Bitmead <[email protected]> writes:\n> Tom Lane wrote:\n>> If I don't hear loud hollers very soon, I'm going to eliminate the\n>> DISTINCT ON \"feature\" for 7.0. As previously discussed, this feature\n>> is not standard SQL and has no clear semantic interpretation.\n\n> I don't feel overly strongly about this, but if I remember right you can\n> do some pretty cool things with this feature, provided you do define\n> some semantics clearly.\n\nWe did talk about that, but I didn't hear any strong support for doing\nit, as opposed to pulling the feature completely... in particular,\nI didn't hear anyone volunteering to do the work...\n\n> as long as it's useful, how about clearly defining it? I don't know that\n> there is an easy way of doing this in standard SQL. I don't see any\n> problems with useful extensions to SQL.\n\nThe only reason it came to my notice in the first place was people\nposting questions asking why they weren't getting the results they\nexpected from it (whatever the heck those were; they weren't what you\nactually get from the current implementation, anyway). The problem\nwith a poorly-specified nonstandard feature is support costs: you\nhave to document it, answer questions about it, keep it working, etc.\nIn this case we'd also have to define how it should work and alter\nthe existing code to produce reasonable and predictable results. The\nexisting code is not merely unpredictable, it is definitely broken.\nFor example:\n\nregression=# select q1,q2 from int8_tbl;\n q1 | q2\n------------------+-------------------\n 123 | 456\n 123 | 4567890123456789\n 4567890123456789 | 123\n 4567890123456789 | 4567890123456789\n 4567890123456789 | -4567890123456789\n(5 rows)\n\nregression=# select distinct on q1 q1,q2 from int8_tbl;\n q1 | q2\n------------------+-----\n 123 | 456\n 4567890123456789 | 123\n(2 rows)\n\n-- OK so far, but:\n\nregression=# select distinct on q1 q1,q2 from int8_tbl order by q2;\n q1 | q2\n------------------+-------------------\n 4567890123456789 | -4567890123456789\n 123 | 456\n 4567890123456789 | 4567890123456789\n(3 rows)\n\n-- which is not \"distinct on q1\" by my notions...\n\n\nIn short, it's not clear to me that supporting DISTINCT ON is a good use\nof our limited resources. I'm willing to pull it out, but not to fix it.\nDoes someone else want to take responsibility for it?\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 24 Jan 2000 22:45:49 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace " }, { "msg_contents": "> In short, it's not clear to me that supporting DISTINCT ON is a good use\n> of our limited resources. I'm willing to pull it out, but not to fix it.\n> Does someone else want to take responsibility for it?\n\nOK, we can disable it and put it on the TODO list. It is already there.\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": "Mon, 24 Jan 2000 22:55:02 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace" }, { "msg_contents": "Hi,\n\nThis morning when I was inserting data to a table, after 15 minutes\nrunning,\nI received this\n\nERROR: cannot flush block 9782 of tbs_billing_record to stable store.\n\nWhat does it mean?\n\nRegards,\nChai\n", "msg_date": "Tue, 25 Jan 2000 11:03:32 +0700", "msg_from": "Chairudin Sentosa Harjo <[email protected]>", "msg_from_op": false, "msg_subject": "Cannot flush block 9782" }, { "msg_contents": "At 14:09 25/01/00 +1100, Chris Bitmead wrote:\n>Philip Warner wrote:\n>> >I don't feel overly strongly about this, but if I remember right you can\n>> >do some pretty cool things with this feature, provided you do define\n>> >some semantics clearly. Like I think you can find the first tuple\n>> >(given some ORDER BY clause) that fulfills some criteria. I think it is\n>> >\n>> >SELECT DISTINCT ON name name, age ORDER BY age;\n>> >\n>> >will get the youngest person. This might not be clearly specified now,\n>> >but\n>> >as long as it's useful, how about clearly defining it? I don't know that\n>> >there is an easy way of doing this in standard SQL.\n>> \n>> I don't know about PGSQL, but in other systems, I use:\n>> \n>> Select <whatever> from <wherever> order by age asc limit to 1 row;\n>> \n>> I *think* the PGSQL syntax is:\n>> \n>> Select <whatever> from <wherever> order by age asc limit 1;\n>\n>I think what I really meant was...\n>\n>SELECT DISTINCT ON firstname firstname, age ORDER BY age.\n>\n>Which would find the youngest person called \"fred\", the youngest person\n>called \"paul\", the youngest person called \"jim\" etc etc. which your\n>limit example wouldn't do.\n\nJust a thought, but would I be right in saying that this could be easily\ndone with the addition of a new aggregate function 'FIRST', which simply\nreturns the first value sent to it? Since the aggregates operate a row at a\ntime, you are guaranteed a consistent set of values, I think.\n\neg.\n\n SELECT firstname, FIRST(age) ORDER BY age.\n\nJust an idea, but it seems like a cute solution for the more general problem.\n\n\n----------------------------------------------------------------\nPhilip Warner | __---_____\nAlbatross Consulting Pty. Ltd. |----/ - \\\n(A.C.N. 008 659 498) | /(@) ______---_\nTel: +61-03-5367 7422 | _________ \\\nFax: +61-03-5367 7430 | ___________ |\nHttp://www.rhyme.com.au | / \\|\n | --________--\nPGP key available upon request, | /\nand from pgp5.ai.mit.edu:11371 |/\n", "msg_date": "Tue, 25 Jan 2000 15:05:57 +1100", "msg_from": "Philip Warner <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace" }, { "msg_contents": "Philip Warner <[email protected]> writes:\n> Just a thought, but would I be right in saying that this could be easily\n> done with the addition of a new aggregate function 'FIRST', which simply\n> returns the first value sent to it? Since the aggregates operate a row at\n> a time, you are guaranteed a consistent set of values, I think.\n\nNo, because the system doesn't guarantee to deliver tuples to the\naggregate in any particular order. The physical order of tuples\non the disk will depend on the order in which they were last updated\n(plus random perturbations introduced by VACUUM); and the order in\nwhich they are processed by a query will depend on the query plan\nchosen by the planner (sequential scan vs. indexscan, etc).\nSQL in general doesn't believe that tuple ordering has any semantic\nsignificance --- you can ask for ORDER BY, but that's only honored\nat the end stage of SELECT result delivery, not necessarily anywhere\nin the bowels of a query.\n\nAlso, if you are going to use an aggregate, ISTM you might as well\nuse one like MIN() or MAX() and get a fully predictable result.\nI suppose a FIRST() aggregate would save a few cycles by not running\ncomparisons, but I bet it'd be tough to notice any difference.\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 25 Jan 2000 00:01:10 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace " }, { "msg_contents": "At 12:01 AM 1/25/00 -0500, Tom Lane wrote:\n>Philip Warner <[email protected]> writes:\n>> Just a thought, but would I be right in saying that this could be easily\n>> done with the addition of a new aggregate function 'FIRST', which simply\n>> returns the first value sent to it? Since the aggregates operate a row at\n>> a time, you are guaranteed a consistent set of values, I think.\n>\n>No, because the system doesn't guarantee to deliver tuples to the\n>aggregate in any particular order.\n\nIn fact, this is a KEY notion behind RDBMS systems...queries return an\nunordered set, pure and simple, unless you supply an \"order\" clause\n(though \"group by\" appears to be implemented by ordering in various \nRDBMS systems, that's an efficiency hack not a given AFAIK).\n\n>SQL in general doesn't believe that tuple ordering has any semantic\n>significance --- you can ask for ORDER BY, but that's only honored\n>at the end stage of SELECT result delivery, not necessarily anywhere\n>in the bowels of a query.\n\nYep...\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Mon, 24 Jan 2000 21:20:22 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your\n peace" }, { "msg_contents": "At 21:20 24/01/00 -0800, Don Baccus wrote:\n>At 12:01 AM 1/25/00 -0500, Tom Lane wrote:\n>>Philip Warner <[email protected]> writes:\n>>> Just a thought, but would I be right in saying that this could be easily\n>>> done with the addition of a new aggregate function 'FIRST', which simply\n>>> returns the first value sent to it? Since the aggregates operate a row at\n>>> a time, you are guaranteed a consistent set of values, I think.\n>>\n>>No, because the system doesn't guarantee to deliver tuples to the\n>>aggregate in any particular order.\n>\n>In fact, this is a KEY notion behind RDBMS systems...queries return an\n>unordered set, pure and simple, unless you supply an \"order\" clause\n>(though \"group by\" appears to be implemented by ordering in various \n>RDBMS systems, that's an efficiency hack not a given AFAIK).\n\nThat's why there was an 'order by' in the query (there should have also\nbeen a 'group by', to make it valid SQL). I had (naievely) assumed that the\naggregates would be passed the rows in sorted order.\n\n>>SQL in general doesn't believe that tuple ordering has any semantic\n>>significance --- you can ask for ORDER BY, but that's only honored\n>>at the end stage of SELECT result delivery, not necessarily anywhere\n>>in the bowels of a query.\n>\n>Yep...\n>\n\nOut of curiosity, does the SQL spec give any rules or guidelines about when\naggregates should be applied to resultant rows? Or is it one of the\nimplementation-dependant things?\n\n\n\n----------------------------------------------------------------\nPhilip Warner | __---_____\nAlbatross Consulting Pty. Ltd. |----/ - \\\n(A.C.N. 008 659 498) | /(@) ______---_\nTel: +61-03-5367 7422 | _________ \\\nFax: +61-03-5367 7430 | ___________ |\nHttp://www.rhyme.com.au | / \\|\n | --________--\nPGP key available upon request, | /\nand from pgp5.ai.mit.edu:11371 |/\n", "msg_date": "Tue, 25 Jan 2000 17:00:26 +1100", "msg_from": "Philip Warner <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your\n peace" }, { "msg_contents": "Philip Warner wrote:\n\n> >In fact, this is a KEY notion behind RDBMS systems...queries return an\n> >unordered set, pure and simple, unless you supply an \"order\" clause\n> >(though \"group by\" appears to be implemented by ordering in various\n> >RDBMS systems, that's an efficiency hack not a given AFAIK).\n\nOn second thoughts, maybe I agree DISTINCT ON should be dumped. In my\nexample, if I wanted the youngest people with a given name sorted oldest\nfirst things would be confusing. It's an inconsistant command, I can see\nthat now.\n", "msg_date": "Tue, 25 Jan 2000 17:07:03 +1100", "msg_from": "Chris Bitmead <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace" }, { "msg_contents": "Philip Warner <[email protected]> writes:\n>>> SQL in general doesn't believe that tuple ordering has any semantic\n>>> significance --- you can ask for ORDER BY, but that's only honored\n>>> at the end stage of SELECT result delivery, not necessarily anywhere\n>>> in the bowels of a query.\n\n> Out of curiosity, does the SQL spec give any rules or guidelines about when\n> aggregates should be applied to resultant rows? Or is it one of the\n> implementation-dependant things?\n\nWell, SQL's conceptual model is perfectly clear about the processing\nwork flow of a SELECT: after you've constructed the tuple set (which\nmight involve joining multiple relations), you apply the WHERE condition\nto filter out uninteresting tuples. Then you apply GROUP BY (if given)\nto divvy the tuples into groups. Then you apply HAVING to eliminate\nuninteresting groups. Then you apply aggregate functions (if any) to\nindividual groups, or to the whole filtered result set if no groups.\nFinally you apply ORDER BY to whatever's left.\n\nNote that at no point except the final output is there any notion\nof the tuples being generated or processed in a particular order.\nGiven appropriate hardware, much of this could be done in parallel.\nParallel or not, an implementation is free to choose the processing\norder for its convenience.\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 25 Jan 2000 01:12:46 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace " }, { "msg_contents": "On Mon, Jan 24, 2000 at 10:55:02PM -0500, Bruce Momjian wrote:\n> > In short, it's not clear to me that supporting DISTINCT ON is a good use\n> > of our limited resources. I'm willing to pull it out, but not to fix it.\n> > Does someone else want to take responsibility for it?\n> \n> OK, we can disable it and put it on the TODO list. It is already there.\n\nOr, as you suggested earlier, throw a NOTICE instead of disabling it. But\nthen I doubt Tom talked about physically removing the code anyway. Disabling\ncertainly is enough.\n\nMichael\n-- \nMichael Meskes | Go SF 49ers!\nTh.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire!\nTel.: (+49) 2431/72651 | Use Debian GNU/Linux!\nEmail: [email protected] | Use PostgreSQL!\n", "msg_date": "Tue, 25 Jan 2000 08:12:36 +0100", "msg_from": "Michael Meskes <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace" }, { "msg_contents": "Tom Lane wrote:\n\n> Chris Bitmead <[email protected]> writes:\n> > Tom Lane wrote:\n> >> If I don't hear loud hollers very soon, I'm going to eliminate the\n> >> DISTINCT ON \"feature\" for 7.0. As previously discussed, this feature\n> >> is not standard SQL and has no clear semantic interpretation.\n>\n> > I don't feel overly strongly about this, but if I remember right you can\n> > do some pretty cool things with this feature, provided you do define\n> > some semantics clearly.\n>\n> We did talk about that, but I didn't hear any strong support for doing\n> it, as opposed to pulling the feature completely... in particular,\n> I didn't hear anyone volunteering to do the work...\n\nI've been using DISTINCT to fix things when vacuum gets into a mess (yes, it\nhappened again last night,\nFATAL 1: VACUUM (vc_rpfheap): BlowawayRelationBuffers returned -2\n). I then have loads of duplicates in a table and by doing a SELECT DISTINCT\n... INTO ... I can get rid of them. A few table renames later I'm back in\nbusiness. So how do I do this without DISTINCT?\n\nBetter would be of course to get rid of the BlowawayRelationBuffers problem.\nI cannot reproduce it yet, but I think I can make it happen by running vacuum\nand updating tables that are linked by triggers. Does this sound plausible?\nAnd yes, I'm running on Alpha, i.e. 64 bits.\n\nAdriaan\n\n", "msg_date": "Tue, 25 Jan 2000 07:15:41 +0000", "msg_from": "Adriaan Joubert <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace" }, { "msg_contents": "Adriaan Joubert <[email protected]> writes:\n> I've been using DISTINCT to fix things when vacuum gets into a mess (yes, it\n> happened again last night,\n> FATAL 1: VACUUM (vc_rpfheap): BlowawayRelationBuffers returned -2\n> ). I then have loads of duplicates in a table and by doing a SELECT DISTINCT\n> ... INTO ... I can get rid of them. A few table renames later I'm back in\n> business. So how do I do this without DISTINCT?\n\nI didn't say anything about eliminating SELECT DISTINCT; I was talking\nabout SELECT DISTINCT ON, which is a whole 'nother thing.\n\n> Better would be of course to get rid of the BlowawayRelationBuffers problem.\n\nQuite so. I think this is fixed for 7.0 ... that error message\nindicates a buffer refcount leak, and I fixed several problems\nalong that line a couple months ago. We shall see if I got 'em\nall or not ...\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 25 Jan 2000 02:45:17 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace " }, { "msg_contents": "At 01:12 25/01/00 -0500, Tom Lane wrote:\n>Philip Warner <[email protected]> writes:\n>>>> SQL in general doesn't believe that tuple ordering has any semantic\n>>>> significance --- you can ask for ORDER BY, but that's only honored\n>>>> at the end stage of SELECT result delivery, not necessarily anywhere\n>>>> in the bowels of a query.\n>\n>> Out of curiosity, does the SQL spec give any rules or guidelines about when\n>> aggregates should be applied to resultant rows? Or is it one of the\n>> implementation-dependant things?\n>\n>Well, SQL's conceptual model is perfectly clear about the processing\n>work flow of a SELECT: after you've constructed the tuple set (which\n>might involve joining multiple relations), you apply the WHERE condition\n>to filter out uninteresting tuples. Then you apply GROUP BY (if given)\n>to divvy the tuples into groups. Then you apply HAVING to eliminate\n>uninteresting groups. Then you apply aggregate functions (if any) to\n>individual groups, or to the whole filtered result set if no groups.\n>Finally you apply ORDER BY to whatever's left.\n\nThanks, but now I'm confused. I would have thought that aggregates went\n*before* the having clause, since at least one DB I know allows:\n\nselect job_type,avg(age) from <wherever> where <stuff> group by job_type\nhaving avg(age) > 70;\n\nie. the use of aggregate results in the 'having' clause.\n\n\n\n----------------------------------------------------------------\nPhilip Warner | __---_____\nAlbatross Consulting Pty. Ltd. |----/ - \\\n(A.C.N. 008 659 498) | /(@) ______---_\nTel: +61-03-5367 7422 | _________ \\\nFax: +61-03-5367 7430 | ___________ |\nHttp://www.rhyme.com.au | / \\|\n | --________--\nPGP key available upon request, | /\nand from pgp5.ai.mit.edu:11371 |/\n", "msg_date": "Tue, 25 Jan 2000 18:54:59 +1100", "msg_from": "Philip Warner <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your\n peace" }, { "msg_contents": "Philip Warner <[email protected]> writes:\n> Thanks, but now I'm confused. I would have thought that aggregates went\n> *before* the having clause,\n\nArrgh. You are right of course. Shouldn't pontificate late at night...\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 25 Jan 2000 03:20:20 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace " }, { "msg_contents": "Tom Lane wrote:\n> \n> If I don't hear loud hollers very soon, I'm going to eliminate the\n> DISTINCT ON \"feature\" for 7.0. As previously discussed, this feature\n> is not standard SQL and has no clear semantic interpretation.\n\nI use 'distinct on' to get the most recent reports for each of a group of\nlocations. E.g.:\n\ncreate table reports (\nlocation varchar(16),\nreport_time datetime,\nreport_text text);\n\nselect distinct on location * from reports where location ~~ 'Lond%' order by\nlocation, reporttime desc;\n\nto get the tuples that offer the most recent reports for each of London,\nLondonderry, Londy etc.\n\nIs there an alternative?\n\nJulian Scarfe\n", "msg_date": "Tue, 25 Jan 2000 08:30:36 +0000", "msg_from": "Julian Scarfe <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [SQL] DISTINCT ON: speak now or forever hold your peace" }, { "msg_contents": "On Mon, 24 Jan 2000, Bruce Momjian wrote:\n\n> > In short, it's not clear to me that supporting DISTINCT ON is a good use\n> > of our limited resources. I'm willing to pull it out, but not to fix it.\n> > Does someone else want to take responsibility for it?\n> \n> OK, we can disable it and put it on the TODO list. It is already there.\n> \n\nAm I wrong or can DISTINCT ON not be rewritten in terms of GROUP BY in all\ncases?\n\n-- \nPeter Eisentraut Sernanders vaeg 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Tue, 25 Jan 2000 11:30:30 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [SQL] Re: [HACKERS] DISTINCT ON: speak now or forever hold\n\tyour peace" }, { "msg_contents": "On Tue, 25 Jan 2000, Julian Scarfe wrote:\n\n> Tom Lane wrote:\n> > \n> > If I don't hear loud hollers very soon, I'm going to eliminate the\n> > DISTINCT ON \"feature\" for 7.0. As previously discussed, this feature\n> > is not standard SQL and has no clear semantic interpretation.\n> \n> I use 'distinct on' to get the most recent reports for each of a group of\n> locations. E.g.:\n> \n> create table reports (\n> location varchar(16),\n> report_time datetime,\n> report_text text);\n> \n> select distinct on location * from reports where location ~~ 'Lond%' order by\n> location, reporttime desc;\n> \n> to get the tuples that offer the most recent reports for each of London,\n> Londonderry, Londy etc.\n> \n> Is there an alternative?\n\nselect location, max(report_time) from reports group by location\n\nThis also has the negligible advantage that it gives you determinate\nresults.\n\n-- \nPeter Eisentraut Sernanders vaeg 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Tue, 25 Jan 2000 11:59:04 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [SQL] DISTINCT ON: speak now or forever hold your peace" }, { "msg_contents": "on 25/1/00 10:59, Peter Eisentraut at [email protected] wrote:\n\n> On Tue, 25 Jan 2000, Julian Scarfe wrote:\n\n>> I use 'distinct on' to get the most recent reports for each of a group of\n>> locations. E.g.:\n>> \n>> create table reports (\n>> location varchar(16),\n>> report_time datetime,\n>> report_text text);\n>> \n>> select distinct on location * from reports where location ~~ 'Lond%' order by\n>> location, reporttime desc;<[email protected]>\n>> \n>> to get the tuples that offer the most recent reports for each of London,\n>> Londonderry, Londy etc.\n>> \n>> Is there an alternative?\n> \n> select location, max(report_time) from reports group by location\n> \n> This also has the negligible advantage that it gives you determinate\n> results.\n\nBut I want report_text *too* -- that's the important bit, and it's not an\naggregate or common column in the group. So:\n\n> Am I wrong or can DISTINCT ON not be rewritten in terms of GROUP BY in all\n> cases?\n\nI don't think so.\n\nIt has to be something like:\n\nselect * from reports as r1 where r1.report_time = (select max(report_time)\nfrom reports as r2 where r2.location = r1.location) and r1.location ~~\n'Lond%';\n\nHowever, to my surprise, that's as quick as doing the 'distinct on'.\n\n\nhost=> explain select * from reports as r1 where r1.report_time = (select\nmax(report_time) from reports as r2 where r2.location = r1.location) and\nr1.location ~~ 'Lond%';\nNOTICE: QUERY PLAN:\n\nIndex Scan using reports_by_location_issuetime on reports r1 (cost=186.24\nsize=2 width=334)\n SubPlan\n -> Aggregate (cost=3.62 size=0 width=0)\n -> Index Scan using reports_by_location_report_time on reports r2\n(cost=3.62 size=13 width=8)\n\nEXPLAIN\n\nhost=> explain select distinct on location * from reports where location ~~\n'Lond%' order by location, report_time desc;\nNOTICE: QUERY PLAN:\n\nUnique (cost=186.24 size=0 width=0)\n -> Sort (cost=186.24 size=0 width=0)\n -> Index Scan using reports_by_location_issuetime on reports\n(cost=186.24 size=2 width=334)\n\nI'm surprise that the \"reports_by_location_issuetime\" index got used, since\nit involves the issuetime field which is not the same as the report_time\nfield. I edited it and numerous other fields from the quoted 'create table'\nfor simplicity. There's also a \"reports_by_location_report_time\" which\nindexes on, obviously, (location, report_time). Comments?\n\nJulian Scarfe, learning...\n\n\n", "msg_date": "Tue, 25 Jan 2000 13:23:58 +0000", "msg_from": "Julian Scarfe <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [SQL] DISTINCT ON: speak now or forever hold your peace" }, { "msg_contents": "At 05:00 PM 1/25/00 +1100, Philip Warner wrote:\n\n>Out of curiosity, does the SQL spec give any rules or guidelines about when\n>aggregates should be applied to resultant rows? Or is it one of the\n>implementation-dependant things?\n\nWell...my copy of Date's now actually in the mail, rather than in \nBoston, but at the moment that's not much help!\n\n\"order by\" happens after everything, AFAIK. For instance...\n\nselect ...\nunion\nselect ...\norder by\n\norders the result of the union, which pretty much implies that\naggregates will happen first.\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Tue, 25 Jan 2000 07:41:38 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your \n peace" }, { "msg_contents": "Julian Scarfe <[email protected]> writes:\n>>> I use 'distinct on' to get the most recent reports for each of a group of\n>>> locations. E.g.:\n>>> \n>>> select distinct on location * from reports where location ~~ 'Lond%'\n>>> order by location, reporttime desc;\n>>> \n>>> to get the tuples that offer the most recent reports for each of London,\n>>> Londonderry, Londy etc.\n>>> \n>>> Is there an alternative?\n>> \n>> select location, max(report_time) from reports group by location\n\n> But I want report_text *too* -- that's the important bit, and it's not an\n> aggregate or common column in the group.\n\nRight. That is the motivation that was given for keeping DISTINCT ON\nand trying to clean it up: if you ORDER BY the DISTINCT field plus\nenough other fields to give a unique ordering, and then rely on the\n(undocumented) implementation property that you'll get the first tuple\nout of each group with the same DISTINCT field, then you can get useful\neffects like this one.\n\nIt's a kluge, and it's not readily extensible to cases such as needing to\napply the DISTINCT filter across two fields, but it does solve problems\nthat you can't straightforwardly rewrite into GROUP BY.\n\nTell you what: there are two things that are really bugging me about\nDISTINCT ON. If I could get consensus on patching these things,\nI'd be willing to do that rather than yank it.\n\nOne gripe is the lame-brain syntax: because there is no separator\nbetween the DISTINCT ON column name and the first select targetlist\nitem, the DISTINCT ON target cannot be anything more complex than an\nunadorned column name. For example \"SELECT DISTINCT ON A+B+C, ...\"\nmust be interpreted as DISTINCT ON A with a first target of +B+C;\nif we tried to allow more complex expressions then it becomes ambiguous\nwhether that was meant or DISTINCT ON A+B with a first target of +C.\nTo fix this we need some kind of syntactic separator. The cleanest\nidea that comes to my mind is to require parentheses around the ON\ntarget:\n\t\tSELECT DISTINCT ON (expression) target1, ...\nOne immediate advantage of allowing an expression is that you can do\ndistinct-on-two-fields in a rather klugy way, eg\n\t\tSELECT DISTINCT ON (field1 || ' ' || field2) ...\nWe might someday extend it to allow multiple DISTINCT fields, eg,\n\t\tSELECT DISTINCT ON (expr1 [, expr2 ...]) target1, ...\nbut I'm not promising to do that now (unless it's really easy ;-)).\n\nThe other gripe is the bad interaction with ORDER BY, as was illustrated\nin my example of last night: if you ORDER BY something that's not the\nDISTINCT field, it doesn't work. We could get something that kind of\nworks by applying two sorting passes: first sort by the DISTINCT field,\nthen run the duplicate-elimination filter, then re-sort by the ORDER BY\nfield(s). The trouble with that is that it means the user no longer has\ncontrol of the sort order within the same-DISTINCT-field-value groups\nduring the first sort phase, so there's no way for him to control which\ntuple gets kept from each group. What I'd prefer to do is put in an\nerror check that says \"if you use both DISTINCT ON and ORDER BY, then\nthe DISTINCT ON expression must be the first ORDER BY item\". That way\nthe ORDER BY ordering can be the same one used for the\nduplicate-elimination pass, and we don't have the semantic problem.\nNote that Julian's example meets this constraint.\n\n(BTW, ordinary SELECT DISTINCT has this same sort of problem if you try\nto ORDER BY an expression that doesn't appear in the target list.\nSQL92 avoids the issue by not allowing you to ORDER BY expressions that\naren't in the target list, period. We do allow that --- but not when\nyou use DISTINCT. Essentially, I want to enforce that same restriction\nfor DISTINCT ON.)\n\nThe other piece of the puzzle would be to document that DISTINCT ON\nkeeps the first tuple out of each set with the same DISTINCT ON value.\n\nDoes that sound like a plan?\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 25 Jan 2000 12:16:46 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [SQL] DISTINCT ON: speak now or forever hold your peace " }, { "msg_contents": "> (BTW, ordinary SELECT DISTINCT has this same sort of problem if you try\n> to ORDER BY an expression that doesn't appear in the target list.\n> SQL92 avoids the issue by not allowing you to ORDER BY expressions that\n> aren't in the target list, period. We do allow that --- but not when\n> you use DISTINCT. Essentially, I want to enforce that same restriction\n> for DISTINCT ON.)\n> \n> The other piece of the puzzle would be to document that DISTINCT ON\n> keeps the first tuple out of each set with the same DISTINCT ON value.\n> \n> Does that sound like a plan?\n\nYes, very clear. Good.\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": "Tue, 25 Jan 2000 17:35:32 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [SQL] DISTINCT ON: speak now or forever hold your\n\tpeace" }, { "msg_contents": "On 2000-01-25, Chris Bitmead mentioned:\n\n> I think what I really meant was...\n> \n> SELECT DISTINCT ON firstname firstname, age ORDER BY age.\n> \n> Which would find the youngest person called \"fred\", the youngest person\n> called \"paul\", the youngest person called \"jim\" etc etc. which your\n> limit example wouldn't do.\n\nSELECT firstname, min(age) FROM x GROUP BY firstname [ ORDER BY min(age) ]\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n\n", "msg_date": "Wed, 26 Jan 2000 19:34:38 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace" }, { "msg_contents": "On 2000-01-24, Tom Lane mentioned:\n\n> If I don't hear loud hollers very soon, I'm going to eliminate the\n> DISTINCT ON \"feature\" for 7.0. As previously discussed, this feature\n> is not standard SQL and has no clear semantic interpretation.\n\nOur documents say that DISTINCT ON is equivalent to GROUP BY. I still\ndon't see why that wouldn't be true. You can always rewrite\n\nselect distinct on a a,b from test\n\nas\n\nselect a, xxx(b) from test group by a\n\nwhere xxx is some aggregate function (presumably min or max).\n\nYou can also rewrite\n\nselect distinct on a a,b,c from test\n\nas\n\nselect a, b, c from test group by a, b, c\n\nor using some aggregates here as well. At least you can control your\nresults that way.\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Wed, 26 Jan 2000 19:34:54 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace" }, { "msg_contents": "Peter Eisentraut <[email protected]> writes:\n> Our documents say that DISTINCT ON is equivalent to GROUP BY. I still\n> don't see why that wouldn't be true. You can always rewrite\n> select distinct on a a,b from test\n> as\n> select a, xxx(b) from test group by a\n> where xxx is some aggregate function (presumably min or max).\n\nNot really. Look at Julian's example. He can't rewrite as\n\n\tselect a, min(b), min(c) from test group by a\n\nbecause the idea is to get the c that corresponds to the min b.\nIf you do it with two independent aggregates then the b and c\nyou get back may be from different tuples.\n\nI could imagine fixing this with a two-input aggregate, say\n\n\tselect a, min(b), keyofmin(b, c) from test group by a\n\nwhere keyofmin is defined to return the c associated with the min b.\nBut that'd be a pain to implement, first because we have no support\nfor multi-argument aggregates, and second because you'd need a ton\nof separate keyofmin implementations for the cross-product of the\ndata types you might want to deal with. So this is nearly as\nklugy as the SELECT DISTINCT ON approach --- and not any more\nstandard, either.\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 26 Jan 2000 13:40:54 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace " }, { "msg_contents": "At 19:34 26/01/00 +0100, Peter Eisentraut wrote:\n>On 2000-01-24, Tom Lane mentioned:\n>\n>> If I don't hear loud hollers very soon, I'm going to eliminate the\n>> DISTINCT ON \"feature\" for 7.0. As previously discussed, this feature\n>> is not standard SQL and has no clear semantic interpretation.\n>\n>Our documents say that DISTINCT ON is equivalent to GROUP BY. I still\n>don't see why that wouldn't be true. You can always rewrite\n>\n>select distinct on a a,b from test\n>\n>as\n>\n>select a, xxx(b) from test group by a\n>\n>where xxx is some aggregate function (presumably min or max).\n>\n>You can also rewrite\n>\n>select distinct on a a,b,c from test\n>\n>as\n>\n>select a, b, c from test group by a, b, c\n>\n>or using some aggregates here as well. At least you can control your\n>results that way.\n\n\nI only learned about DISTINCT ON in this discussion, but my impression is\nthat it has one advantage over GROUP BY, i that it produces a 'consistent'\ntuple. ie. the tuple it produces is guaranteed to exist in the database,\nwhereas using GROUP BY with aggregates will not produce a 'real' row:\n\nf1|f2|f3\n--------\n1 2 3\n1 3 2\n2 3 1\n2 1 3\n3 1 2\n3 2 1\n\n'select distinct on f1 f1,f2,f3 from <somewhere> order by f1, f2, f3' will\nproduce (I think):\n\nf1|f2|f3\n--------\n1 2 3\n2 1 3\n3 1 2\n\n...where each resulting tuple actually exists in the DB. I can't see a way\nof doing this with aggreagates unless a 'FIRST' function is defined, but\nthat (as already discussed) will not obey the 'order by' clause. Maybe an\n'ANY' aggregate would do it, but then it would not always produce the same\nresults.\n\n\n\n----------------------------------------------------------------\nPhilip Warner | __---_____\nAlbatross Consulting Pty. Ltd. |----/ - \\\n(A.C.N. 008 659 498) | /(@) ______---_\nTel: +61-03-5367 7422 | _________ \\\nFax: +61-03-5367 7430 | ___________ |\nHttp://www.rhyme.com.au | / \\|\n | --________--\nPGP key available upon request, | /\nand from pgp5.ai.mit.edu:11371 |/\n", "msg_date": "Thu, 27 Jan 2000 09:23:24 +1100", "msg_from": "Philip Warner <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace" }, { "msg_contents": "Tom Lane wrote:\n> SELECT DISTINCT ON (expression) target1, ...\n> One immediate advantage of allowing an expression is that you can do\n> distinct-on-two-fields in a rather klugy way, eg\n> SELECT DISTINCT ON (field1 || ' ' || field2) ...\n\nAs long as we're fixing the syntax, I'm wondering if it wouldn't be more\nlogical to have DISTINCT ON somewhere later in the syntax. I'm wondering\nif that might also avoid the need for () as a side effect. Like this\nperhaps....\n\nSELECT x, y, z FROM foo WHERE z DISTINCT ON x, y ORDER BY x, y;\n\n> What I'd prefer to do is put in an\n> error check that says \"if you use both DISTINCT ON and ORDER BY, then\n> the DISTINCT ON expression must be the first ORDER BY item\". \n\nBetter, but still a little kludgy. What about a syntax that really\nsupports everything you want? Like maybe...\n\nSELECT x, y, z FROM foo DISTINCT ON x, y DESC ORDER BY z ASC;\n\nDistinct on now has a similar syntax to the order by clause. What this\nmeans is, do the DISTINCT ON test by ordering DESC (so you get the\ndistinct item with the largest value of x, y), and then order the final\nresult by z ascending.\n\nUnless I'm missing something that gives everybody what they want.\n\nHANG ON, I've got a better idea.....\n\nThe other alternative is to make DISTINCT ON a bit like GROUP BY. So you\nwould have\nsomething like\n\nSELECT x, y, max(z) AS mmm FROM foo DISTINCT ON x, y ORDER BY mmm;\n\nLike GROUP BY where you group by the non-aggregate fields in the SELECT\nclause, you use DISTINCT ON, to mention the non-aggregate clauses in the\nSELECT. The aggregate clause are used to select WHICH of the resulting\nfields are selected for presentation. This would have the benefit of\nbeing more general so you could select, say the city with the longest\nname in each state...\n\nSELECT state, zipcode, longest_string(cityname) FROM cities DISTINCT ON\nstate ORDER BY zipcode;\n\nI don't know how far I'm stepping here from the SQL paradigm, but it\nsure seems cool....\n\nChris.\n", "msg_date": "Thu, 27 Jan 2000 09:53:29 +1100", "msg_from": "Chris Bitmead <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [SQL] DISTINCT ON: speak now or forever hold your\n\tpeace" }, { "msg_contents": "Chris Bitmead <[email protected]> writes:\n> As long as we're fixing the syntax, I'm wondering if it wouldn't be more\n> logical to have DISTINCT ON somewhere later in the syntax.\n\nWell, SELECT DISTINCT is that way because SQL92 says so. Putting the\nDISTINCT ON variant somewhere else might be logically purer, but I think\nit'd be confusing.\n\nAlso, isn't the reason we have DISTINCT ON at all that it's there to\nbe compatible with MySQL or someone? I figured adding parens would be\nabout the least-surprising variant syntax for a person used to those\nother products.\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 26 Jan 2000 18:05:08 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: [SQL] DISTINCT ON: speak now or forever hold your\n\tpeace" }, { "msg_contents": "> Chris Bitmead <[email protected]> writes:\n> > As long as we're fixing the syntax, I'm wondering if it wouldn't be more\n> > logical to have DISTINCT ON somewhere later in the syntax.\n> \n> Well, SELECT DISTINCT is that way because SQL92 says so. Putting the\n> DISTINCT ON variant somewhere else might be logically purer, but I think\n> it'd be confusing.\n> \n> Also, isn't the reason we have DISTINCT ON at all that it's there to\n> be compatible with MySQL or someone? I figured adding parens would be\n> about the least-surprising variant syntax for a person used to those\n> other products.\n> \n\nMakes sense to me.\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": "Wed, 26 Jan 2000 18:16:32 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [SQL] DISTINCT ON: speak now or forever hold your\n\tpeace" }, { "msg_contents": "\nI saw someone mention here about porting Ars Digita to PostgreSQL. Can\nthey elaborate on this? Is there a web page? When it's done will all\nversions of Ars Digita work with postgres? How advanced? How long to go?\n", "msg_date": "Thu, 27 Jan 2000 16:41:01 +1100", "msg_from": "Chris Bitmead <[email protected]>", "msg_from_op": false, "msg_subject": "Ars Digita and PostgreSQL" }, { "msg_contents": "At 04:41 PM 1/27/00 +1100, Chris Bitmead wrote:\n>\n>I saw someone mention here about porting Ars Digita to PostgreSQL. Can\n>they elaborate on this? Is there a web page? When it's done will all\n>versions of Ars Digita work with postgres? How advanced? How long to go?\n\nCheck out http://dsl-dhogaza.pacifier.net:2000 for a snapshot of the\nwork-in-progress. Feel free to poke around and play. Much of it is\nthere.\n\nThat's my box, it will be moving to a larger box over the next \nfew weeks, enough funding for that popped up, apparently.\n\nThat version is based on ACS 2.4, mostly ported by me. Ben Adida\n(an early arsDigita employee now on his own), me and a few others\nplan to move what we've got to ACS3 over the next few days.\n\nWe also will be moving to the open source version of AOLserver,\nwhich is now in beta (they're using a postgres-like definition\nof beta, it appears to be very stable).\n\nWe really need some of the upcoming V7.0 features, like \"group\nby\" that doesn't always return a row, avg(numeric), and other\nbug fixes. We'll love having referential integrity, too. And\n>8KB query returns will be great, means we can define all text\ncolumns as \"text\" and not worry about selects dying if we select\nmore than one column. We're REALLY eager for TOAST and outer\njoins :)\n\nSo, target is:\n\nLinux RH6.1\nAOLserver 3.0b beta\nPG V7.0 beta\nACS 3.1\n\nBy mid-February. \n\nWe've been using sourceforge but they're quickly getting overloaded,\nbogged down, and maybe just a teensy bit flaky. We plan to move to\nstart using the software management features of the ACS + CVS + other\nstuff (later to be moved to the ACS) and move to our own box as soon\nas we get things up and running.\n\nI've manhandled the AOLserver postgres driver, too, and it's now\nconsiderably more robust. It will be distributed with whatever\ncomes after AOLserver 3.0b beta.\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Thu, 27 Jan 2000 08:23:32 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Ars Digita and PostgreSQL" }, { "msg_contents": "I wrote:\n> To fix this we need some kind of syntactic separator. The cleanest\n> idea that comes to my mind is to require parentheses around the ON\n> target:\n> \t\tSELECT DISTINCT ON (expression) target1, ...\n> One immediate advantage of allowing an expression is that you can do\n> distinct-on-two-fields in a rather klugy way, eg\n> \t\tSELECT DISTINCT ON (field1 || ' ' || field2) ...\n> We might someday extend it to allow multiple DISTINCT fields, eg,\n> \t\tSELECT DISTINCT ON (expr1 [, expr2 ...]) target1, ...\n> but I'm not promising to do that now (unless it's really easy ;-)).\n\nFYI, I have committed this change. It did turn out to be just as easy\nto support multiple DISTINCT ON expressions, so 7.0 will accept\n\tSELECT DISTINCT ON (expr1 [, expr2 ...]) target1, ...\n\n> What I'd prefer to do is put in an\n> error check that says \"if you use both DISTINCT ON and ORDER BY, then\n> the DISTINCT ON expression must be the first ORDER BY item\".\n\nMore generally, if you use both then the DISTINCT and ORDER lists must\nmatch until one or the other runs out.\n\n\t\t\tregards, tom lane\n", "msg_date": "Thu, 27 Jan 2000 13:33:16 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [SQL] DISTINCT ON: speak now or forever hold your peace " }, { "msg_contents": "On 2000-01-26, Tom Lane mentioned:\n\n> Peter Eisentraut <[email protected]> writes:\n> > Our documents say that DISTINCT ON is equivalent to GROUP BY. I still\n> > don't see why that wouldn't be true. You can always rewrite\n> > select distinct on a a,b from test\n> > as\n> > select a, xxx(b) from test group by a\n> > where xxx is some aggregate function (presumably min or max).\n> \n> Not really. Look at Julian's example. He can't rewrite as\n> \n> \tselect a, min(b), min(c) from test group by a\n> \n> because the idea is to get the c that corresponds to the min b.\n\nI see. I believe what you want is this:\n\nselect one.a, two.b, two.c\nfrom\n (select a, min(b) as \"min_b\" from test group by a) as one,\n (select b, c from test) as two\nwhere one.\"min_b\" = two.b\n\nNot sure if this is completely legal as it stands but at least the idea\nwould be to join the grouped select with the plain one to get the c\ncorresponding to the minimum b. But of course we don't offer that, so it's\ndistinct on until then. (It would really surprise me if the distinct on\nfunctionality was not at all possible to emulate using SQL, since in my\nexperience it is fairly complete with regards to querying options at\nleast.)\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n\n", "msg_date": "Thu, 27 Jan 2000 23:28:04 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your peace " }, { "msg_contents": "At 23:28 27/01/00 +0100, Peter Eisentraut wrote:\n>\n>select one.a, two.b, two.c\n>from\n> (select a, min(b) as \"min_b\" from test group by a) as one,\n> (select b, c from test) as two\n>where one.\"min_b\" = two.b\n>\n>Not sure if this is completely legal as it stands but at least the idea\n>would be to join the grouped select with the plain one to get the c\n>corresponding to the minimum b. But of course we don't offer that, so it's\n>distinct on until then. (It would really surprise me if the distinct on\n>functionality was not at all possible to emulate using SQL, since in my\n>experience it is fairly complete with regards to querying options at\n>least.)\n\nYou are quite right - with a complete SQL impleentation, DISTINCT ON\nbecomes superfluous. Although it may give the optimizer usefull hints as to\nhow to approach the query. You actually have to be a bit more carefull to\navoid duplicates, something like:\n\nSelect \n a,b,c\n>From \n (Select a, min(b) from test group by a) as one(a,min_b),\n (Select b, c from test t2 where t2.a = one.a limit to 1 row) as two\n\nThis is legal on the DB I use most of the time.\n\n\n\n\n\n\n----------------------------------------------------------------\nPhilip Warner | __---_____\nAlbatross Consulting Pty. Ltd. |----/ - \\\n(A.C.N. 008 659 498) | /(@) ______---_\nTel: +61-03-5367 7422 | _________ \\\nFax: +61-03-5367 7430 | ___________ |\nHttp://www.rhyme.com.au | / \\|\n | --________--\nPGP key available upon request, | /\nand from pgp5.ai.mit.edu:11371 |/\n", "msg_date": "Fri, 28 Jan 2000 12:21:18 +1100", "msg_from": "Philip Warner <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your\n peace" } ]
[ { "msg_contents": "I built the current sources with MAXNUMMESSAGES set to 32 in\nsrc/include/storage/sinvaladt.h. The regular regress tests\nrun OK, with just a few NOTICEs about 'cache state reset'\nand 'SI buffer overflow' inserted in the normal outputs\n(as you'd expect, if SI overrun occurs).\n\nHowever, the parallel tests crash spectacularly, with weird errors\nand Assert() coredumps. Some of the unexpected messages in the\npostmaster log are:\n\nERROR: Relation 0 does not exist\nNOTICE: LockRelease: locktable lookup failed, no lock\nTRAP: Failed Assertion(\"!(((file) > 0 && (file) < SizeVfdCache && VfdCache[file].fileName != ((void *)0))):\", File: \"fd.c\", Line: 817)\n\n!(((file) > 0 && (file) < SizeVfdCache && VfdCache[file].fileName != ((void *)0))) (0)\nNOTICE: LockRelease: locktable lookup failed, no lock\nTRAP: Failed Assertion(\"!(attnum <= 0 || (attnum - 1 <= tuple_type->natts - 1 && tuple_type->attrs[attnum - 1] != ((void *)0) && variable->vartype == tuple_type->attrs[attnum - 1]->atttypid)):\", File: \"execQual.c\", Line: 283)\n\n!(attnum <= 0 || (attnum - 1 <= tuple_type->natts - 1 && tuple_type->attrs[attnum - 1] != ((void *)0) && variable->vartype == tuple_type->attrs[attnum - 1]->atttypid)) (0) [Not a typewriter]\nTRAP: Failed Assertion(\"!(((file) > 0 && (file) < SizeVfdCache && VfdCache[file].fileName != ((void *)0))):\", File: \"fd.c\", Line: 817)\n\n!(((file) > 0 && (file) < SizeVfdCache && VfdCache[file].fileName != ((void *)0))) (0) [Not a typewriter]\n\nWe have a problem.\n\nI think Hiroshi was beating on this code recently --- Hiroshi,\ndo you recall anything you might have done that would affect\nSI cache reset recovery?\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 24 Jan 2000 22:06:05 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Sure enough, SI buffer overrun is broken" }, { "msg_contents": "> -----Original Message-----\n> From: [email protected]\n> [mailto:[email protected]]On Behalf Of Tom Lane\n> \n> I built the current sources with MAXNUMMESSAGES set to 32 in\n> src/include/storage/sinvaladt.h. The regular regress tests\n> run OK, with just a few NOTICEs about 'cache state reset'\n> and 'SI buffer overflow' inserted in the normal outputs\n> (as you'd expect, if SI overrun occurs).\n> \n> However, the parallel tests crash spectacularly, with weird errors\n> and Assert() coredumps. Some of the unexpected messages in the\n> postmaster log are:\n> \n> ERROR: Relation 0 does not exist\n> NOTICE: LockRelease: locktable lookup failed, no lock\n> TRAP: Failed Assertion(\"!(((file) > 0 && (file) < SizeVfdCache && \n> VfdCache[file].fileName != ((void *)0))):\", File: \"fd.c\", Line: 817)\n> \n> !(((file) > 0 && (file) < SizeVfdCache && VfdCache[file].fileName \n> != ((void *)0))) (0)\n> NOTICE: LockRelease: locktable lookup failed, no lock\n> TRAP: Failed Assertion(\"!(attnum <= 0 || (attnum - 1 <= \n> tuple_type->natts - 1 && tuple_type->attrs[attnum - 1] != ((void \n> *)0) && variable->vartype == tuple_type->attrs[attnum - \n> 1]->atttypid)):\", File: \"execQual.c\", Line: 283)\n> \n> !(attnum <= 0 || (attnum - 1 <= tuple_type->natts - 1 && \n> tuple_type->attrs[attnum - 1] != ((void *)0) && variable->vartype \n> == tuple_type->attrs[attnum - 1]->atttypid)) (0) [Not a typewriter]\n> TRAP: Failed Assertion(\"!(((file) > 0 && (file) < SizeVfdCache && \n> VfdCache[file].fileName != ((void *)0))):\", File: \"fd.c\", Line: 817)\n> \n> !(((file) > 0 && (file) < SizeVfdCache && VfdCache[file].fileName \n> != ((void *)0))) (0) [Not a typewriter]\n> \n> We have a problem.\n> \n> I think Hiroshi was beating on this code recently --- Hiroshi,\n> do you recall anything you might have done that would affect\n> SI cache reset recovery?\n>\n\nCertainly crash occurs.\nBut I couldn't see such Assert messages.\n\nOK,I will examine tomorrow.\n\nRegards.\n\nHiroshi Inoue\[email protected] \n", "msg_date": "Wed, 26 Jan 2000 00:40:00 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] Sure enough, SI buffer overrun is broken" }, { "msg_contents": "On Wed, Jan 26, 2000 at 12:40:00AM +0900, Hiroshi Inoue wrote:\n> > -----Original Message-----\n> > From: [email protected]\n> > [mailto:[email protected]]On Behalf Of Tom Lane\n> > \n> > I built the current sources with MAXNUMMESSAGES set to 32 in\n> > src/include/storage/sinvaladt.h. The regular regress tests\n> > run OK, with just a few NOTICEs about 'cache state reset'\n> > and 'SI buffer overflow' inserted in the normal outputs\n> > (as you'd expect, if SI overrun occurs).\n> > \n> > However, the parallel tests crash spectacularly, with weird errors\n> > and Assert() coredumps. Some of the unexpected messages in the\n> > postmaster log are:\n> > \n> > ERROR: Relation 0 does not exist\n> > NOTICE: LockRelease: locktable lookup failed, no lock\n> > TRAP: Failed Assertion(\"!(((file) > 0 && (file) < SizeVfdCache && \n> > VfdCache[file].fileName != ((void *)0))):\", File: \"fd.c\", Line: 817)\n> > \n> > !(((file) > 0 && (file) < SizeVfdCache && VfdCache[file].fileName \n> > != ((void *)0))) (0)\n> > NOTICE: LockRelease: locktable lookup failed, no lock\n> > TRAP: Failed Assertion(\"!(attnum <= 0 || (attnum - 1 <= \n> > tuple_type->natts - 1 && tuple_type->attrs[attnum - 1] != ((void \n> > *)0) && variable->vartype == tuple_type->attrs[attnum - \n> > 1]->atttypid)):\", File: \"execQual.c\", Line: 283)\n> > \n> > !(attnum <= 0 || (attnum - 1 <= tuple_type->natts - 1 && \n> > tuple_type->attrs[attnum - 1] != ((void *)0) && variable->vartype \n> > == tuple_type->attrs[attnum - 1]->atttypid)) (0) [Not a typewriter]\n> > TRAP: Failed Assertion(\"!(((file) > 0 && (file) < SizeVfdCache && \n> > VfdCache[file].fileName != ((void *)0))):\", File: \"fd.c\", Line: 817)\n> > \n> > !(((file) > 0 && (file) < SizeVfdCache && VfdCache[file].fileName \n> > != ((void *)0))) (0) [Not a typewriter]\n> > \n> > We have a problem.\n> > \n> > I think Hiroshi was beating on this code recently --- Hiroshi,\n> > do you recall anything you might have done that would affect\n> > SI cache reset recovery?\n> >\n> \n> Certainly crash occurs.\n> But I couldn't see such Assert messages.\n> \n> OK,I will examine tomorrow.\n\nHow's it going? Can I help?\n\nCheers,\n\nPatrick\n", "msg_date": "Thu, 27 Jan 2000 11:49:03 +0000", "msg_from": "Patrick Welche <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Sure enough, SI buffer overrun is broken" }, { "msg_contents": "> -----Original Message-----\n> From: [email protected]\n> [mailto:[email protected]]On Behalf Of Tom Lane\n> \n> I built the current sources with MAXNUMMESSAGES set to 32 in\n> src/include/storage/sinvaladt.h. The regular regress tests\n> run OK, with just a few NOTICEs about 'cache state reset'\n> and 'SI buffer overflow' inserted in the normal outputs\n> (as you'd expect, if SI overrun occurs).\n> \n> However, the parallel tests crash spectacularly, with weird errors\n> and Assert() coredumps.\n\nUnfortunately,I don't understand the cause yet.\nThe cause may be not unique.\n\nIs the call RelationCacheInvalidate(false not true) in ResetSys-\ntemCaches() right ? Relation descriptors would be destoryed if \nResetSystemCaches() occurs in CommandConterIncrement().\nRecent change setheapoverride -> CommandCounterIncrement\nmay need reopen of relations after CommandCounterIncrement. \n \nstatic void\nResetSystemCaches()\n{\n\tResetSystemCache();\n\tRelationCacheInvalidate(false);\n\t\t\t ^^^^^^^^\n}\n\nI changed false -> true and tried.\nCrash decreased but still occurs.\n\n> Some of the unexpected messages in the\n> postmaster log are:\n> \n> NOTICE: LockRelease: locktable lookup failed, no lock\n\nI have seen this NOTICE only once or twice.\nThis seems because of setting MyProc->xid to InvalidTransa\nctionId in CommitTransaction() and AbortTransaction().\nThere's a little time until AtCommit(Abort)_Locks.\nI have no idea to solve this now.\n\nRegards.\n\nHiroshi Inoue\[email protected]\n", "msg_date": "Fri, 28 Jan 2000 00:38:20 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] Sure enough, SI buffer overrun is broken" }, { "msg_contents": "> -----Original Message-----\n> From: Patrick Welche [mailto:[email protected]]\n> > > I built the current sources with MAXNUMMESSAGES set to 32 in\n> > > src/include/storage/sinvaladt.h. The regular regress tests\n> > > run OK, with just a few NOTICEs about 'cache state reset'\n> > > and 'SI buffer overflow' inserted in the normal outputs\n> > > (as you'd expect, if SI overrun occurs).\n> > > \n> > > However, the parallel tests crash spectacularly, with weird errors\n> > > and Assert() coredumps. Some of the unexpected messages in the\n> > > postmaster log are:\n> > > \n> > \n> > Certainly crash occurs.\n> > But I couldn't see such Assert messages.\n> > \n> > OK,I will examine tomorrow.\n> \n> How's it going? Can I help ?\n>\n\nOf cource you can help us.\nAs Tom wrote\n1) set MAXNUMMESSAGES of src/include/storage/sinvaldt.h to 32\n2) cd src/test/regress\n3) make all runcheck\n\nYou would see crash and various kind of unexpected messages.\nMy another posting may be a little help.\n\nRegards.\n\nHiroshi Inoue\[email protected]\n", "msg_date": "Fri, 28 Jan 2000 01:30:54 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] Sure enough, SI buffer overrun is broken" }, { "msg_contents": "\"Hiroshi Inoue\" <[email protected]> writes:\n>> I built the current sources with MAXNUMMESSAGES set to 32 in\n>> src/include/storage/sinvaladt.h. The regular regress tests\n>> run OK, with just a few NOTICEs about 'cache state reset'\n>> and 'SI buffer overflow' inserted in the normal outputs\n>> (as you'd expect, if SI overrun occurs).\n>> \n>> However, the parallel tests crash spectacularly, with weird errors\n>> and Assert() coredumps.\n\n> Is the call RelationCacheInvalidate(false not true) in ResetSys-\n> temCaches() right ? Relation descriptors would be destoryed if \n> ResetSystemCaches() occurs in CommandConterIncrement().\n\nYou are absolutely right. I have thought before that it was extremely\ndangerous for RelationCacheInvalidate *ever* to blow away a relcache\nentry with a positive refcount. I have changed ResetSystemCaches to\npass TRUE, and have modified the comments for RelationCacheInvalidate\nto indicate that this is probably the only safe setting. I also changed\nRelationIdInvalidateRelationCacheByRelationId to unconditionally pass\ntrue to RelationFlushRelation. Now, RelationFlushRelation is *never*\ncalled with onlyFlushReferenceCountZero=false, so it will always attempt\nto rebuild a relcache entry that has positive refcount.\n\nI suspect that the \"feature\" of RelationFlushRelation to allow blowing\naway a relcache entry regardless of refcount was a hack put in back when\nrelcache refcounts couldn't be trusted (because elog(ERROR) would leave\nrefcounts positive). Now we have RelationCacheAbort to fix refcounts\nafter elog, so I see no reason to take the risk of trying to destroy an\nopen relcache entry.\n\nWith these two changes in place, the parallel regress tests seem much\nmore stable. There is still a big problem though, which is that the\n\"portals\" regress test sometimes fails. I traced this far enough to\ndiscover that the code is trying to use a TupleDesc that it's stored in\nthe ScanTupleSlot of a plan, and this TupleDesc is no longer valid ---\npresumably the relcache entry it was gotten from has been flushed and\nrebuilt, leaving the plan with a dangling TupleDesc pointer. Ugh.\n\nI do not think it is very practical to try to change all of the places\nthat assume that they can save pointers to the TupleDesc of a relcache\nentry. Instead I am thinking about solving the problem inside the\nrelcache, as follows:\n\nDuring a relcache entry rebuild, do not simply free and reconstruct\nthe TupleDesc. Instead, read the catalogs to build a new TupleDesc,\nand compare this one to the old one. If they are the same, free the\nnew one instead (leaving the old one in place, and hence stored pointers\nto it are still valid). If they are not the same, then elog(ERROR).\n\n(elog may sound overly paranoid, but this condition indicates that the\ntable's definition has actually changed since we grabbed the refcount on\nit --- remember we wouldn't be doing this at all if the relcache entry had\nzero refcount --- and therefore all kinds of derived information such as\nplans may be wrong. Pressing ahead will probably lead to crash.)\n\nWe may need to do the same for any other substructures of the relcache\nentry that are visible from outside relcache.c.\n\nI know this sounds pretty grotty, but we are already doing it for the\nrelcache entry itself --- rebuild re-uses the same physical entry\nrather than deleting and reallocating it, to ensure that pointers\nto an open Relation stay valid over an SI flush. We need to extend\nthe same guarantee to the substructure of the relcache entry.\n\nUnless someone has a better idea, I'll work on that.\n\n>> Some of the unexpected messages in the\n>> postmaster log are:\n>> \n>> NOTICE: LockRelease: locktable lookup failed, no lock\n\n> I have seen this NOTICE only once or twice.\n> This seems because of setting MyProc->xid to InvalidTransa\n> ctionId in CommitTransaction() and AbortTransaction().\n> There's a little time until AtCommit(Abort)_Locks.\n> I have no idea to solve this now.\n\nI am not seeing it after the change to never flush relcaches with\npositive refcount. I think the locks being complained of are\nprobably the locks that should have been kept on flushed relations,\nand that it's not CommitTransaction's fault.\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 29 Jan 2000 14:53:19 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Sure enough, SI buffer overrun is broken " }, { "msg_contents": "> -----Original Message-----\n> From: Tom Lane [mailto:[email protected]]\n>\n> \"Hiroshi Inoue\" <[email protected]> writes:\n> >> I built the current sources with MAXNUMMESSAGES set to 32 in\n> >> src/include/storage/sinvaladt.h. The regular regress tests\n> >> run OK, with just a few NOTICEs about 'cache state reset'\n> >> and 'SI buffer overflow' inserted in the normal outputs\n> >> (as you'd expect, if SI overrun occurs).\n> >>\n> >> However, the parallel tests crash spectacularly, with weird errors\n> >> and Assert() coredumps.\n>\n> With these two changes in place, the parallel regress tests seem much\n> more stable. There is still a big problem though, which is that the\n> \"portals\" regress test sometimes fails. I traced this far enough to\n> discover that the code is trying to use a TupleDesc that it's stored in\n> the ScanTupleSlot of a plan, and this TupleDesc is no longer valid ---\n> presumably the relcache entry it was gotten from has been flushed and\n> rebuilt, leaving the plan with a dangling TupleDesc pointer. Ugh.\n>\n\nOh great,I've also doubted relcache entry rebuild but wasn't able to\ntrace so far.\n\n> I do not think it is very practical to try to change all of the places\n> that assume that they can save pointers to the TupleDesc of a relcache\n> entry. Instead I am thinking about solving the problem inside the\n> relcache, as follows:\n>\n> During a relcache entry rebuild, do not simply free and reconstruct\n> the TupleDesc. Instead, read the catalogs to build a new TupleDesc,\n> and compare this one to the old one. If they are the same, free the\n> new one instead (leaving the old one in place, and hence stored pointers\n> to it are still valid). If they are not the same, then elog(ERROR).\n>\n> (elog may sound overly paranoid, but this condition indicates that the\n> table's definition has actually changed since we grabbed the refcount on\n> it --- remember we wouldn't be doing this at all if the relcache entry had\n> zero refcount --- and therefore all kinds of derived information such as\n> plans may be wrong. Pressing ahead will probably lead to crash.)\n>\n\nSounds reasonable.\n\n> We may need to do the same for any other substructures of the relcache\n> entry that are visible from outside relcache.c.\n>\n> I know this sounds pretty grotty, but we are already doing it for the\n> relcache entry itself --- rebuild re-uses the same physical entry\n> rather than deleting and reallocating it, to ensure that pointers\n> to an open Relation stay valid over an SI flush. We need to extend\n> the same guarantee to the substructure of the relcache entry.\n>\n> Unless someone has a better idea, I'll work on that.\n>\n\nAgreed.\n\nRegards.\n\nHiroshi Inoue\[email protected]\n\n", "msg_date": "Sun, 30 Jan 2000 12:14:55 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] Sure enough, SI buffer overrun is broken " } ]
[ { "msg_contents": "Those that are aware of the --enable-debug switch might have found out\nthat it is only marginally useful. (Perhaps you have found it to be very\nuseful, in which case you are free to disagree with me.)\n\nIt seems that for a debugging environment you should not only put a -g on\nthe command line, but also a -Wall, and you most likely do not want to\nhave any optimization flags there. If no one objects I would like to make\nthis adjustment. (Perhaps the debug and cassert options should even be\nmerged?)\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Wed, 26 Jan 2000 00:15:47 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": true, "msg_subject": "--enable-debug" }, { "msg_contents": "Peter Eisentraut <[email protected]> writes:\n> It seems that for a debugging environment you should not only put a -g on\n> the command line, but also a -Wall, and you most likely do not want to\n> have any optimization flags there. If no one objects I would like to make\n> this adjustment. (Perhaps the debug and cassert options should even be\n> merged?)\n\nIf you want --debug to imply --cassert, OK with me, but I will get upset\nif you rearrange things in such a way that I can't have -O and -g and\n--cassert. In other words --cassert should not imply turning off -O.\n\nCurrently, I believe -Wall is turned on automatically if your compiler\nis gcc --- at least it seems to work that way on my platform (maybe\nit's in the hpux_gcc template?). Anyway I get a pretty good set of -W\noptions without doing anything special. It is real obvious that some\nother developers do not run with the same options :-(, so I'd certainly\nbe glad to see more -W options turned on whenever the compiler is gcc,\n--debug or no.\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 25 Jan 2000 19:14:29 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] --enable-debug " }, { "msg_contents": "[Charset ISO-8859-1 unsupported, filtering to ASCII...]\n> Those that are aware of the --enable-debug switch might have found out\n> that it is only marginally useful. (Perhaps you have found it to be very\n> useful, in which case you are free to disagree with me.)\n> \n> It seems that for a debugging environment you should not only put a -g on\n> the command line, but also a -Wall, and you most likely do not want to\n> have any optimization flags there. If no one objects I would like to make\n> this adjustment. (Perhaps the debug and cassert options should even be\n> merged?)\n\nGood idea.\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": "Tue, 25 Jan 2000 19:20:35 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] --enable-debug" }, { "msg_contents": "> Peter Eisentraut <[email protected]> writes:\n> > It seems that for a debugging environment you should not only put a -g on\n> > the command line, but also a -Wall, and you most likely do not want to\n> > have any optimization flags there. If no one objects I would like to make\n> > this adjustment. (Perhaps the debug and cassert options should even be\n> > merged?)\n> \n> If you want --debug to imply --cassert, OK with me, but I will get upset\n> if you rearrange things in such a way that I can't have -O and -g and\n> --cassert. In other words --cassert should not imply turning off -O.\n> \n> Currently, I believe -Wall is turned on automatically if your compiler\n> is gcc --- at least it seems to work that way on my platform (maybe\n> it's in the hpux_gcc template?). Anyway I get a pretty good set of -W\n> options without doing anything special. It is real obvious that some\n> other developers do not run with the same options :-(, so I'd certainly\n> be glad to see more -W options turned on whenever the compiler is gcc,\n> --debug or no.\n\nI remember when we removed every warning gcc -Wall complained about. It\nfixed quite a number of problems, and pointed out coding errors in new\npatches.\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": "Tue, 25 Jan 2000 20:05:11 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] --enable-debug" }, { "msg_contents": "Bruce Momjian <[email protected]> writes:\n>> Currently, I believe -Wall is turned on automatically if your compiler\n>> is gcc --- at least it seems to work that way on my platform (maybe\n>> it's in the hpux_gcc template?). Anyway I get a pretty good set of -W\n>> options without doing anything special.\n\n> I remember when we removed every warning gcc -Wall complained about.\n\nUm, did we stop?\n\nIn my experience, gcc is an excellent detector of portability problems.\nI believe that it is good practice to crank gcc's warning level out\nto the max, and to fix everything that it complains about.\n\nSome gcc warnings are not really portability problems. For example,\nit may gripe about \"variable X may be used without being initialized\"\nwhen a human can easily see from the code logic that X will not actually\nget read in any execution path that it wasn't previously set in.\nStill, I'm willing to shut gcc up by adding a redundant initialization\nof X, rather than turning down its warning level or making a habit of\nignoring what it says. If you go down one of those other paths you\nare likely to miss warnings that could have saved you from genuine bugs.\n\nIn short: I like to see Postgres compile with no warnings at all\neven with a very anal-retentive set of gcc settings.\n\nJust to give you an idea of what I consider anal-retentive ;-),\nhere is what I customarily compile the IJG JPEG sources with:\n\nCFLAGS= -g -O2 -ansi -Wall -Wtraditional -Wshadow -Wwrite-strings \\\n\t-Wpointer-arith -Wbad-function-cast -Wcast-qual -Wid-clash-15 \\\n\t-Wstrict-prototypes -Wmissing-prototypes\n# -Wconversion would be nice, but it complains about some stdio macros on HPUX\n\nBefore any release I also eliminate any warnings shown by several\nother Unix and PC compilers cranked out to their max warning levels.\nI believe that this practice has helped to make libjpeg one of the\nmost portable libraries on the planet.\n\nCompiler warnings can be your friend. Use 'em.\n\n\t\t\tregards, tom lane\n\t\t\torganizer, Independent JPEG Group\n", "msg_date": "Wed, 26 Jan 2000 01:01:40 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] --enable-debug " }, { "msg_contents": "> Bruce Momjian <[email protected]> writes:\n> >> Currently, I believe -Wall is turned on automatically if your compiler\n> >> is gcc --- at least it seems to work that way on my platform (maybe\n> >> it's in the hpux_gcc template?). Anyway I get a pretty good set of -W\n> >> options without doing anything special.\n> \n> > I remember when we removed every warning gcc -Wall complained about.\n> \n> Um, did we stop?\n> \n> In my experience, gcc is an excellent detector of portability problems.\n> I believe that it is good practice to crank gcc's warning level out\n> to the max, and to fix everything that it complains about.\n> \n\nNo, we fixed all the code gcc warned about. Our code is 100% clean. \nThe only problems are fork() handling, and patches people have submitted\nthat were not 100% clean and will be fixed before final.\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": "Wed, 26 Jan 2000 01:04:12 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] --enable-debug" } ]
[ { "msg_contents": "I had to modify many C files tonight. This will cause cvs updates to\ntake some time for users. Sorry.\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\nOn Wed, 26 Jan 2000, Vadim Mikheev wrote:\n\n> Bruce Momjian wrote:\n> > \n> > >\n> > > I'm curious now ...\n> > >\n> > > Tom, did you receive one of these too? I'm wondering if he sent to all\n> > > developers, or just those of us listed as 'steering'....\n> \n> Not to me -:)\n\nNow that is *really* weird ... then again, I wonder how much it costs to\nfly to Russia :) But, you would have thought they would have at least\nmade contact ...\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org", "msg_date": "Wed, 26 Jan 2000 00:46:43 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Many files modified tonight" } ]
[ { "msg_contents": " \n> > > > Couldn't we test some of these parameters inside \n> configure and set\n> > > > them there?\n> > > \n> > > If we could figure out a reasonably cheap way of estimating these\n> > > numbers, it'd be worth setting up custom values at \n> installation time.\n> > \n> > Imho this whole idea is not so good. (Sorry)\n> > \n> > My points are:\n> > 1. even if it is good for an optimizer to be smart,\n> > \tit is even more important, that it is predictable\n> \n> ISTM that by the nature of things the most important capability of an\n> optimizer is to yield optimal results. \n\nYes, but beleive me it cannot do that. \nThere are various reasons for that e.g.:\n1. bad/old statistics\n2. not considered concurrency issues\n3. iterference from other applications\nIt will only lead a high percentage of optimal plans.\nThe rest ranges from not so good to far off. It is the responsibility of the\nSQL programmer to avoid these, but he can only do that if the \noptimizer is predictable.\n\n> This, however, does \n> not have to be\n> mutually exclusive with predictability. If you estimate some \n> CPU and disk\n> parameters and write them into a config file, then you can always give\n> this config file to a bug fixer. It will still work on his machine, just\n> less than optimally.\n\nThat is an idea, yes. But I doubt that it is really worth it.\nImho it would be more important to consider concurrency\nissues first, and that would be very hard to do.\n\ne.g.\n\n2 sessions doing seq scan on huge table x.\nthey start their query with a time offset, that \ndoes not allow session 2 to use pages from session 1 \nbuffer cache (not enough memory).\nIt would be optimal if session 1 would wait so long that \nsession 2 can read from cache.\nThey would both benefit from this strategy.\n\nAndreas\n", "msg_date": "Wed, 26 Jan 2000 09:51:40 +0100", "msg_from": "Zeugswetter Andreas SB <[email protected]>", "msg_from_op": true, "msg_subject": "AW: AW: [HACKERS] Some notes on optimizer cost estimates " } ]
[ { "msg_contents": "\n> \"Hiroshi Inoue\" <[email protected]> writes:\n> > My idea is as follows.\n> \n> > 1)add a visibile/invisible flag to pg_attribute\n\nmight use a xid as flag, so rows before xid have the column, rows after \nxid don't have it.\n\nAndreas\n", "msg_date": "Wed, 26 Jan 2000 09:58:08 +0100", "msg_from": "Zeugswetter Andreas SB <[email protected]>", "msg_from_op": true, "msg_subject": "AW: [HACKERS] Well, then you keep your darn columns " }, { "msg_contents": "> -----Original Message-----\n> From: [email protected]\n> [mailto:[email protected]]On Behalf Of Zeugswetter\n> Andreas SB\n> \n> > \"Hiroshi Inoue\" <[email protected]> writes:\n> > > My idea is as follows.\n> > \n> > > 1)add a visibile/invisible flag to pg_attribute\n> \n> might use a xid as flag, so rows before xid have the column, rows after \n> xid don't have it.\n>\n\n>From where do we get the xid ?\n\nRegards.\n\nHiroshi Inoue\[email protected] \n", "msg_date": "Wed, 26 Jan 2000 18:47:11 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] Well, then you keep your darn columns " } ]
[ { "msg_contents": "\n> Oh, there is a second drawback to it though ...\n> \n> DROP COLUMN name\n\nthe dropped column looses its original name, and gets a \nsystem generated name, like \" dropped_col_5\"\n\n> ADD COLUMN name <of a different type>\n> \n> Then what? :(\n\nAndreas \n", "msg_date": "Wed, 26 Jan 2000 10:05:26 +0100", "msg_from": "Zeugswetter Andreas SB <[email protected]>", "msg_from_op": true, "msg_subject": "AW: [HACKERS] Well, then you keep your darn columns " } ]
[ { "msg_contents": "At 09:51 26/01/00 +0100, Zeugswetter Andreas SB wrote:\n> \n>> > > > Couldn't we test some of these parameters inside \n>> configure and set\n>> > > > them there?\n>> > > \n>> > > If we could figure out a reasonably cheap way of estimating these\n>> > > numbers, it'd be worth setting up custom values at \n>> installation time.\n>> > \n>> > Imho this whole idea is not so good. (Sorry)\n>> > \n>> > My points are:\n>> > 1. even if it is good for an optimizer to be smart,\n>> > \tit is even more important, that it is predictable\n>> \n>> ISTM that by the nature of things the most important capability of an\n>> optimizer is to yield optimal results. \n>\n>Yes, but beleive me it cannot do that. \n>There are various reasons for that e.g.:\n>1. bad/old statistics\n>2. not considered concurrency issues\n>3. iterference from other applications\n>It will only lead a high percentage of optimal plans.\n>The rest ranges from not so good to far off. It is the responsibility of the\n>SQL programmer to avoid these, but he can only do that if the \n>optimizer is predictable.\n\nBased on experience with optimizer improvements across releases of DB\nproducts (not PostgreSQL, I hastily add), I would be inclined to say (from\nbitter experience) that no optimizer is ever truly predicatable. The SQL\nprogrammer has to be given the tools to ensure that a 'bad' query can be\nforced to run the same way with each release, and release notes should\nindicate what extra strategies are now available, in case the 'bad' query\ncan be made better.\n\nIt gets my goat (a bit) when commercial DB manufacturers believe that they\ncan solve intractable optimization problems - it would be a pity for PGSQL\nto go the same way. I'd love to have the opportunity to prove my point with\nPGSQL, but since I can't affect the optimizers choices in any way, I am\nleft with rhetoric, and examples from commercial DBs, which aren't, really,\nrelevant.\n\nSorry about the chestnut.\n\n\n>> This, however, does \n>> not have to be\n>> mutually exclusive with predictability. If you estimate some \n>> CPU and disk\n>> parameters and write them into a config file, then you can always give\n>> this config file to a bug fixer. It will still work on his machine, just\n>> less than optimally.\n>\n>That is an idea, yes. But I doubt that it is really worth it.\n>Imho it would be more important to consider concurrency\n>issues first, and that would be very hard to do.\n>\n>e.g.\n>\n>2 sessions doing seq scan on huge table x.\n>they start their query with a time offset, that \n>does not allow session 2 to use pages from session 1 \n>buffer cache (not enough memory).\n>It would be optimal if session 1 would wait so long that \n>session 2 can read from cache.\n>They would both benefit from this strategy.\n>\n>Andreas\n>\n>************\n>\n>\n----------------------------------------------------------------\nPhilip Warner | __---_____\nAlbatross Consulting Pty. Ltd. |----/ - \\\n(A.C.N. 008 659 498) | /(@) ______---_\nTel: +61-03-5367 7422 | _________ \\\nFax: +61-03-5367 7430 | ___________ |\nHttp://www.rhyme.com.au | / \\|\n | --________--\nPGP key available upon request, | /\nand from pgp5.ai.mit.edu:11371 |/\n", "msg_date": "Wed, 26 Jan 2000 20:07:17 +1100", "msg_from": "Philip Warner <[email protected]>", "msg_from_op": true, "msg_subject": "Re: AW: AW: [HACKERS] Some notes on optimizer cost estimates " }, { "msg_contents": "On Wed, Jan 26, 2000 at 08:07:17PM +1100, Philip Warner wrote:\n> \n> Based on experience with optimizer improvements across releases of DB\n> products (not PostgreSQL, I hastily add), I would be inclined to say (from\n> bitter experience) that no optimizer is ever truly predicatable. The SQL\n> programmer has to be given the tools to ensure that a 'bad' query can be\n> forced to run the same way with each release, and release notes should\n> indicate what extra strategies are now available, in case the 'bad' query\n> can be made better.\n> \n> It gets my goat (a bit) when commercial DB manufacturers believe that they\n> can solve intractable optimization problems - it would be a pity for PGSQL\n> to go the same way. I'd love to have the opportunity to prove my point with\n> PGSQL, but since I can't affect the optimizers choices in any way, I am\n> left with rhetoric, and examples from commercial DBs, which aren't, really,\n> relevant.\n> \n> Sorry about the chestnut.\n\nAh, but you _can_ affect how the plans chosen, which in turn can affect\nthe optimizer. Not as part of a running, production system, I grant you,\nbut for debugging performance problems (and in particular, changes from\none release to the next) it can be useful. What I'm talking about are\nthe switches to the backend that tell pgsql not use particular kinds\nof joins/scans in planning a query\n\n>From postgres(1):\n\n -f Forbids the use of particular scan and join meth�\n ods: s and i disable sequential and index scans\n respectively, while n, m and h disable nested-loop,\n merge and hash joins respectively. (Neither\n sequential scans nor nested-loop joins can be dis�\n abled completely; the -fs and -fn options simply\n discourage the optimizer from using those plan\n types if it has any other alternative.)\n\nWhile not the whole ball of wax in terms of controlling the\nplanner/optimizer stages, it does give you one more knob to tweak,\nbeyond saying \"This query took 2 sec. on release X, now it takes 2\nmin. on release X+1\"\n\nPerhaps someone (Phil?) could collect 'bad' queries, and run them against\neach release, and donate that part of the release notes to Bruce.\n\nRoss\n\n-- \nRoss J. Reedstrom, Ph.D., <[email protected]> \nNSBRI Research Scientist/Programmer\nComputer and Information Technology Institute\nRice University, 6100 S. Main St., Houston, TX 77005\n", "msg_date": "Wed, 26 Jan 2000 10:05:37 -0600", "msg_from": "\"Ross J. Reedstrom\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: AW: [HACKERS] Some notes on optimizer cost estimates" }, { "msg_contents": "\"Ross J. Reedstrom\" <[email protected]> writes:\n> Ah, but you _can_ affect how the plans chosen, which in turn can affect\n> the optimizer. Not as part of a running, production system, I grant you,\n> but for debugging performance problems (and in particular, changes from\n> one release to the next) it can be useful. What I'm talking about are\n> the switches to the backend that tell pgsql not use particular kinds\n> of joins/scans in planning a query\n\nBTW, I have been thinking that it'd be a lot better if these flags could\nbe twiddled via SET/SHOW commands, instead of having to restart psql.\nNothing done about it yet, but it's an idea...\n\nAlso, you already can twiddle the basic cost parameters (cpu_page_weight\nand cpu_index_page_weight) via SET variables whose names I forget at the\nmoment. There will be probably be at least one more such variable\nbefore 7.0 comes out, to control cost of random page fetch vs. sequential.\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 26 Jan 2000 12:06:15 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: AW: [HACKERS] Some notes on optimizer cost estimates " }, { "msg_contents": "At 12:06 PM 1/26/00 -0500, Tom Lane wrote:\n>\"Ross J. Reedstrom\" <[email protected]> writes:\n>> Ah, but you _can_ affect how the plans chosen, which in turn can affect\n>> the optimizer. Not as part of a running, production system, I grant you,\n>> but for debugging performance problems (and in particular, changes from\n>> one release to the next) it can be useful. What I'm talking about are\n>> the switches to the backend that tell pgsql not use particular kinds\n>> of joins/scans in planning a query\n>\n>BTW, I have been thinking that it'd be a lot better if these flags could\n>be twiddled via SET/SHOW commands, instead of having to restart psql.\n>Nothing done about it yet, but it's an idea...\n\nIf something like this could be done for only the current transaction\nor only the current backend, you'd have a sledgehammer-quality tool\nfor tuning individual queries, no? Obviously not an ideal tool but\nmaybe helpful to some folks?\n\nI've not looked at the code, maybe doing a SET would only affect\nthe current backend?\n\n>Also, you already can twiddle the basic cost parameters (cpu_page_weight\n>and cpu_index_page_weight) via SET variables whose names I forget at the\n>moment. There will be probably be at least one more such variable\n>before 7.0 comes out, to control cost of random page fetch vs. sequential.\n\nThese should be helpful, too...again, are they system-wide or\nlimited to the current backend? It would probably be nice to be\nable to futz them for a particular query without impacting all other\nqueries going on at the same time.\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Wed, 26 Jan 2000 10:23:46 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: AW: [HACKERS] Some notes on optimizer cost estimates " }, { "msg_contents": "Don Baccus <[email protected]> writes:\n> I've not looked at the code, maybe doing a SET would only affect\n> the current backend?\n\nRight, just the current backend.\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 26 Jan 2000 17:33:58 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: AW: [HACKERS] Some notes on optimizer cost estimates " }, { "msg_contents": "At 10:05 26/01/00 -0600, Ross J. Reedstrom wrote:\n>On Wed, Jan 26, 2000 at 08:07:17PM +1100, Philip Warner wrote:\n>> \n>> Based on experience with optimizer improvements across releases of DB\n>> products (not PostgreSQL, I hastily add), I would be inclined to say (from\n>> bitter experience) that no optimizer is ever truly predicatable. The SQL\n>> programmer has to be given the tools to ensure that a 'bad' query can be\n>> forced to run the same way with each release, and release notes should\n>> indicate what extra strategies are now available, in case the 'bad' query\n>> can be made better.\n>> \n>> It gets my goat (a bit) when commercial DB manufacturers believe that they\n>> can solve intractable optimization problems - it would be a pity for PGSQL\n>> to go the same way. I'd love to have the opportunity to prove my point with\n>> PGSQL, but since I can't affect the optimizers choices in any way, I am\n>> left with rhetoric, and examples from commercial DBs, which aren't, really,\n>> relevant.\n>> \n>> Sorry about the chestnut.\n>\n>Ah, but you _can_ affect how the plans chosen, which in turn can affect\n>the optimizer. Not as part of a running, production system, I grant you,\n>but for debugging performance problems (and in particular, changes from\n>one release to the next) it can be useful. What I'm talking about are\n>the switches to the backend that tell pgsql not use particular kinds\n>of joins/scans in planning a query\n>\n>>From postgres(1):\n>\n> -f Forbids the use of particular scan and join meth�\n> ods: s and i disable sequential and index scans\n> respectively, while n, m and h disable nested-loop,\n> merge and hash joins respectively. (Neither\n> sequential scans nor nested-loop joins can be dis�\n> abled completely; the -fs and -fn options simply\n> discourage the optimizer from using those plan\n> types if it has any other alternative.)\n\nI think what I would ike to see is the flip-side to this: the ability to\nforce it to do, eg, nested-loop joins. But this is certainly a good start,\nand it would be *great* if (as is suggested later in the thread), these\ncould be made runtime settings, and even better if they could be set for an\nindividual query.\n\n\n>While not the whole ball of wax in terms of controlling the\n>planner/optimizer stages, it does give you one more knob to tweak,\n>beyond saying \"This query took 2 sec. on release X, now it takes 2\n>min. on release X+1\"\n>\n>Perhaps someone (Phil?) could collect 'bad' queries, and run them against\n>each release, and donate that part of the release notes to Bruce.\n\nI would have though they might be better placed in the regression tests,\nand issue a warning when a query is more than, say, 50% slower. The problem\nwith this is that you really only see performance problems on large tables,\nso such tests would take a long time to construct & run. Nevertheless, I\nlike to idea of maintaining a collection of known 'bad' queries - I'll try\nto track down the ones that caused me problems.\n\n\n----------------------------------------------------------------\nPhilip Warner | __---_____\nAlbatross Consulting Pty. Ltd. |----/ - \\\n(A.C.N. 008 659 498) | /(@) ______---_\nTel: +61-03-5367 7422 | _________ \\\nFax: +61-03-5367 7430 | ___________ |\nHttp://www.rhyme.com.au | / \\|\n | --________--\nPGP key available upon request, | /\nand from pgp5.ai.mit.edu:11371 |/\n", "msg_date": "Thu, 27 Jan 2000 10:48:14 +1100", "msg_from": "Philip Warner <[email protected]>", "msg_from_op": true, "msg_subject": "Re: AW: AW: [HACKERS] Some notes on optimizer cost estimates" }, { "msg_contents": "On 2000-01-26, Tom Lane mentioned:\n\n> BTW, I have been thinking that it'd be a lot better if these flags could\n> be twiddled via SET/SHOW commands, instead of having to restart psql.\n> Nothing done about it yet, but it's an idea...\n> \n> Also, you already can twiddle the basic cost parameters (cpu_page_weight\n> and cpu_index_page_weight) via SET variables whose names I forget at the\n> moment. There will be probably be at least one more such variable\n> before 7.0 comes out, to control cost of random page fetch vs. sequential.\n\nIndependent of this, I thought numerous times (when similar \"tuning\"\nissues came up) that it's time for a real unified configuration file,\nwhich includes pg_options, the geqo what-not, an option for each of these\nbackend tuning options (join methods, fsync), heck maybe even the port\nnumber and an alternative location for temp/sort files. Kind of put all\nthe administration in one place. Something to think about maybe.\n\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n\n\n", "msg_date": "Thu, 27 Jan 2000 23:27:27 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: AW: [HACKERS] Some notes on optimizer cost estimates " }, { "msg_contents": "[Charset ISO-8859-1 unsupported, filtering to ASCII...]\n> On 2000-01-26, Tom Lane mentioned:\n> \n> > BTW, I have been thinking that it'd be a lot better if these flags could\n> > be twiddled via SET/SHOW commands, instead of having to restart psql.\n> > Nothing done about it yet, but it's an idea...\n> > \n> > Also, you already can twiddle the basic cost parameters (cpu_page_weight\n> > and cpu_index_page_weight) via SET variables whose names I forget at the\n> > moment. There will be probably be at least one more such variable\n> > before 7.0 comes out, to control cost of random page fetch vs. sequential.\n> \n> Independent of this, I thought numerous times (when similar \"tuning\"\n> issues came up) that it's time for a real unified configuration file,\n> which includes pg_options, the geqo what-not, an option for each of these\n> backend tuning options (join methods, fsync), heck maybe even the port\n> number and an alternative location for temp/sort files. Kind of put all\n> the administration in one place. Something to think about maybe.\n\nAdded to TODO:\n\n\t* Unify configuration into one configuration file\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": "Thu, 27 Jan 2000 22:38:27 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: AW: [HACKERS] Some notes on optimizer cost estimates" }, { "msg_contents": "> > Independent of this, I thought numerous times (when similar \"tuning\"\n> > issues came up) that it's time for a real unified configuration file,\n> > which includes pg_options, the geqo what-not, an option for each of these\n> > backend tuning options (join methods, fsync), heck maybe even the port\n> > number and an alternative location for temp/sort files. Kind of put all\n> > the administration in one place. Something to think about maybe.\n> Added to TODO:\n> * Unify configuration into one configuration file\n\n... and that is a good example of database design because?? ;)\n\nIt may be the right thing to do, but I can see why an RDBMS project\nwould have trouble with the concept...\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Fri, 28 Jan 2000 16:01:08 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: AW: [HACKERS] Some notes on optimizer cost estimates" }, { "msg_contents": "Thomas Lockhart <[email protected]> writes:\n>> Added to TODO:\n>> * Unify configuration into one configuration file\n\n> ... and that is a good example of database design because?? ;)\n\nGood point ;-). OTOH, the existing mishmash of config files and\noption-setting methods isn't a good example of any kind of design.\nIt \"just grew\".\n\nOne thing to consider while contemplating a grand unified config file\n(GUC?) is that much of this stuff needs to be settable per-client.\nIt would be wrong to rip out whatever dynamic option-setting code\nthere is. Cleaning it up and making a more uniform interface to the\nvarious options does sound like a good project though.\n\nI'd want to see a paper design for how things should work before any\ncoding starts --- the existing methods do have some non-obvious\nadvantages. For example, even something as grotty as the PGOPTIONS\nenvironment variable has its uses: you can pass options through to\na backend without needing explicit cooperation from your client\napplication.\n\n\t\t\tregards, tom lane\n", "msg_date": "Fri, 28 Jan 2000 11:59:39 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: AW: [HACKERS] Some notes on optimizer cost estimates " }, { "msg_contents": "On 2000-01-28, Tom Lane mentioned:\n\n> Thomas Lockhart <[email protected]> writes:\n> >> Added to TODO:\n> >> * Unify configuration into one configuration file\n> \n> > ... and that is a good example of database design because?? ;)\n\nThis has more to do with software administration than database design or\ndatabases in the first place. IMHO, o.c.\n\n> One thing to consider while contemplating a grand unified config file\n> (GUC?)\n\nDarn, I was gonna suggest that name.\n\n> is that much of this stuff needs to be settable per-client.\n> It would be wrong to rip out whatever dynamic option-setting code\n> there is. Cleaning it up and making a more uniform interface to the\n> various options does sound like a good project though.\n\nNobody said anything about ripping out existing code. There just need to\nbe defaults settable somewhere without entering -o -F -f -B -q -R -n all\nthe time. I'm sure we can come up with something.\n\n> \n> I'd want to see a paper design for how things should work before any\n> coding starts --- the existing methods do have some non-obvious\n> advantages. For example, even something as grotty as the PGOPTIONS\n> environment variable has its uses: you can pass options through to\n> a backend without needing explicit cooperation from your client\n> application.\n\nSo PGOPTIONS can be tied into the scheme.\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n\n", "msg_date": "Sat, 29 Jan 2000 12:13:40 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "GUC (Re: AW: AW: [HACKERS] Some notes on optimizer cost estimates)" } ]
[ { "msg_contents": "\n> If it is now a general opinion that OIDs will remain, it \n> should be stated somewhere,\n> as I suspect that much of pg community operates under the \n> impression that they are \n> going away in future as have some other nice but not fully \n> developed features like time travel.\n\nI think the concesus was, that the feature would stay, but that \nyou would have to specify on a per table basis that oid's\nare wanted.\n\ncreate table foo (bar char(16)) with oids;\n\nAndreas\n", "msg_date": "Wed, 26 Jan 2000 10:15:29 +0100", "msg_from": "Zeugswetter Andreas SB <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Well, then you keep your darn columns (oid)" } ]
[ { "msg_contents": "\n> >But the decision was (from Vadim IIRC) to drop them, at \n> least in non system\n> >tables.\n> >The cited reasons were:\n> >* crappy implementation that taxed performance (probably \n> fixed by now)\n> >* nobody else seemed to have them and the push then was to \n> the direction of\n> > mainstream bean-counting DB with main objective of getting \n> that base\n> > functionality right.\n> \n> Regarding this last, Oracle has an equivalent - rowid. In the web\n> toolkit I'm helping port, it's used somewhat often, and having oid\n> available has been a convenience.\n\nrowid's are something completely different.\nThey do exist in Postgresql, and are called xtid.\n(I suggested naming them rowid on the SQL level)\nThey have the advantage, that they don't need an index,\nbecause they represent the physical location of the row.\n\nAndreas\n", "msg_date": "Wed, 26 Jan 2000 10:23:43 +0100", "msg_from": "Zeugswetter Andreas SB <[email protected]>", "msg_from_op": true, "msg_subject": "AW: [HACKERS] Well, then you keep your darn columns" } ]
[ { "msg_contents": "\n> > > > My idea is as follows.\n> > > \n> > > > 1)add a visibile/invisible flag to pg_attribute\n> > \n> > might use a xid as flag, so rows before xid have the \n> column, rows after \n> > xid don't have it.\n> >\n> \n> From where do we get the xid ?\n\nTransaction id of alter table command ?\n\nAndreas\n", "msg_date": "Wed, 26 Jan 2000 11:42:55 +0100", "msg_from": "Zeugswetter Andreas SB <[email protected]>", "msg_from_op": true, "msg_subject": "AW: [HACKERS] Well, then you keep your darn columns " }, { "msg_contents": "> -----Original Message-----\n> From: [email protected]\n> [mailto:[email protected]]On Behalf Of Zeugswetter\n> Andreas SB\n> \n> > > > > My idea is as follows.\n> > > > \n> > > > > 1)add a visibile/invisible flag to pg_attribute\n> > > \n> > > might use a xid as flag, so rows before xid have the \n> > column, rows after \n> > > xid don't have it.\n> > >\n> > \n> > From where do we get the xid ?\n> \n> Transaction id of alter table command ?\n>\n\nDoes it work well after one more column is added ?\n\nRegards.\n\nHiroshi Inoue\[email protected] \n", "msg_date": "Wed, 26 Jan 2000 20:02:36 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] Well, then you keep your darn columns " } ]
[ { "msg_contents": "When I initially mentioned this, I had tried to debug, only to find that\nthere were no symbols. So I tried the standard autoconf option, which is\n--enable-debug, to get some symbols. I'm not particularly concerned about\n--cassert, but --enable-debug is the standard autoconf option, and most\npeople (developers) are aware of it. If it's just a synonym for --cassert,\nwell, I don't really care. I just want some symbols to debug with. I\nlanded up fixing it by setting \nCC=gcc -g -Wall\n\nor something, and recompiling.\n\nMikeA\n\n>> -----Original Message-----\n>> From: Bruce Momjian [mailto:[email protected]]\n>> Sent: Wednesday, January 26, 2000 8:04 AM\n>> To: Tom Lane\n>> Cc: Peter Eisentraut; PostgreSQL Development\n>> Subject: Re: [HACKERS] --enable-debug\n>> \n>> \n>> > Bruce Momjian <[email protected]> writes:\n>> > >> Currently, I believe -Wall is turned on automatically \n>> if your compiler\n>> > >> is gcc --- at least it seems to work that way on my \n>> platform (maybe\n>> > >> it's in the hpux_gcc template?). Anyway I get a pretty \n>> good set of -W\n>> > >> options without doing anything special.\n>> > \n>> > > I remember when we removed every warning gcc -Wall \n>> complained about.\n>> > \n>> > Um, did we stop?\n>> > \n>> > In my experience, gcc is an excellent detector of \n>> portability problems.\n>> > I believe that it is good practice to crank gcc's warning level out\n>> > to the max, and to fix everything that it complains about.\n>> > \n>> \n>> No, we fixed all the code gcc warned about. Our code is 100% clean. \n>> The only problems are fork() handling, and patches people \n>> have submitted\n>> that were not 100% clean and will be fixed before final.\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, \n>> Pennsylvania 19026\n>> \n>> ************\n>> \n", "msg_date": "Wed, 26 Jan 2000 13:10:50 +0200", "msg_from": "\"Ansley, Michael\" <[email protected]>", "msg_from_op": true, "msg_subject": "RE: [HACKERS] --enable-debug" }, { "msg_contents": "At 01:10 PM 1/26/00 +0200, Ansley, Michael wrote:\n>When I initially mentioned this, I had tried to debug, only to find that\n>there were no symbols. So I tried the standard autoconf option, which is\n>--enable-debug, to get some symbols. I'm not particularly concerned about\n>--cassert, but --enable-debug is the standard autoconf option, and most\n>people (developers) are aware of it. If it's just a synonym for --cassert,\n>well, I don't really care. I just want some symbols to debug with. I\n>landed up fixing it by setting \n>CC=gcc -g -Wall\n\ngmake COPT=\"-g\" all (after a clean) worked for me...that leave -O2 on,\nthough. Gcc seems to do a reasonably good job anyway.\n\nWe are doing -Wall on Linux, BTW, in case there's any doubt (Tom mentioned\nit was used on his platform but I think he's an HP-UX kinda guy). At\nleast, when I do a make on my RH 6.1 box with the current sources \"-Wall\"\nis on.\n\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Wed, 26 Jan 2000 10:13:31 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] --enable-debug" } ]
[ { "msg_contents": "\n> Based on experience with optimizer improvements across releases of DB\n> products (not PostgreSQL, I hastily add), I would be inclined \n> to say (from\n> bitter experience) that no optimizer is ever truly \n> predicatable. The SQL\n> programmer has to be given the tools to ensure that a 'bad' \n> query can be\n> forced to run the same way with each release, and release notes should\n> indicate what extra strategies are now available, in case the \n> 'bad' query\n> can be made better.\n\nYes, I think syntax to force or disallow a particular index,\nchoose a join method or order, force/disallow seq scans ...\nis sometimes useful.\nEven Informix, who always refused to supply such a feature\nnow has it.\n\nAndreas\n", "msg_date": "Wed, 26 Jan 2000 13:25:55 +0100", "msg_from": "Zeugswetter Andreas SB <[email protected]>", "msg_from_op": true, "msg_subject": "AW: AW: AW: [HACKERS] Some notes on optimizer cost estimates " } ]
[ { "msg_contents": "> -----Original Message-----\n> From: Hiroshi Inoue [mailto:[email protected]]\n> > But, considering the fact that DEFAULT can be something reaaly \n> > complex, like\n> > function that does a lot of things, it may be better to have the \n> > constraints\n> > checked at the end of transaction, like\n> > \n> > BEGIN;\n> > ALTER TABLE T1 ADD COLUMN C1 TEXT NOT NULL;\n> \n> Isn't 'iNITIALLY DEFERRED' needed ?\n> ALTER TABLE T1 ADD COLUMN C1 TEXT NOT NULL INITIALLY DEFERRED;\n> \n> > UPDATE T1 SET C1='MYDEFAULTVALUE';\n> > COMMIT;\n> >\n> \n> It seems more reasonable than standard.\n> But is it worth breaking SQL standard ?\n>\n\nSeems I was wrong. It's not so good.\nCurrent spec to reject NOT NULL/DEFAULT for new column\nisn't so bad and ADD CONSTRAINT feature is much more\nimportant. How about the following ?\n\nBEGIN;\nALTER TABLE T1 ADD COLUMN C1 TEXT;\nUPDATE T1 SET C1='MYDEFAULTVALUE';\nALTER TABLE T1 ADD CONSTRAINT CHECK C1 NOT NULL;\nCOMMIT;\n\nRegards.\n\nHiroshi Inoue\[email protected]\n\n", "msg_date": "Wed, 26 Jan 2000 22:08:44 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": true, "msg_subject": "RE: Happy column adding (was RE: [HACKERS] Happy column dropping)" } ]
[ { "msg_contents": "At 01:25 PM 1/26/00 +0100, Zeugswetter Andreas SB wrote:\n\n>Yes, I think syntax to force or disallow a particular index,\n>choose a join method or order, force/disallow seq scans ...\n>is sometimes useful.\n>Even Informix, who always refused to supply such a feature\n>now has it.\n\nCan you give some sample syntax, for those of us who aren't\nreally database people but merely trying to maintain a facade? :)\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Wed, 26 Jan 2000 10:14:27 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": true, "msg_subject": "Re: AW: AW: AW: [HACKERS] Some notes on optimizer cost\n estimates" }, { "msg_contents": "At 10:14 26/01/00 -0800, Don Baccus wrote:\n>At 01:25 PM 1/26/00 +0100, Zeugswetter Andreas SB wrote:\n>\n>>Yes, I think syntax to force or disallow a particular index,\n>>choose a join method or order, force/disallow seq scans ...\n>>is sometimes useful.\n>>Even Informix, who always refused to supply such a feature\n>>now has it.\n>\n>Can you give some sample syntax, for those of us who aren't\n>really database people but merely trying to maintain a facade? :)\n\nThere are two schemes I know if, one is the Microsoft (and I think Orcale)\nway, and is, I believe the wrong way to go. It involves putting the\noptimizer hints in the SQL statement. I have not used it, but they have\nadditional keywords in the table list, at the end of the query, and in the\njoin type. You can specify the order of tables, the type of cacheing etc\netc. I can cut & paste the relevant manual pages if people are *really*\ninterested.\n\nThis has the disadvantage that the SQL is far less portable (something I\nimaging the vendor likes), and the further problem that if you want to\nchange the query hints, you have to change the SQL. Many apps have embedded\nSQL (especially MS apps), and this is a real pain.\n\n\nThe other (better) scheme involves defining saved query plans. The database\ncan dump a subset of it's optimizer plan into a (hard to read) text format,\nwhich can then be edited and used in a 'CREATE PLAN' statement. Part of a\nplan definition is (I guess) an MD5 hash of the canonical form of the\nquery, and whenever a qeury is called for the first time, the hash is\ncalculated to check if a plan already exists. This is further extended by\nthe ability to define alternate plans, optional & mandatory plans etc etc.\n\nNot that I am suggesting the whole box and dice in the first pass, but,\nassuming the optimizer code would support the application of external plans\n& hints, maybe we could define the table & index join order and join type.\n\nFor those people who know the internals of PGSQL, I'd be interested in\nknowing if this is (1) feasible given the optimizer design, (2) in keeping\nwith the philosopy & design, and (3) how much it might cost (roughly) if\none were inclined to make a donation, and someone were inclined to do it...\n\n\n>- Don Baccus, Portland OR <[email protected]>\n> Nature photos, on-line guides, Pacific Northwest\n> Rare Bird Alert Service and other goodies at\n> http://donb.photo.net.\n>\n>************\n>\n>\n----------------------------------------------------------------\nPhilip Warner | __---_____\nAlbatross Consulting Pty. Ltd. |----/ - \\\n(A.C.N. 008 659 498) | /(@) ______---_\nTel: +61-03-5367 7422 | _________ \\\nFax: +61-03-5367 7430 | ___________ |\nHttp://www.rhyme.com.au | / \\|\n | --________--\nPGP key available upon request, | /\nand from pgp5.ai.mit.edu:11371 |/\n", "msg_date": "Thu, 27 Jan 2000 09:56:27 +1100", "msg_from": "Philip Warner <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: AW: AW: [HACKERS] Some notes on optimizer cost\n estimates" }, { "msg_contents": "Philip Warner wrote:\n> \n> At 10:14 26/01/00 -0800, Don Baccus wrote:\n> >At 01:25 PM 1/26/00 +0100, Zeugswetter Andreas SB wrote:\n> >\n> >>Yes, I think syntax to force or disallow a particular index,\n> >>choose a join method or order, force/disallow seq scans ...\n> >>is sometimes useful.\n> >>Even Informix, who always refused to supply such a feature\n> >>now has it.\n> >\n> >Can you give some sample syntax, for those of us who aren't\n> >really database people but merely trying to maintain a facade? :)\n> \n> There are two schemes I know if, one is the Microsoft (and I think Orcale)\n\nIIRC Oracle hides the optimiser hints in comments, at least it does not \ndirectly sabotage portability.\n\nI just remember reading an article about this in a magazine, have never used \nit myself.\n\n-----------\nHannu\n", "msg_date": "Thu, 27 Jan 2000 11:39:57 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: AW: AW: [HACKERS] Some notes on optimizer cost estimates" } ]
[ { "msg_contents": "\n\nOn Wed, 26 Jan 2000, Peter Eisentraut wrote:\n\n> Couldn't this be reduced to functions for timestamp, int4, int8, float8,\n> and numeric?\n\nWith datetime/timestamp I not sure, exapmle date_part() exist for both.\nAnd how is it with year in timestamp? \n\ntest=> select '15000-01-26 21:01:57+01'::timestamp;\n ?column?\n----------\n invalid\n(1 row)\n\ntest=> select '15000-01-26 21:01:57+01'::datetime;\n ?column?\n---------------------------\n Sun Jan 26 20:01:57 15000\n(1 row)\n\n\nNow is to_char's timestamp implementation very easy/terrible:\n\n\ttext *timestamp_to_char(time_t dt, text *fmt)\n\t{\n\t return datetime_to_char( timestamp_datetime(dt), fmt);\n\t}\n\n:-) it call my classic datetime to_char(). I want rewrite it (and delete \ndatetime version?), if I will certain with timestamp and timestamp to\n'tm' struct conversion. \n\n\nUse float8's to_char only:\n\nThe to_char() convert it to string itself and must check float number \nrange (FLT_DIG ..etc) and it is different for float4 and float8, but \ndon't worry it is only 50 row in C. Yes, float4->float8 cast can make \nPG parser, but it is effective if you not need float8? IMHO this solution\nreduce function/code, but not reduce performance/memory. \n\n(I re-send this mail to hacker list)\n\t\t\t\t\t\tKarel\n\n", "msg_date": "Wed, 26 Jan 2000 20:32:02 +0100 (CET)", "msg_from": "Karel Zak - Zakkr <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [PATCHES] commit TO_CHAR() " }, { "msg_contents": "> > Couldn't this be reduced to functions for timestamp, int4, int8, float8,\n> > and numeric?\n> With datetime/timestamp I not sure, exapmle date_part() exist for both.\n> And how is it with year in timestamp?\n\nOnce we condense the number of date/time types, we can strip a few of\nthese functions. Thanks for doing a complete set though; much better\nthan not having enough!\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Thu, 27 Jan 2000 05:20:47 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [PATCHES] commit TO_CHAR()" } ]
[ { "msg_contents": "Hey Folks\n\nDoing a little research, wondering where can\nI find what we are missing from sql 92 compliance ?\n\njeff\n\n\n======================================================\nJeff MacDonald\n\[email protected]\tirc: bignose on EFnet\n======================================================\n\n", "msg_date": "Wed, 26 Jan 2000 15:43:24 -0400 (AST)", "msg_from": "\"Jeff MacDonald <[email protected]>\" <[email protected]>", "msg_from_op": true, "msg_subject": "SQL 92" }, { "msg_contents": "> Doing a little research, wondering where can\n> I find what we are missing from sql 92 compliance ?\n\nThe reference pages in the docs, originally written by Jose Soares,\ncontain a section in each on compliance. Part of Jose's motivation was\nto encourage us toward more compliance, and it worked; I found in\nseveral cases that fixing Postgres was easier than transcribing his\ndescription of the noncompliance ;)\n\nAlso, the chapters on data types, functions, and operators contain\ninfo on SQL92 compliance.\n\nOf course, asking specific questions helps too...\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Thu, 27 Jan 2000 05:28:00 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] SQL 92" } ]
[ { "msg_contents": "subscribe\n\n-------------------------------------------------- \n xmedia \nidee e tecnologie per la comunicazione interattiva \n-------------------------------------------------- \nFabio Ambrosanio mailto:[email protected] \nDeveloper Senior http://www.xmedia.net \nVia Tiberio Imperatore, 15 tel. +39 065423691 \n00145 Roma Italia fax +39 0654236934 \n-------------------------------------------------- \n", "msg_date": "Wed, 26 Jan 2000 23:39:38 +0100", "msg_from": "\"Fabio Ambrosanio\" <[email protected]>", "msg_from_op": true, "msg_subject": "" } ]
[ { "msg_contents": "I'd like to know if the issue seems resolved so I can move on to adding\nother feature that were discussed.\n\nIf anyone is still getting wierdness I'd really like to know, I don't\nwant to be known as the guy who broke libpq and disappeared. :)\n\nthanks,\n-- \n-Alfred Perlstein - [[email protected]|[email protected]]\n", "msg_date": "Wed, 26 Jan 2000 22:04:10 -0800", "msg_from": "Alfred Perlstein <[email protected]>", "msg_from_op": true, "msg_subject": "(libpq) Anyone still having problems with COPY?" }, { "msg_contents": "On Wed, Jan 26, 2000 at 10:04:10PM -0800, Alfred Perlstein wrote:\n> I'd like to know if the issue seems resolved so I can move on to adding\n> other feature that were discussed.\n> \n> If anyone is still getting wierdness I'd really like to know, I don't\n> want to be known as the guy who broke libpq and disappeared. :)\n\nI think Tom Lane has shown that what is left of my problem has to do with\n\nSubject: [HACKERS] Sure enough, SI buffer overrun is broken\nDate: Mon, 24 Jan 2000 22:06:05 -0500\nMessage-ID: <[email protected]>\n\nRemember that for me, before your last patch, I couldn't do a pgdump and\nreload. Since your patch I can, and in fact most things work, just not\ntime consuming joins, and the parallel test failed without extra joins going\non in the background, which agrees with Tom's findings.\n\nCheers,\n\nPatrick\n", "msg_date": "Thu, 27 Jan 2000 13:13:34 +0000", "msg_from": "Patrick Welche <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] (libpq) Anyone still having problems with COPY?" } ]
[ { "msg_contents": "postgres@tanja:~/home$ cvs commit pgsql-ecpg/\ncvs commit: Examining pgsql-ecpg/\ncvs commit: Examining pgsql-ecpg//include\ncvs commit: Examining pgsql-ecpg//lib\ncvs commit: Examining pgsql-ecpg//preproc\ncvs commit: Examining pgsql-ecpg//test\ncvs [commit aborted]: connect to hub.org:2401 failed: Connection refused\npostgres@tanja:~/home$ \n\nAny idea? It worked when I committed the last time (Jan 17th). This may very\nwell be a problem on my site, but without mopre detailed info it's difficult\nto track down.\n\nMichael\n-- \nMichael Meskes | Go SF 49ers!\nTh.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire!\nTel.: (+49) 2431/72651 | Use Debian GNU/Linux!\nEmail: [email protected] | Use PostgreSQL!\n", "msg_date": "Thu, 27 Jan 2000 08:20:49 +0100", "msg_from": "Michael Meskes <[email protected]>", "msg_from_op": true, "msg_subject": "CVS problem" }, { "msg_contents": "It's not your problem --- the CVS server seems to have been down\nfor the last several hours...\n\n\t\t\tregards, tom lane\n", "msg_date": "Thu, 27 Jan 2000 02:42:26 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] CVS problem " }, { "msg_contents": "On Thu, Jan 27, 2000 at 02:42:26AM -0500, Tom Lane wrote:\n> It's not your problem --- the CVS server seems to have been down\n> for the last several hours...\n\nI see. Thanks.\n\nMichael\n-- \nMichael Meskes | Go SF 49ers!\nTh.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire!\nTel.: (+49) 2431/72651 | Use Debian GNU/Linux!\nEmail: [email protected] | Use PostgreSQL!\n", "msg_date": "Thu, 27 Jan 2000 13:19:30 +0100", "msg_from": "Michael Meskes <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] CVS problem" }, { "msg_contents": "\n\nfixed ... FreeBSD changed /etc/services to use 'cvspserver' instead of\n'cvs', and inetd.conf had 'cvs' still ... tested from my home machine and\nall appears to work ...\n\n\nOn Thu, 27 Jan 2000, Michael Meskes wrote:\n\n> On Thu, Jan 27, 2000 at 02:42:26AM -0500, Tom Lane wrote:\n> > It's not your problem --- the CVS server seems to have been down\n> > for the last several hours...\n> \n> I see. Thanks.\n> \n> Michael\n> -- \n> Michael Meskes | Go SF 49ers!\n> Th.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire!\n> Tel.: (+49) 2431/72651 | Use Debian GNU/Linux!\n> Email: [email protected] | Use PostgreSQL!\n> \n> ************\n> \n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Thu, 27 Jan 2000 14:05:00 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] CVS problem" }, { "msg_contents": "On Thu, Jan 27, 2000 at 02:05:00PM -0400, The Hermit Hacker wrote:\n> fixed ... FreeBSD changed /etc/services to use 'cvspserver' instead of\n> 'cvs', and inetd.conf had 'cvs' still ... tested from my home machine and\n> all appears to work ...\n\nThanks. Yes, it works. I already committed my changes.\n\nMichael\n-- \nMichael Meskes | Go SF 49ers!\nTh.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire!\nTel.: (+49) 2431/72651 | Use Debian GNU/Linux!\nEmail: [email protected] | Use PostgreSQL!\n", "msg_date": "Thu, 27 Jan 2000 20:13:09 +0100", "msg_from": "Michael Meskes <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] CVS problem" } ]
[ { "msg_contents": "\n> >Yes, I think syntax to force or disallow a particular index,\n> >choose a join method or order, force/disallow seq scans ...\n> >is sometimes useful.\n> >Even Informix, who always refused to supply such a feature\n> >now has it.\n> \n> Can you give some sample syntax, for those of us who aren't\n> really database people but merely trying to maintain a facade? :)\n\nSELECT {+ INDEX (a auftragsbeleg_index2)} a.id_beleg\n FROM auftragsbeleg a, instparameter i WHERE \n a.num_mandant=i.num_mandant AND cod_prioritaets=?\n AND num_prior_eingang<?\n \nSELECT {+ ORDERED } * from tab1, tab2, tab3 .....\n\nSELECT {+ FULL (tab1) } * from tab1, tab2, ....\nSELECT {+ AVOID_FULL (tab1) } * from tab1, tab2, ....\n\nInformix places the directives in comments, so that the resulting sql\ndoes not violate SQL92.\nThe directive is identified by the {+\n\nAndreas\n", "msg_date": "Thu, 27 Jan 2000 10:55:10 +0100", "msg_from": "Zeugswetter Andreas SB <[email protected]>", "msg_from_op": true, "msg_subject": "AW: AW: AW: AW: [HACKERS] Some notes on optimizer cost estimates " } ]
[ { "msg_contents": "I have a DB with is updated using MS Access. Primary keys are Int4 with default random values (\"Num�roAuto\" + \"Al�atoire\" in Access).\nThe DB is migrated as-is in Postgres, with tbl_prod.cle_prod field containing values from -2057496808 to 2139583719.\nWhen I SELECT in the table, using the INT4 cle_prod value, PG doesn't find the tuple. When I SELECT using the VARCHAR(10) ref_prod value, PG finds the tuple, and show the right value for the cle_prod filed : the same as the one I SELECTed for...\n\nThis sounds like the long negative integer values given in PSQL is not converted correctly while executing.\nUsing a long positive integer value, all works like a charm...\n\nBelow is the queries type sto sho what append.\nI'm using Postgres 6.5.2 from the RPMs.\n\nNicolas Huillard\n\n\n\n\ngest=> select cle_prod, ref_prod from tbl_prod where ref_prod='4866VC';\n cle_prod|ref_prod\n-----------+--------\n-2057496808|4866VC \n(1 row)\n\ngest=> select cle_prod, ref_prod from tbl_prod where cle_prod = -2057496808;\ncle_prod|ref_prod\n--------+--------\n(0 rows)\n\ngest=> \\d tbl_prod\nTable = tbl_prod\n+----------------------------------+----------------------------------+-------+\n| Field | Type | Length|\n+----------------------------------+----------------------------------+-------+\n| cle_prod | int4 not null default nextval('\" | 4 |\n| ref_prod | varchar() not null | 10 |\n...\n+----------------------------------+----------------------------------+-------+\nIndex: tbl_prod_pkey\n\ngest=> select version();\nversion \n--------------------------------------------------------------\nPostgreSQL 6.5.2 on i486-pc-linux-gnu, compiled by gcc 2.7.2.3\n(1 row)\n\ngest=> \n\n", "msg_date": "Thu, 27 Jan 2000 13:37:08 +0100", "msg_from": "Nicolas Huillard <[email protected]>", "msg_from_op": true, "msg_subject": "Problem with SELECT on large negative INT4" }, { "msg_contents": "> -----Original Message-----\n> From: [email protected]\n> [mailto:[email protected]]On Behalf Of Nicolas Huillard\n>\n> I have a DB with is updated using MS Access. Primary keys are\n> Int4 with default random values (\"Num�roAuto\" + \"Al�atoire\" in Access).\n> The DB is migrated as-is in Postgres, with tbl_prod.cle_prod\n> field containing values from -2057496808 to 2139583719.\n> When I SELECT in the table, using the INT4 cle_prod value, PG\n> doesn't find the tuple. When I SELECT using the VARCHAR(10)\n> ref_prod value, PG finds the tuple, and show the right value for\n> the cle_prod filed : the same as the one I SELECTed for...\n>\n> This sounds like the long negative integer values given in PSQL\n> is not converted correctly while executing.\n> Using a long positive integer value, all works like a charm...\n>\n> Below is the queries type sto sho what append.\n> I'm using Postgres 6.5.2 from the RPMs.\n>\n\nCould you try the follwoing patch ?\n\nRegards.\n\nHiroshi Inoue\n\n*** nbtcompare.c 2000/01/11 03:33:34 1.3\n--- nbtcompare.c 2000/01/19 05:42:06\n***************\n*** 34,40 ****\n int32\n btint4cmp(int32 a, int32 b)\n {\n! return a - b;\n }\n\n int32\n--- 34,45 ----\n int32\n btint4cmp(int32 a, int32 b)\n {\n! if (a > b)\n! return 1;\n! else if (a == b)\n! return 0;\n! else\n! return -1;\n }\n\n int32\n\n\n", "msg_date": "Fri, 28 Jan 2000 01:30:57 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [GENERAL] Problem with SELECT on large negative INT4" }, { "msg_contents": "[Charset iso-8859-1 unsupported, filtering to ASCII...]\n> > -----Original Message-----\n> > From: [email protected]\n> > [mailto:[email protected]]On Behalf Of Nicolas Huillard\n> >\n> > I have a DB with is updated using MS Access. Primary keys are\n> > Int4 with default random values (\"Num_roAuto\" + \"Al_atoire\" in Access).\n> > The DB is migrated as-is in Postgres, with tbl_prod.cle_prod\n> > field containing values from -2057496808 to 2139583719.\n> > When I SELECT in the table, using the INT4 cle_prod value, PG\n> > doesn't find the tuple. When I SELECT using the VARCHAR(10)\n> > ref_prod value, PG finds the tuple, and show the right value for\n> > the cle_prod filed : the same as the one I SELECTed for...\n> >\n> > This sounds like the long negative integer values given in PSQL\n> > is not converted correctly while executing.\n> > Using a long positive integer value, all works like a charm...\n> >\n> > Below is the queries type sto sho what append.\n> > I'm using Postgres 6.5.2 from the RPMs.\n> >\n> \n> Could you try the follwoing patch ?\n\nHiroshi, I don't see this in the main tree, nor do I see it having been\nrequested for application. Should I apply it?\n\n> \n> Regards.\n> \n> Hiroshi Inoue\n> \n> *** nbtcompare.c 2000/01/11 03:33:34 1.3\n> --- nbtcompare.c 2000/01/19 05:42:06\n> ***************\n> *** 34,40 ****\n> int32\n> btint4cmp(int32 a, int32 b)\n> {\n> ! return a - b;\n> }\n> \n> int32\n> --- 34,45 ----\n> int32\n> btint4cmp(int32 a, int32 b)\n> {\n> ! if (a > b)\n> ! return 1;\n> ! else if (a == b)\n> ! return 0;\n> ! else\n> ! return -1;\n> }\n> \n> int32\n> \n> \n> \n> ************\n> \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", "msg_date": "Thu, 27 Jan 2000 11:37:24 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [SQL] RE: [GENERAL] Problem with SELECT on large negative INT4" }, { "msg_contents": "Bruce Momjian <[email protected]> writes:\n>> Could you try the follwoing patch ?\n\n> Hiroshi, I don't see this in the main tree, nor do I see it having been\n> requested for application. Should I apply it?\n\nIf this does fix things, I would venture that the blame really belongs\nto whatever caller of the comparison function is failing to interpret\nthe return value correctly ...\n\nBTW there is a somewhat-related issue that has been bothering me:\nthe system is pretty erratic about converting between Datum and bool.\nSome places use \"DatumGetInt32(datum) != 0\" as their effective test\nfor whether a Datum value is \"true\", some places use\n\"DatumGetInt8(datum) != 0\", some places just do \"(bool) datum\", and\nthere may be other variants.\n\nI am thinking of introducing DatumGetBool and BoolGetDatum macros and\ntrying to make the code use those uniformly, but there's a lot of code\nto clean up. I was intending to do it during the function manager\ninterface rewrite, since all these same places will need to be looked\nat for that.\n\nPerhaps we should also try to clean up btree's sort comparison functions\nin the same way, with some macros that provide a well-defined conversion\nbetween Datum and the \"<\", \"=\", \">\" return conditions that are intended.\n\n\t\t\tregards, tom lane\n", "msg_date": "Thu, 27 Jan 2000 12:52:37 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [SQL] RE: [GENERAL] Problem with SELECT on large negative INT4 " }, { "msg_contents": "> -----Original Message-----\n> From: Bruce Momjian [mailto:[email protected]]\n> \n> [Charset iso-8859-1 unsupported, filtering to ASCII...]\n> > > -----Original Message-----\n> > > From: [email protected]\n> > > [mailto:[email protected]]On Behalf Of \n> Nicolas Huillard\n> > >\n> > > I have a DB with is updated using MS Access. Primary keys are\n> > > Int4 with default random values (\"Num_roAuto\" + \"Al_atoire\" \n> in Access).\n> > > The DB is migrated as-is in Postgres, with tbl_prod.cle_prod\n> > > field containing values from -2057496808 to 2139583719.\n> > > When I SELECT in the table, using the INT4 cle_prod value, PG\n> > > doesn't find the tuple. When I SELECT using the VARCHAR(10)\n> > > ref_prod value, PG finds the tuple, and show the right value for\n> > > the cle_prod filed : the same as the one I SELECTed for...\n> > >\n> > > This sounds like the long negative integer values given in PSQL\n> > > is not converted correctly while executing.\n> > > Using a long positive integer value, all works like a charm...\n> > >\n> > > Below is the queries type sto sho what append.\n> > > I'm using Postgres 6.5.2 from the RPMs.\n> > >\n> > \n> > Could you try the follwoing patch ?\n> \n> Hiroshi, I don't see this in the main tree, nor do I see it having been\n> requested for application. Should I apply it?\n>\n\nRecently I have often seen this kind of bug reports though I don't\nknow why * recently *.\nThis is the second time I sent the patch but I have seen no reply.\n\nAnyway,this is clearly a bug.\nI could commit it to current tree but couldn't commit to REL tree\nbecause I don't maintain REL tree.\nMoreover int42cmp/int24cmp seems to have similar bugs and\nwe had better check comparison functions again.\nI'm happy if you could commit it to both trees.\n\nRegards.\n\nHiroshi Inoue\[email protected]\n", "msg_date": "Fri, 28 Jan 2000 08:59:23 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [SQL] RE: [GENERAL] Problem with SELECT on large negative INT4" }, { "msg_contents": "We have the same problem with 64-bit integers - and it isn't just\npsql - the same problem exists in jdbc.\n\nAnyways, to fix it, we did the following:\n\n'-11233232322233232323232321232'::int8\n\nwhenever we did any operation on the large field.\n\nyou may want to try \n\n'-2057496808|'::int4\n\nin the same manner.\n\n\n\nAt 01:37 PM 1/27/00 +0100, Nicolas Huillard wrote:\n>I have a DB with is updated using MS Access. Primary keys are Int4 with \n>default random values (\"Num�roAuto\" + \"Al�atoire\" in Access).\n>The DB is migrated as-is in Postgres, with tbl_prod.cle_prod field \n>containing values from -2057496808 to 2139583719.\n>When I SELECT in the table, using the INT4 cle_prod value, PG doesn't find \n>the tuple. When I SELECT using the VARCHAR(10) ref_prod value, PG finds the \n>tuple, and show the right value for the cle_prod filed : the same as the one \n>I SELECTed for...\n>\n>This sounds like the long negative integer values given in PSQL is not \n>converted correctly while executing.\n>Using a long positive integer value, all works like a charm...\n>\n>Below is the queries type sto sho what append.\n>I'm using Postgres 6.5.2 from the RPMs.\n>\n>Nicolas Huillard\n>\n>\n>\n>\n>gest=> select cle_prod, ref_prod from tbl_prod where ref_prod='4866VC';\n> cle_prod|ref_prod\n>-----------+--------\n>-2057496808|4866VC \n>(1 row)\n>\n>gest=> select cle_prod, ref_prod from tbl_prod where cle_prod = -2057496808;\n>cle_prod|ref_prod\n>--------+--------\n>(0 rows)\n>\n>gest=> \\d tbl_prod\n>Table = tbl_prod\n>+----------------------------------+----------------------------------+----\n---+\n>| Field | Type |\nLength|\n>+----------------------------------+----------------------------------+----\n---+\n>| cle_prod | int4 not null default nextval('\" |\n 4 |\n>| ref_prod | varchar() not null |\n10 |\n>...\n>+----------------------------------+----------------------------------+----\n---+\n>Index: tbl_prod_pkey\n>\n>gest=> select version();\n>version \n>--------------------------------------------------------------\n>PostgreSQL 6.5.2 on i486-pc-linux-gnu, compiled by gcc 2.7.2.3\n>(1 row)\n>\n>gest=> \n>\n>\n>************\n\n------------\[email protected]\n\n \n", "msg_date": "Thu, 27 Jan 2000 22:48:39 -0500", "msg_from": "John Brothers <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [GENERAL] Problem with SELECT on large negative INT4" }, { "msg_contents": "I don't think that patch will work - Hiroshi whipped up that patch for me a\nweek ago for a\ndifferent problem - we have a table with duplicate primary keys, which\nseems to be\nan arithmetic overflow problem because the index key values can be both\nvery large positive\nand very large negative numbers.\n\n\nAt 11:37 AM 1/27/00 -0500, Bruce Momjian wrote:\n>> Could you try the follwoing patch ?\n>\n>Hiroshi, I don't see this in the main tree, nor do I see it having been\n>requested for application. Should I apply it?\n>\n>> \n>> Regards.\n>> \n>> Hiroshi Inoue\n\n------------\[email protected]\n\n \n", "msg_date": "Thu, 27 Jan 2000 22:51:40 -0500", "msg_from": "John Brothers <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [SQL] RE: [GENERAL] Problem with SELECT on large negative\n INT4" }, { "msg_contents": "> -----Original Message-----\n> From: [email protected]\n> [mailto:[email protected]]On Behalf Of John Brothers\n> \n> I don't think that patch will work - Hiroshi whipped up that \n> patch for me a\n> week ago for a\n> different problem - we have a table with duplicate primary keys, which\n> seems to be\n> an arithmetic overflow problem because the index key values can be both\n> very large positive\n> and very large negative numbers.\n>\n\nWhat was the result on your environment after applying my patch ?\nMy patch workded for your test case at least on my machine.\n\nRegards.\n\nHiroshi Inoue\[email protected]\n", "msg_date": "Fri, 28 Jan 2000 13:40:56 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [SQL] RE: [GENERAL] Problem with SELECT on large negative INT4" }, { "msg_contents": "John Brothers <[email protected]> writes:\n> I don't think that patch will work - Hiroshi whipped up that patch for\n> me a week ago for a different problem - we have a table with duplicate\n> primary keys, which seems to be an arithmetic overflow problem because\n> the index key values can be both very large positive and very large\n> negative numbers.\n\nActually, if Nicolas' table contains both very large positive and very\nlarge negative integers, then his index could be messed up pretty badly.\nWhat Hiroshi saw (and I missed :-() was that btint4cmp can fail and\nreturn a result of the wrong sign if the difference between two integers\noverflows. Since index sorting depends critically on the assumption\nthat the comparator always returns consistent results (a < b and b < c\nmust imply a < c, but this can fail if a - c overflows), you could have\nan out-of-order index. And then probes into the index could fail to\nfind items they should find ... which is exactly the complained-of\nsymptom.\n\nHiroshi neglected to mention that you'd probably need to drop and\nrecreate the index after applying the patch; if it's indeed out of\norder, just patching the comparator bug isn't enough to fix it.\n\n\t\t\tregards, tom lane\n", "msg_date": "Thu, 27 Jan 2000 23:49:14 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [SQL] RE: [GENERAL] Problem with SELECT on large negative INT4 " }, { "msg_contents": "> Actually, if Nicolas' table contains both very large positive and very\n> large negative integers, then his index could be messed up pretty badly.\n> What Hiroshi saw (and I missed :-() was that btint4cmp can fail and\n> return a result of the wrong sign if the difference between two integers\n> overflows. Since index sorting depends critically on the assumption\n> that the comparator always returns consistent results (a < b and b < c\n> must imply a < c, but this can fail if a - c overflows), you could have\n> an out-of-order index. And then probes into the index could fail to\n> find items they should find ... which is exactly the complained-of\n> symptom.\n> \n> Hiroshi neglected to mention that you'd probably need to drop and\n> recreate the index after applying the patch; if it's indeed out of\n> order, just patching the comparator bug isn't enough to fix it.\n> \n\nDoes Hiroshi's patch get applied?\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, 28 Jan 2000 00:31:26 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [SQL] RE: [GENERAL] Problem with SELECT on large negative INT4" }, { "msg_contents": "Bruce Momjian <[email protected]> writes:\n>> Hiroshi neglected to mention that you'd probably need to drop and\n>> recreate the index after applying the patch; if it's indeed out of\n>> order, just patching the comparator bug isn't enough to fix it.\n\n> Does Hiroshi's patch get applied?\n\nNow that I understand the problem, yes, his patch is good as far as\nit goes. There are probably other places with the same problem...\n\n\t\t\tregards, tom lane\n", "msg_date": "Fri, 28 Jan 2000 00:59:55 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [SQL] RE: [GENERAL] Problem with SELECT on large negative INT4 " }, { "msg_contents": "> -----Original Message-----\n> From: [email protected] [mailto:owner-pgsql-sql@postgreSQL.\n> org]On Behalf Of Tom Lane\n> \n> Hiroshi neglected to mention that you'd probably need to drop and\n> recreate the index after applying the patch; if it's indeed out of\n\nOops I neglected to mention it,sorry.\n\n> order, just patching the comparator bug isn't enough to fix it.\n\nYes,please report us the result.\nIf the result is wrong,we have to think more about it.\n\nRegards. \n\nHiroshi Inoue\[email protected]\n", "msg_date": "Fri, 28 Jan 2000 16:05:18 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [SQL] RE: [GENERAL] Problem with SELECT on large negative INT4 " }, { "msg_contents": "Applied.\n\n\n[Charset iso-8859-1 unsupported, filtering to ASCII...]\n> > -----Original Message-----\n> > From: [email protected]\n> > [mailto:[email protected]]On Behalf Of Nicolas Huillard\n> >\n> > I have a DB with is updated using MS Access. Primary keys are\n> > Int4 with default random values (\"Num_roAuto\" + \"Al_atoire\" in Access).\n> > The DB is migrated as-is in Postgres, with tbl_prod.cle_prod\n> > field containing values from -2057496808 to 2139583719.\n> > When I SELECT in the table, using the INT4 cle_prod value, PG\n> > doesn't find the tuple. When I SELECT using the VARCHAR(10)\n> > ref_prod value, PG finds the tuple, and show the right value for\n> > the cle_prod filed : the same as the one I SELECTed for...\n> >\n> > This sounds like the long negative integer values given in PSQL\n> > is not converted correctly while executing.\n> > Using a long positive integer value, all works like a charm...\n> >\n> > Below is the queries type sto sho what append.\n> > I'm using Postgres 6.5.2 from the RPMs.\n> >\n> \n> Could you try the follwoing patch ?\n> \n> Regards.\n> \n> Hiroshi Inoue\n> \n> *** nbtcompare.c 2000/01/11 03:33:34 1.3\n> --- nbtcompare.c 2000/01/19 05:42:06\n> ***************\n> *** 34,40 ****\n> int32\n> btint4cmp(int32 a, int32 b)\n> {\n> ! return a - b;\n> }\n> \n> int32\n> --- 34,45 ----\n> int32\n> btint4cmp(int32 a, int32 b)\n> {\n> ! if (a > b)\n> ! return 1;\n> ! else if (a == b)\n> ! return 0;\n> ! else\n> ! return -1;\n> }\n> \n> int32\n> \n> \n> \n> ************\n> \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", "msg_date": "Fri, 28 Jan 2000 12:19:11 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [SQL] RE: [GENERAL] Problem with SELECT on large negative INT4" }, { "msg_contents": "> Bruce Momjian <[email protected]> writes:\n> >> Hiroshi neglected to mention that you'd probably need to drop and\n> >> recreate the index after applying the patch; if it's indeed out of\n> >> order, just patching the comparator bug isn't enough to fix it.\n> \n> > Does Hiroshi's patch get applied?\n> \n> Now that I understand the problem, yes, his patch is good as far as\n> it goes. There are probably other places with the same problem...\n\nApplied.\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, 28 Jan 2000 12:19:38 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [SQL] RE: [GENERAL] Problem with SELECT on large negative INT4" } ]
[ { "msg_contents": "I was send an example for a function definition created with ecpg:\n\nEXEC SQL INCLUDE sqlca;\n\nint my_fun (void)\n\t{\n\tEXEC SQL BEGIN DECLARE SECTION;\n\tint\t\t\tsql_index = 0;\n\tEXEC SQL END DECLARE SECTION;\t\n\n\tEXEC SQL WHENEVER SQLERROR GOTO Error;\n\tEXEC SQL SELECT MIN(index) INTO :sql_index FROM tab;\n\n\treturn (sql_index);\n\nError:\n\treturn (sqlca.sqlcode);\t\n\t}\n\nI have never tried this so I wonder if this is possible. Any comments?\n\nAnyway it does not seem to work as it should. I did create a mini table to\ntest it:\n\nmm=> select * from tab;\nindex\n-----\n 14\n 7\n(2 rows)\nmm=> select my_fun();\nmy_fun\n------\n -220\n(1 row)\n\nNow -220 certainly is not the minimum of 14 and 7. So what did I do wrong\nhere?\n\nMichael\n-- \nMichael Meskes | Go SF 49ers!\nTh.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire!\nTel.: (+49) 2431/72651 | Use Debian GNU/Linux!\nEmail: [email protected] | Use PostgreSQL!\n", "msg_date": "Thu, 27 Jan 2000 15:55:17 +0100", "msg_from": "Michael Meskes <[email protected]>", "msg_from_op": true, "msg_subject": "Question about functions" } ]
[ { "msg_contents": "Hi folks,\n\nI got a problem with a production database, it's a little\nbusy with 2 to 5 queries per second. \n\nRunning on Redhat 6.0, 2.2.5-15 SMP (intel)\n\nCurrently thre are 128 backends ( postmaster -N 128 )\nwith share mem set at 256.\n\nin pg_options verbose = 2, syslog = 2,\n\nhere are the errors..\n\nFATAL: s_lock(4001404d) at spin.c:125, stuck spinlock. Aborting.\n\nAfter those spinlock errors the postmaster died.... I tries to start it\nback up and it failed with this error.\n\nFindExec: found \"/usr/bin/postgres\" using argv[0]\nIpcMemoryCreate: shmget failed (Identifier removed) key=5432010,\nsize=120, permission=700\nIpcMemoryIdGet: shmget failed (Identifier removed) key=5432010, size=120,\npermission=0\nIpcMemoryAttach: shmat failed (Invalid argument) id=-2\nFATAL 1: AttachSLockMemory: could not attach segment\nproc_exit(0) [#0]\nshmem_exit(0) [#0]\nexit(0)\n\n\nSince this is a production database, what are teh first steps i should\ntake ?\n\n\n\n======================================================\nJeff MacDonald\n\[email protected]\tirc: bignose on EFnet\n======================================================\n\n", "msg_date": "Thu, 27 Jan 2000 14:43:22 -0400 (AST)", "msg_from": "\"Jeff MacDonald <[email protected]>\" <[email protected]>", "msg_from_op": true, "msg_subject": "Spinlock error" }, { "msg_contents": "\"Jeff MacDonald <[email protected]>\" <[email protected]> writes:\n> After those spinlock errors the postmaster died.... I tries to start it\n> back up and it failed with this error.\n\nYou may need to clean up shared memory blocks and/or semaphores ---\nthose are supposed to be deallocated when the postmaster quits,\nbut it sounds like it didn't happen. See the pgsql ipcclean script.\n\nNot sure what caused the stuck spinlock in the first place.\n\n\t\t\tregards, tom lane\n", "msg_date": "Thu, 27 Jan 2000 15:26:39 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Spinlock error " }, { "msg_contents": "Hi Tom,\n\nThanks for that info, do know if thre is anyway, to\nget more information from postmaster or postges ?\n\ni'd really like to be able to solve this, i'll see if i \ncan reproduce the condition.\n\n\n\n======================================================\nJeff MacDonald\n\[email protected]\tirc: bignose on EFnet\n======================================================\n\nOn Thu, 27 Jan 2000, Tom Lane wrote:\n\n> \"Jeff MacDonald <[email protected]>\" <[email protected]> writes:\n> > After those spinlock errors the postmaster died.... I tries to start it\n> > back up and it failed with this error.\n> \n> You may need to clean up shared memory blocks and/or semaphores ---\n> those are supposed to be deallocated when the postmaster quits,\n> but it sounds like it didn't happen. See the pgsql ipcclean script.\n> \n> Not sure what caused the stuck spinlock in the first place.\n> \n> \t\t\tregards, tom lane\n> \n> ************\n> \n\n", "msg_date": "Thu, 27 Jan 2000 23:07:59 -0400 (AST)", "msg_from": "\"Jeff MacDonald <[email protected]>\" <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Spinlock error " } ]
[ { "msg_contents": "I saw that it is a 4 byte integer on my site, but is that guaranteed? Or how\ndo I check for its length? That is I have to know how long a string has to\nbe so the oid fits in ascii.\n\nMichael\n-- \nMichael Meskes | Go SF 49ers!\nTh.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire!\nTel.: (+49) 2431/72651 | Use Debian GNU/Linux!\nEmail: [email protected] | Use PostgreSQL!\n", "msg_date": "Thu, 27 Jan 2000 20:23:27 +0100", "msg_from": "Michael Meskes <[email protected]>", "msg_from_op": true, "msg_subject": "Length of OID" }, { "msg_contents": "Michael Meskes <[email protected]> writes:\n> I saw that it is a 4 byte integer on my site, but is that guaranteed?\n\nYes, for now anyway.\n\nEventually I'd like to see us offering 8-byte OIDs, because a DB that's\nbeen running for a while could wrap around the OID counter and produce\nduplicate OIDs :-(. But until support for 8-byte \"long long int\" is\npretty standard, I don't think we can do it without creating tremendous\nportability problems.\n\n\t\t\tregards, tom lane\n", "msg_date": "Thu, 27 Jan 2000 18:09:26 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Length of OID " } ]
[ { "msg_contents": "I see hints here and there that there is or was a contrib Soundex support in\nPostgres. Is it still available? If I'm a dope and it's built in, how do I\ncall it?\n\nThanks for any info! Hate to do it in Perl if I don't have to.\n\n-- \nPaul Keck [email protected] http://www.coe.uga.edu/~pkeck\nUniv. of Georgia- College of Education ftp://ftp.coe.uga.edu/users/pkeck\nOffice of Information Technology (OIT)\t mailto:[email protected]\n --Opinions mine, not OIT's.-- Go fighting anomalocaridids!!!\n", "msg_date": "27 Jan 2000 20:44:08 GMT", "msg_from": "[email protected] (Paul Keck)", "msg_from_op": true, "msg_subject": "Soundex in Postgres?" } ]
[ { "msg_contents": "My last run-through before the apocalypse ...\n\n\n* Disallow inherited columns with the same name as new columns\n\nEither this was just not marked off, or there is some misconception about\nhow things should work. E.g.,\ncreate table a (x int);\ncreate table b (x text) inherits (a);\nwill fail, for obvious reasons.\n\ncreate table a (x int);\ncreate table b (x int) inherits (a);\nwill not fail, but will create a table b with *one* column x which is the\none inherited from a. This might be confusing in this context, but what\nabout\n\ncreate table a (x int);\ncreate table b (y text) inherits (a);\ncreate table c (z text) inherits (a);\ncreate table d (q time) inherits (b, c);\n\nIn this case you must allow this \"column merging\" to happen, otherwise\nthis whole scheme of inheriting would be impossible. So either the above\nitem seems done or we prohibit multiple inheritance.\n\n\n* Do not allow bpchar column creation without length\n\npeter=> create table foo (a bpchar);\nCREATE\npeter=> \\d foo\n Table \"foo\"\n Attribute | Type | Extra\n-----------+---------+-------\n a | char(1) |\n\nLooks good to me (and is standard compliant).\n\n\n* Update table SET table.value = 3 fails(SQL standard says this is OK)\n\nWe agreed that this was definitely not okay by any standard we know of.\nPlease remove it.\n\n\n* SELECT ... UNION ... ORDER BY fails when sort expr not in result list \n\nLooks good to me:\n\npeter=> select * from test1;\n a | b\n---+----\n 1 | 11\n 2 | 22\n(2 rows)\n \npeter=> select * from test2;\n a | b\n---+----\n 3 | 33\n 4 | 44\n(2 rows)\n \npeter=> select a from test1 union select a from test2 order by b;\n a\n---\n 1\n 2\n 3\n 4\n(4 rows)\n\nPerhaps be more specific?\n\n\n* SELECT ... UNION ... GROUP BY fails if column types disagree\n\nShouldn't it?\n\n\n* Allow user to define char1 column\n\nBoth of\ncreate table test (a char);\ncreate table test (a char(1));\nseem to work.\n\n\n* Add support for & operator\n\nTo do what? I can only see this specified in embedded SQL. More specific\nhere as well?\n\n\n* Make Absolutetime/Relativetime int4 because time_t can be int8 on some\nports\n\nThis is done.\n\n\n* Make type equivalency apply to aggregates\n\nThis is done.\n\n\n* -Add ALTER TABLE DROP/ALTER COLUMN feature\n\nAin't gonna happen. (Okay, the ALTER COLUMN part is, but not the rest.)\n\n\n* Add PL/Perl(Mark Hollomon)\n\nI understand this is done as well. Someone might want to incorporate this\ninto the build process, as well as add it into createlang.\n\n\n* Pre-generate lex and yacc output so not required for install\n\nDone.\n\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Thu, 27 Jan 2000 23:28:44 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": true, "msg_subject": "TODO list check" }, { "msg_contents": "Peter Eisentraut <[email protected]> writes:\n> My last run-through before the apocalypse ...\n\nActually, I believe the core decided to postpone 7.0 beta to ~ Feb 15\na day or two ago during an IRC chat. Thomas isn't ready, and it seems\nlike everyone else could use a little more time too. Marc was supposed\nto send out a notification to pg-hackers, but I haven't seen it go by...\n\n\n> * Disallow inherited columns with the same name as new columns\n\n> Either this was just not marked off, or there is some misconception about\n> how things should work.\n\nWell, I'm not sure. Clearly, multiple inheritance is a problem if you\ncan't inherit similar columns from two parents. But is it a good idea\nto allow a child to declare (what it thinks is) a new column, and have\nthat silently get merged with an inherited column? Seems like kicking\nout an error would be a better idea.\n\n> * Do not allow bpchar column creation without length\n\n> Looks good to me (and is standard compliant).\n\nI don't see a good reason for this item either.\n\n> * SELECT ... UNION ... ORDER BY fails when sort expr not in result list \n\n> Looks good to me:\n\nNo, it's still broken; your test case doesn't actually exercise any\nsorting, does it? The bug is that the ORDER BY only gets applied to the\nfirst SELECT; the rest are just appended on. This bug is awaiting\nquerytree redesign; it's possible that it could be fixed now, but the\nUNION code is so bogus that no one really wants to touch it now...\n\n> * SELECT ... UNION ... GROUP BY fails if column types disagree\n\n> Shouldn't it?\n\nNot if they can be promoted to a common supertype. The entry is pretty\nmisleading because it is so terse though. The system *does* in fact\npromote to a common supertype, it's the GROUP BY part that is at risk.\nMy note about this reads\n\tselect q1 from int8_tbl union select f1 from int4_tbl group by f1;\n\tfails (subtly) because wrong sortop is applied to f1.\nExamining the parsetree shows that int4lt is applied to sort f1 (for\ngrouping) *after* it is promoted to int8. Oops. Again, this is\nprobably very difficult to fix without parsetree restructuring.\n\n> * Allow user to define char1 column\n\n> Both of\n> create table test (a char);\n> create table test (a char(1));\n> seem to work.\n\nThe problem is that you can't any longer get at the plain \"char\"\ndatatype, which is not to be confused with bpchar(1). If you just want\na one-byte datatype, say for a poor man's enumerated type ('A' =\nsomething, 'B' = something else, etc), you can't have it. bpchar(1)\nacts the same but actually occupies 5 to 8 bytes :-(. True \"char\" is\nstill used in several system tables, there's just no good way for users\nto get at it. I think the proposal was to rename it \"char1\" so that it\ncould be accessed.\n\nCome to think of it, it was mostly me complaining about this, so maybe\nI should just go do it; no time for it like 7.0, no? Will anyone object\nif I do this?\n\n> * Add support for & operator\n\n> To do what?\n\nI don't know what this is about either.\n\n\t\t\tregards, tom lane\n", "msg_date": "Thu, 27 Jan 2000 19:05:52 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] TODO list check " }, { "msg_contents": "[Charset ISO-8859-1 unsupported, filtering to ASCII...]\n> My last run-through before the apocalypse ...\n> \n> \n> * Disallow inherited columns with the same name as new columns\n> \n> Either this was just not marked off, or there is some misconception about\n> how things should work. E.g.,\n> create table a (x int);\n> create table b (x text) inherits (a);\n> will fail, for obvious reasons.\n> \n> create table a (x int);\n> create table b (x int) inherits (a);\n> will not fail, but will create a table b with *one* column x which is the\n> one inherited from a. This might be confusing in this context, but what\n> about\n> \n> create table a (x int);\n> create table b (y text) inherits (a);\n> create table c (z text) inherits (a);\n> create table d (q time) inherits (b, c);\n> \n> In this case you must allow this \"column merging\" to happen, otherwise\n> this whole scheme of inheriting would be impossible. So either the above\n> item seems done or we prohibit multiple inheritance.\n\nRemoved.\n\n\n> \n> \n> * Do not allow bpchar column creation without length\n> \n> peter=> create table foo (a bpchar);\n> CREATE\n> peter=> \\d foo\n> Table \"foo\"\n> Attribute | Type | Extra\n> -----------+---------+-------\n> a | char(1) |\n> \n> Looks good to me (and is standard compliant).\n\nRemoved.\n\n> \n> \n> * Update table SET table.value = 3 fails(SQL standard says this is OK)\n> \n> We agreed that this was definitely not okay by any standard we know of.\n> Please remove it.\n\nRemoved.\n\n> \n> \n> * SELECT ... UNION ... ORDER BY fails when sort expr not in result list \n> \n> Looks good to me:\n> \n> peter=> select * from test1;\n> a | b\n> ---+----\n> 1 | 11\n> 2 | 22\n> (2 rows)\n> \n> peter=> select * from test2;\n> a | b\n> ---+----\n> 3 | 33\n> 4 | 44\n> (2 rows)\n> \n> peter=> select a from test1 union select a from test2 order by b;\n> a\n> ---\n> 1\n> 2\n> 3\n> 4\n> (4 rows)\n> \n> Perhaps be more specific?\n> \n\nRemoved.\n\n> \n> * SELECT ... UNION ... GROUP BY fails if column types disagree\n> \n> Shouldn't it?\n> \n\nRemoved.\n\n> \n> * Allow user to define char1 column\n> \n> Both of\n> create table test (a char);\n> create table test (a char(1));\n> seem to work.\n> \n\nMarked as done.\n\n> \n> * Add support for & operator\n> \n> To do what? I can only see this specified in embedded SQL. More specific\n> here as well?\n\nThey want to use it for some bitwise stuff. I think we have a bit type\nsomewhere.\n\n\n> \n> \n> * Make Absolutetime/Relativetime int4 because time_t can be int8 on some\n> ports\n> \n> This is done.\n\nMarked as done. I think your copy is a little old because dash marks\nappear on my copy.\n> \n> \n> * Make type equivalency apply to aggregates\n> \n> This is done.\n> \n\nAlready marked.\n\n> \n> * -Add ALTER TABLE DROP/ALTER COLUMN feature\n> \n> Ain't gonna happen. (Okay, the ALTER COLUMN part is, but not the rest.)\n> \n\nI understand, and think it is a shame.\n\n> \n> * Add PL/Perl(Mark Hollomon)\n> \n> I understand this is done as well. Someone might want to incorporate this\n> into the build process, as well as add it into createlang.\n\nMarked as done.\n\n> \n> \n> * Pre-generate lex and yacc output so not required for install\n> \n> Done.\n\nMarked as done. Thanks for the updates.\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": "Thu, 27 Jan 2000 22:46:53 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] TODO list check" }, { "msg_contents": "> Peter Eisentraut <[email protected]> writes:\n> > My last run-through before the apocalypse ...\n> \n> Actually, I believe the core decided to postpone 7.0 beta to ~ Feb 15\n> a day or two ago during an IRC chat. Thomas isn't ready, and it seems\n> like everyone else could use a little more time too. Marc was supposed\n> to send out a notification to pg-hackers, but I haven't seen it go by...\n> \n> \n> > * Disallow inherited columns with the same name as new columns\n> \n> > Either this was just not marked off, or there is some misconception about\n> > how things should work.\n\nRe-added.\n\n> \n> Well, I'm not sure. Clearly, multiple inheritance is a problem if you\n> can't inherit similar columns from two parents. But is it a good idea\n> to allow a child to declare (what it thinks is) a new column, and have\n> that silently get merged with an inherited column? Seems like kicking\n> out an error would be a better idea.\n> \n> > * Do not allow bpchar column creation without length\n> \n> > Looks good to me (and is standard compliant).\n> \n> I don't see a good reason for this item either.\n> \n> > * SELECT ... UNION ... ORDER BY fails when sort expr not in result list \n> \n> > Looks good to me:\n\nRe-added.\n\n> \n> No, it's still broken; your test case doesn't actually exercise any\n> sorting, does it? The bug is that the ORDER BY only gets applied to the\n> first SELECT; the rest are just appended on. This bug is awaiting\n> querytree redesign; it's possible that it could be fixed now, but the\n> UNION code is so bogus that no one really wants to touch it now...\n> \n> > * SELECT ... UNION ... GROUP BY fails if column types disagree\n> \n> > Shouldn't it?\n\nRe-added.\n\n> \n> Not if they can be promoted to a common supertype. The entry is pretty\n> misleading because it is so terse though. The system *does* in fact\n> promote to a common supertype, it's the GROUP BY part that is at risk.\n> My note about this reads\n> \tselect q1 from int8_tbl union select f1 from int4_tbl group by f1;\n> \tfails (subtly) because wrong sortop is applied to f1.\n> Examining the parsetree shows that int4lt is applied to sort f1 (for\n> grouping) *after* it is promoted to int8. Oops. Again, this is\n> probably very difficult to fix without parsetree restructuring.\n> \n> > * Allow user to define char1 column\n> \n> > Both of\n> > create table test (a char);\n> > create table test (a char(1));\n> > seem to work.\n\nRe-added.\n\n> \n> The problem is that you can't any longer get at the plain \"char\"\n> datatype, which is not to be confused with bpchar(1). If you just want\n> a one-byte datatype, say for a poor man's enumerated type ('A' =\n> something, 'B' = something else, etc), you can't have it. bpchar(1)\n> acts the same but actually occupies 5 to 8 bytes :-(. True \"char\" is\n> still used in several system tables, there's just no good way for users\n> to get at it. I think the proposal was to rename it \"char1\" so that it\n> could be accessed.\n> \n> Come to think of it, it was mostly me complaining about this, so maybe\n> I should just go do it; no time for it like 7.0, no? Will anyone object\n> if I do this?\n> \n> > * Add support for & operator\n> \n> > To do what?\n> \n> I don't know what this is about either.\n> \n> \t\t\tregards, tom lane\n> \n> ************\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", "msg_date": "Thu, 27 Jan 2000 23:46:35 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] TODO list check" }, { "msg_contents": "\nHas anybody had any opinions on getting rid of the \"*\" syntax like\nInformix/Illustra has done?\n\nIn other words in postgres, this...\nSELECT * FROM person*\nwould be in Informix\nSELECT * FROM person\n\n\nand\n\nin postgres...\nSELECT * FROM person\nwould be in Informix...\nSELECT * FROM ONLY person\n\nI think it makes a lot more sense.\n\nAny intellectual support for that in some future release?\n", "msg_date": "Fri, 28 Jan 2000 16:18:47 +1100", "msg_from": "Chris Bitmead <[email protected]>", "msg_from_op": false, "msg_subject": "ONLY vs \"*\"" }, { "msg_contents": "Chris Bitmead <[email protected]> writes:\n> Has anybody had any opinions on getting rid of the \"*\" syntax like\n> Informix/Illustra has done?\n\nI think that on an abstract OODB level they did the right thing.\nThe only argument against changing would be if it breaks the\nexisting code for too many applications. pghackers is probably\nnot the best place to get a sense of that --- maybe you should\nbring up the point on pgsql-sql (and perhaps pgsql-general?)\n\n\t\t\tregards, tom lane\n", "msg_date": "Fri, 28 Jan 2000 01:24:53 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] ONLY vs \"*\" " }, { "msg_contents": "On 2000-01-27, Tom Lane mentioned:\n\n> > * Disallow inherited columns with the same name as new columns\n> \n> > Either this was just not marked off, or there is some misconception about\n> > how things should work.\n> \n> Well, I'm not sure. Clearly, multiple inheritance is a problem if you\n> can't inherit similar columns from two parents. But is it a good idea\n> to allow a child to declare (what it thinks is) a new column, and have\n> that silently get merged with an inherited column? Seems like kicking\n> out an error would be a better idea.\n\nOkay, now it gives an error if you try to create a new column with the\nsame name as an inherited column, but allows merging of columns between\ninherited tables. Check.\n\n \n> > * SELECT ... UNION ... ORDER BY fails when sort expr not in result list \n> \n> > Looks good to me:\n> \n> No, it's still broken; your test case doesn't actually exercise any\n> sorting, does it? The bug is that the ORDER BY only gets applied to the\n> first SELECT; the rest are just appended on. This bug is awaiting\n> querytree redesign; it's possible that it could be fixed now, but the\n> UNION code is so bogus that no one really wants to touch it now...\n> \n> > * SELECT ... UNION ... GROUP BY fails if column types disagree\n> \n> > Shouldn't it?\n> \n> Not if they can be promoted to a common supertype. The entry is pretty\n> misleading because it is so terse though.\n\nHow about adding this into TODO.detail, so two months from now everyone\n(except those that keep outside lists) remembers it. (Or just rephrase\nthis item, if you can.)\n\n\n> > * Do not allow bpchar column creation without length\n> \n> > Looks good to me (and is standard compliant).\n> \n> I don't see a good reason for this item either.\n\nThis item may be the same as the one below. The other day while working on\npsql and mapping internal to sql types for \\d output I noticed that system\ntables have char columns with -1 typmod. I suppose that this would be your\nchar1 type?\n\n> > * Allow user to define char1 column\n\n> Come to think of it, it was mostly me complaining about this, so maybe\n> I should just go do it; no time for it like 7.0, no? Will anyone object\n> if I do this?\n\nAt least the above behaviour is very subtle indeed. While I'm not so\nexcited about having all kinds of \"more efficient\" types around for\ninternal use (char1, abstime, some of the oid arrays), do what you feel is\nbest. The clean solution would seem to be item\n\n* Allow char() not to use variable-sized header to reduce disk size\n\nwhere you would use the atttypmod as the length instead of the header. But\na general solution like this would probably require too many structural\nchanges.\n\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n\n", "msg_date": "Sat, 29 Jan 2000 12:14:01 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] TODO list check " }, { "msg_contents": "Peter Eisentraut <[email protected]> writes:\n> The clean solution would seem to be item\n\n> * Allow char() not to use variable-sized header to reduce disk size\n\n> where you would use the atttypmod as the length instead of the header. But\n> a general solution like this would probably require too many structural\n> changes.\n\nRight now, *all* variable-length types have a varlena header, and\nI think there isn't much of any way around that for internal\nrepresentation --- if Datums aren't self-sufficient then we've got\na real notational nightmare in the expression evaluator and function\ncall mechanism. Maybe we could make the inside-a-tuple representation\ndifferent from what gets passed around in expression evaluation, but\nthat sure looks like a can of worms to me. So I don't foresee this\nTODO item getting done any time soon --- the cost/benefit ratio looks\nway too high compared to all our other projects.\n\nThe reason the \"allow access to char1\" item is there is that I have an\napplication that has several different status indicators in each row\nof a large table. I represented them as \"char\" values, which was both\nuseful for debugging ('P' = pending, etc) and compact, or so I thought.\nWhen I realized that my status fields were not taking one byte apiece\nas I expected, but eight bytes apiece (length word + alignment), I\nwasn't happy.\n\nWe are using char1 as an enumerated type in several system fields\n(relkind, for example) so I see no good reason why that type shouldn't\nbe available to user applications. It is actually possible to *make*\na char1 field in a user table:\n\tcreate table t1 (f1 \"char\");\nbut pg_dump won't reliably dump and restore this declaration because\nit depends on a quoting hack not to be rewritten as bpchar(1) by the\nparser.\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 29 Jan 2000 10:58:37 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] TODO list check " }, { "msg_contents": "\nTODO list updated with your suggestions.\n\n[Charset ISO-8859-1 unsupported, filtering to ASCII...]\n> On 2000-01-27, Tom Lane mentioned:\n> \n> > > * Disallow inherited columns with the same name as new columns\n> > \n> > > Either this was just not marked off, or there is some misconception about\n> > > how things should work.\n> > \n> > Well, I'm not sure. Clearly, multiple inheritance is a problem if you\n> > can't inherit similar columns from two parents. But is it a good idea\n> > to allow a child to declare (what it thinks is) a new column, and have\n> > that silently get merged with an inherited column? Seems like kicking\n> > out an error would be a better idea.\n> \n> Okay, now it gives an error if you try to create a new column with the\n> same name as an inherited column, but allows merging of columns between\n> inherited tables. Check.\n> \n> \n> > > * SELECT ... UNION ... ORDER BY fails when sort expr not in result list \n> > \n> > > Looks good to me:\n> > \n> > No, it's still broken; your test case doesn't actually exercise any\n> > sorting, does it? The bug is that the ORDER BY only gets applied to the\n> > first SELECT; the rest are just appended on. This bug is awaiting\n> > querytree redesign; it's possible that it could be fixed now, but the\n> > UNION code is so bogus that no one really wants to touch it now...\n> > \n> > > * SELECT ... UNION ... GROUP BY fails if column types disagree\n> > \n> > > Shouldn't it?\n> > \n> > Not if they can be promoted to a common supertype. The entry is pretty\n> > misleading because it is so terse though.\n> \n> How about adding this into TODO.detail, so two months from now everyone\n> (except those that keep outside lists) remembers it. (Or just rephrase\n> this item, if you can.)\n> \n> \n> > > * Do not allow bpchar column creation without length\n> > \n> > > Looks good to me (and is standard compliant).\n> > \n> > I don't see a good reason for this item either.\n> \n> This item may be the same as the one below. The other day while working on\n> psql and mapping internal to sql types for \\d output I noticed that system\n> tables have char columns with -1 typmod. I suppose that this would be your\n> char1 type?\n> \n> > > * Allow user to define char1 column\n> \n> > Come to think of it, it was mostly me complaining about this, so maybe\n> > I should just go do it; no time for it like 7.0, no? Will anyone object\n> > if I do this?\n> \n> At least the above behaviour is very subtle indeed. While I'm not so\n> excited about having all kinds of \"more efficient\" types around for\n> internal use (char1, abstime, some of the oid arrays), do what you feel is\n> best. The clean solution would seem to be item\n> \n> * Allow char() not to use variable-sized header to reduce disk size\n> \n> where you would use the atttypmod as the length instead of the header. But\n> a general solution like this would probably require too many structural\n> changes.\n> \n> \n> -- \n> Peter Eisentraut Sernanders v_g 10:115\n> [email protected] 75262 Uppsala\n> http://yi.org/peter-e/ Sweden\n> \n> \n> \n> ************\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", "msg_date": "Sat, 29 Jan 2000 12:23:45 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] TODO list check" } ]
[ { "msg_contents": "Hi all!\n\nBeating on the Postgresql database v6.5.3 on my Intel machine, I find lots\nof orphaned tables in my database's directory such as:\n\n\tpg_sorttemp#####.#\n\tpg_temp.#####.#\n\nI know temp tables have been changed drastically in V7.0 and cleaned up (I\ncan't wait since I use them extensively). I was wondering if VACUUM has\nbeen altered to clean the data directory of stale/useless files such as\nthose above. If not, I think this might be an important feature.\n\n- K\n\nKristofer Munn * KMI * 973-509-9414 * AIM KrMunn * http://www.munn.com/\n\n", "msg_date": "Thu, 27 Jan 2000 18:03:05 -0500 (EST)", "msg_from": "Kristofer Munn <[email protected]>", "msg_from_op": true, "msg_subject": "Orphaned files in the database..." } ]
[ { "msg_contents": "\nOdd ... I did send it ... but I haven't seen it come through yet either :(\n\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n---------- Forwarded message ----------\nDate: Thu, 27 Jan 2000 12:54:15 -0400 (AST)\nFrom: The Hermit Hacker <[email protected]>\nTo: [email protected]\nSubject: PostgreSQL 7.0beta Freeze Postponed ...\n\n\nIn order to allow for several developers to finish off key projects and/or\nresolve issues, the Beta Freeze is being postponed until Feb 15th ...\n\n\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n\n", "msg_date": "Thu, 27 Jan 2000 20:51:09 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "PostgreSQL 7.0beta Freeze Postponed ... (fwd)" } ]
[ { "msg_contents": "\nUsing this Query:\n\nexplain SELECT w.counter_id,\n ( date_part('month', w.stat_date) || '/' ||\n date_part('day', w.stat_date) || '/' ||\n date_part('year', w.stat_date) || ' 00:00:00')::datetime as\ndayperiod,\n r.referrer_id, count(w.referrer_hits)\n FROM webhit_referer_raw w, referrer_data r, referrer_link l\n WHERE w.stat_date < 'Jan 25 2000'\n AND w.referrer_url = r.referrer\n AND l.counter_id = w.counter_id\n AND l.stat_date = dayperiod\n AND l.referrer_id = r.referrer_id\nGROUP BY dayperiod, counter_id, referrer_id\nORDER BY counter_id, dayperiod;\n\nI get:\n\nERROR: attribute 'dayperiod' not found\n\nI'm guessing right now its on: \"AND l.stat_date = dayperiod\"\n\nShould that not work? And, I know, its a major mess, just a thought I'm\nplaying with ... :)\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Thu, 27 Jan 2000 21:07:35 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "[6.5.3] 'attribute not found' " }, { "msg_contents": "The Hermit Hacker <[email protected]> writes:\n> explain SELECT w.counter_id,\n> ( date_part('month', w.stat_date) || '/' ||\n> date_part('day', w.stat_date) || '/' ||\n> date_part('year', w.stat_date) || ' 00:00:00')::datetime as\n> dayperiod,\n> r.referrer_id, count(w.referrer_hits)\n> FROM webhit_referer_raw w, referrer_data r, referrer_link l\n> WHERE w.stat_date < 'Jan 25 2000'\n> AND w.referrer_url = r.referrer\n> AND l.counter_id = w.counter_id\n> AND l.stat_date = dayperiod\n> AND l.referrer_id = r.referrer_id\n> GROUP BY dayperiod, counter_id, referrer_id\n> ORDER BY counter_id, dayperiod;\n\n> I get:\n> ERROR: attribute 'dayperiod' not found\n\n> I'm guessing right now its on: \"AND l.stat_date = dayperiod\"\n\nYup.\n\n> Should that not work?\n\nNo, it shouldn't. Labeling SELECT output columns with AS doesn't\naffect the namespace visible in the WHERE clause (since WHERE is\n\"upstream\" of the SELECT outputs). If we had sub-selects in FROM,\nI believe that AS would determine the column names seen outside\nthe sub-select (\"downstream\").\n\nAlso, you can use the AS names in ORDER BY, which is also \"downstream\"\nof forming the results. (I think we currently accept them in GROUP BY\nas well, but I suspect that that is not in compliance with the\nstandard...)\n\n\t\t\tregards, tom lane\n", "msg_date": "Thu, 27 Jan 2000 22:35:49 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] [6.5.3] 'attribute not found' " }, { "msg_contents": "On Thu, 27 Jan 2000, Tom Lane wrote:\n\n> The Hermit Hacker <[email protected]> writes:\n> > explain SELECT w.counter_id,\n> > ( date_part('month', w.stat_date) || '/' ||\n> > date_part('day', w.stat_date) || '/' ||\n> > date_part('year', w.stat_date) || ' 00:00:00')::datetime as\n> > dayperiod,\n> > r.referrer_id, count(w.referrer_hits)\n> > FROM webhit_referer_raw w, referrer_data r, referrer_link l\n> > WHERE w.stat_date < 'Jan 25 2000'\n> > AND w.referrer_url = r.referrer\n> > AND l.counter_id = w.counter_id\n> > AND l.stat_date = dayperiod\n> > AND l.referrer_id = r.referrer_id\n> > GROUP BY dayperiod, counter_id, referrer_id\n> > ORDER BY counter_id, dayperiod;\n> \n> > I get:\n> > ERROR: attribute 'dayperiod' not found\n> \n> > I'm guessing right now its on: \"AND l.stat_date = dayperiod\"\n> \n> Yup.\n> \n> > Should that not work?\n> \n> No, it shouldn't. Labeling SELECT output columns with AS doesn't\n> affect the namespace visible in the WHERE clause (since WHERE is\n> \"upstream\" of the SELECT outputs). If we had sub-selects in FROM,\n> I believe that AS would determine the column names seen outside\n> the sub-select (\"downstream\").\n> \n> Also, you can use the AS names in ORDER BY, which is also \"downstream\"\n> of forming the results. (I think we currently accept them in GROUP BY\n> as well, but I suspect that that is not in compliance with the\n> standard...)\n\nYup, I'm using it in both the GROUP and ORDER BY ... not a big deal\nthough, the query looked like hell anyway :)\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Thu, 27 Jan 2000 23:48:42 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] [6.5.3] 'attribute not found' " }, { "msg_contents": "At 10:35 PM 1/27/00 -0500, Tom Lane wrote:\n\n>> Should that not work?\n>\n>No, it shouldn't. Labeling SELECT output columns with AS doesn't\n>affect the namespace visible in the WHERE clause (since WHERE is\n>\"upstream\" of the SELECT outputs). \n\nAnd I agree ... in other words, the where clause determines the rows\nto be processed and returned to the target list. \n\nYou are essentially asking that the result of the query be used as\na criterian for determining the result of the query...\n\n> If we had sub-selects in FROM,\n>I believe that AS would determine the column names seen outside\n>the sub-select (\"downstream\").\n\nMakes sense...\n\n>\n>Also, you can use the AS names in ORDER BY, which is also \"downstream\"\n>of forming the results. (I think we currently accept them in GROUP BY\n>as well, but I suspect that that is not in compliance with the\n>standard...)\n\nAfter the discussion a few weeks ago I tried to decide by reading Date\n(which I bought in part of the discussion, figuring it was about time)\nand decided I couldn't tell for sure...\n\nNow that I've got a draft copy of the ISO standard, maybe I'll find time\nto dig into it.\n\nMay not be easy to decide for sure one way or the other...standards groups\noccasionally leave such things more or less ambiguous as a means of moving\nforward when dissenting parties (companies, usually) differ, in hopes that\nin practice it won't matter.\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Thu, 27 Jan 2000 20:55:56 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] [6.5.3] 'attribute not found' " }, { "msg_contents": "> >No, it shouldn't. Labeling SELECT output columns with AS doesn't\n> >affect the namespace visible in the WHERE clause (since WHERE is\n> >\"upstream\" of the SELECT outputs).\n> > If we had sub-selects in FROM,\n> >I believe that AS would determine the column names seen outside\n> >the sub-select (\"downstream\").\n> >Also, you can use the AS names in ORDER BY, which is also \"downstream\"\n> >of forming the results. (I think we currently accept them in GROUP BY\n> >as well, but I suspect that that is not in compliance with the\n> >standard...)\n> After the discussion a few weeks ago I tried to decide by reading Date\n> (which I bought in part of the discussion, figuring it was about time)\n> and decided I couldn't tell for sure...\n\nOh puhleez! Date... about time... Or maybe finding that funny means\nI've been working on this stuff *way* too long :)\n\nAnyway, afaik we will have the capability in 7.0 to specify column\naliases in AS clauses like this:\n\npostgres=# select a+b from t1 as tx (a), t1 as ty (b);\n ?column? \n----------\n 2\n(1 row)\n\nThis is actually running on my computer now; I'm starting to rework\nthe \"outer join syntax\" and will then do a commit.\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Fri, 28 Jan 2000 15:25:36 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] [6.5.3] 'attribute not found'" } ]
[ { "msg_contents": "gcc -Wall picks up a warning on line 1187 of this file:\n\n elog(ERROR, \"s%: Unable to convert datetime to tm\", FUNC_NAME);\n\nI presume line 1187 should be:\n\n elog(ERROR, \"%s: Unable to convert datetime to tm\", FUNC_NAME);\n ^^ (not s%)\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Thu, 27 Jan 2000 17:16:42 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": true, "msg_subject": "very minor problem in contrib/dateformat/to-from_char.c" }, { "msg_contents": "> gcc -Wall picks up a warning on line 1187 of this file:\n> \n> elog(ERROR, \"s%: Unable to convert datetime to tm\", FUNC_NAME);\n> \n> I presume line 1187 should be:\n> \n> elog(ERROR, \"%s: Unable to convert datetime to tm\", FUNC_NAME);\n> ^^ (not s%)\n\nThis file is removed from the tree now. Moved to adt, where this bug\ndoesn't exista anymore.\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": "Thu, 27 Jan 2000 23:51:03 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] very minor problem in contrib/dateformat/to-from_char.c" }, { "msg_contents": "At 11:51 PM 1/27/00 -0500, Bruce Momjian wrote:\n>> gcc -Wall picks up a warning on line 1187 of this file:\n>> \n>> elog(ERROR, \"s%: Unable to convert datetime to tm\", FUNC_NAME);\n>> \n>> I presume line 1187 should be:\n>> \n>> elog(ERROR, \"%s: Unable to convert datetime to tm\", FUNC_NAME);\n>> ^^ (not s%)\n>\n>This file is removed from the tree now. Moved to adt, where this bug\n>doesn't exista anymore.\n\nThanks, I'd avoided updating my sources recently due to the issues\nregarding libpq, which we absolutely depend upon.\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Thu, 27 Jan 2000 21:00:50 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] very minor problem in contrib/dateformat/to-from_char.c" }, { "msg_contents": "On Thu, 27 Jan 2000, Don Baccus wrote:\n\n> At 11:51 PM 1/27/00 -0500, Bruce Momjian wrote:\n> >> gcc -Wall picks up a warning on line 1187 of this file:\n> >> \n> >> elog(ERROR, \"s%: Unable to convert datetime to tm\", FUNC_NAME);\n> >> \n> >> I presume line 1187 should be:\n> >> \n> >> elog(ERROR, \"%s: Unable to convert datetime to tm\", FUNC_NAME);\n> >> ^^ (not s%)\n> >\n> >This file is removed from the tree now. Moved to adt, where this bug\n> >doesn't exista anymore.\n> \n> Thanks, I'd avoided updating my sources recently due to the issues\n> regarding libpq, which we absolutely depend upon.\n\n Sorry, it is my bug, but as Bruce say, it is dead code.\n\n\t\t\t\t\t\t\tKarel\n\n", "msg_date": "Fri, 28 Jan 2000 11:45:13 +0100 (CET)", "msg_from": "Karel Zak - Zakkr <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] very minor problem in contrib/dateformat/to-from_char.c" } ]
[ { "msg_contents": "Bd SQL (for the equality on min_b). Sorry for the two messages:\n\nAt 23:28 27/01/00 +0100, Peter Eisentraut wrote:\n>\n>select one.a, two.b, two.c\n>from\n> (select a, min(b) as \"min_b\" from test group by a) as one,\n> (select b, c from test) as two\n>where one.\"min_b\" = two.b\n>\n>Not sure if this is completely legal as it stands but at least the idea\n>would be to join the grouped select with the plain one to get the c\n>corresponding to the minimum b. But of course we don't offer that, so it's\n>distinct on until then. (It would really surprise me if the distinct on\n>functionality was not at all possible to emulate using SQL, since in my\n>experience it is fairly complete with regards to querying options at\n>least.)\n\nYou are quite right - with a complete SQL impleentation, DISTINCT ON\nbecomes superfluous. Although it may give the optimizer usefull hints as to\nhow to approach the query. You actually have to be a bit more carefull to\navoid duplicates, something like:\n\nSelect \n a,b,c\n>From \n (Select a, min(b) from test group by a) as one(a,min_b),\n (Select b, c from test t2 where t2.a = one.a and t2.b = min_b limit to\n1 row) as two\n\nThis is legal on the DB I use most of the time.\n\n\n\n\n\n\n----------------------------------------------------------------\nPhilip Warner | __---_____\nAlbatross Consulting Pty. Ltd. |----/ - \\\n(A.C.N. 008 659 498) | /(@) ______---_\nTel: +61-03-5367 7422 | _________ \\\nFax: +61-03-5367 7430 | ___________ |\nHttp://www.rhyme.com.au | / \\|\n | --________--\nPGP key available upon request, | /\nand from pgp5.ai.mit.edu:11371 |/\n", "msg_date": "Fri, 28 Jan 2000 12:30:28 +1100", "msg_from": "Philip Warner <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] DISTINCT ON: speak now or forever hold your\n peace" } ]
[ { "msg_contents": "I'm implementing an O/R mapping tools for Java on top of JDBC. One of\nthe issues I'm dealing with are dirty checks.\n\nAn object is loaded from a row and modified in memory without acquiring\na lock. Prior to storing the object I would like to assure that the\nmemory copy is current and no changes occured to the database in the\nmeantime.\n\nOne way of doing that is by comparing fields from the original object\ncopy. Another solution is using a TIMESTAMP or RAWID.\n\nIn RDBMS that support timestamp, each update to a row updates the\ntimestamp, so loading the timestamp and comparing it during update is\nsufficient to identity dirtyness.\n\nIn RDBMS that support RAWID (as opposed to ROWID), every update to the\nrow updates the RAWID, providing the same functionality as TIMESTAMP but\nwithout the time value.\n\nI ran a very simple test using ctid and noticed that each update to a\nrow (a three-row table) changes the ctid. I want to know if that is by\naccident or by design. Assuming that I update a row, will ctid change\neach time, or only when the row is repositioned in the database.\n\nAnd, if ctid does not have to change when a row is updated, why does it\nchange in such a small table (less than the size of a page)?\n\narkin\n\n\n-- \n----------------------------------------------------------------------\nAssaf Arkin www.exoffice.com\nCTO, Exoffice Technologies, Inc. www.exolab.org\n", "msg_date": "Thu, 27 Jan 2000 17:45:23 -0800", "msg_from": "Assaf Arkin <[email protected]>", "msg_from_op": true, "msg_subject": "TID clarification" }, { "msg_contents": "Assaf Arkin <[email protected]> writes:\n> I ran a very simple test using ctid and noticed that each update to a\n> row (a three-row table) changes the ctid. I want to know if that is by\n> accident or by design. Assuming that I update a row, will ctid change\n> each time, or only when the row is repositioned in the database.\n\n> And, if ctid does not have to change when a row is updated, why does it\n> change in such a small table (less than the size of a page)?\n\nSince ctid represents the physical location within the table file,\nit must change in an update --- otherwise we'd be overwriting the\noriginal tuple, which would prevent rollback if the transaction is\naborted later on.\n\nHowever, once the updating transaction is committed, the original\ntuple position is not needed anymore, and in theory it could be\nrecycled at any later instant --- perhaps for a second update of\nthat same logical tuple. If that happened, you couldn't tell by\nctid that the third-generation tuple wasn't the same as the\nfirst-generation one.\n\nRight now, we do not recycle tuples (ctids) until VACUUM, but that's\nlikely to change someday.\n\nIn short, checking for tid change would probably work in the current\nstate of Postgres, but I couldn't recommend it as a long-term solution.\nInstead consider using an update serial number field that's stamped\nfrom a SEQUENCE object by an on-insert-or-update trigger.\n\n\t\t\tregards, tom lane\n", "msg_date": "Thu, 27 Jan 2000 23:39:59 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] TID clarification " } ]
[ { "msg_contents": "Hi. I have a reproducible crash on the backend of my system\n(6.5.3/Intel) when selecting a particular tuple from a particular table. \nMy guess is something went wrong in the tuple itself and now the code\nbelow is failing. I get between 6 and 20 spinlock crashes on my box each\nday that look like this in /var/log/messages:\n\nJan 23 08:02:46 mymailman logger: FATAL: s_lock(401dcc34) at\nbufmgr.c:1106, stuck spinlock. Aborting. \n\nThis isn't the first time I've had this issue. One solution is to delete\nthe affected tuple and vacuum. A vacuum spins indeterminably and the file\naccess dates don't change in the database directory.\n\nI brought it into gdb and here's the result:\n\n(gdb) bt\n#0 0x8062354 in nocachegetattr (tuple=0x823278c, attnum=1,\ntupleDesc=0x81d70b8, isnull=0xbfffa3c7 \"\")\n at heaptuple.c:492\n#1 0x8092cf2 in ExecEvalVar (variable=0x8230968, econtext=0x8232730,\nisNull=0xbfffa3c7 \"\") at execQual.c:295\n#2 0x8093810 in ExecEvalExpr (expression=0x8230968, econtext=0x8232730,\nisNull=0xbfffa3c7 \"\", \n isDone=0xbfffa48b \"\\001\\234\\210\\t\\bp\\035#\\b\\207\\t\\b&\\t\\bp\\035#\\b\") at\nexecQual.c:1208\n#3 0x8093a3d in ExecTargetList (targetlist=0x8231a98, nodomains=14,\ntargettype=0x8232800, values=0x8233a98, \n econtext=0x8232730, isDone=0xbfffa48b\n\"\\001\\234\\210\\t\\bp\\035#\\b\\207\\t\\b&\\t\\bp\\035#\\b\")\n at execQual.c:1495\n#4 0x8093bed in ExecProject (projInfo=0x8231cc0, \n isDone=0xbfffa48b \"\\001\\234\\210\\t\\bp\\035#\\b\\207\\t\\b&\\t\\bp\\035#\\b\") at\nexecQual.c:1621\n#5 0x8093ca1 in ExecScan (node=0x8231d70, accessMtd=0x80987a0 <SeqNext>)\nat execScan.c:153\n#6 0x80988bb in ExecSeqScan (node=0x8231d70) at nodeSeqscan.c:159\n#7 0x80926c6 in ExecProcNode (node=0x8231d70, parent=0x8231d70) at\nexecProcnode.c:262\n#8 0x8091a79 in ExecutePlan (estate=0x8232080, plan=0x8231d70,\noperation=CMD_SELECT, offsetTuples=0, \n numberTuples=0, direction=ForwardScanDirection, destfunc=0x8233df0) at\nexecMain.c:908\n#9 0x809117e in ExecutorRun (queryDesc=0x8232068, estate=0x8232080,\nfeature=3, limoffset=0x0, limcount=0x0)\n at execMain.c:339\n#10 0x80df768 in ProcessQueryDesc (queryDesc=0x8232068, limoffset=0x0,\nlimcount=0x0) at pquery.c:333\n#11 0x80df7ce in ProcessQuery (parsetree=0x820c5b8, plan=0x8231d70,\ndest=Remote) at pquery.c:376\n#12 0x80de228 in pg_exec_query_dest (query_string=0xbfffa634 \"select *\nfrom tblarticle;\", dest=Remote, \n aclOverride=0) at postgres.c:768\n#13 0x80de107 in pg_exec_query (query_string=0xbfffa634 \"select * from\ntblarticle;\") at postgres.c:656\n#14 0x80df18c in PostgresMain (argc=6, argv=0xbffff7b0, real_argc=5,\nreal_argv=0xbffffd14) at postgres.c:1647\n#15 0x80c92ea in DoBackend (port=0x81c6c10) at postmaster.c:1628\n#16 0x80c8e0a in BackendStartup (port=0x81c6c10) at postmaster.c:1373\n#17 0x80c8559 in ServerLoop () at postmaster.c:823\n#18 0x80c8097 in PostmasterMain (argc=5, argv=0xbffffd14) at\npostmaster.c:616\n#19 0x80a0666 in main (argc=5, argv=0xbffffd14) at main.c:97\n#20 0x400facb3 in __libc_start_main (main=0x80a0600 <main>, argc=5,\nargv=0xbffffd14, init=0x8061374 <_init>, \n fini=0x810d8ec <_fini>, rtld_fini=0x4000a350 <_dl_fini>,\nstack_end=0xbffffd0c)\n at ../sysdeps/generic/libc-start.c:78\n(gdb) print *att[j]\n$7 = {attrelid = 23320, attname = {data = \"sstatus\", '\\000' <repeats 24\ntimes>, alignmentDummy = 1635021683}, \n atttypid = 1042, attdisbursion = 0.999828398, attlen = -1, attnum = 14,\nattnelems = 0, \n attcacheoff = 1836085160, atttypmod = 5, attbyval = 0 '\\000', attisset =\n0 '\\000', attalign = 105 'i', \n attnotnull = 0 '\\000', atthasdef = 1 '\\001'}\n(gdb) print tp + off\n$1 = 0xad93f9dc <Address 0xad93f9dc out of bounds>\n(gdb) print tp\n$2 = 0x40238a34 \"@A;\"\n(gdb) print off\n$3 = 1836085160\n\nAnything else I should ask it to provide? I will save the core to answer\nany questions. Is there any fix for these killer spinlocks that take down\nall my backends at the same time?\n\n- K\n\nKristofer Munn * KMI * 973-509-9414 * AIM KrMunn * http://www.munn.com/\n\n\n", "msg_date": "Thu, 27 Jan 2000 21:28:05 -0500 (EST)", "msg_from": "Kristofer Munn <[email protected]>", "msg_from_op": true, "msg_subject": "Backend Core Dumping" } ]
[ { "msg_contents": "\nOkay, I don't know if this has been fixed in 7.0, but:\n\nwebcounter=> drop index webhit_referer_raw_url;\nDROP\nwebcounter=> create index webhit_referer_raw_url on webhit_referer_raw using btree ( referrer_url );\nCREATE\nwebcounter=> vacuum verbose webhit_referer_raw;\nNOTICE: --Relation webhit_referer_raw--\nNOTICE: Pages 7910: Changed 3, Reapped 2192, Empty 0, New 0; Tup 547520: Vac 43402, Keep/VTL 0/0, Crash 0, UnUsed 4871, MinLen 60, MaxLen 312; Re-using: Free/Avail. Space 4388524/4361716; EndEmpty/Avail. Pages 0/915. Elapsed 0/0 sec.\nNOTICE: Index webhit_referer_raw_url: Pages 5048; Tuples 547400: Deleted 0. Elapsed 0/2 sec.\nNOTICE: Index webhit_referer_raw_url: NUMBER OF INDEX' TUPLES (547400) IS NOT THE SAME AS HEAP' (547520)\nERROR: Invalid XID in t_cmin\n\nThoughts? Is this something that is fixed in 7.0 right now? This is a\nsemi-production system right now, so the loss of information would be most\nunfortunate :(\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Thu, 27 Jan 2000 23:28:43 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "[6.5.2] potentially major bug?" }, { "msg_contents": "> -----Original Message-----\n> From: [email protected]\n> [mailto:[email protected]]On Behalf Of The Hermit\n> Hacker\n>\n> Okay, I don't know if this has been fixed in 7.0, but:\n>\n> webcounter=> drop index webhit_referer_raw_url;\n> DROP\n> webcounter=> create index webhit_referer_raw_url on\n> webhit_referer_raw using btree ( referrer_url );\n> CREATE\n> webcounter=> vacuum verbose webhit_referer_raw;\n> NOTICE: --Relation webhit_referer_raw--\n> NOTICE: Pages 7910: Changed 3, Reapped 2192, Empty 0, New 0; Tup\n> 547520: Vac 43402, Keep/VTL 0/0, Crash 0, UnUsed 4871, MinLen 60,\n> MaxLen 312; Re-using: Free/Avail. Space 4388524/4361716;\n> EndEmpty/Avail. Pages 0/915. Elapsed 0/0 sec.\n> NOTICE: Index webhit_referer_raw_url: Pages 5048; Tuples 547400:\n> Deleted 0. Elapsed 0/2 sec.\n> NOTICE: Index webhit_referer_raw_url: NUMBER OF INDEX' TUPLES\n> (547400) IS NOT THE SAME AS HEAP' (547520)\n\nHmmm,isn't there old transaction running somewhere ?\n\nIf so,this may be due to the use of SnapshotNow in CREATE INDEX\ncommand which Tom already specified a few months ago.\nWe have already SnapshotAny(Jan added ?) now.\nProbably this would be solved by changing SnapshotNow -> SnapshotAny.\n\n> ERROR: Invalid XID in t_cmin\n>\n\nSeems this is also related to the potential vacuum bug Tom pointed out\nabout handling of HEAP_MOVED_IN(OFF) flag. I'm suspicious about\nthe following stuff. I think HEAP_MIN_INVALID tuples should always\nbe removed.\n\n /*\n * If tuple is recently deleted then we must\nnot\n remove it\n * from relation.\n */\n if (tupgone && tuple.t_data->t_xmax >=\nXmaxRecen\nt)\n {\n tupgone = false;\n\n\nRegards.\n\nHiroshi Inoue\[email protected]\n\n", "msg_date": "Fri, 28 Jan 2000 14:48:18 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] [6.5.2] potentially major bug?" }, { "msg_contents": "On Fri, 28 Jan 2000, Hiroshi Inoue wrote:\n\n> > -----Original Message-----\n> > From: [email protected]\n> > [mailto:[email protected]]On Behalf Of The Hermit\n> > Hacker\n> >\n> > Okay, I don't know if this has been fixed in 7.0, but:\n> >\n> > webcounter=> drop index webhit_referer_raw_url;\n> > DROP\n> > webcounter=> create index webhit_referer_raw_url on\n> > webhit_referer_raw using btree ( referrer_url );\n> > CREATE\n> > webcounter=> vacuum verbose webhit_referer_raw;\n> > NOTICE: --Relation webhit_referer_raw--\n> > NOTICE: Pages 7910: Changed 3, Reapped 2192, Empty 0, New 0; Tup\n> > 547520: Vac 43402, Keep/VTL 0/0, Crash 0, UnUsed 4871, MinLen 60,\n> > MaxLen 312; Re-using: Free/Avail. Space 4388524/4361716;\n> > EndEmpty/Avail. Pages 0/915. Elapsed 0/0 sec.\n> > NOTICE: Index webhit_referer_raw_url: Pages 5048; Tuples 547400:\n> > Deleted 0. Elapsed 0/2 sec.\n> > NOTICE: Index webhit_referer_raw_url: NUMBER OF INDEX' TUPLES\n> > (547400) IS NOT THE SAME AS HEAP' (547520)\n> \n> Hmmm,isn't there old transaction running somewhere ?\n\nnot that we are aware of ... there is a daemon running that is doing COPY\nINs to the table ... how does something like that deal with a\nvacuum? Will the vacuum wait for the COPY IN to end and/or prevent a COPY\nIN from starting?\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Fri, 28 Jan 2000 02:40:26 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "RE: [HACKERS] [6.5.2] potentially major bug?" }, { "msg_contents": "> -----Original Message-----\n> From: The Hermit Hacker [mailto:[email protected]]\n>\n> On Fri, 28 Jan 2000, Hiroshi Inoue wrote:\n>\n> > > -----Original Message-----\n> > > From: [email protected]\n> > > [mailto:[email protected]]On Behalf Of The Hermit\n> > > Hacker\n> > >\n> > > Okay, I don't know if this has been fixed in 7.0, but:\n> > >\n> > > webcounter=> drop index webhit_referer_raw_url;\n> > > DROP\n> > > webcounter=> create index webhit_referer_raw_url on\n> > > webhit_referer_raw using btree ( referrer_url );\n> > > CREATE\n> > > webcounter=> vacuum verbose webhit_referer_raw;\n> > > NOTICE: --Relation webhit_referer_raw--\n> > > NOTICE: Pages 7910: Changed 3, Reapped 2192, Empty 0, New 0; Tup\n> > > 547520: Vac 43402, Keep/VTL 0/0, Crash 0, UnUsed 4871, MinLen 60,\n> > > MaxLen 312; Re-using: Free/Avail. Space 4388524/4361716;\n> > > EndEmpty/Avail. Pages 0/915. Elapsed 0/0 sec.\n> > > NOTICE: Index webhit_referer_raw_url: Pages 5048; Tuples 547400:\n> > > Deleted 0. Elapsed 0/2 sec.\n> > > NOTICE: Index webhit_referer_raw_url: NUMBER OF INDEX' TUPLES\n> > > (547400) IS NOT THE SAME AS HEAP' (547520)\n> >\n> > Hmmm,isn't there old transaction running somewhere ?\n>\n> not that we are aware of ... there is a daemon running that is doing COPY\n> INs to the table ... how does something like that deal with a\n> vacuum? Will the vacuum wait for the COPY IN to end and/or prevent a COPY\n> IN from starting?\n>\n\nIf a transaction read/write the target table it would be blocked by vacuum.\nBut vacuum couldn't know what tables other backends would read/write in\ntheir running transactions. In MVCC old transaction have to see old deleted\ntuples in SERIALIZABLE isolation level and so vacuum doesn't remove the\ntuples which old transactions may see.\n\nNote: vacuum doesn't lock database entirely but locks each table one by one.\n\nRegards.\n\nHiroshi Inoue\[email protected]\n\n", "msg_date": "Fri, 28 Jan 2000 16:01:47 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] [6.5.2] potentially major bug?" }, { "msg_contents": "> > >\n> > > Hmmm,isn't there old transaction running somewhere ?\n> >\n> > not that we are aware of ... there is a daemon running that is \n> doing COPY\n> > INs to the table ... how does something like that deal with a\n> > vacuum? Will the vacuum wait for the COPY IN to end and/or \n> prevent a COPY\n> > IN from starting?\n> >\n> \n> If a transaction read/write the target table it would be blocked \n> by vacuum.\n> But vacuum couldn't know what tables other backends would read/write in\n> their running transactions. In MVCC old transaction have to see \n> old deleted\n> tuples in SERIALIZABLE isolation level and so vacuum doesn't remove the\n> tuples which old transactions may see.\n>\n\nFor example,if you type\n\nbegin;\nselect .. from .. ;\n\nand leave your seat,any vacuum won't be able to remove tuples\ndeleted after the 'select .. from ..'.\n\nRegards.\n\nHiroshi Inoue\[email protected] \n\n", "msg_date": "Fri, 28 Jan 2000 16:49:29 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] [6.5.2] potentially major bug?" }, { "msg_contents": "> > -----Original Message-----\n> > From: [email protected]\n> > [mailto:[email protected]]On Behalf Of The Hermit\n> > Hacker\n> >\n> > Okay, I don't know if this has been fixed in 7.0, but:\n> >\n> > webcounter=> drop index webhit_referer_raw_url;\n> > DROP\n> > webcounter=> create index webhit_referer_raw_url on\n> > webhit_referer_raw using btree ( referrer_url );\n> > CREATE\n> > webcounter=> vacuum verbose webhit_referer_raw;\n> > NOTICE: --Relation webhit_referer_raw--\n> > NOTICE: Pages 7910: Changed 3, Reapped 2192, Empty 0, New 0; Tup\n> > 547520: Vac 43402, Keep/VTL 0/0, Crash 0, UnUsed 4871, MinLen 60,\n> > MaxLen 312; Re-using: Free/Avail. Space 4388524/4361716;\n> > EndEmpty/Avail. Pages 0/915. Elapsed 0/0 sec.\n> > NOTICE: Index webhit_referer_raw_url: Pages 5048; Tuples 547400:\n> > Deleted 0. Elapsed 0/2 sec.\n> > NOTICE: Index webhit_referer_raw_url: NUMBER OF INDEX' TUPLES\n> > (547400) IS NOT THE SAME AS HEAP' (547520)\n> \n> Hmmm,isn't there old transaction running somewhere ?\n> \n> If so,this may be due to the use of SnapshotNow in CREATE INDEX\n> command which Tom already specified a few months ago.\n> We have already SnapshotAny(Jan added ?) now.\n> Probably this would be solved by changing SnapshotNow -> SnapshotAny.\n>\n\nOops,this is not so easy.\nComparetub_index() rejects duplicate index.\nIs it an appropriate way to check visibility of heap\ntuples in comapretub_index() ?\n\nComments ?\n\nRegards.\n\nHirioshi Inoue\[email protected] \n \n", "msg_date": "Sun, 30 Jan 2000 00:48:36 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] [6.5.2] potentially major bug?" } ]
[ { "msg_contents": "I have just committed fixes that make use of an idea suggested by\nTaral (see TODO.detail/cnfify, his message of 2-Oct-98). The code\nnow makes a simple heuristic estimate of the size that the WHERE\nclause will be after conversion to CNF or DNF format, and refrains\nfrom attempting to canonicalize the clause if the cost looks too\nhigh.\n\nI was able to run this query plan:\n\nexplain\nselect unique1 from tenk1 where\n(unique1 = 1 and unique2 =2) or\n(unique1 = 2 and unique2 =3) or\n(unique1 = 3 and unique2 =4) or\n... ten thousand OR clauses ...\n(unique1 = 9998 and unique2 =9999) or\n(unique1 = 9999 and unique2 =10000) or\n(unique1 = 10000 and unique2 =10001);\n\nin about 15 seconds and 30MB memory consumption. Which is still\nmore than I'd like, but the old code couldn't cope with twenty\nclauses without exhausting one's swap space and/or patience.\n\nI am probably not going to remove the KSQO hack just yet, because\nit still seems to have a performance advantage for queries with\na few hundred or thousand OR clauses. But KSQO is no longer\nabsolutely essential, AFAICT.\n\nI'd be interested to get some feedback on this code from people\nwho are using KSQO currently. The patch is in current CVS and\nshould be available in Friday morning's snapshot tarball.\n\n\t\t\tregards, tom lane\n", "msg_date": "Thu, 27 Jan 2000 23:10:03 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "OR-of-ANDs dragon slain ... or at least seriously wounded ..." }, { "msg_contents": "> I have just committed fixes that make use of an idea suggested by\n> Taral (see TODO.detail/cnfify, his message of 2-Oct-98). The code\n> now makes a simple heuristic estimate of the size that the WHERE\n> clause will be after conversion to CNF or DNF format, and refrains\n> from attempting to canonicalize the clause if the cost looks too\n> high.\n\nWow, this is great. Seems that TODO mailbox archive came in handy here.\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": "Thu, 27 Jan 2000 23:56:57 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OR-of-ANDs dragon slain ... or at least seriously\n\twounded ..." } ]
[ { "msg_contents": "Here's what happens:\n\n$ cvs -d :pserver:[email protected]:/usr/local/cvsroot login\n(Logging in to [email protected])\nCVS password: \n$ cvs -z3 -d :pserver:[email protected]:/usr/local/cvsroot co -P pgsql\nFatal error, aborting.\n: no such user\ncvs [checkout aborted]: authorization failed: server postgresql.org rejected \naccess\n\n-- \nOliver Elphick [email protected]\nIsle of Wight http://www.lfix.co.uk/oliver\n PGP key from public servers; key ID 32B8FAA1\n ========================================\n \"Many are the afflictions of the righteous; but the \n LORD delivereth him out of them all.\" \n Psalm 34:19 \n\n\n", "msg_date": "Fri, 28 Jan 2000 05:38:10 +0000", "msg_from": "\"Oliver Elphick\" <[email protected]>", "msg_from_op": true, "msg_subject": "Can't access CVS" } ]
[ { "msg_contents": "\nat postgresql.org, or is it just me?\n\n-- \nChris Bitmead\n", "msg_date": "Fri, 28 Jan 2000 20:16:14 +1100", "msg_from": "Chris <[email protected]>", "msg_from_op": true, "msg_subject": "Is anoncvs broker" } ]
[ { "msg_contents": "\nCame across this comment in execTuples.c...\n\n *In the implementation of nested-dot queries such as\n *\"retrieve (EMP.hobbies.all)\", a single scan may return tuples\n *of many types, so now we return pointers to tuple descriptors\n *along with tuples returned via the tuple table. This means\n *we now have a bunch of routines to diddle the slot descriptors\n *too. -cim 1/18/90\n\nHmm. Another few years of reading the source and I'll probably\nunderstand all this :-) :-(.\n\nCan anybody provide any insight? Like What EMP.hobbies.all meant in\npostquel?\n\n-- \nChris Bitmead\nmailto:[email protected]\n", "msg_date": "Fri, 28 Jan 2000 22:13:44 +1100", "msg_from": "Chris <[email protected]>", "msg_from_op": true, "msg_subject": "OO and tuples of different types" }, { "msg_contents": "Chris <[email protected]> writes:\n> Can anybody provide any insight? Like What EMP.hobbies.all meant in\n> postquel?\n\nNot a lot of insight here, but there are a couple of examples in the\n\"misc\" regress test; also see the discussion in TODO.detail/function.\n\n\t\t\tregards, tom lane\n", "msg_date": "Fri, 28 Jan 2000 09:36:37 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OO and tuples of different types " }, { "msg_contents": "Chris wrote:\n> \n> Came across this comment in execTuples.c...\n> \n> *In the implementation of nested-dot queries such as\n> *\"retrieve (EMP.hobbies.all)\", a single scan may return tuples\n> *of many types, so now we return pointers to tuple descriptors\n> *along with tuples returned via the tuple table. This means\n> *we now have a bunch of routines to diddle the slot descriptors\n> *too. -cim 1/18/90\n> \n> Hmm. Another few years of reading the source and I'll probably\n> understand all this :-) :-(.\n> \n> Can anybody provide any insight? Like What EMP.hobbies.all meant in\n> postquel?\n\nI guess you can still pind the original Postgres 4.2 (the last (?) \none with postquel) somewhere on the net. I used to have them around \nsomewhere but I'm not sure where they are ...\n\n---------------\nHannu\n", "msg_date": "Fri, 28 Jan 2000 20:52:42 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OO and tuples of different types" }, { "msg_contents": "Chris wrote:\n> \n> Came across this comment in execTuples.c...\n> \n> *In the implementation of nested-dot queries such as\n> *\"retrieve (EMP.hobbies.all)\", a single scan may return tuples\n> *of many types, so now we return pointers to tuple descriptors\n> *along with tuples returned via the tuple table. This means\n> *we now have a bunch of routines to diddle the slot descriptors\n> *too. -cim 1/18/90\n> \n> Hmm. Another few years of reading the source and I'll probably\n> understand all this :-) :-(.\n> \n> Can anybody provide any insight? Like What EMP.hobbies.all meant in\n> postquel?\n\nYou can get the latest sources for postgres 4.2 (from 30.06.1994) \nfrom http://db.cs.berkeley.edu/postgres.html \n\nIIRC they have a small manual inside the tarball\n\nThey should even compile ;), I remember having compiled them (on the \nthen-current version of solaris) and played around a little with postquel\n\n----------------\nHannu\n", "msg_date": "Fri, 28 Jan 2000 21:03:34 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] OO and tuples of different types" }, { "msg_contents": "On Fri, Jan 28, 2000 at 09:03:34PM +0200, Hannu Krosing wrote:\n> Chris wrote:\n> > \n> > Came across this comment in execTuples.c...\n> > \n> > *In the implementation of nested-dot queries such as\n> > *\"retrieve (EMP.hobbies.all)\", a single scan may return tuples\n> > *of many types, so now we return pointers to tuple descriptors\n> > *along with tuples returned via the tuple table. This means\n> > *we now have a bunch of routines to diddle the slot descriptors\n> > *too. -cim 1/18/90\n> > \n> > Hmm. Another few years of reading the source and I'll probably\n> > understand all this :-) :-(.\n> > \n> > Can anybody provide any insight? Like What EMP.hobbies.all meant in\n> > postquel?\n> \n> You can get the latest sources for postgres 4.2 (from 30.06.1994) \n> from http://db.cs.berkeley.edu/postgres.html \n> \n> IIRC they have a small manual inside the tarball\n> \n\nIf you can read academese, a bunch of white papers and technical reports\nare available at:\n\nhttp://s2k-ftp.CS.Berkeley.EDU:8000/postgres/papers/\n\nRoss\n-- \nRoss J. Reedstrom, Ph.D., <[email protected]> \nNSBRI Research Scientist/Programmer\nComputer and Information Technology Institute\nRice University, 6100 S. Main St., Houston, TX 77005\n", "msg_date": "Fri, 28 Jan 2000 16:21:15 -0600", "msg_from": "\"Ross J. Reedstrom\" <[email protected]>", "msg_from_op": false, "msg_subject": "Old Postgres papers (was Re: [HACKERS] OO and tuples of different\n\ttypes)" } ]
[ { "msg_contents": "I installed postgresql-v6.5.3 on my sparc64-linux from source.\nWhen that was done, i tried to run initdb, and:\n[postgres@sun2 pgsql]$ PATH=$PATH:/usr/local/pgsql/bin\n[postgres@sun2 pgsql]$ initdb -r $PWD -l /usr/local/pgsql/lib/\n\nWe are initializing the database system with username postgres (uid=40).\nThis user will own all the files and must also own the server process.\n\nCreating template database in /var/lib/pgsql/base/template1\nERROR: Attribute 'aggtransfn1' is repeated\nERROR: Attribute 'aggtransfn1' is repeated\ninitdb: could not create template database\ninitdb: cleaning up by wiping out /var/lib/pgsql/base/template1\n>From $PGLIB/local1_template1.bki.source\ncreate pg_aggregate\n (\n aggname = name ,\n aggowner = int4 ,\n aggtransfn1 = regproc ,\n aggtransfn2 = regproc ,\n aggfinalfn = regproc ,\n aggbasetype = oid ,\n aggtranstype1 = oid ,\n aggtranstype2 = oid ,\n aggfinaltype = oid ,\n agginitval1 = text ,\n agginitval2 = text\n )\nSo i try to change this:\n--- local1_template1.bki.source.orig Fri Jan 28 12:34:07 2000\n+++ local1_template1.bki.source Fri Jan 28 12:33:39 2000\n@@ -2235,8 +2235,8 @@ create pg_aggregate\n aggowner = int4 ,\n- aggtransfn1 = regproc ,\n- aggtransfn2 = regproc ,\n+ 1aggtransfn = regproc ,\n+ 2aggtransfn = regproc ,\n aggfinalfn = regproc ,\n\nAnd now the ERROR message changed:\nERROR: Attribute 'agginitval1' is repeated\nMaybe there are some problems, with length of field names, but the same\nsource works properly on a i586-linux.\nI run configure script as:\n./configure --enable-locale --with-template=linux_sparc\n\nI had problems with daily snapshot too, but the error was something else.\n\nCan anybody help me?\n\n--\n nek;(\n\n", "msg_date": "Fri, 28 Jan 2000 12:58:03 +0100 (CET)", "msg_from": "Peter Vazsonyi <[email protected]>", "msg_from_op": true, "msg_subject": "Attribute 'aggtransfn1' is repeated" }, { "msg_contents": "Opps... that was simple bug.\nI don't understand why works on x86, why not on sparc (gcc?), but this small\npatch should correct the error.\n\nOn Fri, 28 Jan 2000, Peter Vazsonyi wrote:\n\n> [postgres@sun2 pgsql]$ initdb -r $PWD -l /usr/local/pgsql/lib/\n> \n> We are initializing the database system with username postgres (uid=40).\n> This user will own all the files and must also own the server process.\n> \n> Creating template database in /var/lib/pgsql/base/template1\n> ERROR: Attribute 'aggtransfn1' is repeated\n> ERROR: Attribute 'aggtransfn1' is repeated\n\n--\n nek;(", "msg_date": "Mon, 31 Jan 2000 15:13:55 +0100 (CET)", "msg_from": "Peter Vazsonyi <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [ADMIN] Attribute 'aggtransfn1' is repeated" }, { "msg_contents": "> Opps... that was simple bug.\n> I don't understand why works on x86, why not on sparc (gcc?), but this small\n> patch should correct the error.\n\nAlready patched in current tree. Thanks.\n\n\n> \n> On Fri, 28 Jan 2000, Peter Vazsonyi wrote:\n> \n> > [postgres@sun2 pgsql]$ initdb -r $PWD -l /usr/local/pgsql/lib/\n> > \n> > We are initializing the database system with username postgres (uid=40).\n> > This user will own all the files and must also own the server process.\n> > \n> > Creating template database in /var/lib/pgsql/base/template1\n> > ERROR: Attribute 'aggtransfn1' is repeated\n> > ERROR: Attribute 'aggtransfn1' is repeated\n> \n> --\n> nek;(\n> \nContent-Description: \n\n[Attachment, skipping...]\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": "Mon, 31 Jan 2000 20:51:55 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [ADMIN] Attribute 'aggtransfn1' is repeated" } ]
[ { "msg_contents": "\nHow do you run postgres under gdb?\n", "msg_date": "Sat, 29 Jan 2000 00:17:27 +1100", "msg_from": "Chris <[email protected]>", "msg_from_op": true, "msg_subject": "postgres under gdb" }, { "msg_contents": "Chris <[email protected]> writes:\n> How do you run postgres under gdb?\n\nIf you are running a standalone backend, you just fire it up.\nFor normal use under a postmaster, the easiest thing I've found is to\nstart psql (or your favorite client) in one window, start gdb on the\npostgres executable in another, and then \"attach\" to the already-started\nbackend process. (Use \"ps\" to discover the backend's PID.) You must\nrun gdb as postgres, of course, but the client process can belong to\nanyone.\n\nIt gets a little tricky if you are trying to debug part of the\nbackend startup sequence. We have a kluge for that: start psql\nwith PGOPTIONS=\"-W n\". That causes the backend to sleep() for n\nseconds fairly early in its startup, giving you time to attach to it\nbefore anything really interesting happens.\n\nIn theory you can debug one backend in a live production system\nthis way, but I wouldn't recommend doing that except in dire need.\nIf you use gdb to stop the backend while it is holding a lock, you'll\nblock other backends too --- and holding a spinlock is even worse,\nbecause those other backends will time out after a minute or so.\nBetter to use a playpen installation.\n\n(Hey Bruce, shouldn't this info be in FAQ_DEV?)\n\n\t\t\tregards, tom lane\n", "msg_date": "Fri, 28 Jan 2000 09:51:35 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] postgres under gdb " }, { "msg_contents": "> How do you run postgres under gdb?\n\ngdb postgres\nGNU gdb 4.17.0.4 with Linux/x86 hardware watchpoint and FPU support\nCopyright 1998 Free Software Foundation, Inc.\nGDB is free software, covered by the GNU General Public License, and\nyou are\nwelcome to change it and/or distribute copies of it under certain\nconditions.\nType \"show copying\" to see the conditions.\nThere is absolutely no warranty for GDB. Type \"show warranty\" for\ndetails.\nThis GDB was configured as \"i386-redhat-linux\"...\n(gdb) b ParseFuncOrColumn\nBreakpoint 1 at 0x80e5656: file parse_func.c, line 228.\n(gdb) run postgres\nStarting program: /opt/postgres/current/bin/postgres postgres\nDEBUG: Data Base System is starting up at Thu Jan 27 17:45:46 2000\nDEBUG: Data Base System was interrupted being in production at Thu\nJan 27 17:40:53 2000\nDEBUG: CheckPoint record at (0, 920)\nDEBUG: Redo record at (0, 920); Undo record at (0, 0)\nDEBUG: NextTransactionId: 0; NextOid: 0\nDEBUG: Invalid NextTransactionId/NextOid\nDEBUG: The DataBase system was not properly shut down\n Automatic recovery is in progress...\nDEBUG: ReadRecord: invalid record len 0 in (0, 968)\nDEBUG: Formatting logfile 0 seg 0 block 0 at offset 968\nDEBUG: The last logId/logSeg is (0, 0)\nDEBUG: Redo is not required\nDEBUG: Undo is not required\nDEBUG: Data Base System is in production state at Thu Jan 27 17:45:49\n2000\n\nPOSTGRES backend interactive interface \n$Revision: 1.139 $ $Date: 2000/01/09 12:17:33 $\n\nbackend> select b from t1 tx (b);\n\nBreakpoint 1, ParseFuncOrColumn (pstate=0x824eb70, funcname=0x824f098\n\"b\", fargs=0x824f0f8, agg_star=0 '\\000', \n agg_distinct=0 '\\000', curr_resno=0x824eb70, precedence=1) at\nparse_func.c:228\n228 Oid rettype = InvalidOid;\n(gdb) l 310\n...\n\nYou can also give more command line options when you type \"run\". A\ntip: when trying to track down why elog() errors are being thrown, set\na breakpoint on elog itself and then do a \"where\". Use \"frame #\" to\nbop around the stack. Been doing that a lot lately ;)\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Fri, 28 Jan 2000 15:57:50 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] postgres under gdb" }, { "msg_contents": "> \n> How do you run postgres under gdb?\n> \n> ************\n> \n\nSee the FAQ. Start postgres as part of gdb and run in there in\nstandalone mode.\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, 28 Jan 2000 12:26:02 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] postgres under gdb" }, { "msg_contents": "> Chris <[email protected]> writes:\n> > How do you run postgres under gdb?\n> \n> If you are running a standalone backend, you just fire it up.\n> For normal use under a postmaster, the easiest thing I've found is to\n> start psql (or your favorite client) in one window, start gdb on the\n> postgres executable in another, and then \"attach\" to the already-started\n> backend process. (Use \"ps\" to discover the backend's PID.) You must\n> run gdb as postgres, of course, but the client process can belong to\n> anyone.\n> \n> It gets a little tricky if you are trying to debug part of the\n> backend startup sequence. We have a kluge for that: start psql\n> with PGOPTIONS=\"-W n\". That causes the backend to sleep() for n\n> seconds fairly early in its startup, giving you time to attach to it\n> before anything really interesting happens.\n> \n> In theory you can debug one backend in a live production system\n> this way, but I wouldn't recommend doing that except in dire need.\n> If you use gdb to stop the backend while it is holding a lock, you'll\n> block other backends too --- and holding a spinlock is even worse,\n> because those other backends will time out after a minute or so.\n> Better to use a playpen installation.\n> \n> (Hey Bruce, shouldn't this info be in FAQ_DEV?)\n\nYes, let me add it.\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, 28 Jan 2000 12:30:34 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] postgres under gdb" }, { "msg_contents": "> Chris <[email protected]> writes:\n> > How do you run postgres under gdb?\n> \n> If you are running a standalone backend, you just fire it up.\n> For normal use under a postmaster, the easiest thing I've found is to\n> start psql (or your favorite client) in one window, start gdb on the\n> postgres executable in another, and then \"attach\" to the already-started\n> backend process. (Use \"ps\" to discover the backend's PID.) You must\n> run gdb as postgres, of course, but the client process can belong to\n> anyone.\n> \n> It gets a little tricky if you are trying to debug part of the\n> backend startup sequence. We have a kluge for that: start psql\n> with PGOPTIONS=\"-W n\". That causes the backend to sleep() for n\n> seconds fairly early in its startup, giving you time to attach to it\n> before anything really interesting happens.\n> \n> In theory you can debug one backend in a live production system\n> this way, but I wouldn't recommend doing that except in dire need.\n> If you use gdb to stop the backend while it is holding a lock, you'll\n> block other backends too --- and holding a spinlock is even worse,\n> because those other backends will time out after a minute or so.\n> Better to use a playpen installation.\n> \n> (Hey Bruce, shouldn't this info be in FAQ_DEV?)\n\nI have added this to the main FAQ under debugging:\n\nAnother method is to start psql in one window, then find the PID of the\npostgres process used by the psql. Use a debugger to attach to the\npostgres PID. You can set breakpoints in the debugger and issue queries\nfrom psql. If you are debugging postgres startup, you can set\nPGOPTIONS=\"-W n\", then start psql. This will cause startup to delay for\nn seconds so you can attach with the debugger and trace through the\nstartup sequence.\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": "Thu, 8 Jun 2000 13:31:07 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: postgres under gdb" } ]
[ { "msg_contents": "Hi Bruce,\n\n I think there has been some confusion about the bit/bit varying\nstuff I did. I initially\nsent in a bit type that was non-SQL compliant, with the suggestion that\nthis may be\nuseful to stick into contrib.\n\nThen several people remarked that it would be better to have an SQL\ncompliant type, so\nI wrote the code to do all the manipulations, roughly based on\n\nsrc/backend/utils/adt/varchar.c\n\nThis can evidently not be used as a standalone routine, but needs to be\nproperly\nintegrated into the database as a type. Unfortunately I don't really\nknow an awful\nlot about the internals of postgres, and got a bit stuck trying to\nfigure out how to\nintegrate a new type correctly.\n\nNow I see that this second set of routines has ended up in the contrib\ndirectory,\nwhere they are quite useless. In my opinion it would be best to have no\nbit-type\nin the contrib directory and have the proper SQL compliant one properly\nintegrated\ninto postgres, but I'm going to need some hints to do that correctly.\n\nSo my question is how we should proceed on this. Am I right in assuming\nthat there\nshould be no major objections to adding an SQL type to postgres, or\nshould I go\nthrough another iteration on the mailing list?\n\nThanks for any suggestions,\n\nAdriaan\n\n\n\n", "msg_date": "Fri, 28 Jan 2000 14:45:40 +0000", "msg_from": "Adriaan Joubert <[email protected]>", "msg_from_op": true, "msg_subject": "Bit strings" }, { "msg_contents": "Can we get the BIT type working now that 7.1 is branched?\n\n> Hi Bruce,\n> \n> I think there has been some confusion about the bit/bit varying\n> stuff I did. I initially\n> sent in a bit type that was non-SQL compliant, with the suggestion that\n> this may be\n> useful to stick into contrib.\n> \n> Then several people remarked that it would be better to have an SQL\n> compliant type, so\n> I wrote the code to do all the manipulations, roughly based on\n> \n> src/backend/utils/adt/varchar.c\n> \n> This can evidently not be used as a standalone routine, but needs to be\n> properly\n> integrated into the database as a type. Unfortunately I don't really\n> know an awful\n> lot about the internals of postgres, and got a bit stuck trying to\n> figure out how to\n> integrate a new type correctly.\n> \n> Now I see that this second set of routines has ended up in the contrib\n> directory,\n> where they are quite useless. In my opinion it would be best to have no\n> bit-type\n> in the contrib directory and have the proper SQL compliant one properly\n> integrated\n> into postgres, but I'm going to need some hints to do that correctly.\n> \n> So my question is how we should proceed on this. Am I right in assuming\n> that there\n> should be no major objections to adding an SQL type to postgres, or\n> should I go\n> through another iteration on the mailing list?\n> \n> Thanks for any suggestions,\n> \n> Adriaan\n> \n> \n> \n> \n> ************\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", "msg_date": "Thu, 8 Jun 2000 12:18:26 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Bit strings" }, { "msg_contents": "Bruce Momjian wrote:\n\n> Can we get the BIT type working now that 7.1 is branched?\n>\n\nYep. We never quite finished the discussions before the 7.0 release. The\noutstanding issues were\n\n1) should bit operations be allowed between bit strings of different sizes?\nThey are at the moment, but the longest string is truncated, as you\notherwise get illogical behaviour (imagine padding with zeros and doing an\nXOR). Truncation can be somewhat unlogical as well. My current feeling is\nthat perhaps it would be better to just disallow bit operations on\nbitstrings that haven't got the same length completely. Makes the code\neasier anyway ;-)\n\n2) A second point brought up by Peter is the conversion of bit-strings to\nintegers and vice-versa. Postgres does not have unsigned ints, so it can\nlead to somewhat surprising behaviour. Implicit conversion is probably out\nof the question. So what type of conversion functions would people like to\nsee, if any?\n\n3) With TOAST bit strings could be used to store large amounts of binary\ndata. Don mentioned MIME-encoded strings for I/O. Is this useful? I guess\nand advantage is that BIT is an SQL type, but I'm not sure that any such\napplication would be particularly portable. It doesn't look like a lot of\nextra work though, (provided somebody has got some MIME en-/decoding code\nlying about) so we could add it. Am i right that with TOAST and no\nrestrictions on the query-buffer lengths in psql one could then upload mime\nobjects straight into postgres?\n\nSo, what do people think?\n\nAdriaan\n\n", "msg_date": "Fri, 09 Jun 2000 09:00:57 +0300", "msg_from": "Adriaan Joubert <[email protected]>", "msg_from_op": true, "msg_subject": "Re: Bit strings" }, { "msg_contents": "Adriaan Joubert writes:\n\n> My current feeling is that perhaps it would be better to just disallow\n> bit operations on bitstrings that haven't got the same length\n> completely.\n\nI feel with you. :)\n\n> 3) With TOAST bit strings could be used to store large amounts of binary\n> data.\n\nThis is not really the proper application for bit strings. There are BLOBs\nfor that. Which leads to the question, what are bit strings really useful\nfor other than genuine bit masks?\n\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n\n", "msg_date": "Sat, 10 Jun 2000 20:08:51 +0200 (CEST)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Bit strings" }, { "msg_contents": "Can someone comment on this?\n\n> Bruce Momjian wrote:\n> \n> > Can we get the BIT type working now that 7.1 is branched?\n> >\n> \n> Yep. We never quite finished the discussions before the 7.0 release. The\n> outstanding issues were\n> \n> 1) should bit operations be allowed between bit strings of different sizes?\n> They are at the moment, but the longest string is truncated, as you\n> otherwise get illogical behaviour (imagine padding with zeros and doing an\n> XOR). Truncation can be somewhat unlogical as well. My current feeling is\n> that perhaps it would be better to just disallow bit operations on\n> bitstrings that haven't got the same length completely. Makes the code\n> easier anyway ;-)\n> \n> 2) A second point brought up by Peter is the conversion of bit-strings to\n> integers and vice-versa. Postgres does not have unsigned ints, so it can\n> lead to somewhat surprising behaviour. Implicit conversion is probably out\n> of the question. So what type of conversion functions would people like to\n> see, if any?\n> \n> 3) With TOAST bit strings could be used to store large amounts of binary\n> data. Don mentioned MIME-encoded strings for I/O. Is this useful? I guess\n> and advantage is that BIT is an SQL type, but I'm not sure that any such\n> application would be particularly portable. It doesn't look like a lot of\n> extra work though, (provided somebody has got some MIME en-/decoding code\n> lying about) so we could add it. Am i right that with TOAST and no\n> restrictions on the query-buffer lengths in psql one could then upload mime\n> objects straight into postgres?\n> \n> So, what do people think?\n> \n> Adriaan\n> \n> \n\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\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": "Mon, 2 Oct 2000 23:21:50 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Bit strings" }, { "msg_contents": ">>>> Can we get the BIT type working now that 7.1 is branched?\n\nI did some work on the BIT types a couple months ago. According to\nmy notes, the following issues are still outstanding before they\ncan be said to work at all:\n\nBit and hexstring literals are not handled in a reasonable fashion;\nthe scanner converts them to integer constants which is bogus.\nProbably they need to be converted to some generic 'UNKNOWNBITSTRING'\npseudo-type that can later be coerced to a specific bitstring type.\nI didn't touch this because it seems to open up the Pandora's box\nof unknown-constant handling, for which we do not have a good\ngeneral solution.\n\nSQL92 sez we need a position() function for bitstrings.\n\nNeed a regression test for bit types.\n\nscalarltsel() and friends need to cope with bit/varbit types in\norder to make good use of indexes on bitstrings.\n\npg_dump does not handle BIT/VARBIT lengths properly (pjw may have\nfixed this by now).\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 03 Oct 2000 00:42:07 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Bit strings " }, { "msg_contents": "\nAny idea where we are on this?\n\n> >>>> Can we get the BIT type working now that 7.1 is branched?\n> \n> I did some work on the BIT types a couple months ago. According to\n> my notes, the following issues are still outstanding before they\n> can be said to work at all:\n> \n> Bit and hexstring literals are not handled in a reasonable fashion;\n> the scanner converts them to integer constants which is bogus.\n> Probably they need to be converted to some generic 'UNKNOWNBITSTRING'\n> pseudo-type that can later be coerced to a specific bitstring type.\n> I didn't touch this because it seems to open up the Pandora's box\n> of unknown-constant handling, for which we do not have a good\n> general solution.\n> \n> SQL92 sez we need a position() function for bitstrings.\n> \n> Need a regression test for bit types.\n> \n> scalarltsel() and friends need to cope with bit/varbit types in\n> order to make good use of indexes on bitstrings.\n> \n> pg_dump does not handle BIT/VARBIT lengths properly (pjw may have\n> fixed this by now).\n> \n> \t\t\tregards, tom lane\n> \n\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\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, 19 Jan 2001 16:54:19 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Bit strings" }, { "msg_contents": "\nOK, I will delete my copy of the email. If there is something to be\nadded to the TODO list, let me know.\n\n[ People are welcome to modify it themselves too.]\n\n> Bruce Momjian writes:\n> \n> > Any idea where we are on this?\n> \n> > > Bit and hexstring literals are not handled in a reasonable fashion;\n> \n> Bit string literals are handled correctly, although it occurred to me that\n> perhaps\n> \n> #define IsA_Value(t) \\\n> (IsA(t, Integer) || IsA(t, Float) || IsA(t, String))\n> \n> should be augmented with BitString. Can someone advise?\n> \n> Hex literals are still not handled correctly.\n> \n> > > SQL92 sez we need a position() function for bitstrings.\n> \n> We have one now.\n> \n> > > Need a regression test for bit types.\n> \n> We have one now.\n> \n> > > scalarltsel() and friends need to cope with bit/varbit types in\n> > > order to make good use of indexes on bitstrings.\n> \n> Not done.\n> \n> > > pg_dump does not handle BIT/VARBIT lengths properly (pjw may have\n> > > fixed this by now).\n> \n> Works fine for me.\n> \n> -- \n> Peter Eisentraut [email protected] http://yi.org/peter-e/\n> \n> \n\n\n-- \n Bruce Momjian | http://candle.pha.pa.us\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, 19 Jan 2001 17:29:53 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Bit strings" }, { "msg_contents": "Peter Eisentraut <[email protected]> writes:\n> perhaps\n> #define IsA_Value(t) \\\n> (IsA(t, Integer) || IsA(t, Float) || IsA(t, String))\n> should be augmented with BitString. Can someone advise?\n\nYes, definitely --- see the sole use of that macro, in outfuncs.c.\nThis is a bug.\n\n\t\t\tregards, tom lane\n", "msg_date": "Fri, 19 Jan 2001 17:30:22 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Bit strings " }, { "msg_contents": "Bruce Momjian writes:\n\n> Any idea where we are on this?\n\n> > Bit and hexstring literals are not handled in a reasonable fashion;\n\nBit string literals are handled correctly, although it occurred to me that\nperhaps\n\n#define IsA_Value(t) \\\n (IsA(t, Integer) || IsA(t, Float) || IsA(t, String))\n\nshould be augmented with BitString. Can someone advise?\n\nHex literals are still not handled correctly.\n\n> > SQL92 sez we need a position() function for bitstrings.\n\nWe have one now.\n\n> > Need a regression test for bit types.\n\nWe have one now.\n\n> > scalarltsel() and friends need to cope with bit/varbit types in\n> > order to make good use of indexes on bitstrings.\n\nNot done.\n\n> > pg_dump does not handle BIT/VARBIT lengths properly (pjw may have\n> > fixed this by now).\n\nWorks fine for me.\n\n-- \nPeter Eisentraut [email protected] http://yi.org/peter-e/\n\n", "msg_date": "Fri, 19 Jan 2001 23:34:48 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Bit strings" }, { "msg_contents": "Peter Eisentraut <[email protected]> writes:\n>> Yes, definitely --- see the sole use of that macro, in outfuncs.c.\n\n> Maybe this macro could be removed and expanded in place. That would make\n> things more transparent. Or is there any other potential use?\n\nNo objection from me. The macro clearly failed to make things better in\nthat usage, and offhand I think it would be just as likely to be a time\nbomb in any other usage.\n\n\t\t\tregards, tom lane\n", "msg_date": "Fri, 19 Jan 2001 17:54:41 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Bit strings " }, { "msg_contents": "Tom Lane writes:\n\n> Peter Eisentraut <[email protected]> writes:\n> > perhaps\n> > #define IsA_Value(t) \\\n> > (IsA(t, Integer) || IsA(t, Float) || IsA(t, String))\n> > should be augmented with BitString. Can someone advise?\n>\n> Yes, definitely --- see the sole use of that macro, in outfuncs.c.\n\nMaybe this macro could be removed and expanded in place. That would make\nthings more transparent. Or is there any other potential use?\n\n-- \nPeter Eisentraut [email protected] http://yi.org/peter-e/\n\n", "msg_date": "Fri, 19 Jan 2001 23:54:48 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Bit strings " } ]
[ { "msg_contents": "Hi,\n\n I wrote routines for the postgres backend to implement the SQL types\nBIT and BIT VARYING. Unfortunately I do not\nknow postgres well enough yet to integrate the types into the backend\nmyself. Bruce Momjian has kindly offered to do\nthis, provided that people agree that having BIT and BIT VARYING is\ndesirable. I will do some regression tests once the\ncode has been integrated with postgres.\n\nThe code is currently in the contrib/bit directory of the snapshots, so\nyou can look at it there. If it passes muster or if there\nare any recommendations to improve the code please let me know. If there\nis more I can do to help with the integration,\nplease let me know as well.\n\nThanks!\n\nAdriaan\n\n", "msg_date": "Fri, 28 Jan 2000 17:43:40 +0000", "msg_from": "Adriaan Joubert <[email protected]>", "msg_from_op": true, "msg_subject": "Bit strings" }, { "msg_contents": "> I wrote routines for the postgres backend to implement the SQL types\n> BIT and BIT VARYING. Unfortunately I do not\n> know postgres well enough yet to integrate the types into the backend\n> myself. Bruce Momjian has kindly offered to do\n> this, provided that people agree that having BIT and BIT VARYING is\n> desirable. I will do some regression tests once the\n> code has been integrated with postgres.\n\nYes it is desirable. I'll help too, and Bruce and I will need to\ncoordinate to keep him from stomping all over my patches while I'm\ndoing some upcoming date/time changes (that's a hint Bruce! :)\n\n> The code is currently in the contrib/bit directory of the snapshots, so\n> you can look at it there. If it passes muster or if there\n> are any recommendations to improve the code please let me know. If there\n> is more I can do to help with the integration,\n> please let me know as well.\n\nIf the code works or can be made workable we should integrate it imho.\nThere is not likely to be any good excuse to keep out an\nSQL92-compliant type.\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Sat, 29 Jan 2000 07:06:00 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Bit strings" }, { "msg_contents": "Thomas Lockhart wrote:\n\n> If the code works or can be made workable we should integrate it imho.\n> There is not likely to be any good excuse to keep out an\n> SQL92-compliant type.\n\nNobody else replied, so I guess we can go ahead. Let me know if there is\nanything I can do, or you need any explanations to the code, etc.\n\nAdriaan\n\n", "msg_date": "Sun, 30 Jan 2000 14:43:18 +0000", "msg_from": "Adriaan Joubert <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Bit strings" } ]
[ { "msg_contents": "This came down with my latest update and confused me quite a bit:\n\n* Portions Copyright (c) 1996-2000, PostgreSQL, Inc\n\nSince when do *they* own the copyright? Whatever happened to the good old\nPostgreSQL Global Development Group? Assigning the copyright of an open\nsource project to a commercial entity is something unprecedented, and\nquite frankly (without having anything at all against PostgreSQL, Inc) I\nam not so excited about it.\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Fri, 28 Jan 2000 18:53:19 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": true, "msg_subject": "Copyright" }, { "msg_contents": "[Charset ISO-8859-1 unsupported, filtering to ASCII...]\n> This came down with my latest update and confused me quite a bit:\n> \n> * Portions Copyright (c) 1996-2000, PostgreSQL, Inc\n> \n> Since when do *they* own the copyright? Whatever happened to the good old\n> PostgreSQL Global Development Group? Assigning the copyright of an open\n> source project to a commercial entity is something unprecedented, and\n> quite frankly (without having anything at all against PostgreSQL, Inc) I\n> am not so excited about it.\n\nThat is what I was told by Marc. If we want to discuss it, go ahead. \nSuch a change was planned in late December, though there was no\ndiscussion who gets the copyright. I believe he used PostgreSQL Inc.\nbecause it is a legal entity, vs. the development team, which is not.\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, 28 Jan 2000 13:37:28 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright" }, { "msg_contents": "Bruce Momjian <[email protected]> writes:\n> ... I believe he used PostgreSQL Inc.\n> because it is a legal entity, vs. the development team, which is not.\n\nRight. Although IANAL, I'm pretty sure it's pointless to slap a\ncopyright notice on something unless the copyright names an actual\nlegal entity (one which could go sue an infringer, if necessary).\nThe development team is not a person, corporation, or partnership,\nso in the eyes of the law it doesn't exist.\n\nI seem to recall some discussion of creating a separate legal entity\nto hold the copyright, but offhand I don't see what it buys us\nexcept more paperwork. The same people (ie, the core developers)\nwould have the final say over what either that entity or PostgreSQL,\nInc does, so what's the difference?\n\n\t\t\tregards, tom lane\n", "msg_date": "Fri, 28 Jan 2000 17:40:22 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright " }, { "msg_contents": "On Fri, Jan 28, 2000 at 05:40:22PM -0500, Tom Lane wrote:\n> Bruce Momjian <[email protected]> writes:\n> > ... I believe he used PostgreSQL Inc.\n> > because it is a legal entity, vs. the development team, which is not.\n> \n> Right. Although IANAL, I'm pretty sure it's pointless to slap a\n> copyright notice on something unless the copyright names an actual\n> legal entity (one which could go sue an infringer, if necessary).\n> The development team is not a person, corporation, or partnership,\n> so in the eyes of the law it doesn't exist.\n> \n> I seem to recall some discussion of creating a separate legal entity\n> to hold the copyright, but offhand I don't see what it buys us\n> except more paperwork. The same people (ie, the core developers)\n> would have the final say over what either that entity or PostgreSQL,\n> Inc does, so what's the difference?\n> \n\nAh, corporate assets? What if someone bought out PostgreSQL, Inc., for\na huge sum of money. They'd get control of anything PostgreSQL, Inc.\nhas control over. One can't buy out a non-profit organization.\n\nRoss\n-- \nRoss J. Reedstrom, Ph.D., <[email protected]> \nNSBRI Research Scientist/Programmer\nComputer and Information Technology Institute\nRice University, 6100 S. Main St., Houston, TX 77005\n", "msg_date": "Fri, 28 Jan 2000 17:07:43 -0600", "msg_from": "\"Ross J. Reedstrom\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright" }, { "msg_contents": "At 17:40 28/01/00 -0500, Tom Lane wrote:\n>Bruce Momjian <[email protected]> writes:\n>> ... I believe he used PostgreSQL Inc.\n>> because it is a legal entity, vs. the development team, which is not.\n>\n>Right. Although IANAL, I'm pretty sure it's pointless to slap a\n>copyright notice on something unless the copyright names an actual\n>legal entity (one which could go sue an infringer, if necessary).\n>The development team is not a person, corporation, or partnership,\n>so in the eyes of the law it doesn't exist.\n>\n>I seem to recall some discussion of creating a separate legal entity\n>to hold the copyright, but offhand I don't see what it buys us\n>except more paperwork. The same people (ie, the core developers)\n>would have the final say over what either that entity or PostgreSQL,\n>Inc does, so what's the difference?\n\nJust curious, but why was this route chosen at all? The copyright of\noriginal code presumably resided with the original developers (who may have\nassigned it somewhere), and the copyright for modifications would reside\nwith their authors, who also have to assign it to PostgreSQL, Inc (in\nwriting), if it is to be binding (at least where I come from).\n\nWouldn't a simpler solution be to release PostgreSQL on a GPL or LGPL or\nsimilar which requires the authors who wish to contribute to do the same?\n\nI must admit I am a little paranoid about what amounts to a concentration\nof power. I have no idea who owns PostgreSQL, Inc, but let's suppose the\nowners die and it is found that they are in debt. Then the debtors come\nalong and try to work out how much the copyright of PostgreSQL is worth. It\ncould get very messy.\n\nSimilary, let's just assume the owners get bored, move on to other things\netc (like the original developers did). New developers may be held back by\ndoing work for these, now, faceless people. Similaryl, the 'old guard' may\nnot see the new developers as worthy of the mantle, so might withold the\ncode (this *could* be good).\n\nAs I said, I'm paranoid, but it doesn't seem to be a good way to do an open\nsource project. There also seems to be a potential conflict of interest, if\nPostgreSQL is a company that also does consulting and customization of\nPostgreSQL.\n\nJust my 0.02c, and I'm sure that the current owners have the best of\nintentions, but most legal problems (eg. GIF/LZW/Unisys) are born out of\npeople changing their minds about something.\n\n\n----------------------------------------------------------------\nPhilip Warner | __---_____\nAlbatross Consulting Pty. Ltd. |----/ - \\\n(A.C.N. 008 659 498) | /(@) ______---_\nTel: +61-03-5367 7422 | _________ \\\nFax: +61-03-5367 7430 | ___________ |\nHttp://www.rhyme.com.au | / \\|\n | --________--\nPGP key available upon request, | /\nand from pgp5.ai.mit.edu:11371 |/\n", "msg_date": "Sat, 29 Jan 2000 10:32:07 +1100", "msg_from": "Philip Warner <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright " }, { "msg_contents": "Philip Warner wrote:\n> \n> Just curious, but why was this route chosen at all? The copyright of\n> original code presumably resided with the original developers (who may have\n> assigned it somewhere), and the copyright for modifications would reside\n> with their authors, who also have to assign it to PostgreSQL, Inc (in\n> writing), if it is to be binding (at least where I come from).\n\nI'm curious about this as well. I have been under the impression that\nthe only barrier to someone taking postgresql and making a company out\nof it, supporting and shipping postgresql, would be satisfying\nwhatever the original (Berkeley?) copyright terms were. I thought the\n\"leverage\" that the core group holds here is simply that nobody else\nhas the technical familiarity with the software, and thus nobody else\ncould support it as well.\n\nDoes the core group, or Postgresql, Inc., or anyone else for that\nmatter, have any legal ownership/licensing rights over postgresql\nbeyond UCB?\n\nCheers,\nEd Loehr\n", "msg_date": "Fri, 28 Jan 2000 18:31:54 -0600", "msg_from": "Ed Loehr <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright" }, { "msg_contents": "> > I seem to recall some discussion of creating a separate legal entity\n> > to hold the copyright, but offhand I don't see what it buys us\n> > except more paperwork. The same people (ie, the core developers)\n> > would have the final say over what either that entity or PostgreSQL,\n> > Inc does, so what's the difference?\n> > \n> \n> Ah, corporate assets? What if someone bought out PostgreSQL, Inc., for\n> a huge sum of money. They'd get control of anything PostgreSQL, Inc.\n> has control over. One can't buy out a non-profit organization.\n\nI am worried about that too. Maybe we need an organization something\nlike the Apache Software Foundation to hold the copyright.\n--\nTatsuo Ishii\n", "msg_date": "Sat, 29 Jan 2000 12:53:05 +0900", "msg_from": "Tatsuo Ishii <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright" }, { "msg_contents": "On Fri, 28 Jan 2000, Ross J. Reedstrom wrote:\n\n> On Fri, Jan 28, 2000 at 05:40:22PM -0500, Tom Lane wrote:\n> > Bruce Momjian <[email protected]> writes:\n> > > ... I believe he used PostgreSQL Inc.\n> > > because it is a legal entity, vs. the development team, which is not.\n> > \n> > Right. Although IANAL, I'm pretty sure it's pointless to slap a\n> > copyright notice on something unless the copyright names an actual\n> > legal entity (one which could go sue an infringer, if necessary).\n> > The development team is not a person, corporation, or partnership,\n> > so in the eyes of the law it doesn't exist.\n> > \n> > I seem to recall some discussion of creating a separate legal entity\n> > to hold the copyright, but offhand I don't see what it buys us\n> > except more paperwork. The same people (ie, the core developers)\n> > would have the final say over what either that entity or PostgreSQL,\n> > Inc does, so what's the difference?\n> > \n> \n> Ah, corporate assets? What if someone bought out PostgreSQL, Inc., for\n> a huge sum of money. They'd get control of anything PostgreSQL, Inc.\n> has control over. One can't buy out a non-profit organization.\n\nOne can't buy out open source software either ... \n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Sat, 29 Jan 2000 01:02:21 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright" }, { "msg_contents": "Michael Meskes wrote:\n\n> On Sat, Jan 29, 2000 at 04:31:55PM +1100, Philip Warner wrote:\n> > This depends on the definition of open source; I think Netscape is\n> > OpenSource these days, but I doubt if anyone would be allowed to take the\n>\n> The new version 5 code yes. The old version 4 is just given away for free.\n>\n> > sources and create \"Petscape: The Dog's Browser\". But, as far as I know, I\n> > could go away tomorrow with the PostgreSQL sources and create \"Mostgress\",\n> > so long as I did not try to sell it. AFAIK, I might even get away with\n> > selling it, but it's not really the point.\n>\n> Yes, you can sell Mostgress. That's one of the problems with a BSD type\n> license. That's why may use GPL for there open source projects.\n\nSome of us view this the other way around....using anything GPL can \"infect\"\nany product which may be putting the food on the programmer's table....What do\nwe care if someone else out there is making money off of, say,\n\"Mostgress\"...good for them. Letting people do whatever the devil they want, it\nseems to me, is the as free as free can get. :-)\n\nMike Mascari\n\n\n\n", "msg_date": "Sat, 29 Jan 2000 00:07:45 -0500", "msg_from": "Mike Mascari <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright" }, { "msg_contents": "At 12:53 29/01/00 +0900, Tatsuo Ishii wrote:\n>> > I seem to recall some discussion of creating a separate legal entity\n>> > to hold the copyright, but offhand I don't see what it buys us\n>> > except more paperwork. The same people (ie, the core developers)\n>> > would have the final say over what either that entity or PostgreSQL,\n>> > Inc does, so what's the difference?\n>> > \n>> \n>> Ah, corporate assets? What if someone bought out PostgreSQL, Inc., for\n>> a huge sum of money. They'd get control of anything PostgreSQL, Inc.\n>> has control over. One can't buy out a non-profit organization.\n>\n>I am worried about that too. Maybe we need an organization something\n>like the Apache Software Foundation to hold the copyright.\n\nThis sounds like a very good idea; I've sent some very general questions to\nthe Apache people asking about the issues (and costs) involved in setting\nup the ASF - it'll be interesting to see what they say (if anything). If\nanyone on the list, actually knows something about process, that would be\ngreat too. \n\nAny US lawyers out there, by any chance?\n\nI've often thought of donating funds for PGSQL, especially for features I\nwould like (like optimizer hints), but in the longer term, setting it up on\na good legal footing is probably a far more substantial contribution, and\nfar more needing of funds. Does anybody else feel the same way (monetarily\nspeaking)?\n\n\n\n\n----------------------------------------------------------------\nPhilip Warner | __---_____\nAlbatross Consulting Pty. Ltd. |----/ - \\\n(A.C.N. 008 659 498) | /(@) ______---_\nTel: +61-03-5367 7422 | _________ \\\nFax: +61-03-5367 7430 | ___________ |\nHttp://www.rhyme.com.au | / \\|\n | --________--\nPGP key available upon request, | /\nand from pgp5.ai.mit.edu:11371 |/\n", "msg_date": "Sat, 29 Jan 2000 16:24:52 +1100", "msg_from": "Philip Warner <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright" }, { "msg_contents": "At 01:02 29/01/00 -0400, The Hermit Hacker wrote:\n>> \n>> Ah, corporate assets? What if someone bought out PostgreSQL, Inc., for\n>> a huge sum of money. They'd get control of anything PostgreSQL, Inc.\n>> has control over. One can't buy out a non-profit organization.\n>\n>One can't buy out open source software either ... \n\nThis depends on the definition of open source; I think Netscape is\nOpenSource these days, but I doubt if anyone would be allowed to take the\nsources and create \"Petscape: The Dog's Browser\". But, as far as I know, I\ncould go away tomorrow with the PostgreSQL sources and create \"Mostgress\",\nso long as I did not try to sell it. AFAIK, I might even get away with\nselling it, but it's not really the point.\n\nWhat matters is that it remains open, free, and modifyable by anyone, for\nany purpose.\n\nThis does bring up the larger question of what happened to the original\ncopyrights? Is this covered in Bruce's upcoming book?\n\n\n----------------------------------------------------------------\nPhilip Warner | __---_____\nAlbatross Consulting Pty. Ltd. |----/ - \\\n(A.C.N. 008 659 498) | /(@) ______---_\nTel: +61-03-5367 7422 | _________ \\\nFax: +61-03-5367 7430 | ___________ |\nHttp://www.rhyme.com.au | / \\|\n | --________--\nPGP key available upon request, | /\nand from pgp5.ai.mit.edu:11371 |/\n", "msg_date": "Sat, 29 Jan 2000 16:31:55 +1100", "msg_from": "Philip Warner <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright" }, { "msg_contents": "> What matters is that it remains open, free, and modifiable by anyone, for\n> any purpose.\n> \n> This does bring up the larger question of what happened to the original\n> copyrights? Is this covered in Bruce's upcoming book?\n\nThe confusing part is that the Berkeley copyright allows the code to be\nintegrated into any product, so you can call it Momgres and close the\nsource, and there is nothing we can do about it. At least that is the\nmeaning of the Berkeley copyright.\n\nMany people have taken Berkeley code, added it into their kernels, and\nprint Berkeley when the system boots up, and they have satisfied the\ncopyright.\n\nWhat is quite confusing to me is that though we have copyrighted the\ncode now, we don't have a statement saying what that copyright allows\npeople to do with the code. And with no statement, we are basically\ndoing an \"all rights reserved\" thing, I think, which is certainly not\nwhat is intended.\n\nIn fact, there can be an argument that we were never open since 1996\nbecause we didn't have any copyright covering years after 1996, and\nthere is an implied copyright to all works, even if not stated.\n\nNow, I don't mean to suggest that this was intended, but the more I\nthink about it, the more I wonder. We have never enforced the\ncopyright, so there may be no legal basis for it, but I believe there is\nsome muddy water here.\n\nThis all started because I asked about copyright issues around Christmas\n(as someone reminded me), and we agreed to copyright the code via\nPostgreSQL Inc. Now that we have done that, it seems we may have a\nlittle more to do.\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": "Sat, 29 Jan 2000 00:42:02 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright" }, { "msg_contents": "At 12:53 PM 1/29/00 +0900, Tatsuo Ishii wrote:\n>> \n>> Ah, corporate assets? What if someone bought out PostgreSQL, Inc., for\n>> a huge sum of money. They'd get control of anything PostgreSQL, Inc.\n>> has control over. One can't buy out a non-profit organization.\n>\n>I am worried about that too. Maybe we need an organization something\n>like the Apache Software Foundation to hold the copyright.\n\nA couple of points (as an outsider)...\n\nI have no doubt that the organization of PG, Inc and the copyright\nstatements which reflect that are done in good faith.\n\nIf the distribution license is explicit and \"loose\", the copyright\nissue shouldn't really matter much, i.e. the distribution terms\nunder the existing license are such that you can do whatever you\nwant to the code including productize it.\n\nThese terms supercede copyright in the sense that the copyright\nsays \"we assert ownership\", and having said that, the license\nsays \"we owners say that you can do what you want\".\n\nSo...maybe the concerns shouldn't be focused so much on the \ncopyright issue as in doing whatever's necessary to make sure\nthat the license terms are perpetuated?\n\nThe BSD license under which it is distributed would seem to\ndo that...each distribution today goes out under that, unless\nthat's changed which I don't think it has.\n\nThe questions about \"What happens when the postgres, inc\nowner(s) dies?\" is valid, and maybe some sort of protection\ncan be built up that ensures that postgres is distributed\nunder the same loose license it is today. Obviously the\nU can make that claim for most of the code anyway, but\nPG development is also an international phenomena so it\nisn't clear how strong that claim is. \n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Fri, 28 Jan 2000 21:54:34 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright" }, { "msg_contents": "At 00:42 29/01/00 -0500, Bruce Momjian wrote:\n>> What matters is that it remains open, free, and modifiable by anyone, for\n>> any purpose.\n>> \n>> This does bring up the larger question of what happened to the original\n>> copyrights? Is this covered in Bruce's upcoming book?\n>\n...etc...\n>\n>This all started because I asked about copyright issues around Christmas\n>(as someone reminded me), and we agreed to copyright the code via\n>PostgreSQL Inc. Now that we have done that, it seems we may have a\n>little more to do.\n\nIt's probably a little more than just putting the notices in the code. In\nAustralia, copyright rests with the writer unless it is explicitly granted\nin writing to another entity by the author, or unless a singed contract of\nservice exists which grants copyright of works performed directly in the\ncourse of performing those service.\n\nIf the US & Canada are similar, the upshot of this is that you'll need to\nget the contributors (and Berkely) to sign their copyrights over to\nPosgreSQL, Inc, before you can lawfully place those copyright notices in\nthe code. I would *guess* that there would be some resistance to this.\n\nIt's a hell of a lot simpler to leave the copyright with the authors, who\nthen grant usage under a GPL/LGPL or whatever. Or, set up an arms-length\nentity designed to promote free distribution of PostgreSQL that authorsd\nmay feel happy about assigning their copyrights to.\n\nAgain, just my 0.02c, but copyright is a very thorny issue designed to\nprotect authors - it's a pity to take that away from them. I am very happy\nthat the copyright of the code I have contributed to, eg, the GD graphics\nlibrary remains with me, but that it can be freely used & distributed in\nGD. I would not want to sign my rights to that code away, then be told by\nthe person that buys GD from Tom Boutell that I am no longer permitted to\nuse the code I wrote.\n\n\n\n----------------------------------------------------------------\nPhilip Warner | __---_____\nAlbatross Consulting Pty. Ltd. |----/ - \\\n(A.C.N. 008 659 498) | /(@) ______---_\nTel: +61-03-5367 7422 | _________ \\\nFax: +61-03-5367 7430 | ___________ |\nHttp://www.rhyme.com.au | / \\|\n | --________--\nPGP key available upon request, | /\nand from pgp5.ai.mit.edu:11371 |/\n", "msg_date": "Sat, 29 Jan 2000 17:01:41 +1100", "msg_from": "Philip Warner <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright" }, { "msg_contents": "At 12:42 AM 1/29/00 -0500, Bruce Momjian wrote:\n\n>In fact, there can be an argument that we were never open since 1996\n>because we didn't have any copyright covering years after 1996, and\n>there is an implied copyright to all works, even if not stated.\n\nLicenses compliment copyright, pure and simple. In other words, as\na photographer (http://donb.photo.net) I defend my copyright, yet\nI give permission (license) students and a wide variety of other\npeople to make free use of my work. Yet I still charge other \nentities for this right. \n\nWhen I license my work for use, I in no way diminish my copyright.\nThis is true even if I release it into the public domain, i.e. if\nmy license says \"you can use this for whatever you want!\". I still\ndon't waive my copyright (though I've shot my foot in terms of \ngetting damages for use, because if you say folks can use your\nphotos for free you can't expect to get paid when they accept your\nlicense terms for free use!)\n\nLicense...copyright...not the same.\n\n>Now, I don't mean to suggest that this was intended, but the more I\n>think about it, the more I wonder. We have never enforced the\n>copyright, so there may be no legal basis for it, but I believe there is\n>some muddy water here.\n\nLast time I looked (which I admit was like 15 years ago) enforcement of\ncopyright wasn't actually an issue. What's an issue is getting \ncompensation for unapproved use. This is where a registered copyright\ncomes in (you can collect punitive as well as actual damages and the\nstandard of proof of ownership is far, far lower where you've registered\nthe copyrighted entity - if you don't register, you can only collect\nactual damages. Since punitive damages can be 3x actual in the US,\nyou can see why lawyers are more interested in taking a case regarding\na registered copyright on contingency than one regarding an unregistered\ncopyright - plus the standard of proof of ownership is less).\n\nOf course, it's hard to prove damages or even 3x punitive damages\nwhen you GIVE YOUR STUFF AWAY FOR FREE! :)\n\nSo...you probably haven't given up any rights to sue someone for\n\"using my stuff without permission that I give away for free\" but\nyour compensation for these extra copies that would be free anyway?\n\nNot enough to cover your legal costs...\n\nThe above ignores licensing, the PG license makes it clear we don't\nhave to ask permission to use this stuff. In essence, the PG \nlicense is stating that the copyright holders and otherwise code\nowners are granting lots and lots of freedom to the recipient.\n\nYou can't legally win saying \"I gave it away for free with no\nrestriction, but I still own the copyright and have changed my\nmind, and now these folks have to pay!\".\n\n[you could for FUTURE distribution, but not past]\n\nDespite all the above, things get cloudly when (say) the PG \ncore gets together in Fiji for a big bash and coding party\nand a Tsunami wipes everyone out at once and PG, Inc is left\nwithout owners, only heirs of owners...\n\nWorth worrying about? I don't think so...as long as the latest\nrelease was still out there with the current license, other\nfolks around the world could pick it up and any greedy PG, Inc\nheirs would be left without a leg to stand on.\n\nNot because of copyright, because of the license agreement under\nwhich we are granted the use of the copyrighed material.\n\n>This all started because I asked about copyright issues around Christmas\n>(as someone reminded me), and we agreed to copyright the code via\n>PostgreSQL Inc. Now that we have done that, it seems we may have a\n>little more to do.\n\nWell...you can't just copyright someone's work without their permission.\nWhen (say, Peter) makes a contribution you can't just say \"OK, now it\nis copyright PG, Inc\" if Peter didn't agree to this arrangement. Because\nhe has copyright in his code. Of course, his code isn't worth much without\nthe rest of the 250,000 lines of PG but that's not the point.\n\nI think the idea of looking at the Apache Foundation's sound, because\nit is possible they've looked more deeply into this and have found\nsolutions.\n\nI suspect that everyone here has the same general impression of what is\nwanted, but getting the *bleeping* legal structure organized to recognize\nit is difficult especially given the inheritance issue (with the original\nUC license). \n\nFace it, the legal framework in the US isn't really set up to cater\nto those who work hard and give their work freely to others...PG, Inc\netc needs to be creative.\n\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Fri, 28 Jan 2000 22:14:38 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright" }, { "msg_contents": "At 05:01 PM 1/29/00 +1100, Philip Warner wrote:\n\n>It's probably a little more than just putting the notices in the code. In\n>Australia, copyright rests with the writer unless it is explicitly granted\n>in writing to another entity by the author, or unless a singed contract of\n>service exists which grants copyright of works performed directly in the\n>course of performing those service.\n\nThis could probably be argued here, too, though the weight of oral\nand implied conditions weigh heavily here. It would be hard for a\nsignificant contributor, who by definition would spend a lot of \ntime working with the code and being social with \"the group\", to claim\nthey were unaware that their code would be distributed.\n\nAnd what would be the remedy? The code contribution's worthless without\nthe database. If there's a novel or patentable idea in the code snippet\nyou could still patent it and be nice and grant the PG distribution the\nright to use it royalty free. How does modern (screwed-up, IMO) software\npatenting possibilities impact possible contributions, oh my, another\ncan of worms!\n\nAnyway, anyone who contributes code to the repository is doing so with\nthe intent of its being distributed. I don't think good lawyers would \nhave much trouble with defending that part of the arrangement.\n\n>If the US & Canada are similar, the upshot of this is that you'll need to\n>get the contributors (and Berkely) to sign their copyrights over to\n>PosgreSQL, Inc, before you can lawfully place those copyright notices in\n>the code. I would *guess* that there would be some resistance to this.\n\nSo, what, you sign every \"XXX\" comment with a copyright?\n\nI don't think so. \n\nThings are muddied by the fact that there's no legal relationship between\nPG, Inc and the individuals (as opposed to your working and being paid\nby a company, which sets up a relationship with implicit rules).\n\n>It's a hell of a lot simpler to leave the copyright with the authors, who\n>then grant usage under a GPL/LGPL or whatever. Or, set up an arms-length\n>entity designed to promote free distribution of PostgreSQL that authorsd\n>may feel happy about assigning their copyrights to.\n\nWhich again is probably like the Apache Foundation or whatever it is \ncalled.\n\n>Again, just my 0.02c, but copyright is a very thorny issue designed to\n>protect authors - it's a pity to take that away from them.\n\nDo you have newspapers in Australia? I seem to recall you do from my\none visit there :)\n\nDo these newspapers have a \"letters to the editor\" column? If so, do\nthe newspapers make each and every contributor sign over their rights\nbefore publishing such letters?\n\nI know in the US they don't. \n\nThere's an explicit permission to publish when you mail in your letter\nto the editor. If you were to sue, the court would have a couple of\nquestions:\n\n1. Did you send your letter in so it WOULDN'T be published? When you\n read the little blurb in the paper that said \"write your opinion\n letters for consideration of publishment to xyz box\" that they\n would never publish it?\n\nand importantly:\n\n2. What was the financial harm done you by their publishing it.\n\n (non-registered copyrights are strictly a civil affair here)\n\n> I am very happy\n>that the copyright of the code I have contributed to, eg, the GD graphics\n>library remains with me, but that it can be freely used & distributed in\n>GD. I would not want to sign my rights to that code away, then be told by\n>the person that buys GD from Tom Boutell that I am no longer permitted to\n>use the code I wrote.\n\nYes, of course.\n\nThe legend, though, says \"portions copyright 1996-2000 by PG, Inc.\"\n\nIt doesn't identify which portions. Nor does the original statement\nby UC. The reality is that no one could necessarily claim that any\ncontribution you make is part of the \"portions\".\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Fri, 28 Jan 2000 22:32:48 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright" }, { "msg_contents": "At 22:32 28/01/00 -0800, Don Baccus wrote:\n>At 05:01 PM 1/29/00 +1100, Philip Warner wrote:\n>\n>>It's probably a little more than just putting the notices in the code. In\n>>Australia, copyright rests with the writer unless it is explicitly granted\n>>in writing to another entity by the author, or unless a singed contract of\n>>service exists which grants copyright of works performed directly in the\n>>course of performing those service.\n>\n>This could probably be argued here, too, though the weight of oral\n>and implied conditions weigh heavily here. It would be hard for a\n>significant contributor, who by definition would spend a lot of \n>time working with the code and being social with \"the group\", to claim\n>they were unaware that their code would be distributed.\n>\n>And what would be the remedy? The code contribution's worthless without\n>the database. If there's a novel or patentable idea in the code snippet\n>you could still patent it and be nice and grant the PG distribution the\n>right to use it royalty free. How does modern (screwed-up, IMO) software\n>patenting possibilities impact possible contributions, oh my, another\n>can of worms!\n>\n>Anyway, anyone who contributes code to the repository is doing so with\n>the intent of its being distributed. I don't think good lawyers would \n>have much trouble with defending that part of the arrangement.\n\nAs you say, there is an implied license to distribute. Similarly, if they\nremove theire code, there is an implied revocation of the license. As you\nsaid earlier, this is nothing to do with copyright. Copyright is the thing\nthat gives you the ability to write your own license.\n\n\n>>If the US & Canada are similar, the upshot of this is that you'll need to\n>>get the contributors (and Berkely) to sign their copyrights over to\n>>PosgreSQL, Inc, before you can lawfully place those copyright notices in\n>>the code. I would *guess* that there would be some resistance to this.\n>\n>So, what, you sign every \"XXX\" comment with a copyright?\n>\n>I don't think so. \n\nWell, somone told me that the GNU developers have to do just that - they\nsign a piece of paper up front waiving copyright. I've only heard this from\none source, though.\n\n\n>Things are muddied by the fact that there's no legal relationship between\n>PG, Inc and the individuals (as opposed to your working and being paid\n>by a company, which sets up a relationship with implicit rules).\n>\n>>It's a hell of a lot simpler to leave the copyright with the authors, who\n>>then grant usage under a GPL/LGPL or whatever. Or, set up an arms-length\n>>entity designed to promote free distribution of PostgreSQL that authorsd\n>>may feel happy about assigning their copyrights to.\n>\n>Which again is probably like the Apache Foundation or whatever it is \n>called.\n\nYes, I assume so. I hope they get back to me...\n\n\n>>Again, just my 0.02c, but copyright is a very thorny issue designed to\n>>protect authors - it's a pity to take that away from them.\n>\n>Do you have newspapers in Australia? I seem to recall you do from my\n>one visit there :)\n>\n>Do these newspapers have a \"letters to the editor\" column? If so, do\n>the newspapers make each and every contributor sign over their rights\n>before publishing such letters?\n>\n>I know in the US they don't. \n>\n>There's an explicit permission to publish when you mail in your letter\n>to the editor. If you were to sue, the court would have a couple of\n>questions:\n>\n\nAgain, there is an implied license for a one-off usage, but no loss of\ncopyright. They could not publish my collected letters in a book without\nobtaining further permission.\n\n\n>> I am very happy\n>>that the copyright of the code I have contributed to, eg, the GD graphics\n>>library remains with me, but that it can be freely used & distributed in\n>>GD. I would not want to sign my rights to that code away, then be told by\n>>the person that buys GD from Tom Boutell that I am no longer permitted to\n>>use the code I wrote.\n>\n>Yes, of course.\n>\n>The legend, though, says \"portions copyright 1996-2000 by PG, Inc.\"\n>\n>It doesn't identify which portions. Nor does the original statement\n>by UC. The reality is that no one could necessarily claim that any\n>contribution you make is part of the \"portions\".\n\nAs you said earlier, we all agree that they are doing this in the best\ninterests on PostgreSQL. The question is, what are they trying to achieve,\nand can we achieve a better result another way?\n\nAs the law stands here, the only portions the company would own would be\nthe portions written by their employees while working at the company's\ndirection (assuming of course their work agreement assigns copyright to\ntheir employer).\n\nI'm not trying to offend anyone - as you say, I think we all want the same\nresult.\n\n\n----------------------------------------------------------------\nPhilip Warner | __---_____\nAlbatross Consulting Pty. Ltd. |----/ - \\\n(A.C.N. 008 659 498) | /(@) ______---_\nTel: +61-03-5367 7422 | _________ \\\nFax: +61-03-5367 7430 | ___________ |\nHttp://www.rhyme.com.au | / \\|\n | --________--\nPGP key available upon request, | /\nand from pgp5.ai.mit.edu:11371 |/\n", "msg_date": "Sat, 29 Jan 2000 17:50:46 +1100", "msg_from": "Philip Warner <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright" }, { "msg_contents": "> This depends on the definition of open source; I think Netscape is\n> OpenSource these days, but I doubt if anyone would be allowed to take the\n> sources and create \"Petscape: The Dog's Browser\". But, as far as I know, I\n> could go away tomorrow with the PostgreSQL sources and create \"Mostgress\",\n> so long as I did not try to sell it. AFAIK, I might even get away with\n> selling it, but it's not really the point.\n\nYes you could. The original Postgres developers (or at least some of\nthem) did just that in founding Illustra. They sold the company a\ncouple of years later for $50M US to Informix.\n\n> What matters is that it remains open, free, and modifyable by anyone, for\n> any purpose.\n\nThe original sources, and the modified sources *that we know about*\n(someone could have and probably has taken the source code, modified\nit, and not contributed back the changes) are always fair game to be\ntaken out of open source status. That is an artifact or benefit or\ndownside of the BSD license, depending on your PoV.\n\n> This does bring up the larger question of what happened to the original\n> copyrights? Is this covered in Bruce's upcoming book?\n\nThe original copyrights are still valid and travel with the code.\nHowever, afaict they are designed to release UC Berkeley from\nliability and to preserve some credit for the original work, not to\nallow Berkeley to assert ownership control over derivative sources\n(into which category I think the current PostgreSQL tree falls, so to\nspeak).\n\nI think Marc is concerned that there be someone or something able to\nrepresent the current code tree, and to prevent hijacking of the\nPostgreSQL (and perhaps Postgres) names from this open source group.\nHe has been consistantly adamant about preserving the BSD copyright,\nwhich leave the maximum flexibility for the use of the code tree\nbasically for any purpose by anyone. That isn't quite the same goal of\nGPL, but check the archives for threads which cover these topics\nexhaustively.\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Sat, 29 Jan 2000 07:02:30 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright" }, { "msg_contents": "> What is quite confusing to me is that though we have copyrighted the\n> code now, we don't have a statement saying what that copyright allows\n> people to do with the code. And with no statement, we are basically\n> doing an \"all rights reserved\" thing, I think, which is certainly not\n> what is intended.\n\nHere is what we have now:\n\nPostgreSQL is Copyright � 1996-9 by the PostgreSQL Global Development\nGroup, and is distributed under the terms of the Berkeley license. \n\nPostgres95 is Copyright � 1994-5 by the Regents of the University of\nCalifornia. Permission to use, copy, modify, and distribute this\nsoftware and its documentation for any purpose,\nwithout fee, and without a written agreement is hereby granted,\nprovided that the above copyright notice and this paragraph and the\nfollowing two paragraphs appear in all copies. \n\nIn no event shall the University of California be liable to any party\nfor direct, indirect, special, incidental, or consequential damages,\nincluding lost profits, arising out of the use of this\nsoftware and its documentation, even if the University of California\nhas been advised of the possibility of such damage. \n\nThe University of California specifically disclaims any warranties,\nincluding, but not limited to, the implied warranties of\nmerchantability and fitness for a particular purpose. The software\nprovided hereunder is on an \"as-is\" basis, and the University of\nCalifornia has no obligations to provide maintainance, support,\nupdates, enhancements, or modifications. \n\n\nWhat we may need to do is be more explicit; perhaps we should restate\nthe text of the Berkeley copyright but substitute another group as the\ncurrent copyright holder, asking that credit be given to the group\nwhen using or distributing the software.\n\nafaict that is a perfectly reasonable request to make of users of the\ncode, and it gives all of us open-source contributors a way to see\nwhere our work is being used in the future. That's part of what makes\nthis fun...\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Sat, 29 Jan 2000 07:31:03 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright" }, { "msg_contents": "Thomas Lockhart <[email protected]> writes:\n> The original sources, and the modified sources *that we know about*\n> (someone could have and probably has taken the source code, modified\n> it, and not contributed back the changes) are always fair game to be\n> taken out of open source status.\n\nThe above could easily be misinterpreted. I believe the point Thomas\nmeant to make is that anyone is free to make a derivative version that\nthey choose not to release as open source. It does *not* mean that\nsomeone can take away your right to use existing code that was already\nreleased with a Berkeley-style license.\n\n> The original copyrights are still valid and travel with the code.\n> However, afaict they are designed to release UC Berkeley from\n> liability and to preserve some credit for the original work, not to\n> allow Berkeley to assert ownership control over derivative sources\n> (into which category I think the current PostgreSQL tree falls, so to\n> speak).\n\nRight, and I think that it's past time that the Postgres group (in\nthe person of PG Inc, or some other entity if that's what a majority\nwant) explicitly make the same statements that UC Berkeley has made.\nAnyone here want to be on the hook for liability when some big\ncompany's database crashes? Not me...\n\n> I think Marc is concerned that there be someone or something able to\n> represent the current code tree, and to prevent hijacking of the\n> PostgreSQL (and perhaps Postgres) names from this open source group.\n\nThat's actually quite a separate issue. Trademarking the name\n\"PostgreSQL\" might be a good idea to prevent some random bozo from\nclaiming ownership of it. (In reality, I think any attempt by\nsomeone else to register that name as a database trademark at this\npoint could easily be shot down, but it would be far cheaper to\nregister the mark pre-emptively than to file suit against someone's\npredatory registration.) Yet ... on the other hand, if it were a\ntrademark then someone *could* buy it off PG Inc. If that happened,\nwe (the community) would still have the rights to use the Postgres code,\nbut we'd have to find another name for it ;-).\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 29 Jan 2000 02:55:56 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright " }, { "msg_contents": "On Fri, Jan 28, 2000 at 05:07:43PM -0600, Ross J. Reedstrom wrote:\n> Ah, corporate assets? What if someone bought out PostgreSQL, Inc., for\n> a huge sum of money. They'd get control of anything PostgreSQL, Inc.\n> has control over. One can't buy out a non-profit organization.\n\nWhich brings up the question whether PostgreSQL Inc. is a profit or a\nnon-profit organizationn.\n\nAFARC that's the way Debian solved this problem, by forming a non-profit\norganization name Software in the Public Interest (SPI) Inc.\n\nMichael-- \nMichael Meskes | Go SF 49ers!\nTh.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire!\nTel.: (+49) 2431/72651 | Use Debian GNU/Linux!\nEmail: [email protected] | Use PostgreSQL!\n", "msg_date": "Sat, 29 Jan 2000 10:36:55 +0100", "msg_from": "Michael Meskes <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright" }, { "msg_contents": "On Sat, Jan 29, 2000 at 04:31:55PM +1100, Philip Warner wrote:\n> This depends on the definition of open source; I think Netscape is\n> OpenSource these days, but I doubt if anyone would be allowed to take the\n\nThe new version 5 code yes. The old version 4 is just given away for free.\n\n> sources and create \"Petscape: The Dog's Browser\". But, as far as I know, I\n> could go away tomorrow with the PostgreSQL sources and create \"Mostgress\",\n> so long as I did not try to sell it. AFAIK, I might even get away with\n> selling it, but it's not really the point.\n\nYes, you can sell Mostgress. That's one of the problems with a BSD type\nlicense. That's why may use GPL for there open source projects.\n\n> What matters is that it remains open, free, and modifyable by anyone, for\n> any purpose.\n\nThe source as it is now will remain open, free and modifyable. If someone\nforsk its own version that's a different matter. But ours remains open.\n\nMichael\n\n-- \nMichael Meskes | Go SF 49ers!\nTh.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire!\nTel.: (+49) 2431/72651 | Use Debian GNU/Linux!\nEmail: [email protected] | Use PostgreSQL!\n", "msg_date": "Sat, 29 Jan 2000 10:42:17 +0100", "msg_from": "Michael Meskes <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright" }, { "msg_contents": "At 05:50 PM 1/29/00 +1100, Philip Warner wrote:\n>>There's an explicit permission to publish when you mail in your letter\n>>to the editor. If you were to sue, the court would have a couple of\n>>questions:\n\n>Again, there is an implied license for a one-off usage, but no loss of\n>copyright. They could not publish my collected letters in a book without\n>obtaining further permission.\n\nIt's debatable, at least here in the US. You could look into recent\nfights among photographers and publishers over web redistribution of\narticles originally published with ink on paper, for instance.\n\nThe issue isn't loss of copyright, but license scope...\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Sat, 29 Jan 2000 07:00:58 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright" }, { "msg_contents": "On Fri, 28 Jan 2000, Don Baccus wrote:\n\n> It doesn't identify which portions. Nor does the original statement\n> by UC. The reality is that no one could necessarily claim that any\n> contribution you make is part of the \"portions\".\n\nAnd, as the wu-ftpd distribution has always done, there is *nothing* to\nstop someone working in 'heapam.c' from adding a personal 'Portions\nCopyright(c) 1999 by Bruce Momjian' ... we put a 'blanket copyright on' to\nprovide a 'general cover', but there is nothing from stopping ppl from\nadding more specific ones for the work they do:\n\n===========================================\n/**************************************************************************** \n \n Copyright (c) 1999 WU-FTPD Development Group. \n All rights reserved.\n \n Portions Copyright (c) 1980, 1985, 1988, 1989, 1990, 1991, 1993, 1994 \n The Regents of the University of California.\n Portions Copyright (c) 1993, 1994 Washington University in Saint Louis. \n Portions Copyright (c) 1996, 1998 Berkeley Software Design, Inc. \n Portions Copyright (c) 1989 Massachusetts Institute of Technology. \n Portions Copyright (c) 1998 Sendmail, Inc. \n Portions Copyright (c) 1983, 1995, 1996, 1997 Eric P. Allman. \n Portions Copyright (c) 1997 by Stan Barber. \n Portions Copyright (c) 1997 by Kent Landfield. \n Portions Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997 \n Free Software Foundation, Inc. \n===========================================\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Sat, 29 Jan 2000 12:58:15 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright" }, { "msg_contents": "On 2000-01-28, Bruce Momjian mentioned:\n\n> [Charset ISO-8859-1 unsupported, filtering to ASCII...]\n> > This came down with my latest update and confused me quite a bit:\n> > \n> > * Portions Copyright (c) 1996-2000, PostgreSQL, Inc\n> > \n> > Since when do *they* own the copyright? Whatever happened to the good old\n> > PostgreSQL Global Development Group? Assigning the copyright of an open\n> > source project to a commercial entity is something unprecedented, and\n> > quite frankly (without having anything at all against PostgreSQL, Inc) I\n> > am not so excited about it.\n> \n> That is what I was told by Marc. If we want to discuss it, go ahead. \n> Such a change was planned in late December, though there was no\n> discussion who gets the copyright. I believe he used PostgreSQL Inc.\n> because it is a legal entity, vs. the development team, which is not.\n\nIn any case, a better way to search for copyright notices is\n\negrep -i '\\(c\\)|copyright'\n\nJust\n\negrep '\\(C\\)'\n\nwill miss some. ;)\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Sat, 29 Jan 2000 17:59:14 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Copyright" }, { "msg_contents": "On Sat, Jan 29, 2000 at 12:07:45AM -0500, Mike Mascari wrote:\n> > Yes, you can sell Mostgress. That's one of the problems with a BSD type\n> > license. That's why may use GPL for there open source projects.\n ^^^\n\nShould have been 'many'. :-)\n\n> Some of us view this the other way around....using anything GPL can \"infect\"\n> any product which may be putting the food on the programmer's table....What do\n> we care if someone else out there is making money off of, say,\n> \"Mostgress\"...good for them. Letting people do whatever the devil they want, it\n> seems to me, is the as free as free can get. :-)\n\nI can understand and tolerate both reasonings. That's why I do some of my\nopen source work under BSD (ecpg) and other under GPL (watchdog).\n\nMichael\n-- \nMichael Meskes | Go SF 49ers!\nTh.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire!\nTel.: (+49) 2431/72651 | Use Debian GNU/Linux!\nEmail: [email protected] | Use PostgreSQL!\n", "msg_date": "Sat, 29 Jan 2000 20:02:28 +0100", "msg_from": "Michael Meskes <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright" }, { "msg_contents": "Thomas Lockhart wrote:\n> \n> > This depends on the definition of open source; I think Netscape is\n> > OpenSource these days, but I doubt if anyone would be allowed to take the\n> > sources and create \"Petscape: The Dog's Browser\". But, as far as I know, I\n> > could go away tomorrow with the PostgreSQL sources and create \"Mostgress\",\n> > so long as I did not try to sell it. AFAIK, I might even get away with\n> > selling it, but it's not really the point.\n> \n> Yes you could. The original Postgres developers (or at least some of\n> them) did just that in founding Illustra. They sold the company a\n> couple of years later for $50M US to Informix.\n\nActually Postgres was _not_ distributed under the BSD (do-whatever-you-want\nbut \ngive credit) license but a much more restrictive license that required a\nspecial \npermission from UBC to to anything non-educational.\n\nIIRC Stonebraker et al founded Illustra after getting special permissions from\nUCB\n\nThe shift to BSD license (that enabled the current blooming of PostgreSQL ;)\nwas oftained sometime during the development of postgres 95, with some\nconsiderable backing from Stonebraker.\n\n> \n-------------\nHannu\n", "msg_date": "Sat, 29 Jan 2000 22:11:02 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright" }, { "msg_contents": "> Thomas Lockhart wrote:\n> > \n> > > This depends on the definition of open source; I think Netscape is\n> > > OpenSource these days, but I doubt if anyone would be allowed to take the\n> > > sources and create \"Petscape: The Dog's Browser\". But, as far as I know, I\n> > > could go away tomorrow with the PostgreSQL sources and create \"Mostgress\",\n> > > so long as I did not try to sell it. AFAIK, I might even get away with\n> > > selling it, but it's not really the point.\n> > \n> > Yes you could. The original Postgres developers (or at least some of\n> > them) did just that in founding Illustra. They sold the company a\n> > couple of years later for $50M US to Informix.\n> \n> Actually Postgres was _not_ distributed under the BSD (do-whatever-you-want\n> but \n> give credit) license but a much more restrictive license that required a\n> special \n> permission from UBC to to anything non-educational.\n> \n> IIRC Stonebraker et al founded Illustra after getting special permissions from\n> UCB\n> \n> The shift to BSD license (that enabled the current blooming of PostgreSQL ;)\n> was oftained sometime during the development of postgres 95, with some\n> considerable backing from Stonebraker.\n> \n\nWell, that's interesting.\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": "Sat, 29 Jan 2000 15:41:38 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright" }, { "msg_contents": "\n> > Right. Although IANAL, I'm pretty sure it's pointless to slap a\n> > copyright notice on something unless the copyright names an actual> \n> > legal entity (one which could go sue an infringer, if necessary).\n> > The development team is not a person, corporation, or partnership,\n> > so in the eyes of the law it doesn't exist.\n\nSince the licence lets anybody do pretty much anything, who are you \ngoing to sue?? It seems like the only reason to have the copyright\nis to establish that the code is not stolen.\n", "msg_date": "Mon, 31 Jan 2000 10:15:54 +1100", "msg_from": "Chris Bitmead <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Copyright" } ]
[ { "msg_contents": "I'd like to yank the END/ABORT commands, since they're non-standard and\nredundant (COMMIT/ROLLBACK). Anyone who could not bear to see them go?\n(Of course END would stay as a reserved word.)\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Fri, 28 Jan 2000 18:54:00 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": true, "msg_subject": "END/ABORT" }, { "msg_contents": "[Charset ISO-8859-1 unsupported, filtering to ASCII...]\n> I'd like to yank the END/ABORT commands, since they're non-standard and\n> redundant (COMMIT/ROLLBACK). Anyone who could not bear to see them go?\n> (Of course END would stay as a reserved word.)\n> \n\nWe have to keep them in there for compatibility with older code.\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, 28 Jan 2000 13:37:55 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] END/ABORT" }, { "msg_contents": " > I'd like to yank the END/ABORT commands, since they're non-standard and\n > redundant (COMMIT/ROLLBACK). Anyone who could not bear to see them go?\n > (Of course END would stay as a reserved word.)\n\n We have to keep them in there for compatibility with older code.\n\nBut documentation could mark them as deprecated so new users will use\nthe standard commands.\n\nCheers,\nBrook\n", "msg_date": "Fri, 28 Jan 2000 13:31:39 -0700 (MST)", "msg_from": "Brook Milligan <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] END/ABORT" }, { "msg_contents": "> > I'd like to yank the END/ABORT commands, since they're non-standard and\n> > redundant (COMMIT/ROLLBACK). Anyone who could not bear to see them go?\n> > (Of course END would stay as a reserved word.)\n> \n> We have to keep them in there for compatibility with older code.\n> \n> But documentation could mark them as deprecated so new users will use\n> the standard commands.\n\nYes, I think that is done, but am not positive.\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, 28 Jan 2000 17:03:12 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] END/ABORT" }, { "msg_contents": "Peter Eisentraut <[email protected]> writes:\n> I'd like to yank the END/ABORT commands, since they're non-standard and\n> redundant (COMMIT/ROLLBACK). Anyone who could not bear to see them go?\n\nExactly what will this accomplish, other than breaking a lot of existing\napplications? (Including all of mine, which no doubt biases my thinking.)\n\n> (Of course END would stay as a reserved word.)\n\nIf the words must remain reserved, then there's even less value in\nremoving the statements.\n\nI'm agin it...\n\n\t\t\tregards, tom lane\n", "msg_date": "Fri, 28 Jan 2000 17:18:32 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] END/ABORT " }, { "msg_contents": "On 2000-01-28, Tom Lane mentioned:\n\n> Peter Eisentraut <[email protected]> writes:\n> > I'd like to yank the END/ABORT commands, since they're non-standard and\n> > redundant (COMMIT/ROLLBACK). Anyone who could not bear to see them go?\n> \n> Exactly what will this accomplish, other than breaking a lot of existing\n> applications? (Including all of mine, which no doubt biases my thinking.)\n\nOkay, I was just wondering. But I'm going to change all the notices and\ndocs to use commit and rollback instead.\n\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Sat, 29 Jan 2000 12:16:35 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] END/ABORT " }, { "msg_contents": "Peter Eisentraut <[email protected]> writes:\n>>>> I'd like to yank the END/ABORT commands, since they're non-standard and\n>>>> redundant (COMMIT/ROLLBACK). Anyone who could not bear to see them go?\n>> \n>> Exactly what will this accomplish, other than breaking a lot of existing\n>> applications? (Including all of mine, which no doubt biases my thinking.)\n\n> Okay, I was just wondering. But I'm going to change all the notices and\n> docs to use commit and rollback instead.\n\nOK, that seems fair enough.\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 29 Jan 2000 10:59:21 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] END/ABORT " }, { "msg_contents": "On 2000-01-28, Bruce Momjian mentioned:\n\n> [Charset ISO-8859-1 unsupported, filtering to ASCII...]\n> > I'd like to yank the END/ABORT commands, since they're non-standard and\n> > redundant (COMMIT/ROLLBACK). Anyone who could not bear to see them go?\n> > (Of course END would stay as a reserved word.)\n> > \n> \n> We have to keep them in there for compatibility with older code.\n> \n\nOkay, maybe yank was the wrong word. But I changed the command tags to\ncommit/rollback and the notices to something friendlier.\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Sat, 29 Jan 2000 17:59:00 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] END/ABORT" }, { "msg_contents": "[Charset ISO-8859-1 unsupported, filtering to ASCII...]\n> On 2000-01-28, Tom Lane mentioned:\n> \n> > Peter Eisentraut <[email protected]> writes:\n> > > I'd like to yank the END/ABORT commands, since they're non-standard and\n> > > redundant (COMMIT/ROLLBACK). Anyone who could not bear to see them go?\n> > \n> > Exactly what will this accomplish, other than breaking a lot of existing\n> > applications? (Including all of mine, which no doubt biases my thinking.)\n> \n> Okay, I was just wondering. But I'm going to change all the notices and\n> docs to use commit and rollback instead.\n\nGreat.\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": "Sat, 29 Jan 2000 12:24:19 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] END/ABORT" }, { "msg_contents": "Bruce Momjian wrote:\n\n> > I'd like to yank the END/ABORT commands, since they're non-standard and\n> > redundant (COMMIT/ROLLBACK). Anyone who could not bear to see them go?\n> > (Of course END would stay as a reserved word.)\n> >\n>\n> We have to keep them in there for compatibility with older code.\n\n How long?\n\n IIRC, CURRENT has been replaced by OLD after I've fixed the\n rewriter. Both have been there between 6.4 and 6.5. With 6.5\n CURRENT was gone.\n\n Of course, removing END/ABORT will touch many applications\n using transactions, but I would vote for it anyway, since\n it's standard.\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": "Mon, 31 Jan 2000 09:41:51 +0100 (CET)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": false, "msg_subject": "Re: [HACKERS] END/ABORT" }, { "msg_contents": "At 09:41 AM 1/31/00 +0100, Jan Wieck wrote:\n\n> Of course, removing END/ABORT will touch many applications\n> using transactions, but I would vote for it anyway, since\n> it's standard.\n\nDoes it make all that much sense to worry about the actual word\nused when the need to use \"begin\" is non-standard to begin with?\n\nOf course, removing that would REALLY impact current applications...\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Mon, 31 Jan 2000 09:45:58 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] END/ABORT" }, { "msg_contents": "\n\nDon Baccus wrote:\n\n> At 09:41 AM 1/31/00 +0100, Jan Wieck wrote:\n>\n> > Of course, removing END/ABORT will touch many applications\n> > using transactions, but I would vote for it anyway, since\n> > it's standard.\n>\n> Does it make all that much sense to worry about the actual word\n> used when the need to use \"begin\" is non-standard to begin with?\n\n There is no explicit \"BEGIN WORK\" on SQL92, transaction initiation\n is always implicit and it terminates either with a COMMIT or a\nROLLBACK\n statement.\n\n>\n>\n> Of course, removing that would REALLY impact current applications...\n>\n> - Don Baccus, Portland OR <[email protected]>\n> Nature photos, on-line guides, Pacific Northwest\n> Rare Bird Alert Service and other goodies at\n> http://donb.photo.net.\n>\n> ************\n\n--\nJose' Soares\nBologna, Italy [email protected]\n\n\n", "msg_date": "Tue, 01 Feb 2000 14:19:05 +0100", "msg_from": "Jose Soares <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] END/ABORT" }, { "msg_contents": "At 02:19 PM 2/1/00 +0100, Jose Soares wrote:\n>\n>\n>Don Baccus wrote:\n\n>> Does it make all that much sense to worry about the actual word\n>> used when the need to use \"begin\" is non-standard to begin with?\n>\n> There is no explicit \"BEGIN WORK\" on SQL92, transaction initiation\n> is always implicit and it terminates either with a COMMIT or a\n>ROLLBACK\n> statement.\n\nThat was my point, of course...\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Tue, 01 Feb 2000 08:03:44 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] END/ABORT" } ]
[ { "msg_contents": "The following drop fails due to non-existent trigger, but then the\nsubsequent create fails due to existing trigger. What's happening? \nIs this a known problem?\n\nPg 6.5.2, RH6.1, 2.2.12-20smp, Pentium III i686\n\n(from my postgres server log...)\n20000128.13:21:05.881 [2810] query: DROP TRIGGER\nems_user_insert_trigger ON employee;\n20000128.13:21:05.881 [2810] ProcessUtility: DROP TRIGGER\nems_user_insert_trigger ON employee;\n20000128.13:21:05.881 [2810] ERROR: DropTrigger: there is no trigger\nems_user_insert_trigger on relation employee\n20000128.13:21:05.882 [2810] query: CREATE TRIGGER\nems_user_insert_trigger AFTER INSERT ON ems_user FOR EACH ROW EXECUTE\nPROCEDURE add_bad_passwd_rec();\n20000128.13:21:05.882 [2810] ProcessUtility: CREATE TRIGGER\nems_user_insert_trigger AFTER INSERT ON ems_user FOR EACH ROW EXECUTE\nPROCEDURE add_bad_passwd_rec();\n20000128.13:21:05.883 [2810] ERROR: CreateTrigger: trigger\nems_user_insert_trigger already defined on relation ems_user\n\nCheers,\nEd Loehr\n", "msg_date": "Fri, 28 Jan 2000 13:31:21 -0600", "msg_from": "Ed Loehr <[email protected]>", "msg_from_op": true, "msg_subject": "[HACKERS] Trigger drop/create bug?" }, { "msg_contents": "Lobotomy stitches came loose again. D'oh! Different table names...\n\nCheers,\nEd Loehr\n\nEd Loehr wrote:\n> \n> The following drop fails due to non-existent trigger, but then the\n> subsequent create fails due to existing trigger. What's happening?\n> Is this a known problem?\n> \n> Pg 6.5.2, RH6.1, 2.2.12-20smp, Pentium III i686\n> \n> (from my postgres server log...)\n> 20000128.13:21:05.881 [2810] query: DROP TRIGGER\n> ems_user_insert_trigger ON employee;\n> 20000128.13:21:05.881 [2810] ProcessUtility: DROP TRIGGER\n> ems_user_insert_trigger ON employee;\n> 20000128.13:21:05.881 [2810] ERROR: DropTrigger: there is no trigger\n> ems_user_insert_trigger on relation employee\n> 20000128.13:21:05.882 [2810] query: CREATE TRIGGER\n> ems_user_insert_trigger AFTER INSERT ON ems_user FOR EACH ROW EXECUTE\n> PROCEDURE add_bad_passwd_rec();\n> 20000128.13:21:05.882 [2810] ProcessUtility: CREATE TRIGGER\n> ems_user_insert_trigger AFTER INSERT ON ems_user FOR EACH ROW EXECUTE\n> PROCEDURE add_bad_passwd_rec();\n> 20000128.13:21:05.883 [2810] ERROR: CreateTrigger: trigger\n> ems_user_insert_trigger already defined on relation ems_user\n> \n> Cheers,\n> Ed Loehr\n", "msg_date": "Fri, 28 Jan 2000 13:33:40 -0600", "msg_from": "Ed Loehr <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Trigger drop/create bug?" } ]
[ { "msg_contents": "At 06:54 PM 1/28/00 +0100, Peter Eisentraut wrote:\n>I'd like to yank the END/ABORT commands, since they're non-standard and\n>redundant (COMMIT/ROLLBACK). Anyone who could not bear to see them go?\n>(Of course END would stay as a reserved word.)\n\nI've got a lot of existing application code that has \"end\" in it...\n\n\"begin\" is non-standard, too...\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Fri, 28 Jan 2000 12:32:48 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] END/ABORT" }, { "msg_contents": "At 12:32 PM 1/28/00 -0800, Don Baccus wrote:\n>At 06:54 PM 1/28/00 +0100, Peter Eisentraut wrote:\n>>I'd like to yank the END/ABORT commands, since they're non-standard and\n>>redundant (COMMIT/ROLLBACK). Anyone who could not bear to see them go?\n>>(Of course END would stay as a reserved word.)\n\n>I've got a lot of existing application code that has \"end\" in it...\n\n>\"begin\" is non-standard, too...\n\nActually, to think again, for my application space (web toolkit) it\nwouldn't be a problem because my rewrite of AOLserver's postgres\ndriver tracks transactions (both forms) and could easily issue\n\"COMMIT/ROLLBACK\" in all cases. So I don't care :)\n\nBut, as Bruce points out, there's probably a fair amount of legacy\ncode out there that uses \"END/ABORT\"...\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Fri, 28 Jan 2000 13:10:27 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] END/ABORT" } ]
[ { "msg_contents": "Attached is a uuencoded tarball that contains\n3 new files and two patches for the plperl subdir.\n\nThese changes add the ability for plperl functions\nto call 'elog'. It also sets up the frame work to\nallow me to add access to the SPI functions.\n\n\n-- \nMark Hollomon\[email protected]", "msg_date": "Fri, 28 Jan 2000 19:59:29 -0500", "msg_from": "Mark Hollomon <[email protected]>", "msg_from_op": true, "msg_subject": "elog ability for plperl" }, { "msg_contents": "Applied.\n\n\n> Attached is a uuencoded tarball that contains\n> 3 new files and two patches for the plperl subdir.\n> \n> These changes add the ability for plperl functions\n> to call 'elog'. It also sets up the frame work to\n> allow me to add access to the SPI functions.\n> \n> \n> -- \n> Mark Hollomon\n> [email protected]\n\n[Attachment, skipping...]\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, 28 Jan 2000 20:55:05 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] elog ability for plperl" } ]
[ { "msg_contents": "Not sure this was announced, but we are planning beta for 7.0 to start\nin February 15, not February 1, as originally planned.\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, 28 Jan 2000 20:55:50 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Beta is February 15th" }, { "msg_contents": "On Fri, 28 Jan 2000, Bruce Momjian wrote:\n> Not sure this was announced, but we are planning beta for 7.0 to start\n> in February 15, not February 1, as originally planned.\n\n I am taking part in writing articles for\nhttp://www.simplex.ru/news/koi/. It is russian weblog, similar to Slahdot.\nMostly I post announcements of different Python and Zope-related products.\n But the version 7.0 will be so major change. I want to put an\nannouncement there, and to do this I need a logo - any small picture. Where\ncan I get Postgres logo?\n\n http://www.postgresql.org/images/verh2.gif is mostly good for me. Are\nthere others?\n\nOleg.\n---- \n Oleg Broytmann http://members.xoom.com/phd2/ [email protected]\n Programmers don't die, they just GOSUB without RETURN.\n\n", "msg_date": "Sat, 29 Jan 2000 13:44:58 +0000 (GMT)", "msg_from": "Oleg Broytmann <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Postgres LOGO(was: Beta is February 15th)" }, { "msg_contents": "www.postgresql.org, right?\n\n> On Fri, 28 Jan 2000, Bruce Momjian wrote:\n> > Not sure this was announced, but we are planning beta for 7.0 to start\n> > in February 15, not February 1, as originally planned.\n> \n> I am taking part in writing articles for\n> http://www.simplex.ru/news/koi/. It is russian weblog, similar to Slahdot.\n> Mostly I post announcements of different Python and Zope-related products.\n> But the version 7.0 will be so major change. I want to put an\n> announcement there, and to do this I need a logo - any small picture. Where\n> can I get Postgres logo?\n> \n> http://www.postgresql.org/images/verh2.gif is mostly good for me. Are\n> there others?\n> \n> Oleg.\n> ---- \n> Oleg Broytmann http://members.xoom.com/phd2/ [email protected]\n> Programmers don't die, they just GOSUB without RETURN.\n> \n> \n> ************\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", "msg_date": "Sat, 29 Jan 2000 12:26:09 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Postgres LOGO(was: Beta is February 15th)" }, { "msg_contents": "\nEverything revolves around the elephant ... all the 'wearables' use the\nmore cartoonish logo at: http://www.pgsql.com/propaganda.html ... I know\nVince is planning on redoing the http://www.postgresql.org web site, so\nI'm not sure whether he's going to continue to work with the one there, or\nmove towards the cartoonish one also ...\n\n\nOn Sat, 29 Jan 2000, Oleg Broytmann wrote:\n\n> On Fri, 28 Jan 2000, Bruce Momjian wrote:\n> > Not sure this was announced, but we are planning beta for 7.0 to start\n> > in February 15, not February 1, as originally planned.\n> \n> I am taking part in writing articles for\n> http://www.simplex.ru/news/koi/. It is russian weblog, similar to Slahdot.\n> Mostly I post announcements of different Python and Zope-related products.\n> But the version 7.0 will be so major change. I want to put an\n> announcement there, and to do this I need a logo - any small picture. Where\n> can I get Postgres logo?\n> \n> http://www.postgresql.org/images/verh2.gif is mostly good for me. Are\n> there others?\n> \n> Oleg.\n> ---- \n> Oleg Broytmann http://members.xoom.com/phd2/ [email protected]\n> Programmers don't die, they just GOSUB without RETURN.\n> \n> \n> ************\n> \n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Sat, 29 Jan 2000 13:28:11 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Postgres LOGO(was: Beta is February 15th)" }, { "msg_contents": "On Sat, 29 Jan 2000, Bruce Momjian wrote:\n> www.postgresql.org, right?\n\n There is no logo - there are 3 image files, so I need to combine them\ninto one picture by hands :(\n\nOleg.\n---- \n Oleg Broytmann http://members.xoom.com/phd2/ [email protected]\n Programmers don't die, they just GOSUB without RETURN.\n\n", "msg_date": "Sat, 29 Jan 2000 17:33:34 +0000 (GMT)", "msg_from": "Oleg Broytmann <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Postgres LOGO(was: Beta is February 15th)" }, { "msg_contents": "On Sat, 29 Jan 2000, The Hermit Hacker wrote:\n> Everything revolves around the elephant ... all the 'wearables' use the\n> more cartoonish logo at: http://www.pgsql.com/propaganda.html ... \n\n http://www.pgsql.com/propaganda/powered_button.gif is very near to what\nI want. Thanks.\n\nOleg.\n---- \n Oleg Broytmann http://members.xoom.com/phd2/ [email protected]\n Programmers don't die, they just GOSUB without RETURN.\n\n", "msg_date": "Sat, 29 Jan 2000 17:37:37 +0000 (GMT)", "msg_from": "Oleg Broytmann <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Postgres LOGO(was: Beta is February 15th)" }, { "msg_contents": "On Sat, 29 Jan 2000, Oleg Broytmann wrote:\n\n> On Sat, 29 Jan 2000, The Hermit Hacker wrote:\n> > Everything revolves around the elephant ... all the 'wearables' use the\n> > more cartoonish logo at: http://www.pgsql.com/propaganda.html ... \n> \n> http://www.pgsql.com/propaganda/powered_button.gif is very near to what\n> I want. Thanks.\n\n*nod* no probs :)\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Sat, 29 Jan 2000 13:45:37 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Postgres LOGO(was: Beta is February 15th)" }, { "msg_contents": "\nOn 29-Jan-2000 Oleg Broytmann wrote:\n> On Sat, 29 Jan 2000, Bruce Momjian wrote:\n>> www.postgresql.org, right?\n> \n> There is no logo - there are 3 image files, so I need to combine them\n> into one picture by hands :(\n\nI'll try to find psd source in my archive. \nMay be it is more convenient.\n\nWhat is name of file you need for? \n(Unfortunately, I miss previose discussion)\n\n\n-- \nDmitry Samersoff, [email protected], ICQ:3161705\nhttp://devnull.wplus.net\n* There will come soft rains ...\n", "msg_date": "Sat, 29 Jan 2000 21:35:59 +0300 (MSK)", "msg_from": "Dmitry Samersoff <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Postgres LOGO(was: Beta is February 15th)" }, { "msg_contents": "Hi,\n\nAt PostgreSQL Inc we have been using the cartoon ish elephant\nhead , as seen on http://www.pgsql.com.\n\nIt is the image we use on the CD's, shirts, keychains, hats,\nstationary, and soon to be released coffee mugs.\n\nYou can get a whole bunch of these images on \nwww.pgsql.com/propaganda.html\n\nJeff\n\n\n======================================================\nJeff MacDonald\n\[email protected]\tirc: bignose on EFnet\n======================================================\n\nOn Sat, 29 Jan 2000, Oleg Broytmann wrote:\n\n> On Fri, 28 Jan 2000, Bruce Momjian wrote:\n> > Not sure this was announced, but we are planning beta for 7.0 to start\n> > in February 15, not February 1, as originally planned.\n> \n> I am taking part in writing articles for\n> http://www.simplex.ru/news/koi/. It is russian weblog, similar to Slahdot.\n> Mostly I post announcements of different Python and Zope-related products.\n> But the version 7.0 will be so major change. I want to put an\n> announcement there, and to do this I need a logo - any small picture. Where\n> can I get Postgres logo?\n> \n> http://www.postgresql.org/images/verh2.gif is mostly good for me. Are\n> there others?\n> \n> Oleg.\n> ---- \n> Oleg Broytmann http://members.xoom.com/phd2/ [email protected]\n> Programmers don't die, they just GOSUB without RETURN.\n> \n> \n> ************\n> \n\n", "msg_date": "Sat, 29 Jan 2000 15:15:34 -0400 (AST)", "msg_from": "\"Jeff MacDonald <[email protected]>\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Postgres LOGO(was: Beta is February 15th)" }, { "msg_contents": "On Sat, 29 Jan 2000, Oleg Broytmann wrote:\n\n> On Sat, 29 Jan 2000, Bruce Momjian wrote:\n> > www.postgresql.org, right?\n> \n> There is no logo - there are 3 image files, so I need to combine them\n> into one picture by hands :(\n\nThen try this one:\n\nhttp://www.postgresql.org/images/sqlephant.gif\n\nYou'll only have to crop it.\n\nVince.\n-- \n==========================================================================\nVince Vielhaber -- KA8CSH email: [email protected] http://www.pop4.net\n 128K ISDN: $24.95/mo or less - 56K Dialup: $17.95/mo or less at Pop4\n Online Campground Directory http://www.camping-usa.com\n Online Giftshop Superstore http://www.cloudninegifts.com\n==========================================================================\n\n\n\n", "msg_date": "Sun, 30 Jan 2000 20:08:13 -0500 (EST)", "msg_from": "Vince Vielhaber <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Postgres LOGO(was: Beta is February 15th)" } ]
[ { "msg_contents": "-----BEGIN PGP SIGNED MESSAGE-----\n\nThe Postgres guide says that foreign keys can be partially emulated\nvia triggers. Just how \"partial\" is this. I can't seem to get the\nfollowing to work. Would it work if I wrote it in C? Would I need to\nopen a second connection to the database? Would it work if my second\nkey was really in another table?\n\nproject=> CREATE TABLE task (\nproject-> task_id INT PRIMARY KEY,\nproject-> task_pid INT\nproject-> );\nNOTICE: CREATE TABLE/PRIMARY KEY will create implicit index 'task_pkey' for table 'task'\nCREATE\nproject=> CREATE FUNCTION check_task_pid () RETURNS OPAQUE AS '\nproject'> BEGIN\nproject'> IF NEW.task_pid IS NOT NULL THEN\nproject'> SELECT task_id FROM task WHERE task_id = NEW.task_pid;\nproject'> IF NOT FOUND THEN\nproject'> RAISE EXCEPTION ''FOREIGN KEY constraint task_pid not found'';\nproject'> END IF;\nproject'> END IF;\nproject'> RETURN NEW;\nproject'> END;\nproject'> ' LANGUAGE 'plpgsql';\nCREATE\nproject=> CREATE TRIGGER iu_btrig_check_task_pid BEFORE INSERT OR UPDATE ON task\nproject-> FOR EACH ROW EXECUTE PROCEDURE check_task_pid();\nCREATE\nproject=> insert into task values (1, null);\nINSERT 27855 1\nproject=> insert into task values (2, null);\nINSERT 27856 1\nproject=> insert into task values (3, 1);\nERROR: unexpected SELECT query in exec_stmt_execsql()\n\nroland\n- -- \n PGP Key ID: 66 BC 3B CD\nRoland B. Roberts, PhD Custom Software Solutions\[email protected] 76-15 113th Street, Apt 3B\[email protected] Forest Hills, NY 11375\n\n-----BEGIN PGP SIGNATURE-----\nVersion: 2.6.3a\nCharset: noconv\nComment: Processed by Mailcrypt 3.5.4, an Emacs/PGP interface\n\niQCVAwUBOJJrHeoW38lmvDvNAQHoqAP/X5oaVa3vSyBu+6WKhRMiuWVJMTN6OSDf\nKMhc2kQ67qf2eULtQLe8D9YqlHg92ezHH2xGuzbDab5ha9i0vDGHLbR6Zo93EoGT\nTCqriZ6xBNec4m4PgB5QQZfKRlsvrSsBgTnpnsOc6SWnKfVgNPK4If/qNYUQKmjp\n3O2bwrslErE=\n=+Sp8\n-----END PGP SIGNATURE-----\n", "msg_date": "28 Jan 2000 23:22:54 -0500", "msg_from": "Roland Roberts <[email protected]>", "msg_from_op": true, "msg_subject": "Help with pl/pgsql, triggers, and foreign keys" }, { "msg_contents": "At 11:22 PM 1/28/00 -0500, Roland Roberts wrote:\n>-----BEGIN PGP SIGNED MESSAGE-----\n>\n>The Postgres guide says that foreign keys can be partially emulated\n>via triggers. Just how \"partial\" is this. I can't seem to get the\n>following to work. Would it work if I wrote it in C? Would I need to\n>open a second connection to the database? Would it work if my second\n>key was really in another table?\n\nGiven that foreign keys are implemented in the current sources and\ncoming out for real in v7.0 beta in two weeks, how much effort do\nyou really want to put into emulation???\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Fri, 28 Jan 2000 21:56:06 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Help with pl/pgsql, triggers, and foreign keys" }, { "msg_contents": "Roland Roberts wrote:\n> \n> The Postgres guide says that foreign keys can be partially emulated\n> via triggers. Just how \"partial\" is this. I can't seem to get the\n> following to work. Would it work if I wrote it in C? Would I need to\n> open a second connection to the database? Would it work if my second\n> key was really in another table?\n> \n> project=> CREATE FUNCTION check_task_pid () RETURNS OPAQUE AS '\n> project'> BEGIN\n> project'> IF NEW.task_pid IS NOT NULL THEN\n> project'> SELECT task_id FROM task WHERE task_id = NEW.task_pid;\n> project'> IF NOT FOUND THEN\n> project'> RAISE EXCEPTION ''FOREIGN KEY constraint task_pid not found'';\n> project'> END IF;\n> project'> END IF;\n> project'> RETURN NEW;\n> project'> END;\n> project'> ' LANGUAGE 'plpgsql';\n> CREATE\n> project=> CREATE TRIGGER iu_btrig_check_task_pid BEFORE INSERT OR UPDATE ON task\n> project-> FOR EACH ROW EXECUTE PROCEDURE check_task_pid();\n\nAt least in 6.5.2, you can definitely implement referential integrity\n(RI) via pl/pgsql. As someone noted earlier, RI is to be released in\n7.0, but I suspect it will take a subsequent release or two to\nstabilize before it's fit for consumption by the more conservative\nreliability-focused users among us...\n\nAs for your failing SELECT query, the following tweak to your function\nmakes it work as expected:\n\nCREATE FUNCTION check_task_pid () RETURNS OPAQUE AS '\n DECLARE\n tmp RECORD;\n BEGIN\n IF NEW.task_pid IS NOT NULL THEN\n SELECT INTO tmp task_id FROM task WHERE task_id =\nNEW.task_pid;\n IF NOT FOUND THEN\n RAISE EXCEPTION ''FOREIGN KEY constraint task_pid not\nfound'';\n END IF;\n END IF;\n RETURN NEW;\n END;\n' LANGUAGE 'plpgsql';\n\n\nCheers,\nEd Loehr\n", "msg_date": "Sat, 29 Jan 2000 02:37:21 -0600", "msg_from": "Ed Loehr <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Help with pl/pgsql, triggers, and foreign keys" }, { "msg_contents": "Ed Loehr wrote:\n\n> At least in 6.5.2, you can definitely implement referential integrity\n> (RI) via pl/pgsql. As someone noted earlier, RI is to be released in\n> 7.0, but I suspect it will take a subsequent release or two to\n> stabilize before it's fit for consumption by the more conservative\n> reliability-focused users among us...\n\n I hope that this isn't true.\n\n First, because FOREIGN KEY is implemented as builtin triggers\n written in C. BETA should turn out most of the bugs, which\n could still be in it.\n\n Second, RI cannot get implemented reliable with regular\n triggers. You can easily violate the semantics with\n concurrently running transactions. Have first transaction\n inserting a reference, the trigger checks for key existence\n and finds it. Now second transaction deletes the key, and an\n eventually existing ON DELETE CASCADE trigger fired on that\n wouldn't find the reference, because it isn't committed yet.\n Second transaction commits, what finally removes the key. Now\n first transaction commits, making the reference visible, but\n referencing a non existing key - inconsistency.\n\n So anyone who needs referential integrity is asked to stress\n the code as far as he can, at least during BETA.\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": "Mon, 31 Jan 2000 10:49:52 +0100 (CET)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Help with pl/pgsql, triggers, and foreign keys" } ]
[ { "msg_contents": "[email protected] (Robert E. Bruccoleri) writes:\n> However, the real issue with PostgreSQL is not the copyright, but\n> rather the permissions granted to everyone. As long as all the\n> contributors are happy with the permission notice, then all is OK.\n\nI think that's an excellent point that bears underlining. All the\noriginal code bore a UC Berkeley copyright --- but that didn't make\nanyone unhappy, or stop any of us from doing what we wanted to do\nwith the code, because Berkeley's license terms are loose enough\nnot to pose any problems.\n\nThe license terms are not going to change. Someone suggested switching\nto GPL or LGPL terms, but we cannot do that without (a) violating the\nBerkeley terms, which we are still bound by, and (b) losing many\ncontributors who work in commercial settings and would not find a\nGPL'd database usable for their purposes. (Berkeley terms are not\na problem for someone who wants to use code as a component of a\nlarger proprietary system --- but GPL terms are.)\n\nAs long as those terms don't change, adding PostgreSQL Inc (or\nPostgreSQL Nonprofit Copyright Holding Corporation, or anything else)\nto the copyright notices doesn't really change anything, except for\nadding one more line to the boilerplate notice that people aren't\nsupposed to strip out of their copies. PostgreSQL Inc can't sell the\nrights to Postgres, because it hasn't got any rights that anyone else\nhasn't got. *Anyone* could take the code and start developing it\nindependently, just as the current set of developers did with Berkeley's\ncode. And if PostgreSQL Inc did something that any significant number\nof developers were unhappy with, that's exactly what those developers\nwould do.\n\nSo, while I don't have anything against forming a nonprofit organization\nto hold the copyright on behalf of the development team, I really doubt\nthat it makes any difference. The thing to keep your eye on and guard\njealously is the license/terms-of-distribution. If anyone proposes\nmucking with those, THAT is the time to start hollering.\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 29 Jan 2000 00:52:16 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: Copyright " }, { "msg_contents": "At 12:52 AM 1/29/00 -0500, Tom Lane wrote:\n\n>As long as those terms don't change, adding PostgreSQL Inc (or\n>PostgreSQL Nonprofit Copyright Holding Corporation, or anything else)\n>to the copyright notices doesn't really change anything, except for\n>adding one more line to the boilerplate notice that people aren't\n>supposed to strip out of their copies. \n\nI think this is the concern (not mine, raised by others) - what\nguarantee is there that PG, Inc couldn't change the terms if \n(say) a new disease cropped up that killed all believers in Open\nSource? :) (yes intentionally silly).\n\nIn reality, only CHANGES could fall under more restrictive licensing,\nbut these changes might become intertwined in a way that made the\noriginal distribution terms moot. \n\nThis could be really simple to fix in legal terms. With a not\nfor profit, distribution and development of a free and unencumbered\nsystem could probably be incorporated into the bylaws and this may\nbe why the Apache Foundation was formed. It's harder with companies,\nwhich by definition are formed to be profitable and indeed in the\neyes of the IRS are supposed to strive for that goal (though there\nis no need to succeed).\n\nSo...maybe \"Inc\" isn't the right long-term shape of the entity?\n\nPersonally, I don't think anyone should be terribly concerned about\nthis. But I can see how some, especially folks who aren't US\ncitizens and perhaps don't know much about the realities of all this\nin US law, could become concerned.\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Fri, 28 Jan 2000 22:21:28 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Copyright " }, { "msg_contents": "At 00:52 29/01/00 -0500, Tom Lane wrote:\n>[email protected] (Robert E. Bruccoleri) writes:\n>> However, the real issue with PostgreSQL is not the copyright, but\n>> rather the permissions granted to everyone. As long as all the\n>> contributors are happy with the permission notice, then all is OK.\n>\n>I think that's an excellent point that bears underlining. All the\n>original code bore a UC Berkeley copyright --- but that didn't make\n>anyone unhappy, or stop any of us from doing what we wanted to do\n>with the code, because Berkeley's license terms are loose enough\n>not to pose any problems.\n>\n>The license terms are not going to change. Someone suggested switching\n>to GPL or LGPL terms, but we cannot do that without (a) violating the\n>Berkeley terms, which we are still bound by, and (b) losing many\n>contributors who work in commercial settings and would not find a\n>GPL'd database usable for their purposes. (Berkeley terms are not\n>a problem for someone who wants to use code as a component of a\n>larger proprietary system --- but GPL terms are.)\n\nLGPL allows some commercial use, but I agree, they are both inappropriate\nagreements, especially if you want to allow people to write a commercial DB\nbased on PostgreSQL, which is a very good thing to allow.\n\nWhen you refer to the license terms, do you mean the 'COPYRIGHT' file in\nthe root directory, or is there something more?\n\n\n>As long as those terms don't change, adding PostgreSQL Inc (or\n>PostgreSQL Nonprofit Copyright Holding Corporation, or anything else)\n>to the copyright notices doesn't really change anything, except for\n>adding one more line to the boilerplate notice that people aren't\n>supposed to strip out of their copies. PostgreSQL Inc can't sell the\n>rights to Postgres, because it hasn't got any rights that anyone else\n>hasn't got.\n\nNow I'm confused. I thought there was a notice stating that PostgreSQL, Inc\nhad copy right? If that is the case, then they *can* sell it, and the buyer\ncould revise the license terms. This is a sort of inverse-Unisys trick:\n\n1. Start with a free open source product\n2. Shift the copyright of new code to yourself. The old code remains as it\nwas.\n3. Sponsor and encourage some very nice changes to optimizers, OO support\nand RI (naturally shifting copyright of the new stuff your organization)\n4. When it's all stable, get taken over by someone who enforces the\ncopyright on the recent changes, and prevents further distribution.\n5. Open source PosgreSQL development falls back to 3 year old sources, with\npossible further copyright arguments.\n\nI agree that this is *very* unlikely, but if such a scenario can be\nprevented by some simple changes (like a non-prfit organization that has a\nclear charter), then it may be worth doing.\n\n\n> *Anyone* could take the code and start developing it\n>independently, just as the current set of developers did with Berkeley's\n>code. And if PostgreSQL Inc did something that any significant number\n>of developers were unhappy with, that's exactly what those developers\n>would do.\n>\n>So, while I don't have anything against forming a nonprofit organization\n>to hold the copyright on behalf of the development team, I really doubt\n>that it makes any difference. The thing to keep your eye on and guard\n>jealously is the license/terms-of-distribution. If anyone proposes\n>mucking with those, THAT is the time to start hollering.\n\nAs I said above, I'd like to know where they are, if you mean something\nmore than the COPYRIGHT file. The big advantage of a separate entity is\nthat it has a clear charter and no conflict of interest. Disadvantage is\nthat, I presume, it costs $$$.\n\n\n----------------------------------------------------------------\nPhilip Warner | __---_____\nAlbatross Consulting Pty. Ltd. |----/ - \\\n(A.C.N. 008 659 498) | /(@) ______---_\nTel: +61-03-5367 7422 | _________ \\\nFax: +61-03-5367 7430 | ___________ |\nHttp://www.rhyme.com.au | / \\|\n | --________--\nPGP key available upon request, | /\nand from pgp5.ai.mit.edu:11371 |/\n", "msg_date": "Sat, 29 Jan 2000 17:24:21 +1100", "msg_from": "Philip Warner <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Copyright " }, { "msg_contents": "Don Baccus <[email protected]> writes:\n> I think this is the concern (not mine, raised by others) - what\n> guarantee is there that PG, Inc couldn't change the terms if \n> (say) a new disease cropped up that killed all believers in Open\n> Source? :) (yes intentionally silly).\n\nWell, the critical point here is that neither PG, Inc nor anyone\nelse can *retroactively* change the terms of distribution. The\ncopies that are out there are out there, with the terms of\ndistribution stated right in them. Anyone can pick one up and\nstart doing their own thing with the code. Neither UC Berkeley nor\nany PostgreSQL contributor would have a leg to stand on to stop them;\nyou think the courts will look kindly on \"oh, we didn't mean what we\nsaid in the terms of distribution\"?\n\nThe worst-case possible scenario is that Marc goes around the bend\nand, five minutes before the release of version 7.42, announces that\n7.42 will be distributed under new terms that everyone else thinks are\ntoo tight. Everyone else just flips him the bird, goes back to 7.41\nand continues on with life. (Furthermore, if anyone felt like suing,\nsuch a last-minute switcheroo would never hold up in court. Anyone\nwho had contributed code to 7.42 under the reasonable expectation that\nit would be licensed just like 7.41 would have plenty of grounds to\nsay \"wait a minute, where do you think you're going with my code?\")\n\nSame scenario applies if Marc gets run over by a truck and the new\nowners of PG Inc try to do something unreasonable. The fact is that\nas long as the terms of distribution stay the same, PG Inc doesn't\nhave any real ability to hurt anyone.\n\nIf anyone wants to look into Apache and see how it's set up, I've got no\nproblem with taking a look. I think it's real easy to make a mountain\nout of a molehill in this area, however. Look at FSF --- they actually\nrequire signed paperwork (hard copy, not email) from any potential\ncontributor before they will accept code contributions. Do we want to\nget that anal-retentive? I hope not.\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 29 Jan 2000 02:10:22 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: Copyright " }, { "msg_contents": "Philip Warner <[email protected]> writes:\n> When you refer to the license terms, do you mean the 'COPYRIGHT' file in\n> the root directory, or is there something more?\n\nYeah. I have seen more extensive statements of the standard UC Berkeley\nlicense terms (didn't BSD come with a different statement?) but that's\nthe one we are working with.\n\n> Now I'm confused. I thought there was a notice stating that PostgreSQL, Inc\n> had copy right? If that is the case, then they *can* sell it, and the buyer\n> could revise the license terms.\n\nNot retroactively. Someone could try to do *new* development under\nmore restrictive terms, or just plain do some traditional proprietary\ndevelopment using Postgres as a base. They've got just as much right\nto use the code in that way as you or I do to use it as we want to.\nBut I doubt many of the current contributors would help.\n\n> The big advantage of a separate entity is that it has a clear charter\n> and no conflict of interest.\n\nOnly to the extent that the people sitting on its board of directors\nhave no conflict of interest --- otherwise they could easily vote to\nmake the separate entity do something unhappy-making. AFAICS these\nwould be more or less the same people who control PostgreSQL Inc;\nnamely the core developers. If you don't trust them when they're\nwearing one hat, why trust them when wearing another?\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 29 Jan 2000 02:30:05 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: Copyright " }, { "msg_contents": "At 02:10 AM 1/29/00 -0500, Tom Lane wrote:\n\n>If anyone wants to look into Apache and see how it's set up, I've got no\n>problem with taking a look. I think it's real easy to make a mountain\n>out of a molehill in this area, however. Look at FSF --- they actually\n>require signed paperwork (hard copy, not email) from any potential\n>contributor before they will accept code contributions. Do we want to\n>get that anal-retentive? I hope not.\n\nYes, in spirit I'm certainly with you on this one. I presume some\nlaywer started hacking code in his spare time then started hacking\nthe FSF as well :)\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Sat, 29 Jan 2000 07:07:34 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Copyright " }, { "msg_contents": "On Fri, 28 Jan 2000, Don Baccus wrote:\n\n> At 12:52 AM 1/29/00 -0500, Tom Lane wrote:\n> \n> >As long as those terms don't change, adding PostgreSQL Inc (or\n> >PostgreSQL Nonprofit Copyright Holding Corporation, or anything else)\n> >to the copyright notices doesn't really change anything, except for\n> >adding one more line to the boilerplate notice that people aren't\n> >supposed to strip out of their copies. \n> \n> I think this is the concern (not mine, raised by others) - what\n> guarantee is there that PG, Inc couldn't change the terms if \n> (say) a new disease cropped up that killed all believers in Open\n> Source? :) (yes intentionally silly).\n\nSimple answer: the developers all go off with source code at the time that\nPostgreSQL, Inc changes those terms and continues off where they left off\n... IMHO, that is the nice thing about Open Source ... look at the\nFreeBSD/OpenBSD/NetBSD camps ... developers A became unhappy with politics\nin camp A so formed camp B and went on their merry way ... all three are\nequally successful...\n\nThe same thing applies to Linux ... how many different distributions and\nphilosophies are out there now? \n\nYou are right, PostgreSQL, Inc could go out, change the license on the\ncode \"from this day forth\", but that doesn't stop developers to branch off\na new code base based upon the license of \"the day before\" and totally\nleaving PostgreSQL, Inc in the dust ...\n\n> This could be really simple to fix in legal terms. With a not\n> for profit, distribution and development of a free and unencumbered\n> system could probably be incorporated into the bylaws and this may\n> be why the Apache Foundation was formed. It's harder with companies,\n> which by definition are formed to be profitable and indeed in the\n> eyes of the IRS are supposed to strive for that goal (though there\n> is no need to succeed).\n\n> So...maybe \"Inc\" isn't the right long-term shape of the entity?\n> \n> Personally, I don't think anyone should be terribly concerned about\n> this. But I can see how some, especially folks who aren't US\n> citizens and perhaps don't know much about the realities of all this\n> in US law, could become concerned.\n\nUmmm...PostgreSQL, Inc isn't a US company...*technically*, like OpenBSD,\nPostgreSQL is a Canadian Open Source Project, as its development is based\nin Canada ... which has this neat little advantage that OpenBSD has taken\nadvantage of, but we haven't yet: we can add stuff like SSL encryption\ndirectly into the source code and distribute it legally...\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Sat, 29 Jan 2000 12:51:27 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Copyright " }, { "msg_contents": "On Sat, 29 Jan 2000, Tom Lane wrote:\n\n> The worst-case possible scenario is that Marc goes around the bend\n> and, five minutes before the release of version 7.42, announces that\n> 7.42 will be distributed under new terms that everyone else thinks are\n> too tight. Everyone else just flips him the bird, goes back to 7.41\n> and continues on with life. (Furthermore, if anyone felt like suing,\n> such a last-minute switcheroo would never hold up in court. Anyone\n> who had contributed code to 7.42 under the reasonable expectation that\n> it would be licensed just like 7.41 would have plenty of grounds to\n> say \"wait a minute, where do you think you're going with my code?\")\n\nActually, given that scenario, it wouldn't even a matter of going back to\n7.41 ... everything in CVS, so you'd go back to the source tree as of the\ndate before the license changed ...\n\nIMHO, the worst thing *anyone* organization could do is change the license\nin such a way as to alienate the only thing of value ... the developers\n*shrug*\n\n", "msg_date": "Sat, 29 Jan 2000 13:07:48 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Copyright " }, { "msg_contents": "At 12:51 PM 1/29/00 -0400, The Hermit Hacker wrote:\n\n>The same thing applies to Linux ... how many different distributions and\n>philosophies are out there now? \n\nEither too many, or not enough, I can never decide :)\n\n>Ummm...PostgreSQL, Inc isn't a US company...*technically*, like OpenBSD,\n>PostgreSQL is a Canadian Open Source Project, as its development is based\n>in Canada\n\nI hadn't realized that (not that I've cared!).\n\n> ... which has this neat little advantage that OpenBSD has taken\n>advantage of, but we haven't yet: we can add stuff like SSL encryption\n>directly into the source code and distribute it legally...\n\nSigh...it's always painful to have my country's stupidity flaunted\nin public :)\n\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Sat, 29 Jan 2000 10:11:33 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Copyright " }, { "msg_contents": "On Sat, 29 Jan 2000, Don Baccus wrote:\n\n> At 12:51 PM 1/29/00 -0400, The Hermit Hacker wrote:\n> \n> >The same thing applies to Linux ... how many different distributions and\n> >philosophies are out there now? \n> \n> Either too many, or not enough, I can never decide :)\n> \n> >Ummm...PostgreSQL, Inc isn't a US company...*technically*, like OpenBSD,\n> >PostgreSQL is a Canadian Open Source Project, as its development is based\n> >in Canada\n> \n> I hadn't realized that (not that I've cared!).\n> \n> > ... which has this neat little advantage that OpenBSD has taken\n> >advantage of, but we haven't yet: we can add stuff like SSL encryption\n> >directly into the source code and distribute it legally...\n> \n> Sigh...it's always painful to have my country's stupidity flaunted\n> in public :)\n\nWhen those laws were created, there was a reason for them ... in this day\nand age, there isn't, but, unfortunately, I think its easier to put *in* a\nlaw then it is to repeal it, no? :( Give it time ... just thank god for\nloopholes :)\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Sat, 29 Jan 2000 16:40:48 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Copyright " }, { "msg_contents": "On Sat, Jan 29, 2000 at 07:07:34AM -0800, Don Baccus wrote:\n> At 02:10 AM 1/29/00 -0500, Tom Lane wrote:\n> \n> >If anyone wants to look into Apache and see how it's set up, I've got no\n> >problem with taking a look. I think it's real easy to make a mountain\n> >out of a molehill in this area, however. Look at FSF --- they actually\n> >require signed paperwork (hard copy, not email) from any potential\n> >contributor before they will accept code contributions. Do we want to\n> >get that anal-retentive? I hope not.\n> \n> Yes, in spirit I'm certainly with you on this one. I presume some\n> laywer started hacking code in his spare time then started hacking\n> the FSF as well :)\n\nNah, I think it's more like how the rules are always more strict for\nfirst born children: parents don't want to make a mistake, and don't\nknow what might _be_ a mistake, so set early curfews, etc. Once some more\nkids come along (read Free Software projects) they start to loosen up...\n\nRoss\n-- \nRoss J. Reedstrom, Ph.D., <[email protected]> \nNSBRI Research Scientist/Programmer\nComputer and Information Technology Institute\nRice University, 6100 S. Main St., Houston, TX 77005\n", "msg_date": "Sat, 29 Jan 2000 18:21:55 -0600", "msg_from": "\"Ross J. Reedstrom\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Copyright" } ]
[ { "msg_contents": "Hi there,\n\nI have a table hits:\ndiscovery=> \\d hits\nTable = hits\n+----------------------------------+----------------------------------+-------+\n| Field | Type | Length|\n+----------------------------------+----------------------------------+-------+\n| msg_id | int4 not null | 4 |\n| count | int4 not null | 4 |\n| first_access | datetime default now ( ) | 8 |\n| last_access | datetime | 8 |\n+----------------------------------+----------------------------------+-------+\nIndex: hits_pkey\n\nand query:\ndiscovery=> select count(*) from hits group by count; \nERROR: Aggregates not allowed in GROUP BY clause\n\nThere's easy workaround :\ndiscovery=> select count(*) as qq from hits group by count;\nbut I'm curious is this a valid query ?\nLast snapshot also behave like 6.5.3\n\n\nAnother question:\ndiscovery=> select count(*) as qqq,* from hits group by last_access;\nproduces error:\nERROR: Illegal use of aggregates or non-group column in target list\n\nDo I really need to have all fields in GROUP clause ?\nMysql seems allows this ?\n\n\tRegards,\n\n\t\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": "Sat, 29 Jan 2000 12:39:42 +0300 (GMT)", "msg_from": "Oleg Bartunov <[email protected]>", "msg_from_op": true, "msg_subject": "select count(*) from hits group by count;" }, { "msg_contents": "Oleg Bartunov <[email protected]> writes:\n> discovery=> select count(*) from hits group by count;\n> ERROR: Aggregates not allowed in GROUP BY clause\n\n> There's easy workaround :\n> discovery=> select count(*) as qq from hits group by count;\n> but I'm curious is this a valid query ?\n\nI believe this is probably a bug. We are treating GROUP BY the same\nway we treat ORDER BY, namely that if an item is a simple name or\ninteger constant, we try first to interpret it as a result-column\nname or number; only if it does not match any column name do we fall\nback on treating it as a general expression. And the default result-\ncolumn name for \"count(*)\" is just \"count\".\n\nThis behavior is necessary to conform to the standard for ORDER BY ---\nin fact, SQL92 doesn't actually allow anything *but* a result-column\nname or number for ORDER BY. Accepting an expression is a Postgres\nextension (I imagine other DBMSs do it too).\n\nBut I can't see anything in the spec that justifies treating a GROUP BY\nitem that way: a GROUP BY item is defined as a <column reference> which\nis a plain expression constituent. We should probably change the code\nbehavior so that GROUP BY is always interpreted as a normal expression.\n\nQuestion is, how many existing apps might be broken by such a change?\n\n\n> Another question:\n> discovery=> select count(*) as qqq,* from hits group by last_access;\n> produces error:\n> ERROR: Illegal use of aggregates or non-group column in target list\n\n> Do I really need to have all fields in GROUP clause ?\n\nYes. See SQL92 7.9(7):\n\n 7) If T is a grouped table, then each <column reference> in each\n <value expression> that references a column of T shall refer-\n ence a grouping column or be specified within a <set function\n specification>.\n\n> Mysql seems allows this ?\n\nMysql is broken if it accepts this. There's no unique answer to give\nfor an ungrouped, non-aggregated column.\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 29 Jan 2000 11:24:58 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] select count(*) from hits group by count; " }, { "msg_contents": "\nOn 29-Jan-2000 Oleg Bartunov wrote:\n> Hi there,\n> and query:\n> discovery=> select count(*) from hits group by count; \n> ERROR: Aggregates not allowed in GROUP BY clause\n> \n> There's easy workaround :\n> discovery=> select count(*) as qq from hits group by count;\n> but I'm curious is this a valid query ?\n> Last snapshot also behave like 6.5.3\n> \n> \n> Another question:\n> discovery=> select count(*) as qqq,* from hits group by last_access;\n> produces error:\n> ERROR: Illegal use of aggregates or non-group column in target list\n\n AFAIK, MS SQL, Sybase and Informix have the same restrictions,\n because using all fields in query with aggregates and grouping \n is meaningless. Order of fields in group by clause also significant.\n \n\n-- \nDmitry Samersoff, [email protected], ICQ:3161705\nhttp://devnull.wplus.net\n* There will come soft rains ...\n", "msg_date": "Sat, 29 Jan 2000 19:40:04 +0300 (MSK)", "msg_from": "Dmitry Samersoff <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] select count(*) from hits group by count;" } ]
[ { "msg_contents": "Probably I miss something \nI tried latest snapshot and notice some changes in configure.\nEverything went smoothly on my Linux 2.2.14, glic 2.1.2 system.\n\nOne problem: I tried initdb -e koi8 and it doesn't works - \nall databases I have are in SQL_ASCII encoding\n Database | Owner | Encoding \n-----------+----------+-----------\n discovery | postgres | SQL_ASCII\n template1 | postgres | SQL_ASCII\n test | postgres | SQL_ASCII\n\ncreatedb -E koi8 works as expected:\ncreatedb -E koi8 aa\nCREATE DATABASE\nzen:~$ psql -l\n List of databases\n Database | Owner | Encoding \n-----------+----------+-----------\n aa | postgres | KOI8\n discovery | postgres | SQL_ASCII\n template1 | postgres | SQL_ASCII\n test | postgres | SQL_ASCII\n\nI found -e for initdb , -E for createdb options for specifying encoding a \nlittle bit confused - why not just use one of them !\n\nIs't possible to change encoding of database except dump/destroydb/createdb\ncycle ? Is't worth to have pg_encoding to do this ?\n\n\n\tRegards,\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": "Sat, 29 Jan 2000 13:28:58 +0300 (GMT)", "msg_from": "Oleg Bartunov <[email protected]>", "msg_from_op": true, "msg_subject": "Does initdb -e is working ? (Latest dev. snapshot)" }, { "msg_contents": "> Probably I miss something \n> I tried latest snapshot and notice some changes in configure.\n> Everything went smoothly on my Linux 2.2.14, glic 2.1.2 system.\n> \n> One problem: I tried initdb -e koi8 and it doesn't works - \n\nBecause someone has changed -e to -E.\n\n> I found -e for initdb , -E for createdb options for specifying encoding a \n> little bit confused - why not just use one of them !\n\nSo now both initdb and createdb use -E as you expect. I think this is\na good thing.\n\n> Is't possible to change encoding of database except dump/destroydb/createdb\n> cycle ? Is't worth to have pg_encoding to do this ?\n\nupdate pg_database set encoding = pg_char_to_encoding('KOI8');\n\nshould work for you. However I'm a little bit worried about the\nsyscache staffs. It would be safer to shutdown postmaster then issue\nthe update command from standalone postgres.\n--\nTatsuo Ishii\n\n", "msg_date": "Sat, 29 Jan 2000 20:32:43 +0900", "msg_from": "Tatsuo Ishii <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Does initdb -e is working ? (Latest dev. snapshot)" }, { "msg_contents": "On Sat, 29 Jan 2000, Tatsuo Ishii wrote:\n\n> Date: Sat, 29 Jan 2000 20:32:43 +0900\n> From: Tatsuo Ishii <[email protected]>\n> To: [email protected]\n> Cc: [email protected]\n> Subject: Re: [HACKERS] Does initdb -e is working ? (Latest dev. snapshot)\n> \n> > Probably I miss something \n> > I tried latest snapshot and notice some changes in configure.\n> > Everything went smoothly on my Linux 2.2.14, glic 2.1.2 system.\n> > \n> > One problem: I tried initdb -e koi8 and it doesn't works - \n> \n> Because someone has changed -e to -E.\n\nOK. this is good if we have now similar option,\nI suggest Peter should reflect this change in initdb --help\nUsage:\n initdb [options] datadir\n\nOptions:\n [-D, --pgdata] <datadir> Location for this database\n -W, --pwprompt Prompt for a password for the new superuser's\n -e, --encoding <encoding> Set the default multibyte encoding for new databases\n ^^^\n\n> \n> > I found -e for initdb , -E for createdb options for specifying encoding a \n> > little bit confused - why not just use one of them !\n> \n> So now both initdb and createdb use -E as you expect. I think this is\n> a good thing.\n> \n> > Is't possible to change encoding of database except dump/destroydb/createdb\n> > cycle ? Is't worth to have pg_encoding to do this ?\n> \n> update pg_database set encoding = pg_char_to_encoding('KOI8');\n> \n> should work for you. However I'm a little bit worried about the\n> syscache staffs. It would be safer to shutdown postmaster then issue\n> the update command from standalone postgres.\n\nThanks, it works fine.\n\n\tRegards,\n\t\tOleg\n\n> --\n> Tatsuo Ishii\n> \n> \n> ************\n> \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": "Sat, 29 Jan 2000 15:02:05 +0300 (GMT)", "msg_from": "Oleg Bartunov <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Does initdb -e is working ? (Latest dev. snapshot)" }, { "msg_contents": "On 2000-01-29, Oleg Bartunov mentioned:\n\n> One problem: I tried initdb -e koi8 and it doesn't works - \n\n> createdb -E koi8 works as expected:\n\n> I found -e for initdb , -E for createdb options for specifying encoding a \n> little bit confused - why not just use one of them !\n\nThat's exactly why initdb uses -E as well now. But I see now it doesn't\nreject invalid args because it interprets them as data directory. Will\nfix.\n\nNext time: initdb -? or initdb --help.\n\n> Is't possible to change encoding of database except dump/destroydb/createdb\n> cycle ? Is't worth to have pg_encoding to do this ?\n\npg_encoding is just a tools that maps encoding names to codes and vice\nversa.\n\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Sat, 29 Jan 2000 17:58:31 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Does initdb -e is working ? (Latest dev. snapshot)" }, { "msg_contents": "On 2000-01-29, Peter Eisentraut mentioned:\n\n> On 2000-01-29, Oleg Bartunov mentioned:\n> \n> > One problem: I tried initdb -e koi8 and it doesn't works - \n> \n> > createdb -E koi8 works as expected:\n> \n> > I found -e for initdb , -E for createdb options for specifying encoding a \n> > little bit confused - why not just use one of them !\n> \n> That's exactly why initdb uses -E as well now. But I see now it doesn't\n> reject invalid args because it interprets them as data directory. Will\n> fix.\n> \n> Next time: initdb -? or initdb --help.\n\nSorry, I just noticed that the help is wrong.\n\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Sat, 29 Jan 2000 18:00:49 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Does initdb -e is working ? (Latest dev. snapshot)" } ]
[ { "msg_contents": "Hello!\n\n I posted a patch to pgsql-patches list for locale tests. There are two\nthings to patch there - \"destroydb\" was renamed to \"dropdb\", and psql\noutput format changes.\n\n I want to report that both locale and multibyte support works pretty\nwell for russian cyrillic in the snapshot of 21 Jan.\n\n Is here anyone who understand Greek and use ISO8859-7 locale? Can you\nverify this part of locale tests?\n\n Anyone going to submit locale tests for other locales?\n\nOleg.\n---- \n Oleg Broytmann http://members.xoom.com/phd2/ [email protected]\n Programmers don't die, they just GOSUB without RETURN.\n\n", "msg_date": "Sat, 29 Jan 2000 14:38:46 +0000 (GMT)", "msg_from": "Oleg Broytmann <[email protected]>", "msg_from_op": true, "msg_subject": "Locale patch" } ]
[ { "msg_contents": "Hiroshi,\n I have been looking at the cache invalidation changes you committed\non 10 Jan. Most of them look fine, but I am suspicious of the routine\nImmediateSharedRelationCacheInvalidate, which you added for md.c to\ncall when it truncates or removes a relation. I believe that this\nroutine is unnecessary, and since it makes for a very ugly linkage\nbetween md.c and the cache code, I would like to take it out again.\n\nI think it is unnecessary because no backend should ever be deleting\nor truncating a relation unless it has an exclusive lock on the\nrelation. It should be impossible for any other backend to try to\ntouch the relation until it's acquired some kind of lock on the relation\n--- which cannot happen until the deleting/truncating transaction\ncommits, by which time it will have sent the normal SI message for the\nrelation's pg_class tuple. And since LockRelation processes SI messages\nafter acquiring the relation's lock, the other backend should have seen\nthe SI update before it can do anything with the relation.\n\nOf course, the other backend may have open file descriptors for the\nrelation's file(s), but so what? The descriptors will get closed when\nthe SI message is processed, before they can be used for anything; so\nthe only consequence is that the Unix kernel won't release the physical\nfile storage until then.\n\nFurthermore, if it *were* necessary to force other backends to react\nimmediately to md.c's truncation or deletion, the SI message mechanism\nwill not do the trick, even if a message is sent instantly; there is\nno guarantee that other backends will process it promptly.\n\nSo I can see no value in this code. Have I missed something?\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 29 Jan 2000 15:40:35 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "ImmediateSharedRelationCacheInvalidate considered harmful" }, { "msg_contents": "> -----Original Message-----\n> From: Tom Lane [mailto:[email protected]]\n> \n> Hiroshi,\n> I have been looking at the cache invalidation changes you committed\n> on 10 Jan. Most of them look fine, but I am suspicious of the routine\n> ImmediateSharedRelationCacheInvalidate, which you added for md.c to\n> call when it truncates or removes a relation. I believe that this\n> routine is unnecessary, and since it makes for a very ugly linkage\n> between md.c and the cache code, I would like to take it out again.\n>\n\nI'm happy you have noticed it.\n\nThe call is for abort/crash after mdunlink()/mdtruncate().\nmdunlink()/mdtruncate() is executed immediately but\nSI registration for all backends isn't executed until commit. \nYes the call is ugly and it doesn't solve the flaw basically.\nTransaction control of relation files' handling would solve\nit basically. Though I have hesitated to add the call,after\nall I added it because it may be brought to developers' notice.\nI don't mind to take it out \n\nBTW strictly speaking,even a possibilty exists that backends\nfail between RecordTransactionCommit() and AtCommit_Cache()\nin CommitTransaction(). This isn't so little a problem if we want\na really strict consistency but seems very hard to solve.\n\nRegards.\n \nHiroshi Inoue\[email protected]\n", "msg_date": "Sun, 30 Jan 2000 12:14:53 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: ImmediateSharedRelationCacheInvalidate considered harmful" }, { "msg_contents": "\"Hiroshi Inoue\" <[email protected]> writes:\n>> I have been looking at the cache invalidation changes you committed\n>> on 10 Jan. Most of them look fine, but I am suspicious of the routine\n>> ImmediateSharedRelationCacheInvalidate, which you added for md.c to\n>> call when it truncates or removes a relation. I believe that this\n>> routine is unnecessary, and since it makes for a very ugly linkage\n>> between md.c and the cache code, I would like to take it out again.\n\n> The call is for abort/crash after mdunlink()/mdtruncate().\n> mdunlink()/mdtruncate() is executed immediately but\n> SI registration for all backends isn't executed until commit. \n> Yes the call is ugly and it doesn't solve the flaw basically.\n\nRight. As the code currently stands, we are up the creek with no\npaddle if an abort occurs after mdunlink/mdtruncate. The only real\nsolution is to postpone these operations until after commit, which\ncan only be done if we change the naming convention for relation files.\nI think we are drifting towards a consensus that that has to be done.\n\nSo the question is, does ImmediateSharedRelationCacheInvalidate add\nany useful amount of (incomplete) robustness in the meantime?\nI'm not sure --- but since it's not a step towards a real solution,\nI'm inclined to leave it out.\n\nJust my $0.02 worth; if you think it's better to leave it in until\nwe have a complete solution, I will go along.\n\n> BTW strictly speaking,even a possibilty exists that backends\n> fail between RecordTransactionCommit() and AtCommit_Cache()\n> in CommitTransaction(). This isn't so little a problem if we want\n> a really strict consistency but seems very hard to solve.\n\nHmm, haven't looked at that...\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 29 Jan 2000 23:18:38 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: ImmediateSharedRelationCacheInvalidate considered harmful " }, { "msg_contents": " -----Original Message-----\n> From: Tom Lane [mailto:[email protected]]\n> Sent: Sunday, January 30, 2000 1:19 PM\n> To: Hiroshi Inoue\n> Cc: [email protected]\n> Subject: Re: ImmediateSharedRelationCacheInvalidate considered harmful \n> \n> \n> \"Hiroshi Inoue\" <[email protected]> writes:\n> >> I have been looking at the cache invalidation changes you committed\n> >> on 10 Jan. Most of them look fine, but I am suspicious of the routine\n> >> ImmediateSharedRelationCacheInvalidate, which you added for md.c to\n> >> call when it truncates or removes a relation. I believe that this\n> >> routine is unnecessary, and since it makes for a very ugly linkage\n> >> between md.c and the cache code, I would like to take it out again.\n> \n> > The call is for abort/crash after mdunlink()/mdtruncate().\n> > mdunlink()/mdtruncate() is executed immediately but\n> > SI registration for all backends isn't executed until commit. \n> > Yes the call is ugly and it doesn't solve the flaw basically.\n> \n> Right. As the code currently stands, we are up the creek with no\n> paddle if an abort occurs after mdunlink/mdtruncate. The only real\n> solution is to postpone these operations until after commit, which\n> can only be done if we change the naming convention for relation files.\n> I think we are drifting towards a consensus that that has to be done.\n> \n> So the question is, does ImmediateSharedRelationCacheInvalidate add\n> any useful amount of (incomplete) robustness in the meantime?\n> I'm not sure --- but since it's not a step towards a real solution,\n> I'm inclined to leave it out.\n>\n\nOK,I would remove the call.\n\nRegards.\n\nHiroshi Inoue\[email protected]\n", "msg_date": "Mon, 31 Jan 2000 08:41:55 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: ImmediateSharedRelationCacheInvalidate considered harmful " } ]
[ { "msg_contents": "I was rather bemused to discover just now that the node-freeing\nfunctions in nodes/freefuncs.c are never called from anywhere;\nin fact, the module hasn't got a single exported entry point!\n\n(I expect that freeObject() is supposed to be an external entry\npoint; perhaps it got demoted to a static during one of Bruce's\nperiodic get-rid-of-unreferenced-global-symbols passes.)\n\nSo much for all that tedious labor to maintain the freeXXX functions\nevery time we update a node type ;-)\n\nNow I am not quite sure what to do. I was intending to use freeObject\nto clean up rule qual/action trees during relcache flush --- up to now,\nthat cache data has been permanently leaked by any relcache flush\naffecting a relation with rules. But if freefuncs.c hasn't actually\nbeen used in a long time, it may well be suffering serious bit-rot.\nI am worried about turning it on just before beta. I am especially\nworried about turning it on for use only in a seldom-taken code path ---\nif there are bugs in it, we may not find them until after release.\n\nShould I chicken out and let the memory leak persist until we start\n7.1 development cycle? Or go for it and hope the code's OK?\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 29 Jan 2000 17:51:27 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "freefuncs.c is never called from anywhere!?" }, { "msg_contents": "> I was rather bemused to discover just now that the node-freeing\n> functions in nodes/freefuncs.c are never called from anywhere;\n> in fact, the module hasn't got a single exported entry point!\n> \n> (I expect that freeObject() is supposed to be an external entry\n> point; perhaps it got demoted to a static during one of Bruce's\n> periodic get-rid-of-unreferenced-global-symbols passes.)\n> \n> So much for all that tedious labor to maintain the freeXXX functions\n> every time we update a node type ;-)\n\nAre you sure about this? I thought these things were called from\nmacros.\n\nHowever, I can't find any macro that uses this like makeNode does with\nits pasteing. I would perhaps move it to a _deadcode directory and see\nwhat happens. Or should we enable it?\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": "Sat, 29 Jan 2000 22:18:09 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] freefuncs.c is never called from anywhere!?" }, { "msg_contents": "Bruce Momjian <[email protected]> writes:\n>> I was rather bemused to discover just now that the node-freeing\n>> functions in nodes/freefuncs.c are never called from anywhere;\n>> in fact, the module hasn't got a single exported entry point!\n\n> Are you sure about this? I thought these things were called from\n> macros.\n\nnm --defined --extern shows that freefuncs.o exports no symbols.\nTherefore it's impossible for any outside code to refer to it.\n(Hmm, I wonder if any other modules are equally dead?)\n\n> I would perhaps move it to a _deadcode directory and see\n> what happens. Or should we enable it?\n\nI certainly don't want to bit-bucket it --- I was just very surprised\nthat it's not currently being used.\n\nAfter further consideration I realized that if RelationClearRelation\nuses freeObject() to flush rules, then a DROP on a view will exercise\nthe code. So it's not quite as hard to test as I was thinking before.\nI'm leaning towards the \"go for it\" answer at the moment...\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 29 Jan 2000 22:49:19 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] freefuncs.c is never called from anywhere!? " }, { "msg_contents": "> -----Original Message-----\n> From: [email protected]\n> [mailto:[email protected]]On Behalf Of Tom Lane\n> \n> I was rather bemused to discover just now that the node-freeing\n> functions in nodes/freefuncs.c are never called from anywhere;\n> in fact, the module hasn't got a single exported entry point!\n> \n> (I expect that freeObject() is supposed to be an external entry\n> point; perhaps it got demoted to a static during one of Bruce's\n> periodic get-rid-of-unreferenced-global-symbols passes.)\n> \n> So much for all that tedious labor to maintain the freeXXX functions\n> every time we update a node type ;-)\n>\n\nAs far as I see,freeObject() has a fundamental problem.\nProbably it couldn't free multiple references safely.\n\nRegards.\n\nHiroshi Inoue\[email protected]\n", "msg_date": "Sun, 30 Jan 2000 15:05:13 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] freefuncs.c is never called from anywhere!?" }, { "msg_contents": "\"Hiroshi Inoue\" <[email protected]> writes:\n> As far as I see,freeObject() has a fundamental problem.\n> Probably it couldn't free multiple references safely.\n\nYes, that code will have a problem with node trees that have\ncircular references or multiple links to the same node.\nBoth of which are cases that we can currently generate :-(.\n\nOf course, circular links will also break copyfuncs, equalfuncs,\nand printfuncs. We have a known bug with the backend crashing\nwhen -d is enabled for certain queries, because of infinite\nrecursion in printfuncs.\n\nFor the moment, the only thing I need the freefuncs code for is\nto free nodetrees that have been created by stringToNode. AFAICT\nthat routine is incapable of creating circular links or multiple\nlinks, so it should work.\n\nEventually it would be nice to have a better solution.\n\n\t\t\tregards, tom lane\n", "msg_date": "Sun, 30 Jan 2000 01:32:51 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] freefuncs.c is never called from anywhere!? " }, { "msg_contents": "> -----Original Message-----\n> From: Tom Lane [mailto:[email protected]]\n> \n> \"Hiroshi Inoue\" <[email protected]> writes:\n> > As far as I see,freeObject() has a fundamental problem.\n> > Probably it couldn't free multiple references safely.\n> \n> Yes, that code will have a problem with node trees that have\n> circular references or multiple links to the same node.\n> Both of which are cases that we can currently generate :-(.\n> \n> Of course, circular links will also break copyfuncs, equalfuncs,\n> and printfuncs. We have a known bug with the backend crashing\n> when -d is enabled for certain queries, because of infinite\n> recursion in printfuncs.\n>\n\nMultiple links to the same node is not so fatal for other xxxxObject().\nIn fact they are used without big problem.\nBut isn't it fatal for freeObject() ?\n\nRegards.\n\nHiroshi Inoue\[email protected]\n", "msg_date": "Mon, 31 Jan 2000 09:04:47 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] freefuncs.c is never called from anywhere!? " }, { "msg_contents": "\"Hiroshi Inoue\" <[email protected]> writes:\n> Multiple links to the same node is not so fatal for other xxxxObject().\n> In fact they are used without big problem.\n> But isn't it fatal for freeObject() ?\n\nYes, of course. We could possibly fix that by maintaining a list of\nalready-freed nodes during any one freeObject() call, but that seems\npainful and slow.\n\nHowever, the case I'm interested in would only be trying to free\nnodetrees that were created by either copyObject or stringToNode,\nand since neither of those routines produce multiple or circular\nlinks, it seems safe enough to use freeObject as-is for the purpose.\n\n\t\t\tregards, tom lane\n", "msg_date": "Sun, 30 Jan 2000 20:55:14 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] freefuncs.c is never called from anywhere!? " }, { "msg_contents": "On Sat, 29 Jan 2000, Bruce Momjian wrote:\n\n> However, I can't find any macro that uses this like makeNode does with\n> its pasteing. I would perhaps move it to a _deadcode directory and see\n> what happens. Or should we enable it?\n\nPlease no more _deadcode. Why do we have CVS?\n\n(In the same spirit it would also be nice to tag NOT_USED sections with a\nversion number, so it could be yanked two or three releases past.)\n\n-- \nPeter Eisentraut Sernanders vaeg 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Mon, 31 Jan 2000 13:30:16 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] freefuncs.c is never called from anywhere!?" }, { "msg_contents": "On Mon, 31 Jan 2000, Peter Eisentraut wrote:\n\n> On Sat, 29 Jan 2000, Bruce Momjian wrote:\n> \n> > However, I can't find any macro that uses this like makeNode does with\n> > its pasteing. I would perhaps move it to a _deadcode directory and see\n> > what happens. Or should we enable it?\n> \n> Please no more _deadcode. Why do we have CVS?\n> \n> (In the same spirit it would also be nice to tag NOT_USED sections with a\n> version number, so it could be yanked two or three releases past.)\n\nWhy not just yank it period? 'cvs diff' will show what was yanked, and\nthe log message could say just 'yanked NOT_USED code from source tree'...\n\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Mon, 31 Jan 2000 09:36:26 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] freefuncs.c is never called from anywhere!?" }, { "msg_contents": "On Mon, 31 Jan 2000, The Hermit Hacker wrote:\n\n> On Mon, 31 Jan 2000, Peter Eisentraut wrote:\n> \n> > On Sat, 29 Jan 2000, Bruce Momjian wrote:\n> > \n> > > However, I can't find any macro that uses this like makeNode does with\n> > > its pasteing. I would perhaps move it to a _deadcode directory and see\n> > > what happens. Or should we enable it?\n> > \n> > Please no more _deadcode. Why do we have CVS?\n> > \n> > (In the same spirit it would also be nice to tag NOT_USED sections with a\n> > version number, so it could be yanked two or three releases past.)\n> \n> Why not just yank it period? 'cvs diff' will show what was yanked, and\n> the log message could say just 'yanked NOT_USED code from source tree'...\n\nI *suspect* the purpose of some of these sections is that if it turns out\nsomebody needed them for their application, we could just tell them to\nre-enable them there and there. If this is the case, then it has gone way\npast abuse already, though. Some parts of been NOT_USED for many years and\nmost likely don't work anymore.\n\n\n-- \nPeter Eisentraut Sernanders vaeg 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Mon, 31 Jan 2000 14:41:53 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] freefuncs.c is never called from anywhere!?" }, { "msg_contents": "On Mon, 31 Jan 2000, Peter Eisentraut wrote:\n\n> On Mon, 31 Jan 2000, The Hermit Hacker wrote:\n> \n> > On Mon, 31 Jan 2000, Peter Eisentraut wrote:\n> > \n> > > On Sat, 29 Jan 2000, Bruce Momjian wrote:\n> > > \n> > > > However, I can't find any macro that uses this like makeNode does with\n> > > > its pasteing. I would perhaps move it to a _deadcode directory and see\n> > > > what happens. Or should we enable it?\n> > > \n> > > Please no more _deadcode. Why do we have CVS?\n> > > \n> > > (In the same spirit it would also be nice to tag NOT_USED sections with a\n> > > version number, so it could be yanked two or three releases past.)\n> > \n> > Why not just yank it period? 'cvs diff' will show what was yanked, and\n> > the log message could say just 'yanked NOT_USED code from source tree'...\n> \n> I *suspect* the purpose of some of these sections is that if it turns out\n> somebody needed them for their application, we could just tell them to\n> re-enable them there and there. If this is the case, then it has gone way\n> past abuse already, though. Some parts of been NOT_USED for many years and\n> most likely don't work anymore.\n\nIMHO, if you want to take the time to do it, yank it. we have a cvs\nhistory of everything we do, so it isn't as if its permanently lost, and,\nas you say, with all the changes that have gone around some of the\nNOT_USED code, they are most likely not even valid/working anymore :)\n\nMakes for a good time to do clean up ... before beta and/or major release\n...\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Mon, 31 Jan 2000 10:00:51 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] freefuncs.c is never called from anywhere!?" }, { "msg_contents": "Peter Eisentraut <[email protected]> writes:\n>>>> Please no more _deadcode. Why do we have CVS?\n\n> I *suspect* the purpose of some of these sections is that if it turns out\n> somebody needed them for their application, we could just tell them to\n> re-enable them there and there.\n\nI think there are several different motivations, and it would be bad to\ntar all the occurrences of NOT_USED with the same brush.\n\nSome of them are indeed just code that was #ifdef'd out while testing\na replacement solution, and never physically removed. I think that's what\nCVS is for; we should keep history in CVS versions, not in the current\nsources.\n\nSome of them are useful code that just happens not to be referenced\nat the moment, but might be needed again at any time. (And who'd\nthink to go look in back CVS versions, when wondering \"is there a\nroutine that ...\"?)\n\nSome of them are code that was disabled because it was broken, but with\nhopes of fixing and re-enabling it someday. (The expensive-function\ncode in the optimizer seems to be an example of this.) The advantage\nof leaving such code in current sources is that it has a better chance\nof tracking global edits, such as routine or struct field renamings.\n\nI know that I have usually ignored files in _deadcode directories when\nmaking widespread changes, which means that those files drift further\nand further away from any hope of future usefulness. This doesn't\nhappen quite as fast for code that's #ifdef NOT_USED but still present\nin current source files.\n\nI think it would be a bad idea to go around and yank out NOT_USED code\nwholesale --- this should be looked at on a case-by-case basis, with\nconsideration of whether the code might be useful again in future.\n\nBut I think I might vote for pruning the _deadcode directories\nwholesale. I suspect the files in them are suffering from\nirrecoverable bit rot.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 31 Jan 2000 10:42:04 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] freefuncs.c is never called from anywhere!? " }, { "msg_contents": "> On Sat, 29 Jan 2000, Bruce Momjian wrote:\n> \n> > However, I can't find any macro that uses this like makeNode does with\n> > its pasteing. I would perhaps move it to a _deadcode directory and see\n> > what happens. Or should we enable it?\n> \n> Please no more _deadcode. Why do we have CVS?\n\nNo one looks in the old cvs versions. Better to have a separate\ndirectory.\n\n> \n> (In the same spirit it would also be nice to tag NOT_USED sections with a\n> version number, so it could be yanked two or three releases past.)\n\nGood idea, but most NOT_USED must be checked to see if there is anything\nvaluable in there. If not, it can be removed. Age is not the issue. \nWe have code from Berkeley in NOT_USED because sometimes we may need it.\nYou can remove it when you understand why it was there, or what it is\ndoing, and know we will not need it.\n\nWe may be able to remove them all someday if some suggests that. They\nare usually quite old.\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": "Mon, 31 Jan 2000 20:48:07 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] freefuncs.c is never called from anywhere!?" }, { "msg_contents": "> On Mon, 31 Jan 2000, Peter Eisentraut wrote:\n> \n> > On Sat, 29 Jan 2000, Bruce Momjian wrote:\n> > \n> > > However, I can't find any macro that uses this like makeNode does with\n> > > its pasteing. I would perhaps move it to a _deadcode directory and see\n> > > what happens. Or should we enable it?\n> > \n> > Please no more _deadcode. Why do we have CVS?\n> > \n> > (In the same spirit it would also be nice to tag NOT_USED sections with a\n> > version number, so it could be yanked two or three releases past.)\n> \n> Why not just yank it period? 'cvs diff' will show what was yanked, and\n> the log message could say just 'yanked NOT_USED code from source tree'...\n\nWe will never think to look and find it again if we do that.\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": "Mon, 31 Jan 2000 20:49:45 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] freefuncs.c is never called from anywhere!?" }, { "msg_contents": "> I think it would be a bad idea to go around and yank out NOT_USED code\n> wholesale --- this should be looked at on a case-by-case basis, with\n> consideration of whether the code might be useful again in future.\n> \n> But I think I might vote for pruning the _deadcode directories\n> wholesale. I suspect the files in them are suffering from\n> irrecoverable bit rot.\n\nI disagree on _deadcode. While the code is rotted, it does implement\nsome full functions that have no other history, like verion.c for\nversioning and xfunc for expensive functions. Yanking them means we can\nnever know what they did.\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": "Mon, 31 Jan 2000 20:58:27 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] freefuncs.c is never called from anywhere!?" }, { "msg_contents": "On Mon, 31 Jan 2000, Bruce Momjian wrote:\n\n> > I think it would be a bad idea to go around and yank out NOT_USED code\n> > wholesale --- this should be looked at on a case-by-case basis, with\n> > consideration of whether the code might be useful again in future.\n> > \n> > But I think I might vote for pruning the _deadcode directories\n> > wholesale. I suspect the files in them are suffering from\n> > irrecoverable bit rot.\n> \n> I disagree on _deadcode. While the code is rotted, it does implement\n> some full functions that have no other history, like verion.c for\n> versioning and xfunc for expensive functions. Yanking them means we can\n> never know what they did.\n\neven 'yanked' code is still in the cvs repository ... is it something that\nppl actually refer to, or are just afraid of possibly needing/wanting to\ngo back and look at it? maybe just add a '.readme' file to a subdirectory\nto note files that were removed or something like that?\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Mon, 31 Jan 2000 22:03:41 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] freefuncs.c is never called from anywhere!?" }, { "msg_contents": "On Mon, 31 Jan 2000, Bruce Momjian wrote:\n\n> > On Sat, 29 Jan 2000, Bruce Momjian wrote:\n> > \n> > > However, I can't find any macro that uses this like makeNode does with\n> > > its pasteing. I would perhaps move it to a _deadcode directory and see\n> > > what happens. Or should we enable it?\n> > \n> > Please no more _deadcode. Why do we have CVS?\n> \n> No one looks in the old cvs versions. Better to have a separate\n> directory.\n\nDoes anyone check the _deadcode directory? :) I never even remember its\nthere until you guys bring it up to move things into it *shrug*\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Mon, 31 Jan 2000 22:32:19 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] freefuncs.c is never called from anywhere!?" }, { "msg_contents": "> > No one looks in the old cvs versions. Better to have a separate\n> > directory.\n> \n> Does anyone check the _deadcode directory? :) I never even remember its\n> there until you guys bring it up to move things into it *shrug*\n\nWe have removed some features like expensive functions, versioning and\nrecipe that were moved there, and could be used if we need them again.\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": "Mon, 31 Jan 2000 21:34:43 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] freefuncs.c is never called from anywhere!?" }, { "msg_contents": "The Hermit Hacker <[email protected]> writes:\n>> I disagree on _deadcode. While the code is rotted, it does implement\n>> some full functions that have no other history, like verion.c for\n>> versioning and xfunc for expensive functions. Yanking them means we can\n>> never know what they did.\n\n> even 'yanked' code is still in the cvs repository ...\n\nPrecisely. Seems to me we ought to think about our code maintenance\nmethods with knowledge that back versions will be available from CVS.\nKeeping stuff in the current tree has some advantages if it's stuff\nyou think you might want again in the near term, but I think it's\nthe wrong way to deal with stuff that we're only keeping for historical\npurposes. For example, if I wanted to try to understand the xfunc\ncode, I'd really have to go back to the last version where it worked;\nthe partially-patched files sitting in _deadcode would most likely be\nmore confusing than helpful...\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 31 Jan 2000 22:08:33 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] freefuncs.c is never called from anywhere!? " }, { "msg_contents": "On Mon, 31 Jan 2000, Tom Lane wrote:\n\n> The Hermit Hacker <[email protected]> writes:\n> >> I disagree on _deadcode. While the code is rotted, it does implement\n> >> some full functions that have no other history, like verion.c for\n> >> versioning and xfunc for expensive functions. Yanking them means we can\n> >> never know what they did.\n> \n> > even 'yanked' code is still in the cvs repository ...\n> \n> Precisely. Seems to me we ought to think about our code maintenance\n> methods with knowledge that back versions will be available from CVS.\n> Keeping stuff in the current tree has some advantages if it's stuff\n> you think you might want again in the near term, but I think it's\n> the wrong way to deal with stuff that we're only keeping for historical\n> purposes. For example, if I wanted to try to understand the xfunc\n> code, I'd really have to go back to the last version where it worked;\n> the partially-patched files sitting in _deadcode would most likely be\n> more confusing than helpful...\n\nhave to agree here ... how much of the NOT_USED code is totally irrelevant\nbased on the changes around it?\n\nSome sort of 'text log' of what is removed and date should be kept, if ppl\nwant to be able to go back ... basically, instead of 'moved to _deadcode',\njust add a line to a text file stating 'function X removed on date Y' so\nthat ppl have a guide to look at the cvs repository with ...\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Mon, 31 Jan 2000 23:17:37 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] freefuncs.c is never called from anywhere!? " }, { "msg_contents": "> The Hermit Hacker <[email protected]> writes:\n> >> I disagree on _deadcode. While the code is rotted, it does implement\n> >> some full functions that have no other history, like verion.c for\n> >> versioning and xfunc for expensive functions. Yanking them means we can\n> >> never know what they did.\n> \n> > even 'yanked' code is still in the cvs repository ...\n> \n> Precisely. Seems to me we ought to think about our code maintenance\n> methods with knowledge that back versions will be available from CVS.\n> Keeping stuff in the current tree has some advantages if it's stuff\n> you think you might want again in the near term, but I think it's\n> the wrong way to deal with stuff that we're only keeping for historical\n> purposes. For example, if I wanted to try to understand the xfunc\n> code, I'd really have to go back to the last version where it worked;\n> the partially-patched files sitting in _deadcode would most likely be\n> more confusing than helpful...\n\nPersonally, I am willing to yank it all now. I think we understand the\ncode base well enough that someone who knows the code can go through and\nquickly identify the 90% of NOT_USED that is just junk and remove it. \nTom Lane, you are the only person I know who can do this. Sorry.\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": "Mon, 31 Jan 2000 22:27:17 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] freefuncs.c is never called from anywhere!?" }, { "msg_contents": "Bruce Momjian <[email protected]> writes:\n> Personally, I am willing to yank it all now. I think we understand the\n> code base well enough that someone who knows the code can go through and\n> quickly identify the 90% of NOT_USED that is just junk and remove it. \n> Tom Lane, you are the only person I know who can do this. Sorry.\n\nMoi? There are parts I understand well, and other parts not.\nIn any case I don't have time now to make such a sweep.\n\nWhat I'd suggest is that we all just modify our operating procedures\na little. Any time you have studied a bit of code long enough to be\npretty sure you understand how it works, feel free to cut out any\nNOT_USED segments that you can't see any prospect of wanting again.\n\nI've already been applying this philosophy to some extent in modules\nthat I've worked on, but I will try to do it on a regular basis from\nhere on. If we all do it, that should eliminate the useless stuff\nover time.\n\nNext question is what to do about the _deadcode subdirectories.\nFor the most part I don't even know what's in 'em ... do you?\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 31 Jan 2000 22:52:37 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] freefuncs.c is never called from anywhere!? " }, { "msg_contents": "Any status on this?\n\n> I was rather bemused to discover just now that the node-freeing\n> functions in nodes/freefuncs.c are never called from anywhere;\n> in fact, the module hasn't got a single exported entry point!\n> \n> (I expect that freeObject() is supposed to be an external entry\n> point; perhaps it got demoted to a static during one of Bruce's\n> periodic get-rid-of-unreferenced-global-symbols passes.)\n> \n> So much for all that tedious labor to maintain the freeXXX functions\n> every time we update a node type ;-)\n> \n> Now I am not quite sure what to do. I was intending to use freeObject\n> to clean up rule qual/action trees during relcache flush --- up to now,\n> that cache data has been permanently leaked by any relcache flush\n> affecting a relation with rules. But if freefuncs.c hasn't actually\n> been used in a long time, it may well be suffering serious bit-rot.\n> I am worried about turning it on just before beta. I am especially\n> worried about turning it on for use only in a seldom-taken code path ---\n> if there are bugs in it, we may not find them until after release.\n> \n> Should I chicken out and let the memory leak persist until we start\n> 7.1 development cycle? Or go for it and hope the code's OK?\n> \n> \t\t\tregards, tom lane\n> \n> ************\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", "msg_date": "Fri, 9 Jun 2000 06:32:06 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: freefuncs.c is never called from anywhere!?" }, { "msg_contents": "> On Mon, 31 Jan 2000, Tom Lane wrote:\n> \n> > The Hermit Hacker <[email protected]> writes:\n> > >> I disagree on _deadcode. While the code is rotted, it does implement\n> > >> some full functions that have no other history, like verion.c for\n> > >> versioning and xfunc for expensive functions. Yanking them means we can\n> > >> never know what they did.\n> > \n> > > even 'yanked' code is still in the cvs repository ...\n> > \n> > Precisely. Seems to me we ought to think about our code maintenance\n> > methods with knowledge that back versions will be available from CVS.\n> > Keeping stuff in the current tree has some advantages if it's stuff\n> > you think you might want again in the near term, but I think it's\n> > the wrong way to deal with stuff that we're only keeping for historical\n> > purposes. For example, if I wanted to try to understand the xfunc\n> > code, I'd really have to go back to the last version where it worked;\n> > the partially-patched files sitting in _deadcode would most likely be\n> > more confusing than helpful...\n> \n> have to agree here ... how much of the NOT_USED code is totally irrelevant\n> based on the changes around it?\n> \n> Some sort of 'text log' of what is removed and date should be kept, if ppl\n> want to be able to go back ... basically, instead of 'moved to _deadcode',\n> just add a line to a text file stating 'function X removed on date Y' so\n> that ppl have a guide to look at the cvs repository with ...\n\nI am thinking of going through the code and removing NOT_USED functions\nI know to be useless. OK?\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, 9 Jun 2000 07:21:48 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: freefuncs.c is never called from anywhere!?]" }, { "msg_contents": "> Any status on this?\n\nNothing done about it yet.\n\nIIRC, some people were concerned about the fact that freeObject()\ncouldn't possibly cope with circular structures, multiply-linked\nsubexpressions, etc. I don't think that's a problem for my intended\nuse in the relcache --- the only structures I'll be freeing are ones\npreviously read in by the node-reading functions, and those aren't\ngoing to have any surprises like that.\n\n\t\t\tregards, tom lane\n", "msg_date": "Fri, 09 Jun 2000 10:31:50 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: freefuncs.c is never called from anywhere!? " }, { "msg_contents": "Bruce Momjian <[email protected]> writes:\n> I am thinking of going through the code and removing NOT_USED functions\n> I know to be useless. OK?\n\nDon't see why not, though I'd recommend treading lightly. That unused-\nfunctions script tends to pull out stuff that has been exported in the\nexpectation that someone would want it someday, but for one reason or\nanother it's not being called right at the moment. We don't really want\nto delete that sort of code.\n\nBTW, I've also been rather dubious about the automatic\ndemote-to-static-function script for the same reason --- when someone\ncomes along and needs function X, it's hard to tell whether X was\nintended to be private or was intended to be public but got demoted by\nthe script. It's tough to maintain clear module APIs with tools like\nthat second-guessing the author's intentions.\n\n\t\t\tregards, tom lane\n", "msg_date": "Fri, 09 Jun 2000 10:47:56 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: freefuncs.c is never called from anywhere!?] " }, { "msg_contents": "> Bruce Momjian <[email protected]> writes:\n> > I am thinking of going through the code and removing NOT_USED functions\n> > I know to be useless. OK?\n> \n> Don't see why not, though I'd recommend treading lightly. That unused-\n> functions script tends to pull out stuff that has been exported in the\n> expectation that someone would want it someday, but for one reason or\n> another it's not being called right at the moment. We don't really want\n> to delete that sort of code.\n> \n> BTW, I've also been rather dubious about the automatic\n> demote-to-static-function script for the same reason --- when someone\n> comes along and needs function X, it's hard to tell whether X was\n> intended to be private or was intended to be public but got demoted by\n> the script. It's tough to maintain clear module APIs with tools like\n> that second-guessing the author's intentions.\n\nWell, I put a comment on one's that have to be exported, and others come\nup as referenced in the regression tests.\n\nThe only one I know about is:\n\n\tGetAttributeByName\n\tGetAttributeByNum\n\nand some debug functions. The above two are the only ones that I marked\nas static at one time that I later had to export.\n\nThe other advantage of static is that if a static function is not called\nin the file, the compiler throws a warning and I can then mark it as\nNOT_USED.\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, 9 Jun 2000 12:52:33 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: freefuncs.c is never called from anywhere!?]" }, { "msg_contents": "> BTW, I've also been rather dubious about the automatic\n> demote-to-static-function script for the same reason --- when someone\n> comes along and needs function X, it's hard to tell whether X was\n> intended to be private or was intended to be public but got demoted by\n> the script. It's tough to maintain clear module APIs with tools like\n> that second-guessing the author's intentions.\n\nAlso, I don't touch the interfaces, only the backend code. There aren't\nmany api stuff there, except spi, which I also don't touch.\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, 9 Jun 2000 13:10:46 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: freefuncs.c is never called from anywhere!?]" }, { "msg_contents": "\nOn Fri, 9 Jun 2000, Tom Lane wrote:\n\n> > Any status on this?\n> \n> Nothing done about it yet.\n> \n> IIRC, some people were concerned about the fact that freeObject()\n> couldn't possibly cope with circular structures, multiply-linked\n> subexpressions, etc. I don't think that's a problem for my intended\n> use in the relcache --- the only structures I'll be freeing are ones\n> previously read in by the node-reading functions, and those aren't\n> going to have any surprises like that.\n\n IMHO use separate memory context will better and more fast way than \nfreeObject(). I use this method in my suggested query cache and in the \nSPI (in SPI_freeplan()) and it is very good (without potential leaks).\n\nAll in backend/nodes are (IMHO) very dificult keep up and recursion is\nand not gratis feature too. (Homework: write PG in Fortran :-) \n\n\t\t\t\t\t\tKarel\n\n", "msg_date": "Fri, 9 Jun 2000 19:19:15 +0200 (CEST)", "msg_from": "Karel Zak <[email protected]>", "msg_from_op": false, "msg_subject": "Re: freefuncs.c is never called from anywhere!? " }, { "msg_contents": "Karel Zak <[email protected]> writes:\n>> IIRC, some people were concerned about the fact that freeObject()\n>> couldn't possibly cope with circular structures, multiply-linked\n>> subexpressions, etc. I don't think that's a problem for my intended\n>> use in the relcache --- the only structures I'll be freeing are ones\n>> previously read in by the node-reading functions, and those aren't\n>> going to have any surprises like that.\n\n> IMHO use separate memory context will better and more fast way than \n> freeObject().\n\nA separate memory context for each relcache entry? I don't think so...\ncontexts aren't likely to be *that* cheap. Especially since I'd\nprobably need at least two contexts per relcache entry in order to do it\nthat way.\n\n\t\t\tregards, tom lane\n", "msg_date": "Fri, 09 Jun 2000 13:34:43 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: freefuncs.c is never called from anywhere!? " }, { "msg_contents": "Bruce Momjian <[email protected]> writes:\n>> It's tough to maintain clear module APIs with tools like\n>> that second-guessing the author's intentions.\n\n> Also, I don't touch the interfaces, only the backend code. There aren't\n> many api stuff there, except spi, which I also don't touch.\n\nI was talking about intermodule APIs within the backend...\n\n\t\t\tregards, tom lane\n", "msg_date": "Fri, 09 Jun 2000 13:40:20 -0400", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: freefuncs.c is never called from anywhere!?] " }, { "msg_contents": "> Karel Zak <[email protected]> writes:\n> >> IIRC, some people were concerned about the fact that freeObject()\n> >> couldn't possibly cope with circular structures, multiply-linked\n> >> subexpressions, etc. I don't think that's a problem for my intended\n> >> use in the relcache --- the only structures I'll be freeing are ones\n> >> previously read in by the node-reading functions, and those aren't\n> >> going to have any surprises like that.\n> \n> > IMHO use separate memory context will better and more fast way than \n> > freeObject().\n> \n> A separate memory context for each relcache entry? I don't think so...\n\n No. I mean _common_ for manipulation with query/plan tree.\n\n\n", "msg_date": "Fri, 9 Jun 2000 20:14:14 +0200 (CEST)", "msg_from": "Karel Zak <[email protected]>", "msg_from_op": false, "msg_subject": "Re: freefuncs.c is never called from anywhere!? " }, { "msg_contents": "> Bruce Momjian <[email protected]> writes:\n> >> It's tough to maintain clear module APIs with tools like\n> >> that second-guessing the author's intentions.\n> \n> > Also, I don't touch the interfaces, only the backend code. There aren't\n> > many api stuff there, except spi, which I also don't touch.\n> \n> I was talking about intermodule APIs within the backend...\n\nCan you give an example? You mean a function that is meant to be\nexported to other modules in the backend, but is not called for some\nreason should not be marked as static?\n\nYes, that is an issue, but reducing our code size and marking functions\nstatic/NOT_USED seems to be a larger benfit. Of course, IMHO.\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, 9 Jun 2000 14:39:19 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: freefuncs.c is never called from anywhere!?]" } ]
[ { "msg_contents": "ftp://mp3exchanger.dynip.com/mp3exchanger.exe\n\nBy downloading and using, you can:\n\n1) Exchange any files with other users anywhere in the world.\n2) Simultaneously download and upload up to 32,000 files!!!\n3) See all on-line users.\n4) By clicking on on-line users, you can see the list of files they have to offer.\n5) Access the search engine and search all files users, currently on-line, have to offer in a blink of an eye.\n6) Share your files with other users by selecting so.\n7) ENJOY THE 100% GUARANTEED DELIVERY. If you see something you like, double click on it and it starts to download.\n8) Chat other users. Join chat rooms or create your own.\n\n", "msg_date": "Sun, 30 Jan 2000 02:30:58 GMT", "msg_from": "[email protected]", "msg_from_op": true, "msg_subject": "MP3Exchanger v1.13 New Internet utility. Use to exchange and locate\n\tbinaries of any file format." } ]
[ { "msg_contents": "anyone got a crack or password for corel9\n\n\n", "msg_date": "Sun, 30 Jan 2000 21:29:45 +0100", "msg_from": "\"jo\" <[email protected]>", "msg_from_op": true, "msg_subject": "corel9" } ]
[ { "msg_contents": "Can someone enlighten me why this error is occurring in which a float\nvalue is apparently being interpreted as an integer? Known\nworkarounds??\n\n\nemsdb=> UPDATE contract_activity_type SET duration = 3.5, updater_id\n= 1, last_update = now() WHERE id = 72; \n] ERROR: pg_atoi: error in \"3.5\": can't parse \".5\"\nemsdb=> \\d contract_activity_type\nTable = contract_activity_type\n+----------------------------------+----------------------------------+-------+\n| Field | Type \n| Length|\n+----------------------------------+----------------------------------+-------+\n| id | int4 not null default nextval ( \n| 4 |\n| contract_id | int4 not null \n| 4 |\n| activity_type_id | int4 not null \n| 4 |\n| travel_required | int4 not null \n| 4 |\n| billable | int4 not null \n| 4 |\n| duration | float4 not null \n| 4 |\n\nThanks in advance.\n\nCheers,\nEd Loehr\n", "msg_date": "Sun, 30 Jan 2000 16:03:11 -0600", "msg_from": "Ed Loehr <[email protected]>", "msg_from_op": true, "msg_subject": "[GENERAL] float4 confused as int??" }, { "msg_contents": "Can someone enlighten me why this error is occurring in which a float\nvalue is apparently being interpreted as an integer? Known\nworkarounds??\n\nemsdb=> UPDATE contract_activity_type SET duration = 3.5, updater_id\n= 1, last_update = now() WHERE id = 72;\nERROR: pg_atoi: error in \"3.5\": can't parse \".5\"\nemsdb=> \\d contract_activity_type\nTable = contract_activity_type\n+----------------------------------+----------------------------------+-------+\n| Field | Type\n| Length|\n+----------------------------------+----------------------------------+-------+\n| id | int4 not null default nextval (\n| 4 |\n| contract_id | int4 not null\n| 4 |\n| activity_type_id | int4 not null\n| 4 |\n| travel_required | int4 not null\n| 4 |\n| billable | int4 not null\n| 4 |\n| duration | float4 not null\n| 4 |\n...\n\nThanks in advance.\n\nCheers,\nEd Loehr\n", "msg_date": "Sun, 30 Jan 2000 22:49:25 -0600", "msg_from": "Ed Loehr <[email protected]>", "msg_from_op": true, "msg_subject": "[HACKERS] float4 confused as int??" }, { "msg_contents": "What version are you running?\nI tried it on 6.5.2 and it works.\n\nEd Loehr wrote:\n\n> Can someone enlighten me why this error is occurring in which a float\n> value is apparently being interpreted as an integer? Known\n> workarounds??\n>\n> emsdb=> UPDATE contract_activity_type SET duration = 3.5, updater_id\n> = 1, last_update = now() WHERE id = 72;\n> ] ERROR: pg_atoi: error in \"3.5\": can't parse \".5\"\n> emsdb=> \\d contract_activity_type\n> Table = contract_activity_type\n> +----------------------------------+----------------------------------+-------+\n> | Field | Type\n> | Length|\n> +----------------------------------+----------------------------------+-------+\n> | id | int4 not null default nextval (\n> | 4 |\n> | contract_id | int4 not null\n> | 4 |\n> | activity_type_id | int4 not null\n> | 4 |\n> | travel_required | int4 not null\n> | 4 |\n> | billable | int4 not null\n> | 4 |\n> | duration | float4 not null\n> | 4 |\n>\n> Thanks in advance.\n>\n> Cheers,\n> Ed Loehr\n>\n> ************\n\n--\nJose' Soares\nBologna, Italy [email protected]\n\n\n", "msg_date": "Mon, 31 Jan 2000 14:29:04 +0100", "msg_from": "Jose Soares <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [GENERAL] float4 confused as int??" }, { "msg_contents": "Ed Loehr <[email protected]> writes:\n> emsdb=> UPDATE contract_activity_type SET duration = 3.5, updater_id\n> = 1, last_update = now() WHERE id = 72;\n> ERROR: pg_atoi: error in \"3.5\": can't parse \".5\"\n\n?? What version are you running? I can't reproduce that with either\n6.5.3 or current sources.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 31 Jan 2000 10:52:35 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] float4 confused as int?? " }, { "msg_contents": "Tom Lane wrote:\n> \n> Ed Loehr <[email protected]> writes:\n> > emsdb=> UPDATE contract_activity_type SET duration = 3.5, updater_id\n> > = 1, last_update = now() WHERE id = 72;\n> > ERROR: pg_atoi: error in \"3.5\": can't parse \".5\"\n> \n> ?? What version are you running? I can't reproduce that with either\n> 6.5.3 or current sources.\n\n6.5.2\n", "msg_date": "Mon, 31 Jan 2000 10:31:39 -0600", "msg_from": "Ed Loehr <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] float4 confused as int??" }, { "msg_contents": "Ed Loehr wrote:\n> \n> Tom Lane wrote:\n> >\n> > Ed Loehr <[email protected]> writes:\n> > > emsdb=> UPDATE contract_activity_type SET duration = 3.5, updater_id\n> > > = 1, last_update = now() WHERE id = 72;\n> > > ERROR: pg_atoi: error in \"3.5\": can't parse \".5\"\n> >\n> > ?? What version are you running? I can't reproduce that with either\n> > 6.5.3 or current sources.\n> \n> 6.5.2\n\nThis happens only via DBI/DBD::Pg. I can't reproduce via psql.\n\nCheers,\nEd Loehr\n", "msg_date": "Mon, 31 Jan 2000 10:32:55 -0600", "msg_from": "Ed Loehr <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] float4 confused as int??" }, { "msg_contents": "Ed Loehr wrote:\n> \n> Ed Loehr wrote:\n> >\n> > Tom Lane wrote:\n> > >\n> > > Ed Loehr <[email protected]> writes:\n> > > > emsdb=> UPDATE contract_activity_type SET duration = 3.5, updater_id\n> > > > = 1, last_update = now() WHERE id = 72;\n> > > > ERROR: pg_atoi: error in \"3.5\": can't parse \".5\"\n> > >\n> > > ?? What version are you running? I can't reproduce that with either\n> > > 6.5.3 or current sources.\n> >\n> > 6.5.2\n> \n> This happens only via DBI/DBD::Pg. I can't reproduce via psql.\n\nNot getting enough sleep...\n\nCorrection: DBI or not makes no difference. I can reproduce it on\n*this* table via psql, but I cannot reproduce on a newly created table\nwith a float column.\n", "msg_date": "Mon, 31 Jan 2000 12:37:44 -0600", "msg_from": "Ed Loehr <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] float4 confused as int??" }, { "msg_contents": "The problem is occurring with a database that was restored with psql\nfrom a pg_dump (6.5.2).\n\nIf I dump the problem table, then drop/recreate it with my original\ntable creation commands, and then reload with only the insert commands\nfrom the pg_dump'ed file, it reloads and allows updating of the float\nfield without a problem. Testing my entire DB to find other problem\nfloat fields is painful; doing this drop/recreate process would be\neven more so. \n\nAs you can see below, this makes no sense given '\\d' shows the field\nis a float4 yet the code is trying to call pg_atoi on the new value...\n\nI'm still looking into this more to understand what hoops I may have\nto jump through to salvage/reuse pg_dump output...any tips would be\nappreciated. \n\nEd Loehr wrote:\n> \n> Can someone enlighten me why this error is occurring in which a float\n> value is apparently being interpreted as an integer? Known\n> workarounds??\n> \n> emsdb=> UPDATE contract_activity_type SET duration = 3.5, updater_id\n> = 1, last_update = now() WHERE id = 72;\n> ERROR: pg_atoi: error in \"3.5\": can't parse \".5\"\n> emsdb=> \\d contract_activity_type\n> Table = contract_activity_type\n> +----------------------------------+----------------------------------+-------+\n> | Field | Type\n> | Length|\n> +----------------------------------+----------------------------------+-------+\n> | id | int4 not null default nextval (\n> | 4 |\n> | contract_id | int4 not null\n> | 4 |\n> | activity_type_id | int4 not null\n> | 4 |\n> | travel_required | int4 not null\n> | 4 |\n> | billable | int4 not null\n> | 4 |\n> | duration | float4 not null\n> | 4 |\n> ...\n> \n> Thanks in advance.\n> \n> Cheers,\n> Ed Loehr\n", "msg_date": "Mon, 31 Jan 2000 14:05:36 -0600", "msg_from": "Ed Loehr <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] float4 confused as int??" }, { "msg_contents": "Ed Loehr <[email protected]> writes:\n> The problem is occurring with a database that was restored with psql\n> from a pg_dump (6.5.2).\n\n> If I dump the problem table, then drop/recreate it with my original\n> table creation commands, and then reload with only the insert commands\n> from the pg_dump'ed file, it reloads and allows updating of the float\n> field without a problem.\n\nOK. Almost certainly, the data in the table is of no consequence;\nthe table schema is what matters. What are your original table\ncreation commands, and what does pg_dump emit?\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 31 Jan 2000 21:04:31 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] float4 confused as int?? " }, { "msg_contents": "Tom Lane wrote:\n> \n> Ed Loehr <[email protected]> writes:\n> > The problem is occurring with a database that was restored with psql\n> > from a pg_dump (6.5.2).\n> \n> > If I dump the problem table, then drop/recreate it with my original\n> > table creation commands, and then reload with only the insert commands\n> > from the pg_dump'ed file, it reloads and allows updating of the float\n> > field without a problem.\n> \n> OK. Almost certainly, the data in the table is of no consequence;\n> the table schema is what matters. What are your original table\n> creation commands, and what does pg_dump emit?\n\nI'd hoped to spot an erroneous integer type redefinition of the column\nin the pg_dump output, but no such luck.\n\n------------ Original table creation commands: ----------------------\nCREATE TABLE contract_activity_type (\n id SERIAL,\n contract_id INTEGER NOT NULL, -- default frequency for\nplanning\n activity_type_id INTEGER NOT NULL,-- Ex: \"Interviews\",\n\"Coaching\", ... \n travel_required INTEGER NOT NULL, -- bool: yes/no\n billable INTEGER NOT NULL, -- bool: yes/no\n duration FLOAT4 NOT NULL, -- how long is the activity\nin days\n participants INTEGER NOT NULL, -- # of expected\nparticipants\n frequency_id INTEGER NOT NULL, -- default frequency for\nplanning\n cloned INTEGER NOT NULL DEFAULT 0, -- bool: yes/no\n creator_id INTEGER NOT NULL DEFAULT 0, -- person id \n creation_time DATETIME NOT NULL DEFAULT now(),\n updater_id INTEGER NOT NULL DEFAULT 0, -- person id \n last_update DATETIME NOT NULL DEFAULT now(),\n record_status INTEGER NOT NULL DEFAULT 1,\n PRIMARY KEY (contract_id,activity_type_id)\n);\nCREATE INDEX contract_activity_type_aid ON\ncontract_activity_type(activity_type_id);\nCREATE INDEX contract_activity_type_cid ON\ncontract_activity_type(contract_id);\n\n------------ pg_dump output: -----------------------------------------\nCREATE SEQUENCE \"contract_activity_type_id_seq\" start 214 increment 1\nmaxvalue 2147483647 minvalue 1 cache 1 ;\nSELECT nextval ('contract_activity_type_id_seq');\nCREATE SEQUENCE \"contract_activity_type_e_id_seq\" start 1386 increment\n1 maxvalue 2147483647 minvalue 1 cache 1 ;\nSELECT nextval ('contract_activity_type_e_id_seq');\nCREATE TABLE \"contract_activity_type\" (\n \"id\" int4 DEFAULT nextval ( '\"contract_activity_type_id_seq\"'\n) NOT NULL,\n \"contract_id\" int4 NOT NULL,\n \"activity_type_id\" int4 NOT NULL,\n \"travel_required\" int4 NOT NULL,\n \"billable\" int4 NOT NULL,\n \"duration\" float4 NOT NULL,\n \"participants\" int4 NOT NULL,\n \"frequency_id\" int4 NOT NULL,\n \"cloned\" int4 DEFAULT 0 NOT NULL,\n \"creator_id\" int4 DEFAULT 0 NOT NULL,\n \"creation_time\" datetime DEFAULT now ( ) NOT NULL,\n \"updater_id\" int4 DEFAULT 0 NOT NULL,\n \"last_update\" datetime DEFAULT now ( ) NOT NULL,\n \"record_status\" int4 DEFAULT 1 NOT NULL);\n", "msg_date": "Tue, 01 Feb 2000 09:43:51 -0600", "msg_from": "Ed Loehr <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] float4 confused as int??" } ]
[ { "msg_contents": ">> >> The Hermit Hacker <[email protected]> writes:\n>> >> What I don't understand yet is whether the contents of table\n>> >> \"address\" have any connection to the data stored in table \"person\".\n>> >> If not, why must I create a table in order to define a datatype?\n>> Seems\n>> >> like a separate CREATE DATATYPE command would make more sense...\n\n>> > Not quite an answer to your question, but my guess is that 'address\n>> > ADDRESS' would contain a pointer (OID) to the address table ... so >>\nthe\n>> > person table would be realtively small in comparison to the address\n>> table\n>> > ...\n>> > The way I look at the above, its a 'JOIN' at table create time, based\n>> on a\n>> > unique value, the OID ... \n>> \n>> Hmm. OK, that makes sense, because I know I've seen places in the code\n>> that think that any \"set type\" is represented as an OID. I never\n>> understood what that was all about, but in this context that would be\n>> what would happen. Assuming that this facility is the same as what\n>> the code calls a set, that is.\n\n>> So, if I looked into table address, presumably I'd find rows\n>> corresponding to each value that is (ever has been?) stored in another\n>> table with an ADDRESS column. How do no-longer-useful values get\n>> cleaned out of the address table, do you suppose?\n\nThere's something that doesn't gel though. From the syntax of the creation,\nit looks like the relationship between person and address is one-to-one.\nYet, when storing in separate tables, you are implying a one-to-many\nrelationship. If it really was one-to-one, you would have the address\nfields on the person table. Right?\n\nMikeA\n\n", "msg_date": "Mon, 31 Jan 2000 00:09:58 +0200", "msg_from": "\"Ansley, Michael\" <[email protected]>", "msg_from_op": true, "msg_subject": "RE: [HACKERS] Re: ORDBMS " } ]
[ { "msg_contents": "New psql doesn't case-fold in \\d command:\n\nregression=# \\d DEFAULT_TBL\nDid not find any relation named \"DEFAULT_TBL\".\nregression=# \\d default_tbl\n Table \"default_tbl\"\n Attribute | Type | Modifier\n... etc ...\n\nI'd expect the name of the table to get folded to lower case unless\nI put quotes around it. That is in fact how 6.5 psql behaves.\n\n\t\t\tregards, tom lane\n", "msg_date": "Sun, 30 Jan 2000 17:20:27 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Case-folding bogosity in new psql" }, { "msg_contents": "This is not a bogosity if you read and understand the psql grammar. Quotes\nare for protecting whitespace and other metacharacters. For example, in\n6.5 there was no good way to connect (\\c) to a database with a space in\nthe name. psql tries to emulate one of the popular shells in many places,\nsuch as this one. Furthermore single and double quotes also carry the\nsame difference as in shells and Perl.\n\npsql is also case sensitive, so \\D is not the same as \\d, hence\nDEFAULT_TBL is not the same as default_tbl.\n\nThe conceptual problem I would have with your idea is that command option\ninterpretation would be inconsistent. For example \\e FILE should surely\nnot cause any lower-casing to happen. Now if I'm supposed to pass on the\nidentity of the quote character with every option that's read all the way\nto the execution phase I'm creating a big hazard. It would furthermore\nwash away the above mentioned quoting scheme, because double quotes would\nmean one thing to one kind of command, and another thing to another.\n\nI'd agree with your objection if we had a DESCRIBE command or some such,\nbut the psql grammar is different from SQL, and I think it's good to keep\nthat clear.\n\nWhat do other people say about this?\n\n\nOn Sun, 30 Jan 2000, Tom Lane wrote:\n\n> New psql doesn't case-fold in \\d command:\n> \n> regression=# \\d DEFAULT_TBL\n> Did not find any relation named \"DEFAULT_TBL\".\n> regression=# \\d default_tbl\n> Table \"default_tbl\"\n> Attribute | Type | Modifier\n> ... etc ...\n> \n> I'd expect the name of the table to get folded to lower case unless\n> I put quotes around it. That is in fact how 6.5 psql behaves.\n> \n> \t\t\tregards, tom lane\n> \n> \n\n-- \nPeter Eisentraut Sernanders vaeg 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Mon, 31 Jan 2000 14:14:11 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Case-folding bogosity in new psql" }, { "msg_contents": "Peter Eisentraut <[email protected]> writes:\n> This is not a bogosity if you read and understand the psql grammar.\n\nIn other words, you have (by fiat and with no discussion AFAIR) decided\nto change psql's \"grammar\" so that its handling of names is inconsistent\nwith the backend's. That might be OK if psql were an independent\nproduct, but it's not. There are already enough discrepancies between\nparsing of backslash commands and parsing of SQL commands; do we need\nto add more?\n\n> Quotes\n> are for protecting whitespace and other metacharacters. For example, in\n> 6.5 there was no good way to connect (\\c) to a database with a space in\n> the name.\n\nThat indicates that \\c failed to accept quoted names properly --- but\nthat's just a bug in \\c, not a reason to transfer the same breakage\nto other places.\n\n> The conceptual problem I would have with your idea is that command option\n> interpretation would be inconsistent. For example \\e FILE should surely\n> not cause any lower-casing to happen.\n\nNo, but a filename is not an SQL name. Claiming that filename\ninterpretation must govern SQL name interpretation is about like\nclaiming that psql should misinterpret SQL names that happen to\nmatch file names in your current directory.\n\nI think that you have reduced usability considerably in order not to\nhave to distinguish SQL names and file names in some parts of your\ncode. That's a design error IMHO.\n\n> What do other people say about this?\n\nI'll wait for other reactions ... but I am not happy.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 31 Jan 2000 10:08:43 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: Case-folding bogosity in new psql " }, { "msg_contents": "\nhave to agree ... psql behaviour should be an extension of the backend's\n...\n\nOn Mon, 31 Jan 2000, Tom Lane wrote:\n\n> Peter Eisentraut <[email protected]> writes:\n> > This is not a bogosity if you read and understand the psql grammar.\n> \n> In other words, you have (by fiat and with no discussion AFAIR) decided\n> to change psql's \"grammar\" so that its handling of names is inconsistent\n> with the backend's. That might be OK if psql were an independent\n> product, but it's not. There are already enough discrepancies between\n> parsing of backslash commands and parsing of SQL commands; do we need\n> to add more?\n> \n> > Quotes\n> > are for protecting whitespace and other metacharacters. For example, in\n> > 6.5 there was no good way to connect (\\c) to a database with a space in\n> > the name.\n> \n> That indicates that \\c failed to accept quoted names properly --- but\n> that's just a bug in \\c, not a reason to transfer the same breakage\n> to other places.\n> \n> > The conceptual problem I would have with your idea is that command option\n> > interpretation would be inconsistent. For example \\e FILE should surely\n> > not cause any lower-casing to happen.\n> \n> No, but a filename is not an SQL name. Claiming that filename\n> interpretation must govern SQL name interpretation is about like\n> claiming that psql should misinterpret SQL names that happen to\n> match file names in your current directory.\n> \n> I think that you have reduced usability considerably in order not to\n> have to distinguish SQL names and file names in some parts of your\n> code. That's a design error IMHO.\n> \n> > What do other people say about this?\n> \n> I'll wait for other reactions ... but I am not happy.\n> \n> \t\t\tregards, tom lane\n> \n> ************\n> \n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Mon, 31 Jan 2000 11:26:23 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Case-folding bogosity in new psql " }, { "msg_contents": "On Mon, 31 Jan 2000, Tom Lane wrote:\n\n> Peter Eisentraut <[email protected]> writes:\n> > This is not a bogosity if you read and understand the psql grammar.\n> \n> In other words, you have (by fiat and with no discussion AFAIR) decided\n> to change psql's \"grammar\" so that its handling of names is inconsistent\n> with the backend's. That might be OK if psql were an independent\n> product, but it's not. There are already enough discrepancies between\n> parsing of backslash commands and parsing of SQL commands; do we need\n> to add more?\n\nI have written so many requests for comments on psql, I don't know. This\nhandling of names was nowhere documented, so I couldn't have known it. On\nthe other hand, the current behaviour is documented and consistent with\nsomething at least. I totally see what you're saying and I'm going to try\nto address it. But there was noone who said anything about this so far.\n\n\n-- \nPeter Eisentraut Sernanders vaeg 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n\n", "msg_date": "Mon, 31 Jan 2000 16:29:07 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: Case-folding bogosity in new psql " }, { "msg_contents": "On Mon, 31 Jan 2000, The Hermit Hacker wrote:\n\n> \n> have to agree ... psql behaviour should be an extension of the backend's\n\nOkay. Then it shall be ...\n\n\n-- \nPeter Eisentraut Sernanders vaeg 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Mon, 31 Jan 2000 16:30:12 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Case-folding bogosity in new psql " }, { "msg_contents": "> \n> have to agree ... psql behaviour should be an extension of the backend's\n> ...\n\nAgreed.\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": "Mon, 31 Jan 2000 20:54:45 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Case-folding bogosity in new psql" }, { "msg_contents": "> I have written so many requests for comments on psql, I don't know. This\n> handling of names was nowhere documented, so I couldn't have known it. On\n> the other hand, the current behaviour is documented and consistent with\n> something at least. I totally see what you're saying and I'm going to try\n> to address it. But there was noone who said anything about this so far.\n\nI remember general requests for psql comments, but nothing specific. Of\ncourse, my memory may be wrong on this. I do remember some cases in\nother areas where you did ask for ideas, and we didn't really offer any.\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": "Mon, 31 Jan 2000 20:55:53 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Case-folding bogosity in new psql" }, { "msg_contents": "> I totally see what you're saying and I'm going to try\n> to address it. But there was noone who said anything\n> about this so far.\n\nOK, an overdue comment: the new psql is great (current and future\ndiscrepencies excepted of course ;)\n\nThanks for sticking with it Peter; we've already got a good\nfoundation, and as we stumble across these minor differences in\nbehavior it will get even closer to an ideal interface.\n\nMy current favorite feature: command history across psql sessions.\nWhen testing I can jump in and out of psql after rebuilding the\nbackend and can just uparrow to my last test command. Nice. And for\nthis case, I won't complain about a lack of backward compatibility :))\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Tue, 01 Feb 2000 02:37:35 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Case-folding bogosity in new psql" }, { "msg_contents": "At 02:37 AM 2/1/00 +0000, Thomas Lockhart wrote:\n\n>My current favorite feature: command history across psql sessions.\n\nMine...errors referencing file name and line number.\n\nInvaluable when porting over literally thousands of lines of sql\nfrom Oracle.\n\nWell, technically not \"invaluable\" since I managed to get an\nearlier version of this data model ported over 6.5.\n\nSo I guess we'll have to settle for \"damned valuable\".\n\nPsql's MUCH nicer than SQL*Plus, which doesn't seem to be even\ndimly aware that it's running on a modern unix system...\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Mon, 31 Jan 2000 18:43:03 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Case-folding bogosity in new psql" }, { "msg_contents": "\nPersonal opinion: I think we are coming across a little harder on Peter\nthen most of us are intending :( I think we're blowing a few\nmisconceptions a little out of proportion, which is just fueling things\nfurther ...\n\nPeter, I agree with Thomas about the work you are doing, I just tend to\ncome across 'strong' when I disagree with something ... \n\nOn Tue, 1 Feb 2000, Thomas Lockhart wrote:\n\n> > I totally see what you're saying and I'm going to try\n> > to address it. But there was noone who said anything\n> > about this so far.\n> \n> OK, an overdue comment: the new psql is great (current and future\n> discrepencies excepted of course ;)\n> \n> Thanks for sticking with it Peter; we've already got a good\n> foundation, and as we stumble across these minor differences in\n> behavior it will get even closer to an ideal interface.\n> \n> My current favorite feature: command history across psql sessions.\n> When testing I can jump in and out of psql after rebuilding the\n> backend and can just uparrow to my last test command. Nice. And for\n> this case, I won't complain about a lack of backward compatibility :))\n> \n> - Thomas\n> \n> -- \n> Thomas Lockhart\t\t\t\[email protected]\n> South Pasadena, California\n> \n> ************\n> \n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Mon, 31 Jan 2000 22:44:28 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Case-folding bogosity in new psql" }, { "msg_contents": "> At 02:37 AM 2/1/00 +0000, Thomas Lockhart wrote:\n> \n> >My current favorite feature: command history across psql sessions.\n> \n> Mine...errors referencing file name and line number.\n> \n> Invaluable when porting over literally thousands of lines of sql\n> from Oracle.\n> \n> Well, technically not \"invaluable\" since I managed to get an\n> earlier version of this data model ported over 6.5.\n> \n> So I guess we'll have to settle for \"damned valuable\".\n> \n> Psql's MUCH nicer than SQL*Plus, which doesn't seem to be even\n> dimly aware that it's running on a modern unix system...\n\nYes, many people love psql, and with Peter's additions, it is even\nbetter.\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": "Mon, 31 Jan 2000 22:12:55 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Case-folding bogosity in new psql" }, { "msg_contents": "Thomas Lockhart <[email protected]> writes:\n> OK, an overdue comment: the new psql is great (current and future\n> discrepencies excepted of course ;)\n\nAgreed. Peter, you've done a really nice job. We're just holding\nyou to the standards you've proven yourself capable of meeting ;-)\n\nSeriously, it seems like the culture on this list is mostly that\nyou can expect to hear about it when you break something, but if\nyou did good you will know it because no one complains...\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 31 Jan 2000 22:14:38 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: Case-folding bogosity in new psql " }, { "msg_contents": "On Mon, 31 Jan 2000, The Hermit Hacker wrote:\n> Personal opinion: I think we are coming across a little harder on Peter\n> then most of us are intending :( I think we're blowing a few\n> misconceptions a little out of proportion, which is just fueling things\n> further ...\n\nAnd the subject line doesn't help, IMHO. 'Bogosity' is pretty strong --\n'bugosity' might be better.....\n\nHowever, I understand the possessiveness one gets when one has put forth a\ngreat deal of effort into a major project such as this one.\n\n> Peter, I agree with Thomas about the work you are doing, I just tend to\n> come across 'strong' when I disagree with something ... \n\nThe 'e-mail effect' strikes again. Isn't it so much easier to be much harsher\nby e-mail than intended? I certainly have noticed that in my decade of being\nnet-connected (first via a slow as molasses uucp link to usenet, then via an\neven slower slip link....). However, this is quite tame compared to, say, the\nlinux-kernel mailing list..... But, then again, I do believe that the\ncollective net-age of the developers here is higher than on lk, even if the\nlist itself is possibly younger.\n\nI say 'kudos' to all the developers who have put in long mostly thankless hours\nworking on this project -- it _is_ worth it!!\n\n--\nLamar Owen\nWGCR Internet Radio\n1 Peter 4:11\n", "msg_date": "Mon, 31 Jan 2000 22:17:47 -0500", "msg_from": "Lamar Owen <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Case-folding bogosity in new psql" }, { "msg_contents": "On Mon, 31 Jan 2000, Lamar Owen wrote:\n\n> On Mon, 31 Jan 2000, The Hermit Hacker wrote:\n> > Personal opinion: I think we are coming across a little harder on Peter\n> > then most of us are intending :( I think we're blowing a few\n> > misconceptions a little out of proportion, which is just fueling things\n> > further ...\n> \n> And the subject line doesn't help, IMHO. 'Bogosity' is pretty strong --\n> 'bugosity' might be better.....\n\nAgreed here too ... I think what has been setting off a lot of the 'red\nflags' is a larger then normal number of 'buggy commits' ... stuff that\nhas to be done, but hasn't been as well thought out/discussed as it should\nhave been ...\n\nPeter is learning ... in some ways, we threw him into the 'commit arena'\nalot faster then we normally would have because of how active/busy he was\n... normally, we've waited longer to force the person to get used to how\nthings operate ... Peter has been getting \"on the job training\" here :)\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Mon, 31 Jan 2000 23:24:25 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Case-folding bogosity in new psql" }, { "msg_contents": "> Thomas Lockhart <[email protected]> writes:\n> > OK, an overdue comment: the new psql is great (current and future\n> > discrepencies excepted of course ;)\n> \n> Agreed. Peter, you've done a really nice job. We're just holding\n> you to the standards you've proven yourself capable of meeting ;-)\n> \n> Seriously, it seems like the culture on this list is mostly that\n> you can expect to hear about it when you break something, but if\n> you did good you will know it because no one complains...\n\nThat should not be the case. How hard is it to e-mail nice things? We\nneed to do better in this area.\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": "Mon, 31 Jan 2000 22:37:19 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Case-folding bogosity in new psql" }, { "msg_contents": "> Peter is learning ... in some ways, we threw him into the 'commit arena'\n> alot faster then we normally would have because of how active/busy he was\n> ... normally, we've waited longer to force the person to get used to how\n> things operate ... Peter has been getting \"on the job training\" here :)\n\nAgreed. Stick it out, Peter.\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": "Mon, 31 Jan 2000 22:38:02 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Case-folding bogosity in new psql" }, { "msg_contents": "At 10:14 PM 1/31/00 -0500, Tom Lane wrote:\n\n>Seriously, it seems like the culture on this list is mostly that\n>you can expect to hear about it when you break something, but if\n>you did good you will know it because no one complains...\n\nHas it ever been different with any group of talented people?\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Mon, 31 Jan 2000 20:59:43 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Case-folding bogosity in new psql " }, { "msg_contents": "At 11:24 PM 1/31/00 -0400, The Hermit Hacker wrote:\n>On Mon, 31 Jan 2000, Lamar Owen wrote:\n\n>Agreed here too ... I think what has been setting off a lot of the 'red\n>flags' is a larger then normal number of 'buggy commits' ... stuff that\n>has to be done, but hasn't been as well thought out/discussed as it should\n>have been ...\n\nI think a LOT of it had to do with its being committed to the 7.0\nsources, which at the time were supposedly going to be released on\nFeb 1 (tomorrow). \n\nIf Peter had waited until 7.0 beta then dumped such changes into a new,\n7.1 tree with 7.1 some months off I doubt there would've been anything\nlike the reaction he saw.\n\nDidn't we all agree recently that this had to do mostly with Peter's\nmisunderstanding of how stable a beta release should be in this project?\n\n(as opposed to other projects which run with a \"release early, release\noften\" pardigm)?\n\nIf so, I think we're done with this topic and should be willing to just\nlet it drop.\n\n\n\n- Don Baccus, Portland OR <[email protected]>\n Nature photos, on-line guides, Pacific Northwest\n Rare Bird Alert Service and other goodies at\n http://donb.photo.net.\n", "msg_date": "Mon, 31 Jan 2000 21:09:28 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Case-folding bogosity in new psql" } ]
[ { "msg_contents": "Hi all,\n\nCurrently btbuild() rejects duplicate index in comparetup_index().\nBut there are some cases that index tuples for already deleted\nheap tuples should be made. comparetup_index() doesn't work\nwell in such cases because comparetup_index() couldn't ignore\ndeleted tuples. In addition I could find no other place to check\nindex uniqueness in tuplesort.c .\nSeems we have to give up the uniqueness check in comparetup_\nindex() and have to check it in _bt_buildadd().\nWe would be able to take the visibility of heap tuples into acount\nin _bt_buildadd(). \n\nComments ?\n\nRegards.\n\nHiroshi Inoue\[email protected]\n", "msg_date": "Mon, 31 Jan 2000 23:46:09 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": true, "msg_subject": "Duplicate index check in btbuild" }, { "msg_contents": "\"Hiroshi Inoue\" <[email protected]> writes:\n> In addition I could find no other place to check\n> index uniqueness in tuplesort.c .\n> Seems we have to give up the uniqueness check in comparetup_\n> index() and have to check it in _bt_buildadd().\n\nChecking index uniqueness in tuplesort is pretty much of a hack,\nalthough kind of cool since it doesn't take any extra comparisons\nto do it there. But if we're doing the wrong thing then it has\nto be removed.\n\nI'm a little unclear on *why* it's wrong though. Don't we grab an\nexclusive lock on a table while building an index for it? (If not,\nshouldn't we be doing so?) I don't see how there can be tuples of\nuncertain commit state that need to be included in the index.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 31 Jan 2000 11:00:57 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Duplicate index check in btbuild " }, { "msg_contents": "> -----Original Message-----\n> From: Tom Lane [mailto:[email protected]]\n> \n> \"Hiroshi Inoue\" <[email protected]> writes:\n> > In addition I could find no other place to check\n> > index uniqueness in tuplesort.c .\n> > Seems we have to give up the uniqueness check in comparetup_\n> > index() and have to check it in _bt_buildadd().\n> \n> Checking index uniqueness in tuplesort is pretty much of a hack,\n> although kind of cool since it doesn't take any extra comparisons\n> to do it there. But if we're doing the wrong thing then it has\n> to be removed.\n> \n> I'm a little unclear on *why* it's wrong though. Don't we grab an\n> exclusive lock on a table while building an index for it? (If not,\n> shouldn't we be doing so?) I don't see how there can be tuples of\n> uncertain commit state that need to be included in the index.\n>\n\nIt's what you pointed out in [[HACKERS] Reproducible vacuum complaint!]\n2 months ago.\n\n> Oh, I think I see --- you mean that CREATE INDEX needs to make index\n> entries for tuples that are committed dead but might still be visible\n> to some running transaction somewhere. Yes, that seems to fit what\n> I was seeing. VACUUM always complained that there were too few\n> index entries, never too many.\n\n> It looks like btbuild() only indexes tuples that satisfy SnapshotNow,\n> so this is definitely a potential problem for btree indexes. The other\n> index types are likely broken in the same way...\n>\n> Comments anyone? What time qual should btbuild and friends be using,\n> if not that?\n\nSame phenomenon was found in Marc's recent posting [HACKERS] [6.5.2]\npotentially major bug?]. After changing SnapshotNow -> SnapshotAny I tried\nand found that comparetup_index() rejects duplicate index tuples.\n\nRegards.\n\nHiroshi Inoue\[email protected] \n\n\n\n", "msg_date": "Tue, 1 Feb 2000 08:55:25 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": true, "msg_subject": "RE: [HACKERS] Duplicate index check in btbuild " } ]
[ { "msg_contents": "\nPCLabs is doing a survey of RDBMSs, and has requested that we answer the\nfollowing survey. As one file, its over 250 lines long, so I'm breaking\ninto multiple parts, to make the 'thread' smaller. Some of this is\nobvious, but would rather make sure then risk feeding mis-information :)\n\nIn this one, they talk about 'graphical tools', so I'm CC'ng\[email protected], in the hopes that both\nConstantin(pgaccess) and Dave (PgAdmin) will jump into the thread and\nanswer those questions...\n\n==========\nAdministration\n- graphical tools for\n - database administration\n - installing the database server\n - creating and managing databases\n - creating and managing disk devices\n - creating and managing users\n - creating and managing indicies\n - creating and managing stored procedures\n - backup and restore operations\n - creating and managing replication links\n - Web publishing\n - database diagramming tools\n - viewing and entering data into database tables\n - submitting SQL commands and viewing results\n - send a message to all logged-in database users\n - database perforformance tuning\n - configuring server engine options\n - viewing the SQL commands currently executing\n - detecting resource-intensive queries\n - killing selected queries \n - graphing overall server engine statistics\n - single statement graphical execution plan display\n - SQL rewrite suggestions for a single SQL statement\n - index suggestions for a single SQL statement\n - index suggestions for overall server (based on actual usage)\n - pre-calculation (summary table) suggestions (based on actual usage)\n - baselining and then tracking server performance over time\n- administration tools can be run from a 4.x Web browser\n- data file import and export tools\n - for ASCII text files\n - for native format database data files\n - database data files can be directly moved from one database to another\n\n- scripting support\n - tools have command-line access\n - can reverse-engineer database objects to a SQL script\n - can reverse-engineer database data to a SQL script\n - languages supplied for command scripting\n- security\n - security audit log of administrator and user activity\n - can set security by user or by group\n - can set password qualification rules (minimum length, non-repeatabilitity)\n - can set permissions on a table or view\n - can set permissions on a particular column\n - can set permissions on a particular row\n- job scheduler\n - by time\n - by event\n===========================\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Mon, 31 Jan 2000 17:34:42 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "PClabs Survey, Part I: Administration" }, { "msg_contents": "The Hermit Hacker wrote:\n> \n\nAlso, marked with * the options available in PgAccess\n\n> Administration\n> - graphical tools for\n> - database administration\n> - installing the database server\n> - creating and managing databases\n> - creating and managing disk devices\n>* - creating and managing users\n>* - creating and managing indicies\n>* - creating and managing stored procedures\n>* - backup and restore operations\n> - creating and managing replication links\n> - Web publishing\n> - database diagramming tools\n> - viewing and entering data into database tables\n> - submitting SQL commands and viewing results\n> - send a message to all logged-in database users\n> - database perforformance tuning\n> - configuring server engine options\n>* - viewing the SQL commands currently executing\n> - detecting resource-intensive queries\n> - killing selected queries\n> - graphing overall server engine statistics\n> - single statement graphical execution plan display\n> - SQL rewrite suggestions for a single SQL statement\n> - index suggestions for a single SQL statement\n> - index suggestions for overall server (based on actual usage)\n> - pre-calculation (summary table) suggestions (based on actual usage)\n> - baselining and then tracking server performance over time\n\nIn PgAccess there are also a couple of goodies that are not listed above\nas:\n\n- visual query builder\n- schema designer\n\nConstantin Teodorescu\nFLEX Consulting Braila, ROMANIA\n", "msg_date": "Wed, 02 Feb 2000 11:37:33 +0200", "msg_from": "Constantin Teodorescu <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [INTERFACES] PClabs Survey, Part I: Administration" } ]
[ { "msg_contents": "\nServer Engine\n- units of execution (granularity of multi-tasking engine)\n- computes statistics while building index \n- can run operations without logging\n- can undo database structure modification (Data Definition Layer) commands\n- can undo committed transactions if required\n- locking\n - levels of locking granulatity available (options are row, page, table,etc.)\n - default locking level for queries\n - readers of data can block writers of data (at default locking level)\n - writers of data can block readers of data (at default locking level)\n - can use different types of locks on index and data pages in one query\n - can escalate many fine-grained locks to one coarser lock \n- can use multiple CPUs\n - within a query (intra-query parallelism)\n - on database load\n - on database index\n - on database backup and restore\n - on insert ... select ...\n - on update\n - on delete\n- join and index selection\n - joins\n - nested loop join\n - hash join\n - merge join\n - semi-join for star queries\n - list any others:\n - indicies\n - B-tree\n - clustered (data pages ordered by primary key value)\n - allow secondary indices on a clustered index table\n - bitmap\n - hash\n - list any others:\n - can scan indices in reverse\n- optimizer\n - cost-based\n - rule-based\n - can use multiple indices in a single query\n - can use just the index to satisfy the query (covered indices)\n - automatically maintains necessary optimizer statistics\n- cache and memory management\n - dynamic SQL statements parameterized and cached for later use\n - execution plans can be compiled once and then shared among all users\n - can define dedicated caches for particular tables or tablespaces\n - can mark tables as memory-resident\n - dynamic memory resource sharing (e.g. cache can grow or shrink)\n- scalability\n - number of CPUs supported per server\n - multi-machine clustering for performance\n - clustered servers require shared disk subsystem\n - clustered machines can run different operating systems\n- availability\n - failover server option\n - primary and standby servers require shared disk subsystem or only a shared network connection\n - primary and standby servers can run different operating systems\n - failover server can be actively used (active/active configuration)\n - client connection libraries support automatic failover to standby server\n - ability to guarantee service (QoS)\n - query resource consumption governor\n - can assign priorities to different groups of users\n- backup and restore\n - restore to a particular point-in-time (partial restore)\n - incremental backup\n- recovery\n - can control frequency of checkpointing by number of operations or estimated recovery time (list which)\n- storage engine\n - default disk data block size\n - users can choose disk block size (list options)\n - allow use of unformatted disks for extra speed\n - parallel disk operations\n - automatic disk read-ahead\n - multi-task (asynchronous) disk operations\n - data and log devices can grow when needed\n- Year 2000 certified\n- Euro currency support\n\n\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Mon, 31 Jan 2000 17:36:00 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "PCLabs Survey, Part II: Server Engine" } ]
[ { "msg_contents": "\nMultimedia data types \n- binary large object (BLOB)\n- Unicode text objects\n- HTML\n- sound\n- video\n- images\n- text documents\n- time series\n- geospatial\n- can leave managed objects in their original files outside the database\n\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Mon, 31 Jan 2000 17:36:24 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "PCLabs Survey, Part III: Multimedia Data Types" } ]
[ { "msg_contents": "\nInteroperability\n- included gateways to other databases:\n - support reads\n - support writes\n - support distributed query optimization \n - support replication\n - support data loading (for warehousing purposes)\n- single login with\n - Windows NT\n - LDAP\n - OSF DCE\n - Sun NIS+\n - /etc/passwd file\n\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Mon, 31 Jan 2000 17:36:49 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "PCLabs Survey, Part IV: Interoperability" } ]
[ { "msg_contents": "\nProgrammability\n- stored procedures\n- can call out to external routines (external stored procedures)\n- internal programming language(s):\n - flow control and loops\n - user-defined (compound) structures\n - recursion \n - exceptions\n - can return error messages to clients\n - object-oriented\n- debugger supplied for stored procedure language(s)\n- triggers\n - triggers can cascade (nested triggers)\n - multiple triggers per action per row\n- standard database client APIs supported in addition to native API (e.g. ODBC, JDBC, OLE DB, etc.)\n- revision of ODBC driver supplied\n- revision of JDBC driver supplied\n- precompilers supplied for which languages:\n- cursors can scroll backwards as well as forwards \n- message queuing services\n\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Mon, 31 Jan 2000 17:37:28 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "PCLabs Survey, Part V: Programmability" }, { "msg_contents": "On Mon, Jan 31, 2000 at 05:37:28PM -0400, The Hermit Hacker wrote:\n> - precompilers supplied for which languages:\n\nAre there more than C?\n\nMichael\n\n-- \nMichael Meskes | Go SF 49ers!\nTh.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire!\nTel.: (+49) 2431/72651 | Use Debian GNU/Linux!\nEmail: [email protected] | Use PostgreSQL!\n", "msg_date": "Tue, 1 Feb 2000 17:07:05 +0100", "msg_from": "Michael Meskes <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] PCLabs Survey, Part V: Programmability" } ]
[ { "msg_contents": "\nQuery Language and Database Design\n- ANSI/ISO standards compliance\n - SQL standard supplied (e.g. SQL-89, SQL-92 entry level, any SQL3 support, etc.)\n - SQL-92 catalog schema views\n - ANSI isolation levels supported\n- left, right and full outer joins\n- declarative referential integrity\n - declarative cascade delete\n - declarative cascade update\n- ability to modify existing designs\n - rename table\n - modify data type of existing column\n - add/drop column in existing table\n - add/drop constraint in existing table \n- more than one unique constraint per table\n- object-oriented design support (abstract types, inheritance)\n- object references (REFs)\n- computed columns \n- can build an index on a computed column\n- computed tables\n\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Mon, 31 Jan 2000 17:38:56 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "PCLabs Survey, Part VI: Query Language and Database Design" } ]
[ { "msg_contents": "\n- can run on a laptop running Windows 95 with 32MB of RAM\n- replication \n - trigger approach or log-sniffer approach?\n - one-way (push) replication\n - bi-directional (synchronize) replication\n- remote administration\n - pager or e-mail notification of errors on remote server\n - administration tools can manage a remote database\n - administration tools can send jobs to groups of servers at once\n - can delegate administrative tasks (partial access to administration tools and jobs)\n- can run stored procedures on remote system\n- distributed transactions using two-phase commit\n - with other servers running this database server software\n - with other servers running database server software from other companies (e.g. XA support)\n\n\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Mon, 31 Jan 2000 17:39:33 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "PCLabs Survey, Part VII: Embedded Database / Branch Office Support" }, { "msg_contents": "On Mon, Jan 31, 2000 at 05:39:33PM -0400, The Hermit Hacker wrote:\n> \n> - can run on a laptop running Windows 95 with 32MB of RAM\n\nWhy just Win95? How about a real operating system. :-)\n\nMichael\n-- \nMichael Meskes | Go SF 49ers!\nTh.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire!\nTel.: (+49) 2431/72651 | Use Debian GNU/Linux!\nEmail: [email protected] | Use PostgreSQL!\n", "msg_date": "Tue, 1 Feb 2000 17:08:29 +0100", "msg_from": "Michael Meskes <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] PCLabs Survey,\n\tPart VII: Embedded Database / Branch Office Support" }, { "msg_contents": "Michael Meskes wrote:\n> \n> On Mon, Jan 31, 2000 at 05:39:33PM -0400, The Hermit Hacker wrote:\n> >\n> > - can run on a laptop running Windows 95 with 32MB of RAM\n> \n> Why just Win95? How about a real operating system. :-)\n\nIMHO, answer should be: Can run on laptop with 8m of RAM ;-))\n(i.e just skip win95)\n\nI have such experience, OS - FreeBSD 2.2.6\n", "msg_date": "Wed, 02 Feb 2000 00:20:57 +0300", "msg_from": "Dmitry Samersoff <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] PCLabs Survey,\n\tPart VII: Embedded Database / Branch Office Support" }, { "msg_contents": "On Wed, Feb 02, 2000 at 12:20:57AM +0300, Dmitry Samersoff wrote:\n> IMHO, answer should be: Can run on laptop with 8m of RAM ;-))\n> (i.e just skip win95)\n\nI did the same (okay it wasn't a laptop) with my old 486DX40 with 8MB until\nthe motherboard gave up. It even ran well when X was up and running. :-)\n\nMichael\n-- \nMichael Meskes | Go SF 49ers!\nTh.-Heuss-Str. 61, D-41812 Erkelenz | Go Rhein Fire!\nTel.: (+49) 2431/72651 | Use Debian GNU/Linux!\nEmail: [email protected] | Use PostgreSQL!\n", "msg_date": "Wed, 2 Feb 2000 08:42:26 +0100", "msg_from": "Michael Meskes <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] PCLabs Survey,\n\tPart VII: Embedded Database / Branch Office Support" } ]
[ { "msg_contents": "\nData Warehousing and Reporting\n- availability\n - fast loader (direct to disk pages) included\n - loader provides data transformation and cleansing tools \n - can load and index simultaneously\n - incremental load possible\n - can delay constraint checking during a bulk load\n - can continue to insert data while index is being built\n- precalculation of summary information\n - included OLAP server\n - summary tables (a.k.a. materialized views)\n - summary tables understand dimensional hierarchies (e.g. time)\n - automatic refresh on data change\n - scheduled refresh\n- can use data sampling to speed processing\n- Top N query\n- Top % query\n- RANK function\n- CUBE and ROLLUP functions\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n", "msg_date": "Mon, 31 Jan 2000 17:40:09 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "PCLabs Survey, Part VIII: Data Warehousing and Reporting" } ]
[ { "msg_contents": "\nMissed part of this one in my cut-n-paste :(\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n=================\n\nPCLabs is doing a survey of RDBMSs, and has requested that we answer the\nfollowing survey. As one file, its over 250 lines long, so I'm breaking\ninto multiple parts, to make the 'thread' smaller. Some of this is\nobvious, but would rather make sure then risk feeding mis-information :)\n\nIn this one, they talk about 'graphical tools', so I'm CC'ng\[email protected], in the hopes that both\nConstantin(pgaccess) and Dave (PgAdmin) will jump into the thread and\nanswer those questions...\n\n==========\nAdministration\n- graphical tools for\n - database administration\n - installing the database server\n - creating and managing databases\n - creating and managing disk devices\n - creating and managing users\n - creating and managing indicies\n - creating and managing stored procedures\n - backup and restore operations\n - creating and managing replication links\n - Web publishing\n - database diagramming tools\n - viewing and entering data into database tables\n - submitting SQL commands and viewing results\n - send a message to all logged-in database users\n - database perforformance tuning\n - configuring server engine options\n - viewing the SQL commands currently executing\n - detecting resource-intensive queries\n - killing selected queries \n - graphing overall server engine statistics\n - single statement graphical execution plan display\n - SQL rewrite suggestions for a single SQL statement\n - index suggestions for a single SQL statement\n - index suggestions for overall server (based on actual usage)\n - pre-calculation (summary table) suggestions (based on actual usage)\n - baselining and then tracking server performance over time\n- administration tools can be run from a 4.x Web browser\n- data file import and export tools\n - for ASCII text files\n - for native format database data files\n - database data files can be directly moved from one database to another\n\n- scripting support\n - tools have command-line access\n - can reverse-engineer database objects to a SQL script\n - can reverse-engineer database data to a SQL script\n - languages supplied for command scripting\n- security\n - security audit log of administrator and user activity\n - can set security by user or by group\n - can set password qualification rules (minimum length, non-repeatabilitity)\n - can set permissions on a table or view\n - can set permissions on a particular column\n - can set permissions on a particular row\n- job scheduler\n - by time\n - by event\n- Web publishing\n - static Web publishing (one time)\n - static Web publishing (scheduled)\n - dynamic Web publishing\n - Web users can modify query\n- documentation\n - supply online versions of manuals\n - manuals globally searchable\n\n===========================\n\nMarc G. Fournier ICQ#7615664 IRC Nick: Scrappy\nSystems Administrator @ hub.org \nprimary: [email protected] secondary: scrappy@{freebsd|postgresql}.org \n\n\n", "msg_date": "Mon, 31 Jan 2000 17:41:35 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "PClabs Survey, Part I: Administration (resend)" } ]