threads
listlengths
1
2.99k
[ { "msg_contents": "\n> > \n> > OK. May be I miss something.\n> \n> I don't think so. Not with respect to Oracle. Andreas knows that\n> Oracle implicitly commits your running transaction -- and starts\n> a new one whenever a DDL statement is encountered. A large\n> discussion about this arose about 4 months ago...I can't speak\n> for DB2.\n\nYes, sorry, I think we should leave out the ddl statements here.\nThe real essential part is the dml statement block in this example.\nSince the create table was the first statement in the block,\nthe only difference between the other db's is wheather the table\nexists after a rollback. They will all have the table with one row in \nit after a commit.\n\nAndreas\n", "msg_date": "Thu, 24 Feb 2000 10:08:43 +0100", "msg_from": "Zeugswetter Andreas SB <[email protected]>", "msg_from_op": true, "msg_subject": "AW: AW: [HACKERS] TRANSACTIONS" } ]
[ { "msg_contents": "> ========================= example =========================\n> \n> $dbh->{AutoCommit} = 0;\n> $dbh->do(\"CREATE TABLE tmp (a int unique,b int)\");\n> while (<>){\n> if (/([0-9]+) ([0-9]+)/) {\n> \t$rtv = $dbh->do(\"INSERT INTO tmp VALUES ($1,$2)\");\n> \tif ($rtv) {$dbh->do(\"UPDATE tmp SET b=$2 where a=$1\")};\n> }\n> }\n> $dbh->commit;\n> $dbh->disconnect;\n> \n> ========================= end ============================\n\nThis is a very good example, and is unfortunately currently not possible in \nPostgreSQL. But I am sure Vadim is on his way to fix that :-)\n\nAndreas\n", "msg_date": "Thu, 24 Feb 2000 10:18:58 +0100", "msg_from": "Zeugswetter Andreas SB <[email protected]>", "msg_from_op": true, "msg_subject": "AW: [GENERAL] Re: [HACKERS] TRANSACTIONS" }, { "msg_contents": "Here is my example:\n\npackage Apache::Hits;\n\nuse strict;\nuse Apache::Constants qw(:common);\n\nmy ($sth_lock, $sth_upd, $sth_ins );\n\n\nsub handler {\n my $r = shift;\n if ( $r->args() =~ /msg_id=(\\d+)/o ) {\n $HTML::Mason::Commands::dbs ||= My::DB->new(1);\n my $dbh = $HTML::Mason::Commands::dbs->{dbh};\n $sth_lock ||= $dbh->prepare(\"LOCK TABLE hits IN SHARE ROW EXCLUSIVE MODE\");\n $sth_upd ||= $dbh->prepare(\"UPDATE hits SET count=count+1,last_access=now() WHERE msg_id=?\");\n $sth_ins ||= $dbh->prepare(\"INSERT INTO hits (msg_id,count) VALUES (?, 1)\");\n $dbh->{AutoCommit} = 0;\n my $success = 1;\n $success &&= $sth_lock->execute();\n $success &&= $sth_upd->execute( $1 );\n $success &&= $sth_ins->execute( $1 ) if ( $success eq '0E0');\n my $result = ($success ? $dbh->commit : $dbh->rollback);\n unless ( $result ) {\n $r->log_error(\"Unable to process transaction: \". $dbh->errstr .\"\\n\");\n }\n }\n return OK;\n}\n\n1;\n__END__\n\n\nOn Thu, 24 Feb 2000, Zeugswetter Andreas SB wrote:\n\n> Date: Thu, 24 Feb 2000 10:18:58 +0100\n> From: Zeugswetter Andreas SB <[email protected]>\n> To: \"'[email protected]'\"\n <[email protected]>\n> Cc: \"'[email protected]'\" <[email protected]>\n> Subject: AW: [GENERAL] Re: [HACKERS] TRANSACTIONS\n> \n> > ========================= example =========================\n> > \n> > $dbh->{AutoCommit} = 0;\n> > $dbh->do(\"CREATE TABLE tmp (a int unique,b int)\");\n> > while (<>){\n> > if (/([0-9]+) ([0-9]+)/) {\n> > \t$rtv = $dbh->do(\"INSERT INTO tmp VALUES ($1,$2)\");\n> > \tif ($rtv) {$dbh->do(\"UPDATE tmp SET b=$2 where a=$1\")};\n> > }\n> > }\n> > $dbh->commit;\n> > $dbh->disconnect;\n> > \n> > ========================= end ============================\n> \n> This is a very good example, and is unfortunately currently not possible in \n> PostgreSQL. But I am sure Vadim is on his way to fix that :-)\n> \n> Andreas\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": "Thu, 24 Feb 2000 13:46:38 +0300 (GMT)", "msg_from": "Oleg Bartunov <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: [GENERAL] Re: [HACKERS] TRANSACTIONS" }, { "msg_contents": ">Here is my example:\n>\n>package Apache::Hits;\n>\n>use strict;\n>use Apache::Constants qw(:common);\n>\n>my ($sth_lock, $sth_upd, $sth_ins );\n>\n>\n>sub handler {\n> my $r = shift;\n> if ( $r->args() =~ /msg_id=(\\d+)/o ) {\n> $HTML::Mason::Commands::dbs ||= My::DB->new(1);\n> my $dbh = $HTML::Mason::Commands::dbs->{dbh};\n> $sth_lock ||= $dbh->prepare(\"LOCK TABLE hits IN SHARE ROW EXCLUSIVE MODE\");\n> $sth_upd ||= $dbh->prepare(\"UPDATE hits SET count=count+1,last_access=now() WHERE msg_id=?\");\n> $sth_ins ||= $dbh->prepare(\"INSERT INTO hits (msg_id,count) VALUES (?, 1)\");\n> $dbh->{AutoCommit} = 0;\n> my $success = 1;\n> $success &&= $sth_lock->execute();\n> $success &&= $sth_upd->execute( $1 );\n> $success &&= $sth_ins->execute( $1 ) if ( $success eq '0E0');\n> my $result = ($success ? $dbh->commit : $dbh->rollback);\n> unless ( $result ) {\n> $r->log_error(\"Unable to process transaction: \". $dbh->errstr .\"\\n\");\n> }\n> }\n> return OK;\n>}\n>\n>1;\n>__END__\n\nMaybe I'm missing something - I don't use the Apache module, nor the\nmason module, so it's difficult for me to decode this. But I looks to\nme like this commits or rolls back one statement at a time. \n\nWhat I want to be able to do is run a multi-statement transaction, and\nfor each statement in the transaction try to fix it if an error is\ngenerated. If I cannot fix it, I want to roll back all of the\nprevious statements in the transaction. If I can fix it, I want to\nclear the error status and continue on to the next statement in the\ntransaction.\n\nDoes your counter example do this in some way that I am not seeing?\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": "Thu, 24 Feb 2000 10:23:23 -0500", "msg_from": "Karl DeBisschop <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: [GENERAL] Re: [HACKERS] TRANSACTIONS" } ]
[ { "msg_contents": "Hi,\n\n thank You very much, You helped me :-)\n\n\n Well, I will use function date() and not date_trunc() in my views.\n\n I tryed change type of \"bytes\" column from int8 to int4. Range 0 .. +2\n147 483 647 will suffice here. But I must retype this type to int8 in sum\nfunction because overflow can occur:\n\ncollector=> create table flow_sums (\ncollector-> primary_collector varchar(50) not null,\ncollector-> start datetime not null,\ncollector-> end_period datetime not null,\ncollector-> dead_time_rel float4 not null,\ncollector-> src_name varchar(50) not null,\ncollector-> dst_name varchar(50) not null,\ncollector-> bytes int4 not null,\ncollector-> packets int4 not null);\nCREATE\ncollector=> insert into\nflow_sums(primary_collector,start,end_period,dead_time_rel,src_name,dst_name\n,bytes,packets)\ncollector-> select\nprimary_collector,start,end_period,dead_time_rel,src_name,dst_name,bytes,pac\nkets\ncollector-> from flow_sums_200002;\nINSERT 0 3198588\ncollector=> create unique index flow_sums_pk on\nflow_sums(primary_collector,start, src_name, dst_name);\nCREATE\ncollector=>\ncollector=> select sum(bytes) from flow_sums;\n sum\n-----------\n-1712976144\n(1 row)\ncollector=> select sum(int8(bytes)) from flow_sums;\n sum\n------------\n603877412592\n(1 row)\n\ncollector=>\n\n So my views will retype attributes in sums to int8 and they will use\nfunction date to round datetime attribute.\n\n Thank You very much and please forward this mail to\[email protected] becouse the robot will bounce my CC.\n\n Thanks, V. Benes\n\n\n-----Pďż˝vodnďż˝ zprďż˝va-----\nOd: Tom Lane <[email protected]>\nKomu: Vladimďż˝r Beneďż˝ <[email protected]>\nKopie: [email protected] <[email protected]>;\nMďż˝hlpachr Michal <[email protected]>\nDatum: 24. ďż˝nora 2000 6:46\nPďż˝edmďż˝t: Re: [HACKERS] Out of memory problem (forwarded bug report)\n\n\n>Vladimir,\n> Thanks for the details. I think you are undoubtedly running into\n>expression evaluation memory leaks. Basically, any expression that\n>yields a non-pass-by-value data type consumes memory that is not\n>reclaimed until end of statement --- so when you process a few million\n>rows, that memory starts to add up. (Yes, I realize this is a horrible\n>misfeature. It's on our TO-DO list to fix it, but it probably won't\n>happen until 7.1 or 7.2.) In the meantime the best I can offer you\n>is workarounds.\n>\n> I think the major problems here are coming from the\n>\"date_trunc('day',start)\" calculation (because its datetime result is\n>pass-by-reference) and to a lesser extent from the sum(bytes)\n>calculation (because int8 is pass-by-reference). You could easily\n>replace \"date_trunc('day',start)\" with \"date(start)\"; since date is\n>a pass-by-value type, that won't leak memory, and it should give\n>equivalent results. The int8 sum is not quite so easy to fix.\n>I assume you can't get away with switching to int4 --- probably\n>your sum would overflow an int4? It may be that just fixing the\n>inefficient date_trunc calc will reduce your memory requirements\n>enough to get by. If not, the only good news I have is that release\n>7.0 does fix the memory-leak problem for internal calculations of\n>aggregate functions like sum(). You can get the first beta release\n>for 7.0 now.\n>\n> regards, tom lane\n>\n>\n>\"=?iso-8859-2?B?VmxhZGlt7XIgQmVuZbk=?=\" <[email protected]> writes:\n>> -----Pďż˝vodnďż˝ zprďż˝va-----\n>> Od: Tom Lane <[email protected]>\n>> Komu: Oliver Elphick <[email protected]>\n>> Kopie: [email protected] <[email protected]>;\n>> [email protected] <[email protected]>\n>> Datum: 22. ďż˝nora 2000 18:06\n>> Pďż˝edmďż˝t: Re: [HACKERS] Out of memory problem (forwarded bug report)\n>\n>\n>>> \"Oliver Elphick\" <[email protected]> writes:\n>>>> Can someone advise, please, how to deal with this problem in 6.5.3?\n>>>\n>\n>>> My guess is that the cause is memory leaks during expression evaluation;\n>>> but without seeing the complete view definitions and underlying table\n>>> definitions, it's impossible to know what processing is being invoked\n>>> by this query...\n>>>\n>>> regards, tom lane\n>\n>\n>\n>> Well, I will append views and underlying table definition:\n>\n>> 1) Once again - failure query:\n>> select comm_type,name,tot_bytes,tot_packets\n>> from flow_sums_days_send_200002_view\n>> where day='2000-02-21' and name not like '@%'\n>> union all\n>> select comm_type,name,tot_bytes,tot_packets\n>> from flow_sums_days_receive_200002_view\n>> where day='2000-02-21' and name not like '@%'\n>\n>> 2) views definition:\n>> create view flow_sums_days_send_200002_view as\n>> select\n>> 'send'::varchar as comm_type, date_trunc('day',start) as day,\n>> src_name as name, sum(bytes) as tot_bytes, sum(packets) as tot_packets\n>> from flow_sums_200002\n>> group by day, src_name\n>\n>> create view flow_sums_days_receive_200002_view as\n>> select\n>> 'receive'::varchar as comm_type, date_trunc('day',start) as day,\n>> dst_name as name, sum(bytes) as tot_bytes, sum(packets) as tot_packets\n>> from flow_sums_200002\n>> group by day, dst_name\n>\n>\n>> I wanted create only one usefull view:\n>\n>> create view flow_sums_days_200002_view as\n>> select\n>> 'send'::varchar as comm_type, date_trunc('day',start) as day,\n>> src_name as name, sum(bytes) as tot_bytes, sum(packets) as tot_packets\n>> from flow_sums_200002\n>> group by day, src_name\n>> UNION ALL\n>> select\n>> 'receive'::varchar as comm_type, date_trunc('day',start) as day,\n>> dst_name as name, sum(bytes) as tot_bytes, sum(packets) as tot_packets\n>> from flow_sums_200002\n>> group by day, dst_name\n>\n>> ...but Postgres cann't use clause UNION ALL at view definition. So I\ncreated\n>> two views mentioned above and I wanted use this ones with UNION ALL\nclause\n>> only.\n>\n>> 3) underlaying table definition:\n>> create table flow_sums_200002 (\n>> primary_collector varchar(50) not null,\n>> start datetime not null,\n>> end_period datetime not null,\n>> dead_time_rel float4 not null,\n>> src_name varchar(50) not null,\n>> dst_name varchar(50) not null,\n>> bytes int8 not null,\n>> packets int4 not null\n>> )\n>\n>> Today this table has about 3 000 000 rows and the select command\n>> mentioned above returns 190 + 255 rows.\n>\n>\n>> Now I don't use clause \"UNION ALL\" and the program executes two\nqueryes\n>> and then adds both result to new result. I reduced time increment of\nnumber\n>> rows to flow_sums_200002 table (three times less). This table contains\ndata\n>> of February 2000 and the program will create table flow_sums_200003 with\n>> relevant views next month.\n>> Well, now this solution solve my problem but always depends on number\nof\n>> rows - I only moved limit of rows count.\n>\n>\n>> Thank You, V. Benes\n>\n>> P.S.: I append part of top on my system while the query is running:\n>\n>> CPU states: 98.6% user, 1.3% system, 0.0% nice, 0.0% idle\n>> Mem: 127256K av, 124316K used, 2940K free, 29812K shrd, 2620K buff\n>> Swap: 128516K av, 51036K used, 77480K free 7560K\ncached\n>\n>> PID USER PRI NI SIZE RSS SHARE STAT LIB %CPU %MEM TIME\nCOMMAND\n>> 2942 postgres 20 0 141M 99M 17348 R 0 99.0 80.4 1:22\npostmaster\n>\n>> => postmaster later took 80 - 95% of memory, free memory decressed to 2\nMB,\n>> CPU was overloaded (0% idle and 99% by user process of postmaster). Have\nYou\n>> ever seen something similar :-) ?\n\n", "msg_date": "Thu, 24 Feb 2000 13:06:08 +0100", "msg_from": "\"=?iso-8859-2?B?VmxhZGlt7XIgQmVuZbk=?=\" <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Out of memory problem (forwarded bug report) " }, { "msg_contents": "\"=?iso-8859-2?B?VmxhZGlt7XIgQmVuZbk=?=\" <[email protected]> writes:\n> collector=> select sum(int8(bytes)) from flow_sums;\n\nThat will not help, because you're still invoking the int8 flavor of\nsum(). Might as well leave it alone and update to 7.0 beta.\n\n\t\t\tregards, tom lane\n", "msg_date": "Thu, 24 Feb 2000 10:45:01 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Out of memory problem (forwarded bug report) " } ]
[ { "msg_contents": "Hi all\n\nsearching for good Hacker Pages and a Net called Freak net. I�m not sure\nif it really exists!\n\nBye\n", "msg_date": "Thu, 24 Feb 2000 14:27:42 +0100", "msg_from": "Sebastian Fack <[email protected]>", "msg_from_op": true, "msg_subject": "Hacker Pages Fnet" } ]
[ { "msg_contents": "At 10:04 AM 2/24/00 +0100, Zeugswetter Andreas SB wrote:\n>\n>> > In this sense a commit is not partial. The commit should commit\n>> > all statements that were not in error. \n>> \n>> That interpretation eliminates an absolutely essential capability\n>> (all-or-none behavior) in favor of what strikes me as a very minor\n>> programming shortcut.\n>\n>The all-or-none behavior is what you get if you simply do a rollback\n>on any error or warning. I don't see a special programming difficulty here.\n\nUnfortunately (for the current implementation of Postgres) I've come\nto the conclusion that this is indeed what standard SQL specifies.\n\nIt is up to the application or user to rollback the entire transaction\nif that's the behavior that's desired.\n\nOf course the whole concept of an explicit \"begin\" is non-standard,\ntoo. In SQL you're always in a transaction, commit and rollback\nterminate transactions and start a new one. Oracle, at least, provides\na \"autocommit\" mode (which works like Postgres when you're outside a\nbegin/commit block). \n\nI suspect that most applications don't notice the difference. Most\nwill catch errors and roll back the current transaction, because that's\nthe logical thing to do in most cases.\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, 24 Feb 2000 06:19:20 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": true, "msg_subject": "Re: AW: AW: [HACKERS] TRANSACTIONS " }, { "msg_contents": "Don Baccus <[email protected]> writes:\n> It is up to the application or user to rollback the entire transaction\n> if that's the behavior that's desired.\n\n> Of course the whole concept of an explicit \"begin\" is non-standard,\n> too. In SQL you're always in a transaction, commit and rollback\n> terminate transactions and start a new one.\n\nTrue, although SQL doesn't mandate exactly how that is accomplished.\nWe have some client interfaces that provide that behavior,\nand that's a compliant way of doing it AFAICS.\n\nWe ought to consider ways of providing the same behavior in psql,\nbut it's not gonna happen for 7.0 --- too big a change for beta.\n\n> I suspect that most applications don't notice the difference. Most\n> will catch errors and roll back the current transaction, because that's\n> the logical thing to do in most cases.\n\nYou are assuming that the app has the intelligence to do so. A psql\nscript, for example, lacks that intelligence.\n\nI do agree that this is an area where we need to do some work, but\nit's not going to be a simple or small change. We will need nested-\ntransaction support in the backend, and some very careful rethinking\nof the client interfaces to try to avoid breaking existing apps.\n\n\t\t\tregards, tom lane\n", "msg_date": "Thu, 24 Feb 2000 11:34:18 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: AW: [HACKERS] TRANSACTIONS " }, { "msg_contents": "At 11:34 AM 2/24/00 -0500, Tom Lane wrote:\n\n>We ought to consider ways of providing the same behavior in psql,\n>but it's not gonna happen for 7.0 --- too big a change for beta.\n\nOh, yeah, no doubt about that.\n\n>> I suspect that most applications don't notice the difference. Most\n>> will catch errors and roll back the current transaction, because that's\n>> the logical thing to do in most cases.\n>\n>You are assuming that the app has the intelligence to do so. A psql\n>script, for example, lacks that intelligence.\n\nI did say \"most\", not \"all\". \n\n>\n>I do agree that this is an area where we need to do some work, but\n>it's not going to be a simple or small change. We will need nested-\n>transaction support in the backend, and some very careful rethinking\n>of the client interfaces to try to avoid breaking existing apps.\n\nWell...Oracle provides \"autocommit\" as a convenience. Perhaps we\ncould let the user select between old-style or SQL92-compliant behavior\nduring a transition period?\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, 24 Feb 2000 08:51:46 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": true, "msg_subject": "Re: AW: AW: [HACKERS] TRANSACTIONS " } ]
[ { "msg_contents": "Hi!\n\nWhen upgrading a server from version 6.5.2 to 7.0beta1, we hit the following\nproblems when reloading the data from pg_dumpall:\n\n- Is it a \"known feature\" that when using \"psql -f pgfull.dump\" it aborts on\nthe \"\\connect\" lines from pg_dumpall? The dump works fine if I start psql\nand use \\i to load it. (I reliase the documentation says use \"psql <\nfilename\", but I didn't read that far :-)\n\n- It fails to reload datetime indexes, because of \"DefineIndex: datetime_ops\nclass not found\". I take it this is because of the new datetime stuff, but\nit should at least be put into some notes somewhere that you have to tweak\nthe pg_dump output for these.\n\n- It also failed to reload a view, but that was because the old pg_dump\ndumped it as both a table and a view. Nothing wrong with 7.0 there.\n\n\nApart from these very minor issues, the reload went just fine. Just figured\nthat these small things should perhaps go into some notices somewhere.\n\n//Magnus\n", "msg_date": "Thu, 24 Feb 2000 15:53:08 +0100", "msg_from": "Magnus Hagander <[email protected]>", "msg_from_op": true, "msg_subject": "Minor problems reloading dump in 7.0beta1" }, { "msg_contents": "On Thu, 24 Feb 2000, Magnus Hagander wrote:\n\n> When upgrading a server from version 6.5.2 to 7.0beta1, we hit the following\n> problems when reloading the data from pg_dumpall:\n> \n> - Is it a \"known feature\" that when using \"psql -f pgfull.dump\" it aborts on\n> the \"\\connect\" lines from pg_dumpall?\n\nNo. It will abort if it cannot actually perform the connect, however ...\n\n> The dump works fine if I start psql and use \\i to load it. (I reliase\n> the documentation says use \"psql < filename\", but I didn't read that\n> far :-)\n\n... makes this look like a really weird bug. What's the connect statement,\nand what's the error message? (It better not abort without one. ;)\n\n\n-- \nPeter Eisentraut Sernanders vaeg 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Thu, 24 Feb 2000 16:12:04 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Minor problems reloading dump in 7.0beta1" }, { "msg_contents": "[Charset iso-8859-1 unsupported, filtering to ASCII...]\n> Hi!\n> \n> When upgrading a server from version 6.5.2 to 7.0beta1, we hit the following\n> problems when reloading the data from pg_dumpall:\n> \n> - Is it a \"known feature\" that when using \"psql -f pgfull.dump\" it aborts on\n> the \"\\connect\" lines from pg_dumpall? The dump works fine if I start psql\n> and use \\i to load it. (I reliase the documentation says use \"psql <\n> filename\", but I didn't read that far :-)\n\nThis is a new psql feature that scripts exit on first failure, I think.\n\n> - It fails to reload datetime indexes, because of \"DefineIndex: datetime_ops\n> class not found\". I take it this is because of the new datetime stuff, but\n> it should at least be put into some notes somewhere that you have to tweak\n> the pg_dump output for these.\n\nWe need to fix that somehow.\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, 24 Feb 2000 10:18:35 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Minor problems reloading dump in 7.0beta1" }, { "msg_contents": "Magnus Hagander <[email protected]> writes:\n> - It fails to reload datetime indexes, because of \"DefineIndex: datetime_ops\n> class not found\".\n\nOops. Comparing 6.5 and current pg_opclass contents, I see we are going\nto have this trouble with timespan_ops and oid8_ops as well as with\ndatetime_ops (although very likely there are no user tables with indexes\non oid8? Not certain though).\n\nBruce, do you want to hack the parser to drop these opclass names the\nsame way it's dropping network_ops? Or do we need to adopt a cleaner\nsolution?\n\n\t\t\tregards, tom lane\n", "msg_date": "Thu, 24 Feb 2000 11:05:59 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Minor problems reloading dump in 7.0beta1 " }, { "msg_contents": "> Magnus Hagander <[email protected]> writes:\n> > - It fails to reload datetime indexes, because of \"DefineIndex: datetime_ops\n> > class not found\".\n> \n> Oops. Comparing 6.5 and current pg_opclass contents, I see we are going\n> to have this trouble with timespan_ops and oid8_ops as well as with\n> datetime_ops (although very likely there are no user tables with indexes\n> on oid8? Not certain though).\n> \n> Bruce, do you want to hack the parser to drop these opclass names the\n> same way it's dropping network_ops? Or do we need to adopt a cleaner\n> solution?\n\nDoing it now.\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, 24 Feb 2000 11:26:26 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Minor problems reloading dump in 7.0beta1" }, { "msg_contents": "Applied.\n\n> Magnus Hagander <[email protected]> writes:\n> > - It fails to reload datetime indexes, because of \"DefineIndex: datetime_ops\n> > class not found\".\n> \n> Oops. Comparing 6.5 and current pg_opclass contents, I see we are going\n> to have this trouble with timespan_ops and oid8_ops as well as with\n> datetime_ops (although very likely there are no user tables with indexes\n> on oid8? Not certain though).\n> \n> Bruce, do you want to hack the parser to drop these opclass names the\n> same way it's dropping network_ops? Or do we need to adopt a cleaner\n> solution?\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, 24 Feb 2000 11:33:30 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Minor problems reloading dump in 7.0beta1" } ]
[ { "msg_contents": "Hi!\n\nThe following is required in order to make beta1 compile on the Win32\nplatform (psql and libpq):\n\nThe file \"config.h.win32\" in the include\\ directory (from my patch from\n2000-01-18) is missing from the tree. It needs to be put back :-)\n\nThe following patch has to be applied in the interfaces\\libpq directory.\n\n\n//Magnus\n\n <<beta_win32.patch>>", "msg_date": "Thu, 24 Feb 2000 16:35:07 +0100", "msg_from": "Magnus Hagander <[email protected]>", "msg_from_op": true, "msg_subject": "7.0beta1 on Win32" }, { "msg_contents": "Applied.\n\n\n[Charset iso-8859-1 unsupported, filtering to ASCII...]\n> Hi!\n> \n> The following is required in order to make beta1 compile on the Win32\n> platform (psql and libpq):\n> \n> The file \"config.h.win32\" in the include\\ directory (from my patch from\n> 2000-01-18) is missing from the tree. It needs to be put back :-)\n> \n> The following patch has to be applied in the interfaces\\libpq directory.\n> \n> \n> //Magnus\n> \n> <<beta_win32.patch>> \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": "Thu, 24 Feb 2000 10:49:16 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] 7.0beta1 on Win32" } ]
[ { "msg_contents": "> > When upgrading a server from version 6.5.2 to 7.0beta1, we \n> hit the following\n> > problems when reloading the data from pg_dumpall:\n> > \n> > - Is it a \"known feature\" that when using \"psql -f \n> pgfull.dump\" it aborts on\n> > the \"\\connect\" lines from pg_dumpall?\n> \n> No. It will abort if it cannot actually perform the connect, \n> however ...\nThat's expected. But I could connect manually.\n\n\n> > The dump works fine if I start psql and use \\i to load it. \n> (I reliase\n> > the documentation says use \"psql < filename\", but I didn't read that\n> > far :-)\n> \n> ... makes this look like a really weird bug. What's the \n> connect statement,\n> and what's the error message? (It better not abort without one. ;)\n\nFirst it was:\n\\connect template1\n\nNoticing it was not like the statements further down in the file, I changed\nit to:\n\\connect template1 postgres\n\nIt dies with:\npsql: FATAL 1: Database \"postgres\" does not exist in the system catalog.\n\nSame error message in both cases.\n\n//Magnus\n", "msg_date": "Thu, 24 Feb 2000 16:40:32 +0100", "msg_from": "Magnus Hagander <[email protected]>", "msg_from_op": true, "msg_subject": "RE: [HACKERS] Minor problems reloading dump in 7.0beta1" } ]
[ { "msg_contents": "> > > The dump works fine if I start psql and use \\i to load it. \n> > (I reliase\n> > > the documentation says use \"psql < filename\", but I \n> didn't read that\n> > > far :-)\n> > \n> > ... makes this look like a really weird bug. What's the \n> > connect statement,\n> > and what's the error message? (It better not abort without one. ;)\n> \n> First it was:\n> \\connect template1\n> \n> Noticing it was not like the statements further down in the \n> file, I changed\n> it to:\n> \\connect template1 postgres\n> \n> It dies with:\n> psql: FATAL 1: Database \"postgres\" does not exist in the \n> system catalog.\n> \n> Same error message in both cases.\n\nOk. Kill me. I know the problem - user error.\nI forgot to enter which database psql should connect to first. So it tried\n'postgres', since 'postgres' was the user I was logged in as.\nStupid.\n\nSorry about this one.\n\n//Magnus\n", "msg_date": "Thu, 24 Feb 2000 16:55:37 +0100", "msg_from": "Magnus Hagander <[email protected]>", "msg_from_op": true, "msg_subject": "RE: [HACKERS] Minor problems reloading dump in 7.0beta1" } ]
[ { "msg_contents": "Hi,\nHelp me please.\nI need solid edge timer fix, send it please :(\[email protected]\nBye&Txh4all\n\nTu correo gratis en MixMail http://www.mixmail.com\nInicia tu navegacion en http://www.ya.com\n", "msg_date": "Thu, 24 Feb 2000 03:20:16 -1300", "msg_from": "\"Post Message\" <[email protected]>", "msg_from_op": true, "msg_subject": "Solid timer" } ]
[ { "msg_contents": "Hello, I'm looking for solid edge \"timer fix\", help me \nplease \nsend it to [email protected]\n\nBye&Thx4All\n\nTu correo gratis en MixMail http://www.mixmail.com\nInicia tu navegacion en http://www.ya.com\n", "msg_date": "Thu, 24 Feb 2000 03:32:00 -1300", "msg_from": "\"Post Message\" <[email protected]>", "msg_from_op": true, "msg_subject": "Solid time" } ]
[ { "msg_contents": "\n> > I suspect that most applications don't notice the difference. Most\n> > will catch errors and roll back the current transaction, because that's\n> > the logical thing to do in most cases.\n> \n> You are assuming that the app has the intelligence to do so. A psql\n> script, for example, lacks that intelligence.\n\nI thought that psql is the only frontend that would not have a problem\nwith the new behavior, because it now has the feature of \"exit on first\nerror\"\nand thus rolls back the last open transaction anyway.\n\n> I do agree that this is an area where we need to do some work, but\n> it's not going to be a simple or small change. We will need nested-\n> transaction support in the backend, and some very careful rethinking\n> of the client interfaces to try to avoid breaking existing apps.\n\nYes, unfortunately.\n\nAndreas\n", "msg_date": "Thu, 24 Feb 2000 17:43:40 +0100", "msg_from": "Zeugswetter Andreas SB <[email protected]>", "msg_from_op": true, "msg_subject": "AW: AW: AW: [HACKERS] TRANSACTIONS " } ]
[ { "msg_contents": "\n> > They don't necessarily have nested tx, although some have.\n> > All they provide is atomicity of single statements.\n> \n> If it looks like a duck, walks like a duck, and quacks like a duck,\n> it's a duck no matter what it's called. How would you \n> provide atomicity\n> of a single statement without a transaction-equivalent implementation?\n> That statement might be affecting many tuples in several different\n> tables. It's not noticeably easier to roll back one statement than\n> a whole sequence of them.\n\nYes, the only difference seems to be, that the changes need not \nbe sync'd to disk, and you only need one level of nesting as long\nas the user is not presented the ability to use nested tx.\n\nAndreas\n", "msg_date": "Thu, 24 Feb 2000 17:53:54 +0100", "msg_from": "Zeugswetter Andreas SB <[email protected]>", "msg_from_op": true, "msg_subject": "AW: AW: AW: [HACKERS] TRANSACTIONS " }, { "msg_contents": "Hi,\n\nDoes anyone know how to teach netscape navigators mail client to \nrecognize additional (national) forms of Re:\n\nI often miss Andreases answers as they are neither threaded nor \nsorted together with others in in my mailreader. ;(\n\nIt does recognize Re: and ignores it when sorting \n\n--------------\nHannu\n", "msg_date": "Fri, 25 Feb 2000 00:37:30 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: AW: AW: .... (off-topic)" }, { "msg_contents": "> -----Original Message-----\n> From: [email protected]\n> [mailto:[email protected]]On Behalf Of Zeugswetter\n> \n> > > They don't necessarily have nested tx, although some have.\n> > > All they provide is atomicity of single statements.\n> > \n> > If it looks like a duck, walks like a duck, and quacks like a duck,\n> > it's a duck no matter what it's called. How would you \n> > provide atomicity\n> > of a single statement without a transaction-equivalent implementation?\n> > That statement might be affecting many tuples in several different\n> > tables. It's not noticeably easier to roll back one statement than\n> > a whole sequence of them.\n> \n> Yes, the only difference seems to be, that the changes need not \n> be sync'd to disk, and you only need one level of nesting as long\n> as the user is not presented the ability to use nested tx.\n>\n\nHmm,what do you want now ?\n\nNote that (f)sync is irrelevant at all.\nPartial rollback is the problem of only the backend to be rollbacked\nexcept locking.\n\nVadim has already planned savepoints functionality instead of nested\ntx. I have never heard objections to the proposal.\nI could see little difference between the implementation of rollback\nto arbitrary savepoints and the implemention of rollback only to the\nsavepoint implicitly placed immediately before current statement. \n\nDo you want another hack ?\n \nRegards.\n\nHiroshi Inoue\[email protected]\n", "msg_date": "Fri, 25 Feb 2000 10:06:15 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: AW: AW: [HACKERS] TRANSACTIONS " }, { "msg_contents": "Hannu Krosing <[email protected]> writes:\n\n> Does anyone know how to teach netscape navigators mail client to \n> recognize additional (national) forms of Re:\n\nThe right solution is for people who use Microsoft Outlook to upgrade\nto the latest version, where Microsoft (incredible as it sounds) has\nfixed this bug. Outlook now generates the correct \"Re: \" prefix.\n\n-tih\n-- \nPopularity is the hallmark of mediocrity. --Niles Crane, \"Frasier\"\n", "msg_date": "25 Feb 2000 08:06:14 +0100", "msg_from": "Tom Ivar Helbekkmo <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: AW: AW: AW: .... (off-topic)" } ]
[ { "msg_contents": "I have a problem with 6.5.3 and TEMP table inside transaction.\n\ntest=> begin;\nBEGIN\ntest=> create temp table tempid (id int, level int);\nCREATE\ntest=> \\q\n\nPostgres process doesn't stopped. The same happens if I\nuse rollback before ending transaction.\n\ntest=> \\d\nCouldn't find any tables, sequences or indices!\ntest=> begin;\nBEGIN\ntest=> create temp table tempid (id int, level int);\nCREATE\ntest=> insert into tempid ( id, level ) values (1 ,1);\nINSERT 332330 1\ntest=> rollback;\nABORT\ntest=> end;\nNOTICE: EndTransactionBlock and not inprogress/abort state \nEND\ntest=> \\q\n\nzen:~/app/pgsql$ psql test\nWelcome to the POSTGRESQL interactive sql monitor:\n Please read the file COPYRIGHT for copyright terms of POSTGRESQL\n[PostgreSQL 6.5.3 on i686-pc-linux-gnu, compiled by gcc egcs-2.91.66]\n\n type \\? for help on slash commands\n type \\q to quit\n type \\g or terminate with semicolon to execute query\n You are currently connected to the database: test\n\ntest=> vacuum;\nNOTICE: AbortTransaction and not in in-progress state \nERROR: cannot write block 0 of pg_temp.8928.0 [test] blind\ntest=> \n\n\nI checked 7.0 from cvs and it looks better.\n\nAlso, I see a lot of opened files when doing \nselect/inserts into temp table inside transaction\n(temp table was created before transaction). So, \nif I do a lot of selects/inserts I easily reach file description limit.\n\nDo I miss here ?\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": "Thu, 24 Feb 2000 21:35:32 +0300 (GMT)", "msg_from": "Oleg Bartunov <[email protected]>", "msg_from_op": true, "msg_subject": "problems with TEMP table (6.5.3)" }, { "msg_contents": "> I have a problem with 6.5.3 and TEMP table inside transaction.\n> \n> test=> vacuum;\n> NOTICE: AbortTransaction and not in in-progress state \n> ERROR: cannot write block 0 of pg_temp.8928.0 [test] blind\n> test=> \n> \n\nYes, there were some problems with temp tables and transaction scoping\nthat we could not fix in 6.5.*. Those are all addressed in 7.0.\n\n> \n> I checked 7.0 from cvs and it looks better.\n> \n> Also, I see a lot of opened files when doing \n> select/inserts into temp table inside transaction\n> (temp table was created before transaction). So, \n> if I do a lot of selects/inserts I easily reach file description limit.\n> \n> Do I miss here ?\n\nFile descriptors are kept open as a cache. They will be closed as not\nneeded.\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, 24 Feb 2000 14:42:54 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] problems with TEMP table (6.5.3)" } ]
[ { "msg_contents": "\nHas anyone done any performance metrics for PostgreSQL on smp vs\nnon-smp systems? I'm guessing it won't add much, as the hard disk\nperformance is probably a greater concern for a database (assumption).\n\nMy situation is I need some new hardware and am strapped for cash. My\noptions are a single processor (probably Intel PII 450 or comparable)\nor a dual system based on the same. It'll be running PostgreSQL and\nApache (yeah, I know I ought to separate them onto different machines\nbut humor me here). I'm exploring how Apache and PostgreSQL fair with\ndual processor systems. Given that I'll have both running, it may be\na wise choice. Any wisdom people have would be very useful.\n\n\nThanks,\n-Kyle\nkaf@_nwlink_._com_\nremove underscores to reply\n\n", "msg_date": "24 Feb 2000 10:50:21 -0800", "msg_from": "Kyle <kaf@_nwlink_._com_>", "msg_from_op": true, "msg_subject": "postgresql performance, smp vs non-smp" } ]
[ { "msg_contents": ">>> QuickSort: 1.6E+14\n>>> SortStop: 1.5E+11\n>\n>> Are there some zeroes missing here? That sounds like an awful lot of\n>> operations for a quicksort of only 1E5 elements...\n\n> Yeah, obviously one or more of his numbers are wrong. Let's see, a\n> [...]\n\nYes I'm sorry, those numbers were completely wrong, I shoud have realized immediately. Here are the correct ones:\n\nQuickSort: 1.66096e+06\nSortStop: 1.00327e+05\n\n>> The obvious way to do it would be with a heap-based sort. After you've\n>> built the heap, you pull out the first ten elements and then stop.\n>> Offhand this only seems like it'd save about half the work, though,\n>> so maybe Roberto has a better idea.\n\n> I'd like to see some elaboration.\n\nIt is, indeed, a heap-based sort, but you don't need to do so many insertions in the heap.\nIt works like that:\n\n\n- put first 10 rows in the heap, whith the worst value on head\n- compare each other 99990 rows with the current head\n- if new row is better, then \n trash current head and insert new row into the heap,\n otherwise trash the new row.\n\nIn this way the number of insertions in the heap is considerably lower (you can find more details on Knuth, vol III). Moreover, only <N> rows (10 in this case) are kept in memory at the same time, reducing the probability to need an external-sort.\n\nRegards\n\nRoberto Cornacchia\n\n===========================================================\n\nVIRGILIO MAIL - Il tuo indirizzo E-mail gratis e per sempre\nhttp://mail.virgilio.it/\n\n\nVIRGILIO - La guida italiana a Internet\nhttp://www.virgilio.it/\n", "msg_date": "Thu, 24 Feb 2000 15:56:58 -0500", "msg_from": "\"Roberto Cornacchia\" <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: about 7.0 LIMIT optimization " }, { "msg_contents": "At 03:56 PM 2/24/00 -0500, Roberto Cornacchia wrote:\n>>>> QuickSort: 1.6E+14\n>>>> SortStop: 1.5E+11\n>>\n>>> Are there some zeroes missing here? That sounds like an awful lot of\n>>> operations for a quicksort of only 1E5 elements...\n>\n>> Yeah, obviously one or more of his numbers are wrong. Let's see, a\n>> [...]\n>\n>Yes I'm sorry, those numbers were completely wrong, I shoud have realized\nimmediately. Here are the correct ones:\n>\n>QuickSort: 1.66096e+06\n>SortStop: 1.00327e+05\n\nYeah, there you go! Thanks...\n\n>- put first 10 rows in the heap, whith the worst value on head\n>- compare each other 99990 rows with the current head\n>- if new row is better, then \n> trash current head and insert new row into the heap,\n> otherwise trash the new row.\n>\n>In this way the number of insertions in the heap is considerably lower\n(you can find more details on Knuth, vol III).\n\n\"Sorting and searching\", right, where would we be without Knuth?\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, 24 Feb 2000 13:36:54 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: about 7.0 LIMIT optimization " } ]
[ { "msg_contents": "Hi,\n\n> I'm not sure about your comment about referential constraints. If you\n> are doing analysis of restriction clauses to prove that a particular\n> stage doesn't require reading as many rows as it otherwise would, then\n> you've done more than I have.\n\nYes, that's what we do. Here is a clarifying example:\n\n-----\n\"Retrieve name, salary and Dept name of the 10 most paid employees\"\n\nSELECT Emp.name, Emp.salary, Dep.name\n FROM Emp, Dep\nWHERE Emp.dno=Dept.dno\nSTOP AFTER 10\nRANK BY Emp.salary DESC;\n-----\n\nSuppose you have a referential constraint like:\nEmp->dno --> Dep.dno (foreign --> primary)\n\nIn this case we can do :\n\njoin (Emp.dno = Dep.dno)\n Stop 10\n Scan Emp\n Scan Dept\n\nsince we are sure that every employee works in a departement (because of the constraints), so the 10 most paid employees will survive after the join. In this way you can reduce the cardinality of one of the input stream of the join, obtaining the same final results. \n\nNote that this is a very simple case. In many plans involving a larger number of joins you can place a Stop operator in a deep position, reducing the work of all the following joins.\n\nWe have formalized a set of rules which allow us to determine wheter or not a position in the plan for the Stop operator is safe and then we have developed a fast algorithm able to take the right decision.\n\nRegards\n\nR. Cornacchia\nA. Ghidini\nDr. P. Ciaccia\n \n\n===========================================================\n\nVIRGILIO MAIL - Il tuo indirizzo E-mail gratis e per sempre\nhttp://mail.virgilio.it/\n\n\nVIRGILIO - La guida italiana a Internet\nhttp://www.virgilio.it/\n", "msg_date": "Thu, 24 Feb 2000 16:41:25 -0500", "msg_from": "\"Roberto Cornacchia\" <[email protected]>", "msg_from_op": true, "msg_subject": "Re: about 7.0 LIMIT optimization " } ]
[ { "msg_contents": "\nThis page:\n\nhttp://www.postgresql.org/docs/postgres/datatype1033.htm\n\nsays to use timestamp in preference to datetime. It also says that datetime is\n\"equivalent to timestamp\". Ok, so I'll use timestamp, no prob. But I want to\nindex that field. In v6.5.3, there is no timestamp_ops, only datetime_ops. In\nv7.0b1 the datetime_ops is gone, and there is a timestamp_ops available, which\ntakes care of my problem. But until I put 7.0 on my production server, I can't\nmake an index on a timestamp field. My question is, how \"equivalent\" are these\ntypes? Can I use datetime_ops to index a timestamp field in a v6.5.3 database?\nI.e., can I do this:\n\ncreate table thing ( bleh text, blah timetamp );\ncreate index thing_blah on thing ( blah datetime_ops );\n\nIt runs without error, but is it legit? TIA...\n\n-- \nAlex Howansky\nWankwood Associates\nhttp://www.wankwood.com/\n\n", "msg_date": "Thu, 24 Feb 2000 16:27:21 -0600 (CST)", "msg_from": "Alex Howansky <[email protected]>", "msg_from_op": true, "msg_subject": "how to create index on timestamp field in pre v7 database" }, { "msg_contents": "Alex Howansky <[email protected]> writes:\n> My question is, how \"equivalent\" are these types?\n\nThey're the same code: we jacked up the name \"timestamp\" and rolled the\nold datetime code underneath. Strictly a matter of coming closer to\nthe SQL standard names for these datatypes.\n\n> Can I use datetime_ops to index a timestamp field in a v6.5.3 database?\n\nSimilarly, \"datetime_ops\" in 6.5 is now \"timestamp_ops\".\n\nAs a rule, I'd suggest not bothering with opclasses in index\ndeclarations. The only situation where you need to select one is\nwhere there is more than one possible opclass for the same datatype.\nThis holds for some of the geometric types, but not for any plain scalar\ntypes like numerics or date/time types. (You could think of an opclass\nas specifying which sort order the index uses...)\n\n\t\t\tregards, tom lane\n\nPS: Actually there's a second case where you must specify an opclass,\nwhich is if you are creating a functional index; for some reason the\nsystem can't figure out the right opclass in that case. This is a bug,\nno doubt ... never looked at it hard enough to see why it's failing.\n", "msg_date": "Thu, 24 Feb 2000 18:57:50 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [SQL] how to create index on timestamp field in pre v7 database " }, { "msg_contents": "\n----------------------------------------------------------------\[email protected]\n----- Original Message -----\nFrom: Tom Lane <[email protected]>\nTo: Alex Howansky <[email protected]>\nCc: <[email protected]>\nSent: Thursday, February 24, 2000 11:57 PM\nSubject: Re: [SQL] how to create index on timestamp field in pre v7\ndatabase\n\n\n> Alex Howansky <[email protected]> writes:\n> > My question is, how \"equivalent\" are these types?\n>\n> They're the same code: we jacked up the name \"timestamp\" and rolled\nthe\n> old datetime code underneath. Strictly a matter of coming closer to\n> the SQL standard names for these datatypes.\n>\n> > Can I use datetime_ops to index a timestamp field in a v6.5.3\ndatabase?\n>\n> Similarly, \"datetime_ops\" in 6.5 is now \"timestamp_ops\".\n>\n> As a rule, I'd suggest not bothering with opclasses in index\n> declarations. The only situation where you need to select one is\n> where there is more than one possible opclass for the same datatype.\n> This holds for some of the geometric types, but not for any plain\nscalar\n> types like numerics or date/time types. (You could think of an\nopclass\n> as specifying which sort order the index uses...)\n\nAgreed - but note that pg_dump currently produces CREATE INDEX\nstatements with opclasses included.\n\nThat means running a script created by pg_dump v.6.5.x will fail under\n7.0 because there is no index opclass of the type datetime?\n\nJudging from my brief experiments that looks to be the case, anyway.\nIt looks like replacing all occurrences of datetime with timestamp in\nthe script works - even for the few functions I have that used the\ndatetime() function.\n\nYours,\nMoray\n\n\n", "msg_date": "Fri, 25 Feb 2000 11:16:10 -0000", "msg_from": "\"Moray McConnachie\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [SQL] how to create index on timestamp field in pre v7 database " }, { "msg_contents": "\"Moray McConnachie\" <[email protected]> writes:\n> Agreed - but note that pg_dump currently produces CREATE INDEX\n> statements with opclasses included.\n\nRight, as it should since its purpose is to ensure you rebuild exactly\nthe same database. I was just opining that handwritten CREATE INDEXes\nusually can omit the opclass. (BTW, I fixed the problem with functional\nindexes needing an explicit opclass spec last night.)\n\n> That means running a script created by pg_dump v.6.5.x will fail under\n> 7.0 because there is no index opclass of the type datetime?\n\nAn embarrassing problem. We are going to work around this by having\nthe 7.0 parser discard the word \"datetime\" if it sees it in the opclass\nposition. There are a couple of other now-dead opclass names that will\nbe discarded in the same way. Klugy, but it will get the job done for\nreading old dump files.\n\n(This hack is not in 7.0beta1, but will be in beta2.)\n\n\t\t\tregards, tom lane\n", "msg_date": "Fri, 25 Feb 2000 11:29:16 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [SQL] how to create index on timestamp field in pre v7 database " }, { "msg_contents": "[email protected] writes:\n> It looks like replacing all occurrences of datetime with timestamp in\n> the script works - even for the few functions I have that used the\n> datetime() function.\n\nOooh --- another case we didn't think about. We really should continue\nto make a function named datetime() available, even though the type it\nproduces will officially be named timestamp.\n\nI can see two ways to do that: either add another function to pg_proc\n(five of them actually :-(), or hack the parser to translate a function\nname 'datetime' to 'timestamp'. Ugly as the second one sounds, it has\na couple of advantages. First, it would provide an automatic upgrade\npath: future dumps of 7.0 databases would show the correct function\nname, at least for uses in rules. So we could hope to get rid of the\ncompatibility hack someday. Second, the parser has special treatment\nfor functions that are named the same as datatypes --- it knows they\nrepresent type coercions --- so a function named \"datetime\" won't really\nwork quite the way it should for type resolution.\n\nNot sure which way to jump. Comments anyone?\n\n\t\t\tregards, tom lane\n", "msg_date": "Fri, 25 Feb 2000 11:36:23 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: missing function datetime()" }, { "msg_contents": "> \"Moray McConnachie\" <[email protected]> writes:\n> > Agreed - but note that pg_dump currently produces CREATE INDEX\n> > statements with opclasses included.\n> \n> Right, as it should since its purpose is to ensure you rebuild exactly\n> the same database. I was just opining that handwritten CREATE INDEXes\n> usually can omit the opclass. (BTW, I fixed the problem with functional\n> indexes needing an explicit opclass spec last night.)\n> \n> > That means running a script created by pg_dump v.6.5.x will fail under\n> > 7.0 because there is no index opclass of the type datetime?\n> \n> An embarrassing problem. We are going to work around this by having\n> the 7.0 parser discard the word \"datetime\" if it sees it in the opclass\n> position. There are a couple of other now-dead opclass names that will\n> be discarded in the same way. Klugy, but it will get the job done for\n> reading old dump files.\n> \n> (This hack is not in 7.0beta1, but will be in beta2.)\n\nIt is my understanding we are generating a new beta every night, so it\nshould be there now.\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, 25 Feb 2000 11:54:40 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [SQL] how to create index on timestamp field in pre v7 database" }, { "msg_contents": "Thomas Lockhart <[email protected]> writes:\n>> I can see two ways to do that: either add another function to pg_proc\n>> (five of them actually :-(), or hack the parser to translate a function\n>> name 'datetime' to 'timestamp'. Ugly as the second one sounds, it has\n>> a couple of advantages.\n\n> xlateSqlFunc() is already in gram.y; enjoy...\n\nWill do, just wanted to see if you approved or not.\n\nWhen you finish catching up on the back email, I'd like to know what\nyou think about the question of comment lexing. Should we change scan.l\nso that it will recognize /* or -- as comment starters even if they are\nembedded in what would currently be considered a long operator token?\nIf so, is it OK to depend on yyless() to do it, or is that a flex-ism?\n\nI'd also kind of like to put in a test to detect unterminated comments\nand literals. The flex manual recommends <<EOF>> but that only works\nin flex. I was speculating that a rule for <xq> followed by nothing\nmight work, if all the other <xq> rules match at least one character.\nThoughts?\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 28 Feb 2000 11:26:35 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: missing function datetime() " }, { "msg_contents": "> I can see two ways to do that: either add another function to pg_proc\n> (five of them actually :-(), or hack the parser to translate a function\n> name 'datetime' to 'timestamp'. Ugly as the second one sounds, it has\n> a couple of advantages. First, it would provide an automatic upgrade\n> path: future dumps of 7.0 databases would show the correct function\n> name, at least for uses in rules. So we could hope to get rid of the\n> compatibility hack someday. Second, the parser has special treatment\n> for functions that are named the same as datatypes --- it knows they\n> represent type coercions --- so a function named \"datetime\" won't really\n> work quite the way it should for type resolution.\n\nxlateSqlFunc() is already in gram.y; enjoy...\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Mon, 28 Feb 2000 16:26:42 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: missing function datetime()" } ]
[ { "msg_contents": "In current sources, ecpg doesn't compile anymore:\n\nmake[3]: Entering directory `/home/postgres/pgsql/src/interfaces/ecpg/lib'\nmake[3]: *** No rule to make target `dynamic.c', needed by `ecpglib.o'.\ngcc -I../../../include -I../../../backend -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -O -g -I../include -I../../../interfaces/libpq -fPIC -c -o typename.o typename.c\ngcc -I../../../include -I../../../backend -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -O -g -I../include -I../../../interfaces/libpq -fPIC -c -o descriptor.o descriptor.c\ndescriptor.c: In function `get_char_item':\ndescriptor.c:131: dereferencing pointer to incomplete type\ndescriptor.c:133: dereferencing pointer to incomplete type\ndescriptor.c:135: dereferencing pointer to incomplete type\ndescriptor.c:136: dereferencing pointer to incomplete type\ndescriptor.c:137: dereferencing pointer to incomplete type\nmake[3]: *** [descriptor.o] Error 1\n\n(similar errors in several additional source files)\n\n\t\t\tregards, tom lane\n", "msg_date": "Thu, 24 Feb 2000 23:59:19 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "ecpg seems rather badly broken" }, { "msg_contents": "On Thu, Feb 24, 2000 at 11:59:19PM -0500, Tom Lane wrote:\n> In current sources, ecpg doesn't compile anymore:\n> ...\n\nOops. The last commit left out the changes to one include file. Will commit\nthis ASAP. \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": "Fri, 25 Feb 2000 09:02:37 +0100", "msg_from": "Michael Meskes <[email protected]>", "msg_from_op": false, "msg_subject": "Re: ecpg seems rather badly broken" } ]
[ { "msg_contents": "It seems I cannot compile the backend anymore. Here's what I get after make\ndistclean; configure; make:\n\n...\ngcc -I../../../include -I../../../backend -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -I../.. -c -o tupdesc.o tupdesc.c\nld -r -o SUBSYS.o heaptuple.o indextuple.o indexvalid.o printtup.o scankey.o tupdesc.o\nmake[3]: Leaving directory /home/postgres/pgsql/src/backend/access/common'\nmake -C gist SUBSYS.o\nmake[3]: Entering directory /home/postgres/pgsql/src/backend/access/gist'\nmake[3]: *** No rule to make target ../../../include/utils/dt.h', needed by\n\u0007ist.o'. Stop.\nmake[3]: Leaving directory /home/postgres/pgsql/src/backend/access/gist'\nmake[2]: *** [submake] Error 2\nmake[2]: Leaving directory /home/postgres/pgsql/src/backend/access'\nmake[1]: *** [access.dir] Error 2\nmake[1]: Leaving directory /home/postgres/pgsql/src/backend'\nmake: *** [all] Error 2\n\nNewly updated archive.\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": "Fri, 25 Feb 2000 09:03:53 +0100", "msg_from": "Michael Meskes <[email protected]>", "msg_from_op": true, "msg_subject": "Compile woes" }, { "msg_contents": "Michael Meskes <[email protected]> writes:\n> It seems I cannot compile the backend anymore. Here's what I get after make\n> distclean; configure; make:\n\n> make[3]: Entering directory /home/postgres/pgsql/src/backend/access/gist'\n> make[3]: *** No rule to make target ../../../include/utils/dt.h', needed by\n> \u0007ist.o'. Stop.\n\nMichael, did you solve this yet? My guess is you need a new 'make depend'.\n\n\t\t\tregards, tom lane\n", "msg_date": "Sun, 27 Feb 2000 01:57:52 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Compile woes " }, { "msg_contents": "On Sun, Feb 27, 2000 at 01:57:52AM -0500, Tom Lane wrote:\n> Michael, did you solve this yet? My guess is you need a new 'make depend'.\n\nmake depend does not run through since ecpg/preproc/Makefile does not know\ndepend. But it works on the backend directories. Then again it does not\nchange anything.\n\nWhat did work, however, is manually removing all files named 'depend'.\nShouldn't this be done by a 'make distclean'?\n\nInterestingly enough running 'make depend' now that the old depend files are\nremoved creates the correct ones.\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, 1 Mar 2000 08:27:21 +0100", "msg_from": "Michael Meskes <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Compile woes" } ]
[ { "msg_contents": "Hi,\nI get:\n\nsu-2.01$ gmake MAKE=gmake\ngmake -C include all\ngmake[1]: Entering directory\n`/usr/home/pgtest/pgsql/src/interfaces/ecpg/include'\nNothing to be done.\ngmake[1]: Leaving directory `/usr/home/pgtest/pgsql/src/interfaces/ecpg/include'\ngmake -C lib all\ngmake[1]: Entering directory `/usr/home/pgtest/pgsql/src/interfaces/ecpg/lib'\ngmake[1]: *** No rule to make target `dynamic.c', needed by `ecpglib.o'. Stop.\ngmake[1]: Leaving directory `/usr/home/pgtest/pgsql/src/interfaces/ecpg/lib'\ngmake: *** [all] Error 2\n\n\nBye!\n----\nMichael Reifenberger\nPlaut Software GmbH, R/3 Basis\n\n", "msg_date": "Fri, 25 Feb 2000 10:50:58 +0100 (CET)", "msg_from": "Michael Reifenberger <[email protected]>", "msg_from_op": true, "msg_subject": "failing to compile -current on FreeBSD" } ]
[ { "msg_contents": "James,\nI would be interested in writing tutorial (a couple of parts) on basic\nsystem design using postgres:\n- specification,\n- entity-relationship diagram + data flow diagram + state transition diagram\nor slightly modified object diagram (CY) + state transition diagram using\nDome522 free case,\n- refinements,\n- grants and access,\n- basic business rules in postgres (functions, triggers, constrains ..)\n- preparing data definition (database) SQL scripts;\n- preparing basic processing scripts in SQL,\n- preparing basic perl/tcl processing scripts,\n- preparing simple interface for importing data (data cleaning process),\n- preparing of basic user interface (for example CGI script).\n\nI see that in repeatible process starting from simplest case of 3 - 4\nobjects (tables) being refined to more sofisticated scheme including\nsuccessive constructs.\n\nOf course it is a rough idea now. If you are interested I will prepare\ndetailed table of contents.\n\nRegards,\nAndrzej Mazurkiewicz\n\[email protected]\n\nwww.mazurkiewicz.org\n\n", "msg_date": "Fri, 25 Feb 2000 14:31:15 +0100", "msg_from": "Andrzej Mazurkiewicz <[email protected]>", "msg_from_op": true, "msg_subject": "[HACKERS] Re: Interested in writing a PostgreSQL article?" } ]
[ { "msg_contents": "Dear sir,\n\n i have one problem in postgres and could u\nhelp me in this regard.?\n\n i am relatively new guy to postgres. since\nthe guy who handled the postgres is not available.\ni'm forced to look into postgres.\n\n Here is the problem, the postgres server\ndoes't stop after certain time [ the query is execuing\nfor long time ],it's running forever and eating lot of\nmemory [ up to 18 MB in RAM], so the machine [ also\nrunning httpd ] is become slow. it cannot serve pages\nfastly.\n\n i'm using postgres 6.4, perl scripts [ DBI/DBD\n], linux redhat 6.0, [ 128 MB Ram ]\n\n the postmaster is started as\n\n $ postmaster -i -S -B 3000\n\ni don't know where the problem lies, is the query is\nwrong?, or i'm often connecting postgres thru PERL\nDBI,is it wrong? or the database is corrupted.?\n\n \n I really appreciate if u say anything needful \n\nVery Thanks.\n\nSincerely,\nNed.\n \n \n the facts and states of my server is \n\n$ uname -a\n\nLinux saregama 2.2.5-15 #1 Mon Apr 19 21:39:28 EDT\n1999 i686 unknown\n\n$ top\n\n 2:44pm up 101 days, 7:05, 1 user, load average:\n30.69, 30.24, 27.92\n78 processes: 45 sleeping, 33 running, 0 zombie, 0\nstopped\nCPU states: 97.0% user, 2.9% system, 0.0% nice, \n0.0% idle\nMem: 128028K av, 99996K used, 28032K free, 614976K\nshrd, 2840K buff\nSwap: 128484K av, 19764K used, 108720K free \n 52488K cached\n\n PID USER PRI NI SIZE RSS SHARE STAT LIB %CPU\n%MEM TIME COMMAND\n 6652 postgres 20 0 20644 20M 20124 R 0 7.4\n16.0 0:48 postmaster\n 6714 postgres 16 0 20524 19M 20000 R 0 5.5\n15.9 0:42 postmaster\n 5122 postgres 20 0 21256 20M 20696 R 0 4.7\n16.2 3:23 postmaster\n 5209 postgres 10 0 21216 20M 20676 R 0 4.3\n16.2 3:13 postmaster\n 6382 postgres 10 0 20608 19M 20040 R 0 4.3\n15.7 1:08 postmaster\n 6721 postgres 10 0 22128 21M 21612 R 0 4.3\n17.2 0:42 postmaster\n 5029 postgres 10 0 21212 20M 20664 R 0 4.1\n16.2 3:39 postmaster\n 5043 postgres 10 0 21212 20M 20656 R 0 4.1\n16.2 3:39 postmaster\n 5056 postgres 10 0 21216 20M 20672 R 0 4.1\n16.2 3:33 postmaster\n 6186 postgres 10 0 21136 20M 20572 R 0 4.1\n16.1 1:21 postmaster\n 6651 postgres 10 0 20688 20M 20168 R 0 4.1\n16.1 0:48 postmaster\n 7253 saregama 10 0 2064 2064 992 R 0 4.1\n 1.6 0:00 saregama\n 6339 postgres 10 0 20844 19M 20284 R 0 3.9\n15.9 1:08 postmaster\n 7254 saregama 10 0 2064 2064 992 R 0 3.9\n 1.6 0:00 saregama\n 7030 postgres 10 0 18888 18M 18368 R 0 3.7\n14.7 0:18 postmaster\n 5025 postgres 9 0 21212 20M 20660 R 0 3.5\n16.2 3:43 postmaster\n 5079 postgres 9 0 21212 20M 20656 R 0 3.3\n16.2 3:34 postmaster\n 6214 postgres 10 0 21212 20M 20656 R 0 3.3\n16.2 1:14 postmaster\n 3991 postgres 10 0 21412 20M 20716 R 0 3.1\n16.3 21:48 postmaster\n 4549 postgres 10 0 21208 20M 20664 R 0 3.1\n16.2 9:51 postmaster\n 5232 postgres 15 0 21212 20M 20668 R 0 2.9\n16.2 3:12 postmaster\n 4879 postgres 9 0 21212 20M 20652 R 0 2.7\n16.2 5:24 postmaster\n 6483 postgres 9 0 21204 20M 20644 R 0 2.7\n16.2 0:50 postmaster\n 6991 postgres 9 0 19572 19M 19052 R 0 2.3\n15.2 0:20 postmaster\n 7255 root 10 0 892 892 640 R 0 1.7\n 0.6 0:00 xkbcomp \n\n\n\n\n$ ps xafw\n\n2832 ? S 0:00 postmaster -i -S -B 2500\n 3991 ? R 21:38 \\_ [postmaster]\n 4549 ? R 9:41 \\_ [postmaster]\n 4557 ? R 9:03 \\_ [postmaster]\n 4879 ? R 5:14 \\_ [postmaster]\n 4916 ? R 4:33 \\_ [postmaster]\n 5025 ? R 3:33 \\_ [postmaster]\n 5029 ? R 3:29 \\_ [postmaster]\n 5043 ? R 3:29 \\_ [postmaster]\n 5056 ? R 3:23 \\_ [postmaster]\n 5079 ? R 3:23 \\_ [postmaster]\n 5122 ? R 3:13 \\_ [postmaster]\n 5193 ? R 3:04 \\_ [postmaster]\n 5209 ? R 3:03 \\_ [postmaster]\n 5232 ? R 3:02 \\_ [postmaster]\n 6184 ? R 1:10 \\_ [postmaster]\n 6186 ? R 1:11 \\_ [postmaster]\n 6214 ? R 1:04 \\_ [postmaster]\n 6339 ? R 0:58 \\_ [postmaster]\n 6373 ? R 0:51 \\_ [postmaster]\n 6382 ? R 0:57 \\_ [postmaster]\n 6483 ? R 0:40 \\_ [postmaster]\n 6651 ? R 0:38 \\_\n/usr/local/pgsql/bin/postgres localhost yantra rp\n 6652 ? R 0:38 \\_\n/usr/local/pgsql/bin/postgres localhost yantra rp\n 6714 ? R 0:32 \\_\n/usr/local/pgsql/bin/postgres localhost yantra rp\n 6721 ? R 0:32 \\_\n/usr/local/pgsql/bin/postgres localhost postgres\n 6766 ? R 0:28 \\_\n/usr/local/pgsql/bin/postgres localhost yantra rp\n 6962 ? R 0:13 \\_\n/usr/local/pgsql/bin/postgres localhost postgres\n 6991 ? R 0:10 \\_\n/usr/local/pgsql/bin/postgres localhost yantra rp\n 7030 ? R 0:07 \\_\n/usr/local/pgsql/bin/postgres localhost yantra rp \n\n\n__________________________________________________\nDo You Yahoo!?\nTalk to your friends online with Yahoo! Messenger.\nhttp://im.yahoo.com\n", "msg_date": "Fri, 25 Feb 2000 05:55:01 -0800 (PST)", "msg_from": "Nedu <[email protected]>", "msg_from_op": true, "msg_subject": "Problem - Postgres Running continously" } ]
[ { "msg_contents": "subscribe\n______________________________________________________\nGet Your Private, Free Email at http://www.hotmail.com\n\n", "msg_date": "Fri, 25 Feb 2000 14:03:37 PST", "msg_from": "\"Joaquin Eduardo Monje\" <[email protected]>", "msg_from_op": true, "msg_subject": "subscribe" } ]
[ { "msg_contents": "Hi,\nI need to use libpq in a multithreaded environment.\nIdeally I would like to open a single connection to\nthe database and use that for all threads. \nI just discovered that the PGconn returned when a\nconnection is opened is usable for only one thread\nsince it also seems to store the result (PGresult *)\nand the errorMessage. Could you tell me if there is a\nway to use one connection in multiple threads, or\nwhether I will need to necessarily open one Connection\nper thread ? Which is the preferred course of action ?\n\n\nThanks,\nRini\n\nps : Sorry, but I've been unable to search the\narchives before sending this mail. For the last three\ndays each time I try a search I get the folllowing\nmessage :\n\nThe document contained no data. Try again later or\ncontact the server's administrator.\n__________________________________________________\nDo You Yahoo!?\nTalk to your friends online with Yahoo! Messenger.\nhttp://im.yahoo.com\n", "msg_date": "Fri, 25 Feb 2000 08:47:31 -0800 (PST)", "msg_from": "Rini Dutta <[email protected]>", "msg_from_op": true, "msg_subject": "Using libpq in a multithreaded environment" }, { "msg_contents": "Rini Dutta <[email protected]> writes:\n> I need to use libpq in a multithreaded environment.\n> Ideally I would like to open a single connection to\n> the database and use that for all threads. \n\nNot unless you provide some interlock that will prevent multiple threads\nfrom issuing queries at the same time...\n\n> I just discovered that the PGconn returned when a\n> connection is opened is usable for only one thread\n> since it also seems to store the result (PGresult *)\n> and the errorMessage.\n\nThis is the least of your worries --- the backend is not multithreaded\neither, so it will not accept concurrent queries; nor is the frontend-\nto-backend protocol capable of keeping track of concurrent queries.\n\nUnless your intended use of the connection is considerably more\nrestricted than you have indicated, you will want one connection\nper query-issuing thread.\n\nThis would not prevent you from handing off completed PGresults to\nother threads for processing; but operations on a PGconn should be\neither restricted to one thread or protected by a mutex.\n\n\t\t\tregards, tom lane\n", "msg_date": "Fri, 25 Feb 2000 13:19:34 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Using libpq in a multithreaded environment " } ]
[ { "msg_contents": "Can anyone provide references (docs, whitepapers, personal opinions, ...)\nabout the security of XML based systems?\nI'm not interested in digital signature only.\nI'd like to know how many information hackers can \"steal\" monitoring the\nnetwork.\nHow many doors does a system open when it is based on XML?\n\nThanks for any info you might want to send back\n\nMB\n\n\n", "msg_date": "Fri, 25 Feb 2000 19:44:53 +0100", "msg_from": "\"M. Brady\" <[email protected]>", "msg_from_op": true, "msg_subject": "XML and Security" } ]
[ { "msg_contents": "Hi,\n\n there was discussion about readding the lztext type for\n internal use in pg_rewrite for 7.0, then remove it again once\n we have TOAST.\n\n Was because significant growth of the rule plan strings due\n to other changes can cause views/rules to be rejected by 7.0,\n that easily worked with 6.5.\n\n I've reconstructed the entire lztext type now from CVS, could\n reapply changes and reactivate deleted files from ./Attic.\n Will work on a NOTICE/ERROR message now, preventing users to\n use it in their schemas.\n\n But it requires an initdb and we're in BETA. So I better ask\n if someone complains.\n\n\nJan\n\n--\n\n#======================================================================#\n# It's easier to get forgiveness for being wrong than for being right. #\n# Let's break this rule - forgive me. #\n#========================================= [email protected] (Jan Wieck) #\n\n\n", "msg_date": "Fri, 25 Feb 2000 21:36:34 +0100 (CET)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": true, "msg_subject": "LZTEXT for rule plan stings" }, { "msg_contents": "On Fri, 25 Feb 2000, Jan Wieck wrote:\n\n> Hi,\n> \n> there was discussion about readding the lztext type for\n> internal use in pg_rewrite for 7.0, then remove it again once\n> we have TOAST.\n> \n> Was because significant growth of the rule plan strings due\n> to other changes can cause views/rules to be rejected by 7.0,\n> that easily worked with 6.5.\n> \n> I've reconstructed the entire lztext type now from CVS, could\n> reapply changes and reactivate deleted files from ./Attic.\n> Will work on a NOTICE/ERROR message now, preventing users to\n> use it in their schemas.\n> \n> But it requires an initdb and we're in BETA. So I better ask\n> if someone complains.\n\nthis close to the beginning of beta, I would say go for it ... the\nbenefits of doing so, as I undesrtand it, *far* outweighs the disadvantage\nof requiring an initdb ...\n\n\n", "msg_date": "Fri, 25 Feb 2000 17:14:25 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] LZTEXT for rule plan stings" }, { "msg_contents": "At 09:36 PM 2/25/00 +0100, Jan Wieck wrote:\n\n> But it requires an initdb and we're in BETA. So I better ask\n> if someone complains.\n\nWell...here's an example of a view that worked in 6.5, with an 8KB\nblock size, that fails in 7.0 unless I build with a 16KB block size:\n\ncreate view ec_products_displayable\nas\nselect * from ec_products\nwhere active_p='t';\n\nImpressively large, eh? :) I was kinda grossed out when Postgres\nchoked on it, to be honest.\n\nec_products in this case has quite a few columns...\n\nYou know, I've investigated further and the rule string itself is\nno where near 8KB. More like 1KB. So there is more to the story\nthan just the string itself.\n\nStill, it should help because most of my failing views were just\na bit over 8KB. One still fails with a 16KB block size, though!\nFortunately it's not currently used in the web tool kit.\n\nAnyway, it seems to me that we need SOME solution to this problem.\nIt is going to be hard to convince users that views like the one\nabove are really too complex for Postgres to handle.\n\nI still like the idea of \"text\" being implemented under the hood\nas lzText for a quick 7.1 release if that idea works out ...\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, 25 Feb 2000 13:29:40 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] LZTEXT for rule plan stings" }, { "msg_contents": "Don Baccus wrote:\n> \n> \n> I still like the idea of \"text\" being implemented under the hood\n> as lzText for a quick 7.1 release if that idea works out ...\n\nBut without TOAST it would result in _undefined_ max tuple length,\nwhich is probably not desirable.\n\nUsing it for views is another thing as their max size was undefined \nto begin with.\n\n-----------\nHannu\n", "msg_date": "Sat, 26 Feb 2000 03:02:22 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] LZTEXT for rule plan stings" }, { "msg_contents": "At 03:02 AM 2/26/00 +0200, Hannu Krosing wrote:\n>Don Baccus wrote:\n>> \n>> \n>> I still like the idea of \"text\" being implemented under the hood\n>> as lzText for a quick 7.1 release if that idea works out ...\n>\n>But without TOAST it would result in _undefined_ max tuple length,\n>which is probably not desirable.\n\nBoy, I'd sure find it desirable. There's nothing to stop people from\nusing varchar(8000) or whatever if they want a predictable top limit.\nText is not a standard type, and this wouldn't break standard semantics.\n\nlzText wasn't removed because folks thought it was useless, IIRC,\nit was removed because TOAST was an exciting and much more powerful\napproach and no one wanted to introduce a new type doomed to disappear\nafter a single release cycle.\n\nWith TOAST, from the user's point of view you'll still have an\n_undefined_ max tuple length - the max will just be really, really\nlarge. Sure, the tuples will actually be fixed but large varying\ntypes can be split off into a series of tuples in the TOASTer\noven, so to speak. So I guess I have difficulty understanding\nyour argument.\n\nIf text were implemented as lzText for a quick 7.1, which apparently\nwas Jan's spin on the idea, then for 7.1 we'd say:\n\n\"maximum number of characters you can store in a column of type\n text varies\"\n\nand after TOAST we'd say:\n\n\"maximum number of characters you can store in a column of type\n text varies\"\n\nRight? The only difference is that the _undefined_ maximum in\nthe non-TOAST case is \"thousands of characters\" and in the TOAST\ncase \"gigabytes of characters\" but undefined is undefined in my\nbook.\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, 25 Feb 2000 17:15:52 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] LZTEXT for rule plan stings" }, { "msg_contents": "Don Baccus <[email protected]> writes:\n> Well...here's an example of a view that worked in 6.5, with an 8KB\n> block size, that fails in 7.0 unless I build with a 16KB block size:\n\n> create view ec_products_displayable\n> as\n> select * from ec_products\n> where active_p='t';\n\n> You know, I've investigated further and the rule string itself is\n> no where near 8KB. More like 1KB. So there is more to the story\n> than just the string itself.\n\nReally? That's interesting. Could you send me a test case\n(create table and create view commands)?\n\n\t\t\tregards, tom lane\n", "msg_date": "Fri, 25 Feb 2000 20:17:17 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] LZTEXT for rule plan stings " }, { "msg_contents": "At 08:17 PM 2/25/00 -0500, Tom Lane wrote:\n>Don Baccus <[email protected]> writes:\n>> Well...here's an example of a view that worked in 6.5, with an 8KB\n>> block size, that fails in 7.0 unless I build with a 16KB block size:\n>\n>> create view ec_products_displayable\n>> as\n>> select * from ec_products\n>> where active_p='t';\n>\n>> You know, I've investigated further and the rule string itself is\n>> no where near 8KB. More like 1KB. So there is more to the story\n>> than just the string itself.\n>\n>Really? That's interesting. Could you send me a test case\n>(create table and create view commands)?\n\nI'll try to get to it soon.\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, 25 Feb 2000 17:17:37 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] LZTEXT for rule plan stings " }, { "msg_contents": "[email protected] (Jan Wieck) writes:\n> Will work on a NOTICE/ERROR message now, preventing users to\n> use it in their schemas.\n\nI think a NOTICE is sufficient --- people who really need it will\ngo in and dike out any ERROR anyway ;-)\n\n> But it requires an initdb and we're in BETA. So I better ask\n> if someone complains.\n\nNot me.\n\n\t\t\tregards, tom lane\n", "msg_date": "Fri, 25 Feb 2000 20:18:31 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] LZTEXT for rule plan stings " }, { "msg_contents": "At 08:18 PM 2/25/00 -0500, Tom Lane wrote:\n>[email protected] (Jan Wieck) writes:\n>> Will work on a NOTICE/ERROR message now, preventing users to\n>> use it in their schemas.\n>\n>I think a NOTICE is sufficient --- people who really need it will\n>go in and dike out any ERROR anyway ;-)\n\nIt will also be very easy to upgrade to TOAST for those of us who\nare knowledgable enough to edit our pg_dumps from \"lztext\" to \"text\"\nwhen that feature finally comes out. We'll undoubtably have to\ndump and reload anyway :)\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, 25 Feb 2000 17:32:05 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] LZTEXT for rule plan stings " }, { "msg_contents": "At 08:17 PM 2/25/00 -0500, Tom Lane wrote:\n\n>Really? That's interesting. Could you send me a test case\n>(create table and create view commands)?\n\nNormally, I wouldn't post the test case to the whole group\nbut figured folks might find this interesting. It's not all\nthat complex a table and the view of course is very simple.\n\nNow...this is running on a snapshot from last weekend, just\nbefore you fixed the pg_dump/reload problem associated with\ncolumn alias and views. I tried downloading the latest sources\nvia CVS and got bit by the \"it don't compile\" problem others\nhave complained about earlier today (ecpg). Here's the test\ncase:\n\ncreate table ec_products (\n product_id integer not null primary key,\n sku varchar(100),\n product_name varchar(200),\n creation_date datetime default current_timestamp not null,\n one_line_description varchar(400),\n detailed_description varchar(4000),\n search_keywords varchar(4000),\n price numeric,\n shipping numeric,\n shipping_additional numeric,\n weight float4,\n dirname varchar(200),\n present_p char(1) check (present_p in ('f','t')) default 't',\n active_p char(1) check (active_p in ('f','t')) default 't',\n available_date datetime default current_timestamp not null,\n announcements varchar(4000),\n announcements_expire datetime,\n url varchar(300),\n template_id integer,\n stock_status char(1) check (stock_status in ('o','q','m','s','i')),\n last_modified datetime not null,\n last_modifying_user integer not null,\n modified_ip_address varchar(20) not null\n);\n\ncreate view ec_products_displayable\nas\nselect * from ec_products e\nwhere active_p='t';\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, 25 Feb 2000 17:54:43 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] LZTEXT for rule plan stings " }, { "msg_contents": "Don Baccus wrote:\n\n> At 03:02 AM 2/26/00 +0200, Hannu Krosing wrote:\n> >Don Baccus wrote:\n> >>\n> >>\n> >> I still like the idea of \"text\" being implemented under the hood\n> >> as lzText for a quick 7.1 release if that idea works out ...\n> >\n> >But without TOAST it would result in _undefined_ max tuple length,\n> >which is probably not desirable.\n\n True.\n\n> Boy, I'd sure find it desirable. There's nothing to stop people from\n> using varchar(8000) or whatever if they want a predictable top limit.\n> Text is not a standard type, and this wouldn't break standard semantics.\n>\n> lzText wasn't removed because folks thought it was useless, IIRC,\n> it was removed because TOAST was an exciting and much more powerful\n> approach and no one wanted to introduce a new type doomed to disappear\n> after a single release cycle.\n\n True.\n\n> With TOAST, from the user's point of view you'll still have an\n> _undefined_ max tuple length - the max will just be really, really\n> large. Sure, the tuples will actually be fixed but large varying\n> types can be split off into a series of tuples in the TOASTer\n> oven, so to speak. So I guess I have difficulty understanding\n> your argument.\n\n False.\n\n With TOAST, the maximum tuple length is limited by available\n disk space (minus some overhead) and/or the number of bits we\n use to represent the values original size and/or the size\n addressable by the TOAST'ers table at all. Available space\n allways limits the amount of data in a DB, and you allways\n have to take some overhead into account, but calling this\n _undefined_ isn't correct IMHO - better call it hard to\n figure out.\n\n The number of bits representing the attributes size is\n another story, because we already decided to use some of the\n top bits for special purposes, so a single attribute will\n have some limit around 1/4 to 1 GB. Not too bad I think, who\n would ever attempt to store a complete server backup in one\n tuple? And which client/server combo will be able to handle\n the required queries using the existing FE/BE protocol and\n libpq implementation either. Thus there are other limits\n causing problems before we need to continue this discussion,\n surely.\n\n> If text were implemented as lzText for a quick 7.1, which apparently\n> was Jan's spin on the idea, then for 7.1 we'd say:\n\n On the first look, it was a tempting solution. But there are\n ton's of places in the backend, that assume text is binary\n compatible to something or the bytes after the VARSIZE are\n plain value bytes, not some compressed garbage to be passed\n through a function first. Replacing TEXT by LZTEXT therefore\n wouldn't be such an easy job, but would be working for the\n wastebasked from the very beginning anyway, because TOAST\n needs to revert it all again.\n\n I don't like that kind of work.\n\n Maybe I found some kind of compromise:\n\n - We make LZTEXT a released type, without warning and anyone\n can use it as needed.\n\n - When featuring TOAST, we remove it and create a type\n alias. This way, the \"backend\" will convert the table\n schemas (WRT lztext->text) at reload time of the\n conversion.\n\n - We keep the type alias active past the next one or two\n major releases. Someone skipping major releases,\n converting from say 7.1 to 9.2, will have other problems\n than replacing all occurences of lztext by text in his\n dumps.\n\n Actually I have some problems with the type coercion stuff.\n There are functions lztext(text) and vice versa, but the\n system is unable to find an \"=\" operator for lztext and text\n when issuing\n\n SELECT * FROM t1, t2, WHERE t1.lztext_att = t2.text_att;\n\n This worked in the past releases (IIRC), so I wonder if the\n failure above is a wanted \"feature\". I'll commit the stuff I\n have tomorrow and hope someone can help me to get the\n coercion working. All we have to do then is to tell in the\n release notes and docs \"Never use LZTEXT type name explicitly\n in an application query (like for type casting) - use TEXT\n instead\".\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": "Sat, 26 Feb 2000 04:06:05 +0100 (CET)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": true, "msg_subject": "Re: [HACKERS] LZTEXT for rule plan stings" }, { "msg_contents": "At 04:06 AM 2/26/00 +0100, Jan Wieck wrote:\n\n> False.\n\n> With TOAST, the maximum tuple length is limited by available\n> disk space (minus some overhead) and/or the number of bits we\n> use to represent the values original size and/or the size\n> addressable by the TOAST'ers table at all. Available space\n> allways limits the amount of data in a DB, and you allways\n> have to take some overhead into account, but calling this\n> _undefined_ isn't correct IMHO - better call it hard to\n> figure out.\n\nSame is true for non-TOAST lzText.\n\nOr...non lzText text, for that matter.\n\nOf course, the size of text IS UNDEFINED TODAY.\n\ncreate table foo (\n t1 text,\n t2 text);\n\nPray tell, what is the maximum size of t1? \n\nIs it independent of t2? Or...correct me if I'm mistaken...if t2\ncontains 8,000+ characters won't \"insert\" bomb me if I try to \ninsert 8,000+ characters into t1? Or even a few characters? Exactly\nwhere is this vaunted and well defined limit?\n\n(oops - you can't answer that question because it depends on the\nsize of BLCKSZ, which of course one can change at will)\n\nThe maximum size of \"text\" is already undefined, as it depends on:\n\nBLCKSZ (which the user may not've set herself, and maybe is unaware of\nif she's a user at the mercy of some sysadmin)\n\nand \n\nthe actual bytes occupied by other variable-length columns.\n\n\"bytea\" for instance. \"text\" for instance. \"varchar(n)\" for instance,\nwhich actually is a variable-length string which has a maximum value.\n\nPG lets me do this:\n\ncreate table foo (\n t1 varchar(8000),\n t2 varchar(8000),\n tn varchar(8000) -- n fairly large\n);\n\nCan I insert 8K chars into t1?\n\nInto t2?\n\nInto t3?\n\nTrick PG question - into all three at once?\n\nSorry, but this is a crap argument. There is no way to know how\nmany characters you can insert into a \"text\" column unless you have\ndetailed knowledge of the table, not only the types in the table\nbut the data stored in the pertinent row of the table.\n\nI should know, I've been fighting this when porting code over from\nOracle, where the blocksize truly limits the size of ONE COLUMN,\nnot a row (tuple) at large.\n\nIf I can really have a tuple with 1000 varchar(BLCKSZ-overhead) columns,\nfully filled with data, could you please tell me how to do this? My\nlife will be much simpler.\n\n>> If text were implemented as lzText for a quick 7.1, which apparently\n>> was Jan's spin on the idea, then for 7.1 we'd say:\n>\n> On the first look, it was a tempting solution. But there are\n> ton's of places in the backend, that assume text is binary\n> compatible to something or the bytes after the VARSIZE are\n> plain value bytes, not some compressed garbage to be passed\n> through a function first. Replacing TEXT by LZTEXT therefore\n> wouldn't be such an easy job, but would be working for the\n> wastebasked from the very beginning anyway, because TOAST\n> needs to revert it all again.\n\n> I don't like that kind of work.\n\nNor do I, which is why I didn't suggest it when lzText first came up\nand drifted into a TOAST discussion. Clearly, TOAST is a better\nsolution.\n\nIn particular, it solves Hannu's objection regarding the fact that\na compressed text type would have no fixed upper limit.\n\nBetter yet, it would solve Hannu's misunderstanding that today's\ntext type has such a limit.\n\nBecause (I love flogging dead horses):\n\ncreate table foo (\n i: integer,\n t: text);\n\nand \n\ncreate table bar (\n t: text);\n\ncreate two columns T with different maximum limits. Because the\nlimit is based on tuple-size.\n\nA compressed text type is only a bad idea because it's a dead end.\nNot because it turns a \"defined\" max text limit into an undefined\nmax text limit. The maximum number of chars you can stuff into\na text var is always undefined unless you dissect exactly how\nother columns eat storage.\n\n> Maybe I found some kind of compromise:\n>\n> - We make LZTEXT a released type, without warning and anyone\n> can use it as needed.\n>\n> - When featuring TOAST, we remove it and create a type\n> alias. This way, the \"backend\" will convert the table\n> schemas (WRT lztext->text) at reload time of the\n> conversion.\n\nI have no strong feelings here. Personally, I can live with just\ncompiling PG with a 16KB blocksize, for the work I'm doing today.\n\nBut I don't think the upgrade problem's a big deal. If the type's\nnot popularized, only those of us \"inside\" will know of it, and as\nfar as I'm concerned, hand-editing a pg_dump would be fine with me if\nI choose to use it.\n\nBut I'm only speaking for myself.\n\nTOAST is clearly the way to go.\n\nOn the other hand, I don't see people flinging bricks at Interbase\nfor compressing their text type. After all, they have outer joins...\n\n> Actually I have some problems with the type coercion stuff.\n> There are functions lztext(text) and vice versa, but the\n> system is unable to find an \"=\" operator for lztext and text\n> when issuing\n>\n> SELECT * FROM t1, t2, WHERE t1.lztext_att = t2.text_att;\n>\n> This worked in the past releases (IIRC), so I wonder if the\n> failure above is a wanted \"feature\". I'll commit the stuff I\n> have tomorrow and hope someone can help me to get the\n> coercion working. All we have to do then is to tell in the\n> release notes and docs \"Never use LZTEXT type name explicitly\n> in an application query (like for type casting) - use TEXT\n> instead\".\n\nDespite the above, I have no really strong feelings. I only raised\nthe compressed text issue because my (belated) reading of the Interbase\ndocs made it clear that they do this, and Tom resurrected lztext in\nregard to views (and my problems there probably made it a red herring\nin this case, too!) It's an interesting idea, and if TOAST is indeed\nimplemented probably a moot one. Though...where is the crossover between\nan in-place compression and moving an item to the TOASTed table. And...\nall of the problems with the backend making assumptions about text\netc will have to be addressed by the TOASTER, too.\n\nFor instance...varchar(4000) might still benefit from being compressed,\neven if it is not TOASTed, due to PG's love of dragging full tuples\naround. Saves disk space. Bigger slices of tables can be sorted in\nmemory vs. disk for any given backend sort/hash buffer size parameter.\nToday's x86 CPUs, at least, favor shrinking the memory footprint of\ndata due to the fact that CPUs tend to be data-starved when working\non large amounts of data in RAM. Etc etc etc. So such a compressed\nimplementation may actually be a win even if Hannu's made happy by\naffixing fixed varchar(n) limits on the column length.\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, 25 Feb 2000 21:15:13 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] LZTEXT for rule plan stings" }, { "msg_contents": "Don Baccus <[email protected]> writes:\n> Here's the test case:\n\nHmm. I get a rule string exceeding 8K out of this (in current sources),\nas checked by breakpointing at InsertRule() in rewriteDefine.c and\nlooking at 'actiontree'.\n\nWhat's your basis for asserting the rule is only ~ 1K?\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 26 Feb 2000 01:27:19 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] LZTEXT for rule plan stings " }, { "msg_contents": "Don Baccus wrote:\n> \n> Boy, I'd sure find it desirable. There's nothing to stop people from\n> using varchar(8000) or whatever if they want a predictable top limit.\n> Text is not a standard type, and this wouldn't break standard semantics.\n>\n> lzText wasn't removed because folks thought it was useless, IIRC,\n> it was removed because TOAST was an exciting and much more powerful\n> approach and no one wanted to introduce a new type doomed to disappear\n> after a single release cycle.\n> \n> With TOAST, from the user's point of view you'll still have an\n> _undefined_ max tuple length - the max will just be really, really\n> large. Sure, the tuples will actually be fixed but large varying\n> types can be split off into a series of tuples in the TOASTer\n> oven, so to speak. So I guess I have difficulty understanding\n> your argument.\n\nAcutually it was not undefined but variable that made me uncertain - \ni.e. the fact that max size depends on the contents of string\n\n> If text were implemented as lzText for a quick 7.1, which apparently\n> was Jan's spin on the idea, then for 7.1 we'd say:\n> \n> \"maximum number of characters you can store in a column of type\n> text varies\"\n\n... varies from below 8K to ~100K depending on the redundancy of data\"\n\n> and after TOAST we'd say:\n> \n> \"maximum number of characters you can store in a column of type\n> text varies\"\n\nRather \"maximum number of characters you can store in a column of type\n text is limited by available memory and/or disk space\"\n\n-----------------\nHannu\n", "msg_date": "Sat, 26 Feb 2000 14:41:29 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] LZTEXT for rule plan stings" }, { "msg_contents": "At 01:27 AM 2/26/00 -0500, Tom Lane wrote:\n>Don Baccus <[email protected]> writes:\n>> Here's the test case:\n>\n>Hmm. I get a rule string exceeding 8K out of this (in current sources),\n>as checked by breakpointing at InsertRule() in rewriteDefine.c and\n>looking at 'actiontree'.\n>\n>What's your basis for asserting the rule is only ~ 1K?\n\nI looked at the string dumped by pg_dump and it didn't appear to be\nanywhere near 8KB, so I presumed that the actual data stuffed into\nthe rule is larger than whatever gets dumped out as the source\nrepresentation.\n\nI've never looked at the implementation of rules, so it's unclear\nto me just exactly what is being saved and just how much of it\nusing lzText would impact.\n\nI had breakpointed the debugger at first and that's why I first\nsaid apparently the rule string was > 8KB. Then I looked at \npg_dump output and had doubts that the answer was this simple...\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, 26 Feb 2000 06:46:23 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] LZTEXT for rule plan stings " }, { "msg_contents": "At 02:41 PM 2/26/00 +0200, Hannu Krosing wrote:\n\n>Rather \"maximum number of characters you can store in a column of type\n> text is limited by available memory and/or disk space\"\n\nTOAST is obviously ideal, so in a sense this discussion's pointless\nbecause I have no doubt TOAST will happen.\n\nWe could still put an 8KB upper limit on a compressed text type if\nwe wish. The size savings would be a plus, and you'd be able to\nhave full-sized 8KB text columns in many tables, at least, that carry\na bunch of other cruft around.\n\nThat's really the problem I run in porting over the web toolkit\nfrom arsDigita.\n\nI see tables that have two or three varchar(4000) columns with other\ndata, i.e. names and stuff that are also varchar but smaller. I know\nthat these don't actually get stuffed with 4000 chars but rather\nthat 4KB is the upper limit of the size of an Oracle varchar and that\nthe author's been lazy. If I had a compressed text or varchar type\nI'd be quite confident that the application code would run even with\nan 8KB block size.\n\nIn the interim. Until TOAST comes or until I have time to dig into\nthe code and determine more accurate and reasonable sizes for the\nvarchars.\n\nOn the other hand, as I've mentioned I'm also just as happy to run\nwith a 16KB block size. From the point of view of distributing the\nweb toolkit, some of our little group feel uncomfortable with that\nrequirement but it doesn't really bother me as I know TOAST will solve\nthe problem and that by end of year we'll be able to run the toolkit\non a default installation of Postgres.\n\nSo I'm happy, I run with a 16KB block size and eagerly await TOASTed\ntuples.\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, 26 Feb 2000 06:58:40 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] LZTEXT for rule plan stings" }, { "msg_contents": "> I see tables that have two or three varchar(4000) columns with other\n> data, i.e. names and stuff that are also varchar but smaller. I know\n> that these don't actually get stuffed with 4000 chars but rather\n> that 4KB is the upper limit of the size of an Oracle varchar and that\n> the author's been lazy. If I had a compressed text or varchar type\n> I'd be quite confident that the application code would run even with\n> an 8KB block size.\n\nJust to clearify, varchar(4000) does not take 4000 chars on disk, while\nchar(4000) does use 4000 chars on the disk.\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, 26 Feb 2000 10:36:20 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] LZTEXT for rule plan stings" }, { "msg_contents": "Don Baccus <[email protected]> writes:\n>> What's your basis for asserting the rule is only ~ 1K?\n\n> I looked at the string dumped by pg_dump and it didn't appear to be\n> anywhere near 8KB, so I presumed that the actual data stuffed into\n> the rule is larger than whatever gets dumped out as the source\n> representation.\n\nYes, the source representation is *vastly* more compact. A single\nresult column might look like \"tab1.product_id\" when dumped by pg_dump,\nbut the nodetree dump looks more like\n\n { TARGETENTRY \n :resdom \n { RESDOM \n :resno 1 \n :restype 23 \n :restypmod -1 \n :resname product_id \n :reskey 0 \n :reskeyop 0 \n :ressortgroupref 0 \n :resjunk false \n }\n \n :expr \n { VAR \n :varno 1 \n :varattno 1 \n :vartype 23 \n :vartypmod -1 \n :varlevelsup 0 \n :varnoold 1 \n :varoattno 1\n }\n }\n\nand (except for not using any excess whitespace) that is exactly what\ngoes into a rule action string.\n\nAs you can see, this is very amenable to compression, especially\nwhen you have a lot of columns in a view.\n\nSomeday we might think about using a more compact representation for\nstored rules, but there are advantages to using a format that's fairly\neasy for a human to examine.\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 26 Feb 2000 12:15:19 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] LZTEXT for rule plan stings " }, { "msg_contents": "At 10:36 AM 2/26/00 -0500, Bruce Momjian wrote:\n>> I see tables that have two or three varchar(4000) columns with other\n>> data, i.e. names and stuff that are also varchar but smaller. I know\n>> that these don't actually get stuffed with 4000 chars but rather\n>> that 4KB is the upper limit of the size of an Oracle varchar and that\n>> the author's been lazy. If I had a compressed text or varchar type\n>> I'd be quite confident that the application code would run even with\n>> an 8KB block size.\n>\n>Just to clearify, varchar(4000) does not take 4000 chars on disk, while\n>char(4000) does use 4000 chars on the disk.\n\nYes, I know. The point is that without digging into how the code actually\nuses these tables, I don't know which, if any, of the columns might\nactually get stuffed with two, three, or four thousand characters. If\nI'm unlucky, all of them will be. For now my simple solution is to\nrun with a 16KB blocksize and not worry about it.\n\nThis isn't postgresql's fault or whatever, the basic problem is a\nlazy web hacker arbitrarily declaring varchar(4000) columns rather\nthan sitting down and determining what they need, because in Oracle\nthe amount taken is also only the number of bytes in the string\nstuffed into the column.\n\nThis is kind of a pointless discussion. We all know that TOAST is\ngoing to be ultra-slick.\n\nlztext was resurrected as an idea by Tom Lane in response to the\nexplosion in the length of the rule strings generated for views\nin PG7.0.\n\nThat just triggered a memory on my part that Interbase apparently\ncompresses their text type, a fact I found interesting enough to\nmention.\n\nI'm neither lobbying for or against Postgres implementation of lztext,\ntext as lztext, or anything else.\n\nI just found the notion interesting...\n\nIt would be nice if a simple table/view combination such as I posted\nhere earlier didn't bomb PG7.0 with a default 8KB blocksize, though!\n\nMy own views are working fine since I've switched to a 16KB blocksize\nfor the reasons hinted at above, but the fact that this example fails\nin the default 8KB version is pretty grotty. Tom Lane will probably\nhave it all fixed via lztext or some other method before most of the\nfolks on this list read this note :)\n\nRegarding large types, TOAST is clearly the path to follow, and Jan's\nplans for TOASTed couples includes compression when appropriate. I\nalso think we can layer SQL3-compliant BLOBs and CLOBs on top of his\nTOAST implementation later on - for compatibility reasons only, of\ncourse.\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, 26 Feb 2000 10:49:14 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] LZTEXT for rule plan stings" }, { "msg_contents": "At 12:15 PM 2/26/00 -0500, Tom Lane wrote:\n\n>and (except for not using any excess whitespace) that is exactly what\n>goes into a rule action string.\n>\n>As you can see, this is very amenable to compression, especially\n>when you have a lot of columns in a view.\n>\n>Someday we might think about using a more compact representation for\n>stored rules, but there are advantages to using a format that's fairly\n>easy for a human to examine.\n\nOh, now I understand, I didn't realize the tree was being stored in\nhuman-readable form as a string, but thought it was being parsed into\na binary form. That's why I began having doubts that I might've triggered\nunecessary work on Jan's part regarding lztext. Yes, since it's\nstored as a text string lztext should help a LOT.\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, 26 Feb 2000 10:55:12 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] LZTEXT for rule plan stings " }, { "msg_contents": "Don Baccus <[email protected]> writes:\n> My own views are working fine since I've switched to a 16KB blocksize\n> for the reasons hinted at above, but the fact that this example fails\n> in the default 8KB version is pretty grotty. Tom Lane will probably\n> have it all fixed via lztext or some other method before most of the\n> folks on this list read this note :)\n\nNot me --- Jan gets the credit for lztext.\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 26 Feb 2000 16:35:09 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] LZTEXT for rule plan stings " }, { "msg_contents": "At 04:35 PM 2/26/00 -0500, Tom Lane wrote:\n>Don Baccus <[email protected]> writes:\n>> My own views are working fine since I've switched to a 16KB blocksize\n>> for the reasons hinted at above, but the fact that this example fails\n>> in the default 8KB version is pretty grotty. Tom Lane will probably\n>> have it all fixed via lztext or some other method before most of the\n>> folks on this list read this note :)\n>\n>Not me --- Jan gets the credit for lztext.\n\nDid he hook it up to pg_rewrite, then? If so, I'll try downloading\nit and I'll toss my stuff at 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": "Sat, 26 Feb 2000 13:57:00 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] LZTEXT for rule plan stings " } ]
[ { "msg_contents": "Web Site Opportunity for Database Expert\n\nA group of business men and web site designers in the UK are working\non a revolutionary new web site that will take the retail-shopping\nworld by storm. They need to involve a leading UK database expert to\ncomplete the work. Interested persons should contact me for further\ndetails with a short resume of their experience.\n", "msg_date": "Sat, 26 Feb 2000 09:57:56 +0000", "msg_from": "[email protected]", "msg_from_op": true, "msg_subject": "Web Site Opportunity for Database Expert" } ]
[ { "msg_contents": "This was a helpful introduction to submitting bug reports:\n\n\thttp://www.freshmeat.net/news/2000/02/26/951627540.html\n\nMaybe add it to the web site?\n\n-- \n Bruce Momjian | http://www.op.net/~candle\n [email protected] | (610) 853-3000\n + If your life is a hard drive, | 830 Blythe Avenue\n + Christ can be your backup. | Drexel Hill, Pennsylvania 19026\n\n", "msg_date": "Sat, 26 Feb 2000 16:44:50 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Web page on bug reports" }, { "msg_contents": "Bruce Momjian writes:\n\n> This was a helpful introduction to submitting bug reports:\n> \n> \thttp://www.freshmeat.net/news/2000/02/26/951627540.html\n> \n> Maybe add it to the web site?\n\nWow, that is long. I once thought of writing up something along similar\nlines. Since you are apparently interested, I could but an abbreviated and\nfitted to PostgreSQL edition in the user's guide.\n\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Mon, 28 Feb 2000 00:56:36 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Web page on bug reports" }, { "msg_contents": "On Mon, 28 Feb 2000, Peter Eisentraut wrote:\n\n> Bruce Momjian writes:\n> \n> > This was a helpful introduction to submitting bug reports:\n> > \n> > \thttp://www.freshmeat.net/news/2000/02/26/951627540.html\n> > \n> > Maybe add it to the web site?\n> \n> Wow, that is long. I once thought of writing up something along similar\n> lines. Since you are apparently interested, I could but an abbreviated and\n> fitted to PostgreSQL edition in the user's guide.\n\nThat is extremely long. I'd be interested in seeing what Peter could\ndo in a shortened version. It could go on the website.\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, 27 Feb 2000 21:04:29 -0500 (EST)", "msg_from": "Vince Vielhaber <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Web page on bug reports" }, { "msg_contents": "[Charset ISO-8859-1 unsupported, filtering to ASCII...]\n> Bruce Momjian writes:\n> \n> > This was a helpful introduction to submitting bug reports:\n> > \n> > \thttp://www.freshmeat.net/news/2000/02/26/951627540.html\n> > \n> > Maybe add it to the web site?\n> \n> Wow, that is long. I once thought of writing up something along similar\n> lines. Since you are apparently interested, I could but an abbreviated and\n> fitted to PostgreSQL edition in the user's guide.\n\nIf you want. Seems it is helpful for all bug report cases, not just\nPostgreSQL ones.\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, 27 Feb 2000 21:18:24 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Web page on bug reports" }, { "msg_contents": "> > Wow, that is long. I once thought of writing up something along similar\n> > lines. Since you are apparently interested, I could but an abbreviated \n> > and fitted to PostgreSQL edition in the user's guide.\n\nGreat. And we can point to the html version in the User's Guide from\nthe web page, to keep everything self-consistant. Much better than\nhaving a special web version vs printed/online docs.\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Mon, 28 Feb 2000 16:38:26 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Web page on bug reports" } ]
[ { "msg_contents": "Hello,\nHow can one differential between apparently duplicated usernames?\nFor example I have a postgres id 'www' present within my pg_shadow/pg_user.\nI recently installed a package and inadvertantly created another 'www' user.\nI have managed to remove the duplicate user by deleting it from pg_shadow by\nidentifying it via its usesysid field.\n\nHow can I\n\n1) Ensure I canot in future create duplicate names?\n2) If duplicate users are possible by what other means can the\n various instances of them be referenced?\n\nStephen\n\n----------------------------------------------\n010000C9\n\n", "msg_date": "Sat, 26 Feb 2000 17:01:55 -0800", "msg_from": "\"Stephen Martin\" <[email protected]>", "msg_from_op": true, "msg_subject": "" }, { "msg_contents": "Hello,\nas a post script to this..\nUnder normal circumstances one cannot add\nanother user of the same name (phew!:) )\nI think this was the result of a setup\nscript\nwriting directly into pg_shadow and pg_user;\n\nStephen\n\n----------------------------------------------\n010000C9\n\n-----Original Message-----\nFrom: [email protected]\n[mailto:[email protected]]On Behalf Of Stephen\nMartin\nSent: Saturday, February 26, 2000 5:00 PM\nTo: [email protected]\nSubject: [INTERFACES] Date: Sat, 26 Feb 2000 17:01:55 -0800\n\n\nHello,\nHow can one differential between apparently duplicated usernames?\nFor example I have a postgres id 'www' present within my pg_shadow/pg_user.\nI recently installed a package and inadvertantly created another 'www' user.\nI have managed to remove the duplicate user by deleting it from pg_shadow by\nidentifying it via its usesysid field.\n\nHow can I\n\n1) Ensure I canot in future create duplicate names?\n2) If duplicate users are possible by what other means can the\n various instances of them be referenced?\n\nStephen\n\n----------------------------------------------\n010000C9\n\n\n************\n\n", "msg_date": "Sat, 26 Feb 2000 17:15:34 -0800", "msg_from": "\"Stephen Martin\" <[email protected]>", "msg_from_op": true, "msg_subject": "RE: [INTERFACES] Date: Sat, 26 Feb 2000 17:01:55 -0800" }, { "msg_contents": "\"Stephen Martin\" <[email protected]> writes:\n> For example I have a postgres id 'www' present within my pg_shadow/pg_user.\n> I recently installed a package and inadvertantly created another 'www' user.\n\n> How can I\n> 1) Ensure I canot in future create duplicate names?\n\nThere should probably be a unique index on pg_shadow's usename field,\nand another one on the usesysid field (otherwise there's not a unique\nmap from sysids to users, which is bad since we use sysids as\nreferential keys in other tables).\n\nI'm surprised this hasn't been pointed out before :-(\n\nI'm not sure how difficult it would be to do it. Just creating\nan index with CREATE INDEX will not work, because pg_shadow is\nan installation-wide table and its index must be as well. There's\nsome routine somewhere in the backend that would have to be taught\nabout the index.\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 26 Feb 2000 20:47:08 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [INTERFACES] Date: Sat, 26 Feb 2000 17:01:55 -0800 " } ]
[ { "msg_contents": "I was looking at the trigger function that's been added to try to\nupdate pg_pwd automatically if pg_shadow is updated via standard\nSQL commands. It's got some problems:\n\n1. Since the trigger is executed as soon as a tuple is inserted/\nupdated/deleted, it will write pg_pwd before the transaction is\ncommitted. If you then abort the transaction, pg_pwd contains wrong\ndata. Even if you don't abort, the postmaster may read and act on the\nupdated pg_pwd before you've committed, which could have bad\nconsequences (logging in a user who doesn't exist yet, for example).\n\n2. The trigger tries to grab AccessExclusiveLock on pg_shadow.\nSince this is being done in the middle of a transaction that has\npreviously grabbed some lower level of lock on pg_shadow, it's\nvery easy to create a deadlock situation. All you need is two\ndifferent transactions modifying pg_shadow concurrently, and\nit'll fail.\n\n3. CREATE USER and friends refuse to run inside a transaction block\nin the vain hope of making life safe for the trigger. It's vain\nsince the above problems will occur anyway, if one simply alters\npg_shadow using ordinary SQL commands. (And if we're not going to\nsupport that, why bother with the trigger?) I think this is a rather\nunpleasant restriction, especially so when it isn't buying any\nsafety at all.\n\n\nA possible solution for these problems is to have the trigger procedure\nitself do nothing except set a flag variable. The flag is examined\nsomewhere in xact.c after successful completion of a transaction,\nand if it's set then we run a new transaction cycle in which we\nread pg_shadow and write pg_pwd. (A new transaction is needed so\nthat it's safe to demand AccessExclusiveLock on pg_shadow --- we\nhave to release all our old locks before we can do that.) Note that\n*only* this second transaction would need AccessExclusiveLock; CREATE\nUSER and friends would not.\n\nI am not quite certain that this is completely bulletproof when there\nare multiple backends concurrently updating pg_shadow, but I have not\nbeen able to think of a case where it'd fail. The worst possibility\nis that a committed update in pg_shadow might not get propagated to\npg_pwd for a while because some other transaction is holding a lock on\npg_shadow. (But pg_pwd updates can be delayed for that reason now,\nso it's certainly no worse than before.)\n\nComments?\n\n\t\t\tregards, tom lane\n", "msg_date": "Sat, 26 Feb 2000 23:48:49 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "update_pg_pwd trigger does not work very well" }, { "msg_contents": "> I am not quite certain that this is completely bulletproof when there\n> are multiple backends concurrently updating pg_shadow, but I have not\n> been able to think of a case where it'd fail. The worst possibility\n> is that a committed update in pg_shadow might not get propagated to\n> pg_pwd for a while because some other transaction is holding a lock on\n> pg_shadow. (But pg_pwd updates can be delayed for that reason now,\n> so it's certainly no worse than before.)\n> \n> Comments?\n\nI see your point. Guess we have to do it inside xact.\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, 27 Feb 2000 00:35:42 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] update_pg_pwd trigger does not work very well" }, { "msg_contents": "help\n", "msg_date": "Sat, 26 Feb 2000 21:52:14 -0800", "msg_from": "\"Ray Messier\" <[email protected]>", "msg_from_op": false, "msg_subject": "" }, { "msg_contents": "Tom Lane writes:\n\n> 1. Since the trigger is executed as soon as a tuple is inserted/\n> updated/deleted, it will write pg_pwd before the transaction is\n> committed. If you then abort the transaction, pg_pwd contains wrong\n> data.\n\nWow, that implies that every trigger that contains non-database\nside-effects is potentially bogus. That never occured to me. Perhaps (as a\nfuture plan), it would be a good idea to have deferred triggers as well?\nNow that I think of it, wasn't that the very reason Jan had to invent the\nseparate constraint triggers?\n\n> 2. The trigger tries to grab AccessExclusiveLock on pg_shadow.\n\nIt doesn't actually need that exclusive lock, I think. A shared read lock\n(i.e., none really) would suffice.\n\n> A possible solution for these problems is to have the trigger procedure\n> itself do nothing except set a flag variable. The flag is examined\n> somewhere in xact.c after successful completion of a transaction,\n> and if it's set then we run a new transaction cycle in which we\n> read pg_shadow and write pg_pwd.\n\nIf you think that this is okay (and not just a hack), then go for it. If\nthe above mentioned deferred triggers are at all in the near future I\nwouldn't mind scrapping that trigger altogether. There isn't a good reason\nto muck with pg_shadow.{usename|password|validuntil} anyway. And it is in\ngeneral not safe to muck with system catalogs period. (Try to rename a\ntable by updating pg_class.relname. ;)\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": "Mon, 28 Feb 2000 00:54:45 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] update_pg_pwd trigger does not work very well" }, { "msg_contents": "[Charset ISO-8859-1 unsupported, filtering to ASCII...]\n> Tom Lane writes:\n> \n> > 1. Since the trigger is executed as soon as a tuple is inserted/\n> > updated/deleted, it will write pg_pwd before the transaction is\n> > committed. If you then abort the transaction, pg_pwd contains wrong\n> > data.\n> \n> Wow, that implies that every trigger that contains non-database\n> side-effects is potentially bogus. That never occured to me. Perhaps (as a\n> future plan), it would be a good idea to have deferred triggers as well?\n> Now that I think of it, wasn't that the very reason Jan had to invent the\n> separate constraint triggers?\n\nYes! I remember him talking about this. I bet you can just modify your\ntrigger to be of that type.\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, 27 Feb 2000 19:18:22 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] update_pg_pwd trigger does not work very well" }, { "msg_contents": "Peter Eisentraut wrote:\n\n> Tom Lane writes:\n>\n> > 1. Since the trigger is executed as soon as a tuple is inserted/\n> > updated/deleted, it will write pg_pwd before the transaction is\n> > committed. If you then abort the transaction, pg_pwd contains wrong\n> > data.\n>\n> Wow, that implies that every trigger that contains non-database\n> side-effects is potentially bogus. That never occured to me. Perhaps (as a\n> future plan), it would be a good idea to have deferred triggers as well?\n> Now that I think of it, wasn't that the very reason Jan had to invent the\n> separate constraint triggers?\n\n The reason for the trigger queue was deferrability at all.\n And the way it's implemented doesn't help out.\n\n Imagine that the trigger not only affects external data, but\n does further checks and/or modifications to table data. If\n some statement affects multiple rows, a trigger ran from the\n queue can still abort the transaction, but earlier triggers\n have already done their external work.\n\n I think some \"AT COMMIT EXECUTE function(args)\" would be\n better. These functions go into a separate queue and shall\n not modify any database content any more. At least, it would\n restrict cases of external data inconsistency to cases, where\n external modifications fail.\n\n> > itself do nothing except set a flag variable. The flag is examined\n> > somewhere in xact.c after successful completion of a transaction,\n> > and if it's set then we run a new transaction cycle in which we\n> > read pg_shadow and write pg_pwd.\n>\n> If you think that this is okay (and not just a hack), then go for it.\n\n I consider it a hack, since this particular trigger needs a\n global flag known explicitly by xact routines. I like general\n solutions instead.\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, 28 Feb 2000 08:34:43 +0100 (CET)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": false, "msg_subject": "Re: [HACKERS] update_pg_pwd trigger does not work very well" }, { "msg_contents": "> [Charset ISO-8859-1 unsupported, filtering to ASCII...]\n> > Tom Lane writes:\n> >\n> > > 1. Since the trigger is executed as soon as a tuple is inserted/\n> > > updated/deleted, it will write pg_pwd before the transaction is\n> > > committed. If you then abort the transaction, pg_pwd contains wrong\n> > > data.\n> >\n> > Wow, that implies that every trigger that contains non-database\n> > side-effects is potentially bogus. That never occured to me. Perhaps (as a\n> > future plan), it would be a good idea to have deferred triggers as well?\n> > Now that I think of it, wasn't that the very reason Jan had to invent the\n> > separate constraint triggers?\n>\n> Yes! I remember him talking about this. I bet you can just modify your\n> trigger to be of that type.\n\n He could make the trigger look like a by default deferred RI\n trigger in pg_trigger, of course. Then it will go onto the\n queue.\n\n But as soon as someone does\n\n SET CONSTRAINTS ALL IMMEDIATE;\n\n it will be fired if queued or as soon as it appears. So it's\n not the final solution.\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, 28 Feb 2000 08:47:21 +0100 (CET)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": false, "msg_subject": "Re: [HACKERS] update_pg_pwd trigger does not work very well" }, { "msg_contents": "[email protected] (Jan Wieck) writes:\n>>>> itself do nothing except set a flag variable. The flag is examined\n>>>> somewhere in xact.c after successful completion of a transaction,\n>>>> and if it's set then we run a new transaction cycle in which we\n>>>> read pg_shadow and write pg_pwd.\n>> \n>> If you think that this is okay (and not just a hack), then go for it.\n\n> I consider it a hack, since this particular trigger needs a\n> global flag known explicitly by xact routines. I like general\n> solutions instead.\n\nWell, really it's pg_pwd itself that is a hack --- we wouldn't need\nto be worrying about all this if pg_pwd didn't exist outside the\ndatabase/transaction universe. But I don't think it'd be wise to\ntry to bring the postmaster into that universe, so we're stuck with\na hack for exporting user authorization info.\n\nIf we had examples of other problems that could be solved by such\na mechanism, then I'd agree with Jan that we ought to invent a general\nafter-commit-do mechanism. But I don't recall users clamoring for it,\nso I question whether the extra effort is worthwhile.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 28 Feb 2000 03:02:22 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] update_pg_pwd trigger does not work very well " }, { "msg_contents": "Tom Lane wrote:\n\n> [email protected] (Jan Wieck) writes:\n> > I consider it a hack, since this particular trigger needs a\n> > global flag known explicitly by xact routines. I like general\n> > solutions instead.\n>\n> Well, really it's pg_pwd itself that is a hack --- we wouldn't need\n> to be worrying about all this if pg_pwd didn't exist outside the\n> database/transaction universe. But I don't think it'd be wise to\n> try to bring the postmaster into that universe, so we're stuck with\n> a hack for exporting user authorization info.\n>\n> If we had examples of other problems that could be solved by such\n> a mechanism, then I'd agree with Jan that we ought to invent a general\n> after-commit-do mechanism. But I don't recall users clamoring for it,\n> so I question whether the extra effort is worthwhile.\n\n Exactly these days there was someone having trouble to\n dynamically load the tclLDAP package into PL/Tcl. He wanted\n to UPDATE his LDAP from inside a trigger.\n\n If he hasn't had this loading problem, I'd never known. So I\n assume there are already constructs like this out there.\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, 28 Feb 2000 09:13:38 +0100 (CET)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": false, "msg_subject": "Re: [HACKERS] update_pg_pwd trigger does not work very well" }, { "msg_contents": "At 08:34 AM 2/28/00 +0100, Jan Wieck wrote:\n\n> I consider it a hack, since this particular trigger needs a\n> global flag known explicitly by xact routines. I like general\n> solutions instead.\n\nIt's very much a hack. Something like the \"on commit execute()\" \nsolution would be much better. How crucial is a short-term fix\nfor this particular problem? Could it wait until a more generalized\nfacility is provided?\n\nIf not I suppose it could be hacked in with copious notes that it\nshould be redone later.\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, 28 Feb 2000 06:16:20 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] update_pg_pwd trigger does not work very well" } ]
[ { "msg_contents": "Well,\n\n LZTEXT is there again, and pg_rewrite uses it for action and\n qual strings. This is what it tells:\n\n pgsql=# select rulename, length(ev_action), octet_length(ev_action)\n pgsql-# from pg_rewrite;\n rulename | length | octet_length\n ----------------+--------+--------------\n _RETpg_user | 3043 | 855\n _RETpg_rules | 3074 | 1139\n _RETpg_views | 4261 | 1252\n _RETpg_tables | 5187 | 1338\n _RETpg_indexes | 3525 | 1122\n (5 rows)\n\n Yes, the 3043 bytes long rule action string got stored in 855\n bytes in pg_rewrite. That's 71.9% compression rate on this\n attempt!\n\n There are functions text(lztext) and lztext(text) too, but\n the system is unable to find an operator if one compares\n text=lztext in a query. IIRC, creating a function named as\n the target type and taking the source type is what made auto-\n type-conversion work - so what am I missing here?\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": "Sun, 27 Feb 2000 13:03:37 +0100 (CET)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": true, "msg_subject": "type coerce problem with lztext" }, { "msg_contents": "> Yes, the 3043 bytes long rule action string got stored in 855\n> bytes in pg_rewrite. That's 71.9% compression rate on this\n> attempt!\n> \n> There are functions text(lztext) and lztext(text) too, but\n> the system is unable to find an operator if one compares\n> text=lztext in a query. IIRC, creating a function named as\n> the target type and taking the source type is what made auto-\n> type-conversion work - so what am I missing here?\n\nAdded to Features:\n\n\tNew lztext data type for compressed text fields\n\tLarger views/rules supported\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, 27 Feb 2000 09:50:45 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] type coerce problem with lztext" }, { "msg_contents": "At 01:03 PM 2/27/00 +0100, Jan Wieck wrote:\n>Well,\n>\n> LZTEXT is there again, and pg_rewrite uses it for action and\n> qual strings. This is what it tells:\n>\n> pgsql=# select rulename, length(ev_action), octet_length(ev_action)\n> pgsql-# from pg_rewrite;\n> rulename | length | octet_length\n> ----------------+--------+--------------\n> _RETpg_user | 3043 | 855\n> _RETpg_rules | 3074 | 1139\n> _RETpg_views | 4261 | 1252\n> _RETpg_tables | 5187 | 1338\n> _RETpg_indexes | 3525 | 1122\n> (5 rows)\n>\n> Yes, the 3043 bytes long rule action string got stored in 855\n> bytes in pg_rewrite. That's 71.9% compression rate on this\n> attempt!\n\nThis will greatly help counter 7.0's \"rule length explosion\". \n\nThanks.\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, 27 Feb 2000 07:34:07 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] type coerce problem with lztext" }, { "msg_contents": "[email protected] (Jan Wieck) writes:\n> There are functions text(lztext) and lztext(text) too, but\n> the system is unable to find an operator if one compares\n> text=lztext in a query. IIRC, creating a function named as\n> the target type and taking the source type is what made auto-\n> type-conversion work - so what am I missing here?\n\nI'll take a look. I think the key may be teaching TypeCategory\nto know that lztext is a member of the text type class.\n\n\t\t\tregards, tom lane\n", "msg_date": "Sun, 27 Feb 2000 12:55:45 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] type coerce problem with lztext " }, { "msg_contents": "[email protected] (Jan Wieck) writes:\n> There are functions text(lztext) and lztext(text) too, but\n> the system is unable to find an operator if one compares\n> text=lztext in a query. IIRC, creating a function named as\n> the target type and taking the source type is what made auto-\n> type-conversion work - so what am I missing here?\n\nYup, TypeCategory was the missing ingredient. Seems to work now.\n\n> Yes, the 3043 bytes long rule action string got stored in 855\n> bytes in pg_rewrite. That's 71.9% compression rate on this\n> attempt!\n\nOver all the rules in the regression test database, I see:\n\nregression=# select sum(length(ev_action)),sum(octet_length(ev_action)) from pg\n_rewrite;\n sum | sum\n--------+-------\n 105270 | 38091\n(1 row)\n\nor about 64% compression. Not bad...\n\n\t\t\tregards, tom lane\n", "msg_date": "Sun, 27 Feb 2000 13:58:31 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] type coerce problem with lztext " }, { "msg_contents": "> Yup, TypeCategory was the missing ingredient. Seems to work now.\n> \n> > Yes, the 3043 bytes long rule action string got stored in 855\n> > bytes in pg_rewrite. That's 71.9% compression rate on this\n> > attempt!\n> \n> Over all the rules in the regression test database, I see:\n> \n> regression=# select sum(length(ev_action)),sum(octet_length(ev_action)) from pg\n> _rewrite;\n> sum | sum\n> --------+-------\n> 105270 | 38091\n> (1 row)\n> \n> or about 64% compression. Not bad...\n\nWe clearly needed this for 7.0 because of the larger plans. Good thing\nJan had it available, becuase I can imagine some major headaches for\npeople without 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": "Sun, 27 Feb 2000 14:06:21 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] type coerce problem with lztext" }, { "msg_contents": "> [email protected] (Jan Wieck) writes:\n> > There are functions text(lztext) and lztext(text) too, but\n> > the system is unable to find an operator if one compares\n> > text=lztext in a query. IIRC, creating a function named as\n> > the target type and taking the source type is what made auto-\n> > type-conversion work - so what am I missing here?\n>\n> Yup, TypeCategory was the missing ingredient. Seems to work now.\n\n Tnx\n\n> Over all the rules in the regression test database, I see:\n>\n> regression=# select sum(length(ev_action)),sum(octet_length(ev_action)) from pg\n> _rewrite;\n> sum | sum\n> --------+-------\n> 105270 | 38091\n> (1 row)\n>\n> or about 64% compression. Not bad...\n\n Amazing, when looking at the simpleness of the algorithm,\n isn't it?\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": "Sun, 27 Feb 2000 21:36:09 +0100 (CET)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": true, "msg_subject": "Re: [HACKERS] type coerce problem with lztext" }, { "msg_contents": "Bruce Momjian wrote:\n\n> We clearly needed this for 7.0 because of the larger plans. Good thing\n> Jan had it available, becuase I can imagine some major headaches for\n> people without it.\n\n I haven't had it available. But where able to dig out some\n revision numbers, then take some CVS diffs, and reactivate\n two files from the CVS Attic directories.\n\n Here's something close to the new limit:\n\n rulename | length | octet_length\n ----------------+--------+--------------\n _RETv1 | 64677 | 7440\n\n The view v1 is a simple 'SELECT * FROM t1' and t1 is a table\n of 220 columns with the same names and types as nearly all\n attributes of the system catalogs. Makes me feel comfortable.\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": "Sun, 27 Feb 2000 22:02:36 +0100 (CET)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": true, "msg_subject": "Re: [HACKERS] type coerce problem with lztext" }, { "msg_contents": "> Bruce Momjian wrote:\n> \n> > We clearly needed this for 7.0 because of the larger plans. Good thing\n> > Jan had it available, becuase I can imagine some major headaches for\n> > people without it.\n> \n> I haven't had it available. But where able to dig out some\n> revision numbers, then take some CVS diffs, and reactivate\n> two files from the CVS Attic directories.\n> \n> Here's something close to the new limit:\n> \n> rulename | length | octet_length\n> ----------------+--------+--------------\n> _RETv1 | 64677 | 7440\n> \n> The view v1 is a simple 'SELECT * FROM t1' and t1 is a table\n> of 220 columns with the same names and types as nearly all\n> attributes of the system catalogs. Makes me feel comfortable.\n\nWow, that's a large number, 64k.\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, 27 Feb 2000 16:18:30 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] type coerce problem with lztext" }, { "msg_contents": "At 04:18 PM 2/27/00 -0500, Bruce Momjian wrote:\n>> Bruce Momjian wrote:\n\n>> The view v1 is a simple 'SELECT * FROM t1' and t1 is a table\n>> of 220 columns with the same names and types as nearly all\n>> attributes of the system catalogs. Makes me feel comfortable.\n>\n>Wow, that's a large number, 64k.\n\nThis is the \"explosion\" in length due to the column aliases now\nbeing inserted into the rule, apparently. The limit on views now\nis much more tied to the number of columns in the referenced table(s)\nthan on the actual complexity of the view's definition per se.\n\nlztext is doing a GREAT job of sweeping this problem under the rug,\nso to speak, but it's still there...\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, 27 Feb 2000 13:30:28 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] type coerce problem with lztext" }, { "msg_contents": "[email protected] (Jan Wieck) writes:\n> rulename | length | octet_length\n> ----------------+--------+--------------\n> _RETv1 | 64677 | 7440\n\n> The view v1 is a simple 'SELECT * FROM t1' and t1 is a table\n> of 220 columns with the same names and types as nearly all\n> attributes of the system catalogs. Makes me feel comfortable.\n\nWow, better than 8-to-1. I guess you'd expect good compression on that,\nconsidering the very repetitive nature of the targetlist node string.\nHave you tried something with a long, boring WHERE-clause?\n\n\t\t\tregards, tom lane\n", "msg_date": "Sun, 27 Feb 2000 16:35:54 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] type coerce problem with lztext " }, { "msg_contents": "Don Baccus <[email protected]> writes:\n> This is the \"explosion\" in length due to the column aliases now\n> being inserted into the rule, apparently.\n> lztext is doing a GREAT job of sweeping this problem under the rug,\n> so to speak, but it's still there...\n\nActually, as far as I can tell 7.0 should be only marginally worse than\nprior releases in terms of verbosity of the rule parsetree string.\nAs a check I did\n\ncreate table foo (f1 int, f2 char(10), f3 text);\ncreate view foov as select * from foo;\nselect ev_action from pg_rewrite where rulename = '_RETfoov';\n\nand got (linebreaks inserted for readability)\n\n({ QUERY :command 1 :utility <> :resultRelation 0 :into <> :isPortal\nfalse :isBinary false :isTemp false :unionall false :distinctClause <>\n:sortClause <>\n :rtable (\n{ RTE :relname foov :ref { ATTR :relname *CURRENT*\n :attrs ( \"f1\" \"f2\" \"f3\" )}\n :relid 148363 :inh false :inFromCl false :inJoinSet false :skipAcl false}\n{ RTE :relname foov :ref { ATTR :relname *NEW*\n :attrs ( \"f1\" \"f2\" \"f3\" )}\n :relid 148363 :inh false :inFromCl false :inJoinSet false :skipAcl false}\n{ RTE :relname foo :ref { ATTR :relname foo\n :attrs ( \"f1\" \"f2\" \"f3\" )}\n :relid 148352 :inh false :inFromCl true :inJoinSet true :skipAcl false})\n :targetlist (\n{ TARGETENTRY :resdom { RESDOM :resno 1 :restype 23 :restypmod -1\n:resname f1 :reskey 0 :reskeyop 0 :ressortgroupref 0 :resjunk false }\n:expr { VAR :varno 3 :varattno 1 :vartype 23 :vartypmod -1\n:varlevelsup 0 :varnoold 3 :varoattno 1}}\n{ TARGETENTRY :resdom { RESDOM :resno 2 :restype 1042 :restypmod 14\n:resname f2 :reskey 0 :reskeyop 0 :ressortgroupref 0 :resjunk false }\n:expr { VAR :varno 3 :varattno 2 :vartype 1042 :vartypmod 14\n:varlevelsup 0 :varnoold 3 :varoattno 2}}\n{ TARGETENTRY :resdom { RESDOM :resno 3 :restype 25 :restypmod -1\n:resname f3 :reskey 0 :reskeyop 0 :ressortgroupref 0 :resjunk false }\n:expr { VAR :varno 3 :varattno 3 :vartype 25 :vartypmod -1\n:varlevelsup 0 :varnoold 3 :varoattno 3}})\n :qual <> :groupClause <> :havingQual <> :hasAggs false :hasSubLinks\nfalse :unionClause <> :intersectClause <> :limitOffset <> :limitCount <>\n:rowMark <>})\n\nThe thrice-repeated list of attribute names in the rtable entries is\nnew with Thomas' latest changes, and I'd like to see it go away again,\nbut even so it's not very long compared to the targetlist entries.\n\nThe inJoinSet fields in rtable entries are new, and ressortgroupref\nused to be called resgroupref which is costing us 4 more bytes per\ntargetlist item ;-). But otherwise it's three occurrences of the\nfield name added onto an existing cost of about 230 bytes per target\nentry. This is not an \"explosion\".\n\nIn fact, if I do\nselect length(ev_action) from pg_rewrite where rulename = '_RETfoov';\nI get 1507 in current sources and 1318 in 6.5.3, or about 15% growth.\n\nMy guess is that Don's problems are stemming from rules that reference\ntables that have many more columns than are being output. Citations\nof the otherwise-unreferenced columns in the rtable could add a lot of\nbulk that wasn't there before. But it doesn't look to me like the size\nof a simple \"SELECT *\" rule string has grown all that much.\n\n\t\t\tregards, tom lane\n", "msg_date": "Sun, 27 Feb 2000 17:02:02 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] type coerce problem with lztext " }, { "msg_contents": "At 05:02 PM 2/27/00 -0500, Tom Lane wrote:\n\n>My guess is that Don's problems are stemming from rules that reference\n>tables that have many more columns than are being output. Citations\n>of the otherwise-unreferenced columns in the rtable could add a lot of\n>bulk that wasn't there before. But it doesn't look to me like the size\n>of a simple \"SELECT *\" rule string has grown all that much.\n\nI'll buy that. A couple of the views I was having problems with were\nindeed returning a few columns from a view joining a couple of tables, with\nin two cases a \"where\" clause with a further subselect returning\na single column (used on the right of an \"=\"). I might add that the\nproblem was made worse by the fact that the view itself wasn't as\ncomplex earlier - I updated my PG7.0 snapshot to include Thomas'\nlast changes at roughly same time I updated the web toolkit.\n\nI picked out one doing just a \"select *\" as an example because I\nfelt it would kind of drive the point home that simple views on\nrelatively small tables were failing...\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, 27 Feb 2000 14:16:24 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] type coerce problem with lztext " }, { "msg_contents": "Bruce Momjian writes:\n\n> Added to Features:\n> \n> \tNew lztext data type for compressed text fields\n\nI strongly suggest to not name this new feature. All the attempts to make\nit go away silently in 7.1 will get a blow in the face from this.\n\nRegarding which: Make a default description/comment (DESCR macro) \"for\ninternal use only\" and don't mention it in the documention (see last\nparagraph), that should suffice. If people disregard that, they probably\nuse int2vector for their production applications as well.\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": "Mon, 28 Feb 2000 00:54:53 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] type coerce problem with lztext" }, { "msg_contents": "Peter Eisentraut <[email protected]> writes:\n>> New lztext data type for compressed text fields\n\n> I strongly suggest to not name this new feature. All the attempts to make\n> it go away silently in 7.1 will get a blow in the face from this.\n\nPeople *will* use it, if it's there. Don't fool yourself.\n\nHowever, we can make it \"go away silently\" the same way we are making\ndatetime go away: the 7.1 (or whatever) parser can just translate the\ntypename lztext to text. If that weren't feasible then I'd be pretty\nworried too.\n\n\t\t\tregards, tom lane\n", "msg_date": "Sun, 27 Feb 2000 21:24:11 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] type coerce problem with lztext " }, { "msg_contents": "[Charset ISO-8859-1 unsupported, filtering to ASCII...]\n> Bruce Momjian writes:\n>\n> > Added to Features:\n> >\n> > New lztext data type for compressed text fields\n>\n> I strongly suggest to not name this new feature. All the attempts to make\n> it go away silently in 7.1 will get a blow in the face from this.\n\n I already discovered that this ain't true.\n\n At the time we feature TOAST, we remove LZTEXT and put in a\n type alias to TEXT. This way, during a dump/reload upgrade\n from any non-toasted to a toasted release, the \"backend\" will\n take care for the silent conversion of table schemas. We can\n keep this alias for a faily long time, so external schema\n scripts can be modified.\n\n This way, all we have to mention is exactly the above, so\n schema writers take it onto their upgrade-checklist, and that\n no application query should ever use LZTEXT explicitly (like\n in casting expressions). They shall use TEXT instead.\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, 28 Feb 2000 08:42:08 +0100 (CET)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": true, "msg_subject": "Re: [HACKERS] type coerce problem with lztext" } ]
[ { "msg_contents": "One of the major must-fix items remaining on my to-do-for-7.0 list\nis making pg_dump smarter about the order to dump stuff in, so as\nto avoid problems like table constraints referring to not-yet-\ndefined functions.\n\nWe have talked about this before, and I thought some people had\nexpressed interest in fixing it, but I haven't seen any results.\nIs anyone working on it?\n\nIf not, I'm willing to do the quick-and-dirty approach of sorting\nthe objects by OID. This could be extended later to allow a\ndependency-based sort, but I don't have the time or interest to\nattempt that now.\n\nI'd be just as happy to yield the project to someone else though ;-)\n\n\t\t\tregards, tom lane\n", "msg_date": "Sun, 27 Feb 2000 13:00:23 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Is anyone working on pg_dump?" }, { "msg_contents": "Tom Lane writes:\n\n> We have talked about this before, and I thought some people had\n> expressed interest in fixing it, but I haven't seen any results.\n> Is anyone working on it?\n\nThat was me, but not for 7.0. Feel free to try the oid thing, if it works\nwell, I might not have to do my thing so early.\n\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Mon, 28 Feb 2000 00:58:27 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Is anyone working on pg_dump?" }, { "msg_contents": "Tom Lane wrote:\n> \n> One of the major must-fix items remaining on my to-do-for-7.0 list\n> is making pg_dump smarter about the order to dump stuff in, so as\n> to avoid problems like table constraints referring to not-yet-\n> defined functions.\n> \n> We have talked about this before, and I thought some people had\n> expressed interest in fixing it, but I haven't seen any results.\n> Is anyone working on it?\n\nI had expressed interest in working on this, but have run out of\nspare time. Please feel free.\n\n-- \n\nMark Hollomon\[email protected]\nESN 451-9008 (302)454-9008\n", "msg_date": "Mon, 28 Feb 2000 07:50:35 -0500", "msg_from": "\"Mark Hollomon\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Is anyone working on pg_dump?" }, { "msg_contents": "I wrote:\n> One of the major must-fix items remaining on my to-do-for-7.0 list\n> is making pg_dump smarter about the order to dump stuff in, so as\n> to avoid problems like table constraints referring to not-yet-\n> defined functions.\n\nI spent a couple evenings working on this, and have made good progress;\nbut looking at how much I've changed and how much remains, I'm forced\nto realize that this is \"too big a change for beta\". It requires a\nmajor restructuring of pg_dump. Since we don't have regression tests\nfor pg_dump, I think the risk of breaking something is too high for\nthis phase of the release cycle.\n\nI plan to set the unfinished code aside for now, and come back to it\nearly in the 7.1 cycle. We'll have to live with the ordering issue\nfor another release.\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 29 Feb 2000 10:28:37 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: Is anyone working on pg_dump? " } ]
[ { "msg_contents": "Looking at the example I just cited, it's hard to avoid noticing how\nmuch space is being used on purely-decorative field labels.\nFor example,\n\n{ TARGETENTRY :resdom { RESDOM :resno 1 :restype 23 :restypmod -1\n:resname f1 :reskey 0 :reskeyop 0 :ressortgroupref 0 :resjunk false }\n:expr { VAR :varno 3 :varattno 1 :vartype 23 :vartypmod -1\n:varlevelsup 0 :varnoold 3 :varoattno 1}}\n\ndoesn't really contain any information that's not in\n\n{ TARGETENTRY { RESDOM 1 23 -1 f1 0 0 0 false } { VAR 3 1 23 -1 0 3 1}}\n\nwhich takes a third as much space. Now I think I'd want to stick with\nthe more-verbose form for EXPLAIN output and debugging displays, but\nI wonder if it isn't worth while to strip the labels from stored rule\nstrings.\n\nRemoving the labels would actually save code in readfuncs.c, which\nwouldn't have to skip over them. In outfuncs.c, we could either\nhave every node-writing subroutine know about two output modes, or\nmake a post-pass that strips anything that looks like a field label.\nThe latter would be less maintenance work in the long run.\n\nComments?\n\n\t\t\tregards, tom lane\n", "msg_date": "Sun, 27 Feb 2000 17:39:07 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "A further thought on rule string size" }, { "msg_contents": "> Removing the labels would actually save code in readfuncs.c, which\n> wouldn't have to skip over them. In outfuncs.c, we could either\n> have every node-writing subroutine know about two output modes, or\n> make a post-pass that strips anything that looks like a field label.\n> The latter would be less maintenance work in the long run.\n> \n> Comments?\n\nIf you could keep the labels just for EXPLAIN, go for 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": "Sun, 27 Feb 2000 18:49:29 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] A further thought on rule string size" }, { "msg_contents": "> > Removing the labels would actually save code in readfuncs.c, which\n> > wouldn't have to skip over them. In outfuncs.c, we could either\n> > have every node-writing subroutine know about two output modes, or\n> > make a post-pass that strips anything that looks like a field label.\n> > The latter would be less maintenance work in the long run.\n> >\n> > Comments?\n>\n> If you could keep the labels just for EXPLAIN, go for it.\n\n Not right now, put it onto TODO for after 7.0.\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, 28 Feb 2000 08:22:06 +0100 (CET)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": false, "msg_subject": "Re: [HACKERS] A further thought on rule string size" }, { "msg_contents": "> > > Removing the labels would actually save code in readfuncs.c, which\n> > > wouldn't have to skip over them. In outfuncs.c, we could either\n> > > have every node-writing subroutine know about two output modes, or\n> > > make a post-pass that strips anything that looks like a field label.\n> > > The latter would be less maintenance work in the long run.\n> > >\n> > > Comments?\n> >\n> > If you could keep the labels just for EXPLAIN, go for it.\n> \n> Not right now, put it onto TODO for after 7.0.\n\nBut we just required initdb for lztext. If we need another initdb\nlater, maybe we should do 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, 28 Feb 2000 03:28:10 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] A further thought on rule string size" }, { "msg_contents": "> > > If you could keep the labels just for EXPLAIN, go for it.\n> >\n> > Not right now, put it onto TODO for after 7.0.\n>\n> But we just required initdb for lztext. If we need another initdb\n> later, maybe we should do it?\n\n LZTEXT was a fairly limited change, tested out before and\n just reapplied. This time you ask for mucking with the family\n of node-print and -read functions. Even if it's a limited\n area of code affected, I don't feel comfortable doing it now.\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, 28 Feb 2000 09:28:29 +0100 (CET)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": false, "msg_subject": "Re: [HACKERS] A further thought on rule string size" }, { "msg_contents": "> > > > If you could keep the labels just for EXPLAIN, go for it.\n> > >\n> > > Not right now, put it onto TODO for after 7.0.\n> >\n> > But we just required initdb for lztext. If we need another initdb\n> > later, maybe we should do it?\n> \n> LZTEXT was a fairly limited change, tested out before and\n> just reapplied. This time you ask for mucking with the family\n> of node-print and -read functions. Even if it's a limited\n> area of code affected, I don't feel comfortable doing it now.\n\nOK. Added to TODO.\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, 28 Feb 2000 04:10:59 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] A further thought on rule string size" }, { "msg_contents": "At 09:28 AM 2/28/00 +0100, Jan Wieck wrote:\n>> > > If you could keep the labels just for EXPLAIN, go for it.\n>> >\n>> > Not right now, put it onto TODO for after 7.0.\n>>\n>> But we just required initdb for lztext. If we need another initdb\n>> later, maybe we should do it?\n>\n> LZTEXT was a fairly limited change, tested out before and\n> just reapplied. This time you ask for mucking with the family\n> of node-print and -read functions. Even if it's a limited\n> area of code affected, I don't feel comfortable doing it now.\n\nAnd lztext compression of the rule strings is such a big win that\nI suspect folks upgrading from 6.5 to 7.0 won't have to worry about\nhaving their views blow up in their face. So the \"mini-crisis\" is\nsolved, folks will be able to upgrade smoothly, and in practice will\nbe able to build views on tables with many more columns.\n\nRemoving the additional verbosity from the rule strings is also a\ngood idea, but doesn't feel like a critical-path thing to me. So\nI think Jan's right, it can wait.\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, 28 Feb 2000 06:21:41 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] A further thought on rule string size" }, { "msg_contents": "[email protected] (Jan Wieck) writes:\n>> But we just required initdb for lztext. If we need another initdb\n>> later, maybe we should do it?\n\nThat was what I was thinking, too. But...\n\n> LZTEXT was a fairly limited change, tested out before and\n> just reapplied. This time you ask for mucking with the family\n> of node-print and -read functions. Even if it's a limited\n> area of code affected, I don't feel comfortable doing it now.\n\nYeah, Jan is probably right --- too much risk of breaking something\nand not noticing till after release. 7.0 will already allow longer\nrules than 6.5 because of lztext, so it's not critical to do this now.\nLet's wait.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 28 Feb 2000 09:40:01 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] A further thought on rule string size " } ]
[ { "msg_contents": "Found a rogue line in the resultmap file.\n\nIt's only a few days since I last ran the regression tests\nso it must have appreared fairly recently.\n\nHere's a patch,\nKeith.\n\n*** src/test/regress/resultmap.orig Sun Feb 27 23:37:03 2000\n--- src/test/regress/resultmap Sun Feb 27 23:37:18 2000\n***************\n*** 20,24 ****\n horology/sparc-sun-solaris=horology-solaris-1947\n abstime/sparc-sun-solaris=abstime-solaris-1947\n tinterval/sparc-sun-solaris=tinterval-solaris-1947\n- #include <sys/types.h> /* For pid_t */\n- \n--- 20,22 ----\n\n", "msg_date": "Sun, 27 Feb 2000 23:42:00 +0000 (GMT)", "msg_from": "Keith Parks <[email protected]>", "msg_from_op": true, "msg_subject": "Rogue line in regression resultmap file." }, { "msg_contents": "> Found a rogue line in the resultmap file.\n> \n> It's only a few days since I last ran the regression tests\n> so it must have appreared fairly recently.\n> \n> Here's a patch,\n> Keith.\n> \n> *** src/test/regress/resultmap.orig Sun Feb 27 23:37:03 2000\n> --- src/test/regress/resultmap Sun Feb 27 23:37:18 2000\n> ***************\n> *** 20,24 ****\n> horology/sparc-sun-solaris=horology-solaris-1947\n> abstime/sparc-sun-solaris=abstime-solaris-1947\n> tinterval/sparc-sun-solaris=tinterval-solaris-1947\n> - #include <sys/types.h> /* For pid_t */\n> - \n\nWhat, how did that get in there? I assume it was during:\n\t\n\trevision 1.7\n\tdate: 2000/02/23 15:46:15; author: momjian; state: Exp; lines: +5 -0\n\t1. miscadmin.h needs to include sys/types.h for a definition of pid_t\n\nIt is already in miscadmin.h, so I guess it was some fluke on my end. \nSorry.\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, 27 Feb 2000 21:12:54 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Rogue line in regression resultmap file." } ]
[ { "msg_contents": "i was wondering if u have the crack for catia v5 r3\n\nand nastranv70.5\n\nthanks i realy need those cracks\n\n__________________________________________________\nDo You Yahoo!?\nTalk to your friends online with Yahoo! Messenger.\nhttp://im.yahoo.com\n", "msg_date": "Sun, 27 Feb 2000 21:54:09 -0800 (PST)", "msg_from": "subaesh ramjan <[email protected]>", "msg_from_op": true, "msg_subject": "info" } ]
[ { "msg_contents": "I have a group by that groups some, but not all, identical rows. Here are\nthe details:\nI can reproduce the problem using one single table, details below;\n\nTable = hits\n+----------------------------------+----------------------------------+-----\n--+\n| Field | Type |\nLength|\n+----------------------------------+----------------------------------+-----\n--+\n| userid | varchar |\n12 |\n| dat | date |\n4 |\n| tim | time |\n8 |\n| ipa | int4 |\n4 |\n| ipb | int4 |\n4 |\n| ipc | int4 |\n4 |\n| ipd | int4 |\n4 |\n| site | varchar |\n50 |\n+----------------------------------+----------------------------------+-----\n--+\n\nI want a report showing how many occurrences of \"site\" there are for each\ndistinct \"site\".\nThere is a lot of data, in there, so I'll look at a particular example of\nthe problem. When\nI run this query:\n\nselect count(site), site\n from hits\n group by site;\n\nThe output contains lines like the following. Note that these are all\nconsecutive in the output.\n\n 2|xlink.zdnet.com\n 2|xlink.zdnet.com\n 1|xlink.zdnet.com\n 2|xlink.zdnet.com\n 2|xlink.zdnet.com\n 2|xlink.zdnet.com\n 3|xlink.zdnet.com\n 2|xlink.zdnet.com\n 3|xlink.zdnet.com\n 2|xlink.zdnet.com\n 1|xlink.zdnet.com\n\nSuspecting that there were differences in each xlink.zdnet.com, I counted\njust them:\n\nweb=> select count (*) from hits where site='xlink.zdnet.com';\ncount\n-----\n 22\n(1 row)\n\nSo, all 22 xlink.zdnet.com are selected above, but they have not grouped in\nthe previous\none. Any ideas why?\n\nOn a lesser note: I tried \"select * into temp from hits\" as per the doco,\nbut it barfs. Looks\nlike the syntax has changed. Any current \"railway\" diagrams for the commands\nanywhere? Also,\nwhere can I find out about other environment settings like PGDATESTYLE? I\nknow about that one,\nbut what others are there?\n\nI'm trying to port from Oracle. Any guides? There are many differences in\nthe SQL.\n\n\n**************************************************************\nThe information contained in this E-Mail is confidential\nand is intended only for the use of the addressee(s).\nIf you receive this E-Mail in error, any use, distribution\nor copying of this E-Mail is not permitted. You are \nrequested to forward unwanted E-Mail and address any problems\nto the MIM Holdings Limited Help Desk. \nE-Mail: [email protected] or phone: Australia 07 3833 8042.\n**************************************************************\n", "msg_date": "Mon, 28 Feb 2000 16:22:46 +1000", "msg_from": "George Dau <[email protected]>", "msg_from_op": true, "msg_subject": "prob with aggregate and group by - returns multiples" }, { "msg_contents": "George Dau <[email protected]> writes:\n> select count(site), site from hits group by site;\n\n> The output contains lines like the following. Note that these are all\n> consecutive in the output.\n\n> 2|xlink.zdnet.com\n> 2|xlink.zdnet.com\n> 1|xlink.zdnet.com\n> 2|xlink.zdnet.com\n> 2|xlink.zdnet.com\n> 2|xlink.zdnet.com\n> 3|xlink.zdnet.com\n> 2|xlink.zdnet.com\n> 3|xlink.zdnet.com\n> 2|xlink.zdnet.com\n> 1|xlink.zdnet.com\n\n> Suspecting that there were differences in each xlink.zdnet.com, I counted\n> just them:\n\n> web=> select count (*) from hits where site='xlink.zdnet.com';\n> count\n> -----\n> 22\n> (1 row)\n\n> So, all 22 xlink.zdnet.com are selected above, but they have not grouped in\n> the previous one. Any ideas why?\n\nWow, that is bizarre. My first thought was that you had varying numbers\nof trailing blanks in the \"site\" values, but your second example seems\nto disprove that theory.\n\nWhat Postgres version are you running, and on what platform? Can you\ngenerate a self-contained example (a script that demonstrates the error\nfrom a standing start)? I suspect you may be hitting a platform-\nspecific porting problem, but it's just speculation unless we have a\nself-contained test case to try on other machines.\n\n> On a lesser note: I tried \"select * into temp from hits\" as per the doco,\n> but it barfs.\n\nPostgres thinks that TEMP is a keyword, so it won't take it as a table\nname unless you put quotes around it. If we have doco examples that\nuse TEMP as a table name, they need to be changed --- do you recall\nwhere you saw that, exactly?\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 28 Feb 2000 02:50:01 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [SQL] prob with aggregate and group by - returns multiples " }, { "msg_contents": "Tom Lane writes:\n\n> > On a lesser note: I tried \"select * into temp from hits\" as per the doco,\n> > but it barfs.\n> \n> Postgres thinks that TEMP is a keyword, so it won't take it as a table\n> name unless you put quotes around it.\n\nThis is really an unfortunate case where someone should have read the SQL\nstandard before putting in a feature. The SQL keyword is TEMPORARY, and\nTEMP is really a popular name for a dummy table.\n\nI tried making TEMP a ColId but it croaks on this syntactic contruct:\n\nSELECT xxx INTO [TEMP] [TABLE] tablename\n\nwhich is incidentally not SQL either. If someone is interested in allowing\n'temp' as an identifier, there doesn't seem to be a good way without\nrequiring the TABLE keyword above. Would that be worth it for 7.0 maybe?\n\nOf course the documentation should be changed to TEMPORARY as well in\nvarious places.\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Tue, 29 Feb 2000 00:19:05 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [SQL] prob with aggregate and group by - returns multiples " }, { "msg_contents": "Thomas Lockhart <[email protected]> writes:\n>> This is really an unfortunate case where someone should have read the SQL\n>> standard before putting in a feature. The SQL keyword is TEMPORARY, and\n>> TEMP is really a popular name for a dummy table.\n\n> So why not yank TEMP and require TEMPORARY?\n\nProbably we ought to stop to ask why TEMP is in there to begin with;\nperhaps for compatibility with some other RDBMS?\n\nIf not, I'd vote for pulling it out. That's a heck of a poor word to\nreserve.\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 29 Feb 2000 00:44:22 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [SQL] prob with aggregate and group by - returns\n\tmultiples" }, { "msg_contents": "> > Postgres thinks that TEMP is a keyword, so it won't take it as a table\n> > name unless you put quotes around it.\n> This is really an unfortunate case where someone should have read the SQL\n> standard before putting in a feature. The SQL keyword is TEMPORARY, and\n> TEMP is really a popular name for a dummy table.\n\nSo why not yank TEMP and require TEMPORARY? Saving an extra 5\ncharacters of typing is not a good enough reason to keep it imho, and\nif the SQL92 standard requires a particular form why bother extending\nit?\n\nA major release is a good time to adjust syntax to promote\ncompliance...\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Tue, 29 Feb 2000 05:48:12 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [SQL] prob with aggregate and group by - returns\n\tmultiples" }, { "msg_contents": "> Thomas Lockhart <[email protected]> writes:\n> >> This is really an unfortunate case where someone should have read the SQL\n> >> standard before putting in a feature. The SQL keyword is TEMPORARY, and\n> >> TEMP is really a popular name for a dummy table.\n> \n> > So why not yank TEMP and require TEMPORARY?\n> \n> Probably we ought to stop to ask why TEMP is in there to begin with;\n> perhaps for compatibility with some other RDBMS?\n\nIt was me. Informix uses it.\n\n> \n> If not, I'd vote for pulling it out. That's a heck of a poor word to\n> reserve.\n\nI am afraid of lots of user complaints, even if we had not already used\nTEMP.\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": "Tue, 29 Feb 2000 00:59:12 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [SQL] prob with aggregate and group by - returns\n\tmultiplesh" }, { "msg_contents": "> > If not, I'd vote for pulling it out. That's a heck of a poor word to\n> > reserve.\n> I am afraid of lots of user complaints, even if we had not already used\n> TEMP.\n\nOK, but we've already got \"user complaints\" about TEMP being a\nreserved word, so that part seems to balance out. There is apparently\nno basis in published standards for TEMP being a reserved word. And\nbtw it is not currently documented as a reserved word in\nsyntax.sgml...\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Tue, 29 Feb 2000 06:48:06 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [SQL] prob with aggregate and group by - returns\n\tmultiplesh" }, { "msg_contents": "On Tue, 29 Feb 2000, Thomas Lockhart wrote:\n\n> > > Postgres thinks that TEMP is a keyword, so it won't take it as a table\n> > > name unless you put quotes around it.\n> > This is really an unfortunate case where someone should have read the SQL\n> > standard before putting in a feature. The SQL keyword is TEMPORARY, and\n> > TEMP is really a popular name for a dummy table.\n> \n> So why not yank TEMP and require TEMPORARY? Saving an extra 5\n> characters of typing is not a good enough reason to keep it imho, and\n> if the SQL92 standard requires a particular form why bother extending\n> it?\n> \n> A major release is a good time to adjust syntax to promote\n> compliance...\n\nI've been (lightly) bashed in the past for proposing such things (see\nEND/ABORT) but I'm with you. I think that TEMP may be far too wide-spread\nby now, though.\n\n-- \nPeter Eisentraut Sernanders vaeg 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Tue, 29 Feb 2000 11:54:06 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [SQL] prob with aggregate and group by - returns\n\tmultiples" }, { "msg_contents": "> > A major release is a good time to adjust syntax to promote\n> > compliance...\n> I've been (lightly) bashed in the past for proposing such things (see\n> END/ABORT) but I'm with you. I think that TEMP may be far too wide-spread\n> by now, though.\n\nWell, imho the TEMP issue is not identical to END/ABORT. For TEMP, we\nare unnecessarily restricting the space of possible identifiers,\neliminating a common and obvious name. The fix is trivial, and the\naffected parties are *only* those who use temporary tables and who\nchose to *not* use SQL92 syntax, which was always available.\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Tue, 29 Feb 2000 14:35:08 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [SQL] prob with aggregate and group by -\n\treturnsmultiples" }, { "msg_contents": "At 06:48 AM 2/29/00 +0000, Thomas Lockhart wrote:\n>> > If not, I'd vote for pulling it out. That's a heck of a poor word to\n>> > reserve.\n>> I am afraid of lots of user complaints, even if we had not already used\n>> TEMP.\n>\n>OK, but we've already got \"user complaints\" about TEMP being a\n>reserved word, so that part seems to balance out. There is apparently\n>no basis in published standards for TEMP being a reserved word. And\n>btw it is not currently documented as a reserved word in\n>syntax.sgml...\n\nI vote for the SQL92 TEMPORARY. Let's not add a keyword that is non-standard\njust because one or another commercial database makes use of it, unless\nthere's some real functionality to be gained that's not covered by the\nstandard.\n\nTEMP is covered in SQL92 by TEMPORARY.\n\nAs an example of when adopting a construct from another commercial database\nmakes sense to me, SEQUENCE and SERIAL are both convenient means of generating\nunique keys that have no equivalent in the standard.\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, 29 Feb 2000 06:35:25 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [SQL] prob with aggregate and group by -\n\treturns multiplesh" }, { "msg_contents": ">>>> If not, I'd vote for pulling it out. That's a heck of a poor word to\n>>>> reserve.\n>> I am afraid of lots of user complaints, even if we had not already used\n>> TEMP.\n\n> OK, but we've already got \"user complaints\" about TEMP being a\n> reserved word, so that part seems to balance out. There is apparently\n> no basis in published standards for TEMP being a reserved word. And\n> btw it is not currently documented as a reserved word in\n> syntax.sgml...\n\nThe real problem is not that we accept TEMP as a synonym for TEMPORARY;\nit is that we treat TEMP as a reserved word. What are the chances that\nwe could make it a member of the ColId list? I am thinking that\n\"... INTO TEMP temp\" is *not* ambiguous given one token lookahead...\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 29 Feb 2000 09:57:56 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [SQL] prob with aggregate and group by - returns\n\tmultiplesh" }, { "msg_contents": "Don Baccus <[email protected]> writes:\n> I vote for the SQL92 TEMPORARY. Let's not add a keyword that is non-standard\n> just because one or another commercial database makes use of it,\n\nYou're missing the point: we are not talking about *adding* a keyword,\nwe're talking about *removing* one that we've already supported for\na year or so. That changes matters considerably, IMHO.\n\nI have in fact been able to make a conflict-free grammar in which TEMP\nis accepted but not reserved. It requires a certain amount of\nredundancy in the productions (see below), but I think this is a\nworthwhile tradeoff for not breaking existing user code.\n\nShall I commit this?\n\n\t\t\tregards, tom lane\n\n\n/*\n * Redundancy here is needed to avoid shift/reduce conflicts,\n * since TEMP is not a reserved word. See also OptTemp.\n *\n * The result is a cons cell (not a true list!) containing\n * a boolean and a table name.\n */\nOptTempTableName: TEMPORARY opt_table relation_name\n { $$ = lcons(makeInteger(TRUE), (List *) $3); }\n | TEMP opt_table relation_name\n { $$ = lcons(makeInteger(TRUE), (List *) $3); }\n | LOCAL TEMPORARY opt_table relation_name\n { $$ = lcons(makeInteger(TRUE), (List *) $4); }\n | LOCAL TEMP opt_table relation_name\n { $$ = lcons(makeInteger(TRUE), (List *) $4); }\n | GLOBAL TEMPORARY opt_table relation_name\n {\n elog(ERROR, \"GLOBAL TEMPORARY TABLE is not currently supported\");\n $$ = lcons(makeInteger(TRUE), (List *) $4);\n }\n | GLOBAL TEMP opt_table relation_name\n {\n elog(ERROR, \"GLOBAL TEMPORARY TABLE is not currently supported\");\n $$ = lcons(makeInteger(TRUE), (List *) $4);\n }\n | TABLE relation_name\n { $$ = lcons(makeInteger(FALSE), (List *) $2); }\n | relation_name\n { $$ = lcons(makeInteger(FALSE), (List *) $1); }\n ;\n", "msg_date": "Tue, 29 Feb 2000 11:09:37 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [SQL] prob with aggregate and group by - returns\n\tmultiplesh" }, { "msg_contents": "On Tue, 29 Feb 2000, Don Baccus wrote:\n\n> I vote for the SQL92 TEMPORARY. Let's not add a keyword that is non-standard\n> just because one or another commercial database makes use of it, unless\n> there's some real functionality to be gained that's not covered by the\n> standard.\n\nThe difference is that TEMP is already a keyword since 6.5 and we're\nconsidering removing it.\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Tue, 29 Feb 2000 17:38:26 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [SQL] prob with aggregate and group by -\n\treturns multiplesh" }, { "msg_contents": "> > > If not, I'd vote for pulling it out. That's a heck of a poor word to\n> > > reserve.\n> > I am afraid of lots of user complaints, even if we had not already used\n> > TEMP.\n> \n> OK, but we've already got \"user complaints\" about TEMP being a\n> reserved word, so that part seems to balance out. There is apparently\n> no basis in published standards for TEMP being a reserved word. And\n> btw it is not currently documented as a reserved word in\n> syntax.sgml...\n\nOK, I certainly didn't look at the standard to when I implemented TEMP\ntables. In fact, I was surprised it worked considering it is just a\nhack on the cache code.\n\nLet's forget I made a mistake, and consider how many people are going to\nthink they should use TEMP and how many TEMPORARY. I personally would\nguess TEMP and never TEMPORARY. I wonder if others would too.\n\nSo are we willing to field questions from people trying to use TEMP\ntables and trying TEMP and not TEMPORARY. I realize the restriction on\na field called TEMP, but we don't get those very often. How many people\nare going to guess TEMP and not TEMPORARY?\n\nOf course, as a Unix guy, I may have guessed TMP too. :-)\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, 29 Feb 2000 12:19:02 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [SQL] prob with aggregate and group by - returns\n\tmultiplesh" }, { "msg_contents": "Looks good to me.\n\n> Don Baccus <[email protected]> writes:\n> > I vote for the SQL92 TEMPORARY. Let's not add a keyword that is non-standard\n> > just because one or another commercial database makes use of it,\n> \n> You're missing the point: we are not talking about *adding* a keyword,\n> we're talking about *removing* one that we've already supported for\n> a year or so. That changes matters considerably, IMHO.\n> \n> I have in fact been able to make a conflict-free grammar in which TEMP\n> is accepted but not reserved. It requires a certain amount of\n> redundancy in the productions (see below), but I think this is a\n> worthwhile tradeoff for not breaking existing user code.\n> \n> Shall I commit this?\n> \n> \t\t\tregards, tom lane\n> \n> \n> /*\n> * Redundancy here is needed to avoid shift/reduce conflicts,\n> * since TEMP is not a reserved word. See also OptTemp.\n> *\n> * The result is a cons cell (not a true list!) containing\n> * a boolean and a table name.\n> */\n> OptTempTableName: TEMPORARY opt_table relation_name\n> { $$ = lcons(makeInteger(TRUE), (List *) $3); }\n> | TEMP opt_table relation_name\n> { $$ = lcons(makeInteger(TRUE), (List *) $3); }\n> | LOCAL TEMPORARY opt_table relation_name\n> { $$ = lcons(makeInteger(TRUE), (List *) $4); }\n> | LOCAL TEMP opt_table relation_name\n> { $$ = lcons(makeInteger(TRUE), (List *) $4); }\n> | GLOBAL TEMPORARY opt_table relation_name\n> {\n> elog(ERROR, \"GLOBAL TEMPORARY TABLE is not currently supported\");\n> $$ = lcons(makeInteger(TRUE), (List *) $4);\n> }\n> | GLOBAL TEMP opt_table relation_name\n> {\n> elog(ERROR, \"GLOBAL TEMPORARY TABLE is not currently supported\");\n> $$ = lcons(makeInteger(TRUE), (List *) $4);\n> }\n> | TABLE relation_name\n> { $$ = lcons(makeInteger(FALSE), (List *) $2); }\n> | relation_name\n> { $$ = lcons(makeInteger(FALSE), (List *) $1); }\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": "Tue, 29 Feb 2000 12:21:26 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [SQL] prob with aggregate and group by - returns\n\tmultiplesh" }, { "msg_contents": "On Wed, 01 Mar 2000, Tom Lane wrote:\n> Don Baccus <[email protected]> writes:\n> > I vote for the SQL92 TEMPORARY. Let's not add a keyword that is non-standard\n> > just because one or another commercial database makes use of it,\n> \n> You're missing the point: we are not talking about *adding* a keyword,\n> we're talking about *removing* one that we've already supported for\n> a year or so. That changes matters considerably, IMHO.\n> \n> I have in fact been able to make a conflict-free grammar in which TEMP\n> is accepted but not reserved. It requires a certain amount of\n> redundancy in the productions (see below), but I think this is a\n> worthwhile tradeoff for not breaking existing user code.\n> \n> Shall I commit this?\n\n Is there not also the possibility of making this a configure-time option?\n\n./configure --temporary-table=TEMPORARY # or TEMP as you wish\n\nDefault to TEMPORARY in accord with SQL 92.\n\n--\nSincerely etc.,\n\n NAME Christopher Sawtell - Support Engineer - iOpen Technologies Ltd.\n CELL PHONE 021 257 4451\n ICQ UIN 45863470\n EMAIL chris @ iopen . co . nz, csawtell @ xtra . co . nz\n CNOTES ftp://ftp.funet.fi/pub/languages/C/tutorials/sawtell_C.tar.gz\n\n ---->>> Please refrain from using HTML attachments in e-mails to me. <<<----\n\n", "msg_date": "Wed, 1 Mar 2000 16:26:24 +1300", "msg_from": "Christopher Sawtell <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [SQL] prob with aggregate and group by - returns\n\tmultiplesh" }, { "msg_contents": "> So are we willing to field questions from people trying to use TEMP\n> tables and trying TEMP and not TEMPORARY. I realize the restriction on\n> a field called TEMP, but we don't get those very often. How many people\n> are going to guess TEMP and not TEMPORARY?\n\nWell, that's one reason to stick to a published standard. No guessing\nrequired since one could look it up ;)\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Wed, 01 Mar 2000 06:14:51 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [SQL] prob with aggregate and group by - returns\n\tmultiplesh" }, { "msg_contents": "> > So are we willing to field questions from people trying to use TEMP\n> > tables and trying TEMP and not TEMPORARY. I realize the restriction on\n> > a field called TEMP, but we don't get those very often. How many people\n> > are going to guess TEMP and not TEMPORARY?\n> \n> Well, that's one reason to stick to a published standard. No guessing\n> required since one could look it up ;)\n\nIf you survive reading the standard. :-)\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, 1 Mar 2000 01:18:41 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [SQL] prob with aggregate and group by - returns\n\tmultiplesh" }, { "msg_contents": "Thomas Lockhart <[email protected]> writes:\n>> So are we willing to field questions from people trying to use TEMP\n>> tables and trying TEMP and not TEMPORARY. I realize the restriction on\n>> a field called TEMP, but we don't get those very often. How many people\n>> are going to guess TEMP and not TEMPORARY?\n\n> Well, that's one reason to stick to a published standard. No guessing\n> required since one could look it up ;)\n\nAs of an hour ago, neither one is a reserved word ;-)\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 01 Mar 2000 01:29:25 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [SQL] prob with aggregate and group by - returns\n\tmultiplesh" }, { "msg_contents": "> As of an hour ago, neither one is a reserved word ;-)\n\nDarn, I was just warming up to a good argument :))\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Wed, 01 Mar 2000 06:46:28 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [SQL] prob with aggregate and group by - returns\n\tmultiplesh" }, { "msg_contents": "----- Original Message -----\nFrom: Bruce Momjian <[email protected]>\nTo: Thomas Lockhart <[email protected]>\nCc: Tom Lane <[email protected]>; '[email protected]'\n<[email protected]>; PostgreSQL Development\n<[email protected]>\nSent: Wednesday, March 01, 2000 6:18 AM\nSubject: Re: [HACKERS] Re: [SQL] prob with aggregate and group by -\nreturns multiplesh\n\n\n> > > So are we willing to field questions from people trying to use\nTEMP\n> > > tables and trying TEMP and not TEMPORARY. I realize the\nrestriction on\n> > > a field called TEMP, but we don't get those very often. How\nmany people\n> > > are going to guess TEMP and not TEMPORARY?\n> >\n> > Well, that's one reason to stick to a published standard. No\nguessing\n> > required since one could look it up ;)\n>\n> If you survive reading the standard. :-)\n\nIf you can even *find* the standard :->\n\n(is there an on-line source - all links I've ever seen 404ed...?)\n\n", "msg_date": "Wed, 1 Mar 2000 09:48:18 -0000", "msg_from": "\"Moray McConnachie\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [SQL] prob with aggregate and group by - returns\n\tmultiplesh" } ]
[ { "msg_contents": "Well, I got pg_options and syslog (and ELOG timestamping) figured out --\nhowever, there is a quirk:\n\nWith syslog set to 2 (supposedly suppressing ANY stderr/stdout, I still get\nsome output (I know that the documentation mentions this) )-- the output I am\ngetting is \"reset_client_encoding().. \n reset_client_encoding() done\" immediately after a InitPostgres\nlog line. Incidentally, the two reset_client_encoding lines are not\ntimestamped, while the InitPostgres line IS.\n\nTo get syslog functionality working (at least under RedHat Linux 6.1/Intel), do\nthe following:\n\nEither edit src/include/config.h.in before configure, or edit\nsrc/include/config.h after configure but before make (for RPM-building, I patch\nconfig.h.in before running configure) -- uncomment both ELOG_TIMESTAMPS and\nUSE_SYSLOG.\n\nIn $PGDATA/pg_options, make verbose=1 or 2, and syslog >0 -- read the\npg_options page in the admin docs for more stuff you can put in pg_options.\n\nTo get information into the syslog, in /etc/syslog.conf place a line:\nlocal0.*\t\t/var/log/postgresql\nand /var/log/postgresql will get ALL those messages. NICE. Log rotation under\nRedHat is a simple config file in /etc/logrotate.d......\n\nThese changes (including the syslog.conf one) will be in the next RPM\nset to be released.\n\nMassimo, what syslog levels are you using (I've perused\nsrc/backend/misc/trace.c, but, unfortunately, my knowledge of syslog code is\nweak)?\n\nMan, those regression tests really issue the queries (normally, my system will\ndo the non-parallel regression in about 2:15, but with syslog and query=4, it\ntakes 3:14).\n\n--\nLamar Owen\nWGCR Internet Radio\n1 Peter 4:11\n", "msg_date": "Mon, 28 Feb 2000 01:36:58 -0500", "msg_from": "Lamar Owen <[email protected]>", "msg_from_op": true, "msg_subject": "Syslog and pg_options (for RPMs)" }, { "msg_contents": "> Well, I got pg_options and syslog (and ELOG timestamping) figured out --\n> however, there is a quirk:\n> \n> With syslog set to 2 (supposedly suppressing ANY stderr/stdout, I still get\n> some output (I know that the documentation mentions this) )-- the output I am\n> getting is \"reset_client_encoding().. \n> reset_client_encoding() done\" immediately after a InitPostgres\n> log line. Incidentally, the two reset_client_encoding lines are not\n> timestamped, while the InitPostgres line IS.\n\nIt seems that there is some code which doesn't use elog() or TPRINTF() but\noutputs directly to stderr instead. For example in postgres.c:\n\n#ifdef MULTIBYTE\n\t/* set default client encoding */\n\tif (Verbose)\n\t\tputs(\"\\treset_client_encoding()..\");\n\treset_client_encoding();\n\tif (Verbose)\n\t\tputs(\"\\treset_client_encoding() done.\");\n#endif\n\nIn my opinion this is wrong. It should be:\n\n\tTPRINTF(TRACE_VERBOSE, \"reset_client_encoding()..\"\");\n\nor better:\n\n\tTPRINTF(TRACE_MULTYBYTE, \"reset_client_encoding()..\"\");\n\nA quick grep shows that the following files contain puts()\n\n src/backend/access/common/printtup.c:\n src/backend/bootstrap/bootparse.c:\n src/backend/bootstrap/bootstrap.c:\n src/backend/executor/execAmi.c:\n src/backend/libpq/be-dumpdata.c:\n src/backend/nodes/copyfuncs.c:\n src/backend/parser/parse_expr.c:\n src/backend/tcop/postgres.c:\n src/backend/utils/adt/dt.c:\n src/backend/utils/adt/ruleutils.c:\n src/backend/utils/init/postinit.c:\n src/backend/utils/misc/database.c:\n src/backend/utils/sort/lselect.c:\n src/bin/psql/psql.c:\n src/interfaces/libpgtcl/pgtclId.c:\n\nand many other files contain printf().\n\n> To get syslog functionality working (at least under RedHat Linux 6.1/Intel), do\n> the following:\n> \n> Either edit src/include/config.h.in before configure, or edit\n> src/include/config.h after configure but before make (for RPM-building, I patch\n> config.h.in before running configure) -- uncomment both ELOG_TIMESTAMPS and\n> USE_SYSLOG.\n\nYou can also add the following line into Makefile.custom:\n\nCUSTOM_COPT += -DUSE_SYSLOG -DELOG_TIMESTAMPS\n\n> In $PGDATA/pg_options, make verbose=1 or 2, and syslog >0 -- read the\n> pg_options page in the admin docs for more stuff you can put in pg_options.\n> \n> To get information into the syslog, in /etc/syslog.conf place a line:\n> local0.*\t\t/var/log/postgresql\n> and /var/log/postgresql will get ALL those messages. NICE. Log rotation under\n> RedHat is a simple config file in /etc/logrotate.d......\n> \n> These changes (including the syslog.conf one) will be in the next RPM\n> set to be released.\n> \n> Massimo, what syslog levels are you using (I've perused\n> src/backend/misc/trace.c, but, unfortunately, my knowledge of syslog code is\n> weak)?\n\nLOG_DEBUG, unless you enable the \"all\" trace flag, in which case LOG_INFO\nis used.\n\n> Man, those regression tests really issue the queries (normally, my system will\n> do the non-parallel regression in about 2:15, but with syslog and query=4, it\n> takes 3:14).\n> \n> --\n> Lamar Owen\n> WGCR Internet Radio\n> 1 Peter 4:11\n> \n> ************\n> \n\n-- \nMassimo Dal Zotto\n\n+----------------------------------------------------------------------+\n| Massimo Dal Zotto email: [email protected] |\n| Via Marconi, 141 phone: ++39-0461534251 |\n| 38057 Pergine Valsugana (TN) www: http://www.cs.unitn.it/~dz/ |\n| Italy pgp: finger [email protected] |\n+----------------------------------------------------------------------+\n\n", "msg_date": "Mon, 28 Feb 2000 19:45:41 +0100 (MET)", "msg_from": "Massimo Dal Zotto <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Syslog and pg_options (for RPMs)" } ]
[ { "msg_contents": "\n> > Yes, the only difference seems to be, that the changes need not \n> > be sync'd to disk, and you only need one level of nesting as long\n> > as the user is not presented the ability to use nested tx.\n> >\n> \n> Hmm,what do you want now ?\n\nI basically just wanted to say yes, but stated some differences that are\nminor\nand can be ignored.\n\n> \n> Note that (f)sync is irrelevant at all.\n> Partial rollback is the problem of only the backend to be rollbacked\n> except locking.\n> \n> Vadim has already planned savepoints functionality instead of nested\n> tx. I have never heard objections to the proposal.\n\nI think this is the same as nested tx, at least that is my understanding.\n\n> I could see little difference between the implementation of rollback\n> to arbitrary savepoints and the implemention of rollback only to the\n> savepoint implicitly placed immediately before current statement. \n> \n> Do you want another hack ?\n\nNo.\n\nAndreas\n", "msg_date": "Mon, 28 Feb 2000 09:01:58 +0100", "msg_from": "Zeugswetter Andreas SB <[email protected]>", "msg_from_op": true, "msg_subject": "AW: AW: AW: [HACKERS] TRANSACTIONS " } ]
[ { "msg_contents": "Hi,\n\nHow I can convert some tables since sybase to posgtres.\n\nthank a lot\n______________________________________________________\nGet Your Private, Free Email at http://www.hotmail.com\n\n", "msg_date": "Mon, 28 Feb 2000 09:40:51 PST", "msg_from": "\"Joaquin Eduardo Monje\" <[email protected]>", "msg_from_op": true, "msg_subject": "ask sybase - postgres" } ]
[ { "msg_contents": "Hi,\n\nHow I can convert some tables since sybase to posgtres.\n\nthank a lot\n______________________________________________________\nGet Your Private, Free Email at http://www.hotmail.com\n\n", "msg_date": "Mon, 28 Feb 2000 09:41:08 PST", "msg_from": "\"Joaquin Eduardo Monje\" <[email protected]>", "msg_from_op": true, "msg_subject": "ask sybase - postgres" } ]
[ { "msg_contents": "Hello!\n\n A month ago I tested a snapshot (21 or 24 Jan), and locale/multibyte\nsupport worked.\n In the snapshot of 21 Feb locale support have been broken. \"SELECT *\nFROM table ORDER BY name\" returns rows in wrong order; \"SELECT * FROM table\nWHERE name ~* re\" performs case-sensitive match.\n\n I remember Tatsuo once fixed case-sensitiveness by replacing char with\n\"unsigned char\". Should I teach my gcc to always use unsigned chars?\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": "Mon, 28 Feb 2000 10:03:10 +0000 (GMT)", "msg_from": "Oleg Broytmann <[email protected]>", "msg_from_op": true, "msg_subject": "Locale support broken in latest snapshots" }, { "msg_contents": "Oleg Broytmann <[email protected]> writes:\n> In the snapshot of 21 Feb locale support have been broken. \"SELECT *\n> FROM table ORDER BY name\" returns rows in wrong order; \"SELECT * FROM table\n> WHERE name ~* re\" performs case-sensitive match.\n\nUgh.\n\n> I remember Tatsuo once fixed case-sensitiveness by replacing char with\n> \"unsigned char\". Should I teach my gcc to always use unsigned chars?\n\nNo, that's not a solution (since it's not available to non-gcc users).\nWe need to find the coding error and fix it.\n\nHowever, if you can try that as a test to see if it fixes the behavior,\nplease do; knowing whether it does will help narrow down what the bug\ncould be.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 28 Feb 2000 09:48:28 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Locale support broken in latest snapshots " }, { "msg_contents": "Oleg Bartunov gave me the advice to rerun initdb -E KOI8...\n\n And - oops - this helped. Locale test for koi8 locale passed.\n\n It is strange - I did fresh and clean install into empty directory, and\nof course I did initdb -E. Locale tests failed. But stopping postmaster,\nremoving data directory, running initdb -E and restarting postmaster\nhelped...\n\nOn Mon, 28 Feb 2000, Tom Lane wrote:\n> Oleg Broytmann <[email protected]> writes:\n> > In the snapshot of 21 Feb locale support have been broken. \"SELECT *\n> > FROM table ORDER BY name\" returns rows in wrong order; \"SELECT * FROM table\n> > WHERE name ~* re\" performs case-sensitive match.\n> \n> Ugh.\n> \n> > I remember Tatsuo once fixed case-sensitiveness by replacing char with\n> > \"unsigned char\". Should I teach my gcc to always use unsigned chars?\n> \n> No, that's not a solution (since it's not available to non-gcc users).\n> We need to find the coding error and fix it.\n> \n> However, if you can try that as a test to see if it fixes the behavior,\n> please do; knowing whether it does will help narrow down what the bug\n> could be.\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": "Mon, 28 Feb 2000 15:40:09 +0000 (GMT)", "msg_from": "Oleg Broytmann <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Locale support broken in latest snapshots " } ]
[ { "msg_contents": "Here is an updated version of the HISTORY file for 7.0.\n\nI have added sections on Types and Performance to try and reduce the\nnumber of items in each section.\n\nStill, the list is so long as to be almost unreadable.\n\nI can't figure out how to reduce it. I mention all user-visible changes\nin the release, as I have done in the past. The problem is that the\nlist is almost twice the size compared to previous releases.\n\nIf I were MySQL or another commercial database, I would be worried by\nthe list of items I see here. There are a ton 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\nThis release shows the continued growth of PostgreSQL. There are more\nupdated items in 7.0 than in any previous release. Don't be concerned\nthis is a dot-zero release. PostgreSQL does its best to put\nout only solid releases, and this one is no exception.\n\nMajor changes in this release:\n\nForeign Keys: Foreign keys are now implemented, with the exception of\nPARTIAL MATCH foreign keys. Many users have been asking for this\nfeature, and we are pleased to finally offer it.\n\nOptimizer Overhaul: Continuing on work started a year ago, the\noptimizer has been overhauled in many significant ways, allowing better\nquery execution processing with faster performance and less memory\nusage.\n\nUpdated psql: psql, our interactive terminal monitor, has been updated,\nwith a variety of new features. See the psql manual page for the details.\n\nUpcoming Features: In 7.1, we plan to have outer joins, storage for very long\nrows, and a write-ahead logging system.\n\nBug Fixes\n---------\nPrevent function calls with more than maximum number of arguments (Tom)\nMany fixes for CASE (Tom)\nFix SELECT coalesce(f1,0) FROM int4_tbl GROUP BY f1 (Tom)\nFix SELECT sentence.words[0] FROM sentence GROUP BY sentence.words[0] (Tom)\nAllow utility statements in plpgsql (Tom)\nFix GROUP BY scan bug (Tom)\nImprovements in SQL grammar processing (Tom)\nFix for views involved in INSERT ... SELECT ... (Tom)\nFix for SELECT a/2, a/2 FROM test_missing_target GROUP BY a/2 (Tom)\nFix for subselects in INSERT ... SELECT (Tom)\nPrevent INSERT ... SELECT ... ORDER BY (Tom)\nFixes for relations greater than 2GB, including vacuum\nImprove communication of system table changes to other running backends (Tom)\nImprove communication of user table modifications to other running backends (Tom)\nFix handling of temp tables in complex situations (Bruce, Tom)\nDisallow DROP TABLE/DROP INDEX inside a transaction block\nAllow table locking when tables opened, improving concurrent reliability (Tom)\nProperly quote sequence names in pg_dump (Ross J. Reedstrom)\nPrevent DESTROY DATABASE while others accessing\nPrevent any rows from being returned by GROUP BY if no rows processed (Tom)\nFix SELECT COUNT(1) FROM table WHERE ...' if no rows matching WHERE (Tom)\nFix pg_upgrade so it works for MVCC(Tom)\nFix for SELECT ... WHERE x IN (SELECT ... HAVING SUM(x) > 1) (Tom)\nMake TABLE optional keyword in LOCK TABLE (Bruce)\nFix for \"f1 datetime DEFAULT 'now'\" (Tom)\nFix problems with CURRENT_DATE used in DEFAULT (Tom)\nAllow comment-only lines, and ;;; lines too. (Tom)\nImprove recovery after failed disk writes, disk full (Hiroshi)\nFix cases where table is mentioned in FROM but not joined (Tom)\nAllow HAVING clause without aggregate functions (Tom)\nFix for \"--\" comment and no trailing newline, as seen in Perl\nImprove pg_dump failure error reports (Bruce)\nAllow sorts and hashes to exceed 2GB file sizes (Tom)\nFix for pg_dump dumping of inherited rules (Tom)\nFix for NULL handling comparisons (Tom)\nFix inconsistent state caused by failed CREATE/DROP commands (Hiroshi)\nFix for dbname with dash\nPrevent DROP INDEX from interfering with other backends (Tom)\nFix file descriptor leak in verify_password()\nFix for \"Unable to identify an operator =$\" problem\nFix ODBC so no segfault if CommLog and Debug enabled (Dirk Niggemann)\nFix for recursive exit call (Massimo)\nFix for extra-long timezones (Jeroen van Vianen)\nMake pg_dump preserve primary key information (Peter E)\nPrevent databases with single quotes (Peter E)\nPrevent DROP DATABASE inside transaction (Peter E)\necpg memory leak fixes (Stephen Birch)\nFix for SELECT null::text, SELECT int4fac(null) and SELECT 2 + (null) (Tom)\nY2K timestamp fix (Massimo)\nFix for VACUUM 'HEAP_MOVED_IN was not expected' errors (Tom)\nFix for views with tables/columns containing spaces (Tom)\nPrevent permissions on indexes (Peter E)\nFix for spinlock stuck problem when error is generated (Hiroshi)\nFix ipcclean on Linux\nFix handling of NULL constraint conditions (Tom)\nFix memory leak in odbc driver (Nick Gorham)\n\nEnhancements\n------------\nNew CLI interface include file sqlcli.h, based on SQL3/SQL98\nRemove all limits on query length, row length limit still exists (Tom)\nUpdate jdbc protocol to 2.0 (Jens Glaser [email protected])\nAdd TRUNCATE command to quickly truncate relation (Mike Mascari)\nFix to give super user and createdb user proper update catalog rights (Peter E)\nAllow ecpg bool variables to have NULL values (Christof)\nIssue ecpg error if NULL value is returned to variable with no NULL\nindicator (Christof)\nAllow ^C to cancel COPY command (Massimo)\nAdd SET FSYNC and SHOW PG_OPTIONS commands(Massimo)\nImprove CREATE FUNCTION to allow type conversion specification \n\t(Bernie Frankpitt)\nAdd CmdTuples() to libpq++(Vince)\nNew CREATE CONSTRAINT TRIGGER and SET CONSTRAINTS commands(Jan)\nAllow CREATE FUNCTION WITH clause to be used for all language types\nconfigure --enable-debug adds -g (Peter E)\nconfigure --disable-debug removes -g (Peter E)\nAllow more complex default expressions (Tom)\nFirst real FOREIGN KEY constraint trigger functionality (Jan)\nAdd FOREIGN KEY ... MATCH FULL ... ON DELETE CASCADE (Jan)\nAdd FOREIGN KEY ... MATCH <unspecified> referential actions (Don Baccus)\nAllow WHERE restriction on ctid (physical heap location) (Hiroshi)\nMove pginterface from contrib to interface directory, rename to pgeasy (Bruce)\nAdd DEC and SESSION_USER as reserved words\nRequire SELECT DISTINCT target list to have all ORDER BY columns (Tom)\nAdd Oracle's COMMENT ON command (Mike Mascari <mascarim@yahoo.\nlibpq's PQsetNoticeProcessor function now returns previous hook(Peter E)\nPrevent PQsetNoticeProcessor from being set to NULL (Peter E)\nMake USING in COPY optional (Bruce)\nAllow subselects in the target list (Tom)\nAllow subselects on the left side of comparison operators (Tom)\nNew parallel regression test (Jan)\nChange backend-side COPY to write files with permissions 644 not 666 (Tom)\nForce permissions on PGDATA directory to be secure, even if it exists (Tom)\nAdded psql LastOid variable to return last inserted oid (Peter E)\nAllow concurrent vacuum and remove pg_vlock vacuum lock file (Tom)\nAdd permissions check so only Postgres superuser or table owner can\nvacuum (Peter E)\nNew libpq functions to allow asynchronous connections: PQconnectStart(), \n PQconnectPoll(), PQresetStart(), PQresetPoll(), PQsetenvStart(), \n PQsetenvPoll(), PQsetenvAbort (Ewan Mellor)\nNew libpq PQsetenv() function (Ewan Mellor)\ncreate/alter user extension (Peter E)\nNew postmaster.pid and postmaster.opts under $PGDATA (Tatsuo)\nNew scripts for create/drop user/db (Peter E)\nMajor psql overhaul(Peter E)\nAdd const to libpq interface(Peter E)\nNew libpq function PQoidValue (Peter E)\nShow specific non-aggregate causing problem with GROUP BY (Tom)\nMake changes to pg_shadow recreate pg_pwd file (Peter E)\nAdd aggregate(DISTINCT ...) (Tom)\nAllow flag to control COPY input/output of NULLs (Peter E)\nMake postgres user have a password by default (Peter E)\nAdd CREATE/ALTER/DROP GROUP (Peter E)\nAll administration scripts now support --long options (Peter E, Karel)\nVacuumdb script now supports --alldb option (Peter E)\necpg new portable FETCH syntax\nAdd ecpg EXEC SQL IFDEF, EXEC SQL IFNDEF, EXEC SQL ELSE, EXEC SQL ELIF \n\tand EXEC SQL ENDIF directives\nAdd pg_ctl script to control backend startup (Tatsuo)\nAdd postmaster.opts.default file to store startup flags (Tatsuo)\nAllow --with-mb=SQL_ASCII\nIncrease maximum number of index keys to 16 (Bruce)\nIncrease maximum number of function arguments to 16 (Bruce)\nAllow user configuration of maximum number of index keys and arguments\n(Bruce)\nAllow unprivileged users to change their passwords (Peter E)\nWith password authentication enabled, new users without passwords can't\nconnect (Peter E)\nDisallow dropping a user who owns a database (Peter E)\nAdd initdb --enable-multibyte option (Peter E)\nAdd option for initdb to prompts for superuser password (Peter E)\nAllow complex type casts like col::numeric(9,2) and col::int2::float8 (Tom)\nUpdated user interfaces on initdb, initlocation, pg_dump, ipcclean\n(Peter E)\nNew pg_char_to_encoding() and pg_encoding_to_char() functions (Tatsuo\nLibpq non-blocking mode (Alfred Perlstein)\nImprove conversion of types in casts that don't specify a length\nNew plperl internal programming language (Mark Hollomon)\nAllow COPY IN to read file that do not end with a newline (Tom)\nIndicate when long identifiers are truncated (Tom)\nAllow aggregates to use type equivalency (Peter E)\nAdd Oracle's to_char(), to_date(), to_datetime(), to_timestamp(), to_number()\n\tconversion functions (Karel Zak <[email protected]>)\nAdd SELECT DISTINCT ON (expr [, expr ...]) targetlist ... (Tom)\nCheck to be sure ORDER BY is compatible with the DISTINCT operation (Tom)\nAdd NUMERIC and int8 types to ODBC\nImprove EXPLAIN results for Append, Group, Agg, Unique (Tom)\nAdd ALTER TABLE ... ADD FOREIGN KEY (Stephan Szabo)\nAllow SELECT .. FOR UPDATE in PL/pgSQL (Hiroshi)\nEnable backward sequential scan even after reaching EOF (Hiroshi)\nAdd btree indexing of boolean values, >= and <= (Don Baccus)\nPrint current line number when COPY FROM fails (Massimo)\nRecognize special case of POSIX time zone: \"GMT+8\" and \"GMT-8\" (Thomas)\nAdd DEC as synonym for \"DECIMAL (Thomas)\nAdd SESSION_USER as SQL92 keyword, same as CURRENT_USER (Thomas)\nImplement column aliases (aka correlation names) and more join syntax\n(Thomas)\nAllow queries like SELECT a FROM t1 tx (a) (Thomas)\nAllow queries like SELECT * FROM t1 NATURAL JOIN t2 (Thomas)\nMake INTERVAL reserved word allowed as a column identifier (Thomas)\nImplement REINDEX command (Hiroshi)\nAccept ALL in aggregate function SUM(ALL col) (Tom)\nPrevent GROUP BY from using column aliases (Tom)\nNew psql \\encoding option (Tatsuo)\nAllow PQrequestCancel() to terminate when in waiting-for-lock state (Hiroshi)\nAllow negation of a negative number in all cases\nAdd ecpg descriptors\nAllow CREATE VIEW v AS SELECT f1::char(8) FROM tbl\nNew libpq functions PQsetClientEncoding(), PQclientEncoding() (Tatsuo)\nAdd support for SJIS user defined characters (Tatsuo)\nLarger views/rules supported\n\nTypes\n-----\nMany array fixes (Tom)\nAllow bare column names to be subscripted as arrays (Tom)\nImprove type casting of int and float constants (Tom)\nCleanups for int8 inputs, range checking, and type conversion (Tom)\nFix for SELECT timespan('21:11:26'::time) (Tom)\nFix for netmask('x.x.x.x/0') is 255.255.255.255 instead of 0.0.0.0 \n\t(Oleg Sharoiko)\nAdd btree index on NUMERIC(Jan)\nPerl fix for large objects containing NUL characters (Douglas Thomson) \nODBC fix for for large objects (free)\nFix indexing of cidr data type\nFix for Ethernet MAC addresses (macaddr type) comparisons\nFix for date/time types when overflows happened in computations (Tom)\nAllow array on int8 (Peter E)\nFix for rounding/overflow of NUMERIC type, like NUMERIC(4,4) (Tom)\nAllow NUMERIC arrays\nFix bugs in NUMERIC ceil() and floor() functions (Tom)\nMake char_length()/octet_length including trailing blanks (Tom)\nMade abstime/reltime use int4 instead of time_t (Peter E)\nNew lztext data type for compressed text fields\nRevise code to handle coercion of int and float constants (Tom)\nNew C-routines to implement a BIT and BIT VARYING type in /contrib \n\t(Adriaan Joubert)\nNUMERIC now accepts scientific notation (Tom)\nNUMERIC to int4 rounds (Tom)\nConvert float4/8 to NUMERIC properly (Tom)\nAllow type conversion with NUMERIC (Thomas)\nMake ISO date style (2000-02-16 09:33) the default (Thomas)\n\nPerformance\n-----------\nPrevent exponential space consumption with many AND's and OR's (Tom)\nCollect attribute selectivity values for system columns (Tom)\nReduce memory usage of aggregates (Tom)\nFix for LIKE optimization to use indexes with multi-byte encodings (Tom)\nFix r-tree index optimizer selectivity (Thomas)\nImprove optimizer selectivity computations and functions (Tom)\nOptimize btree searching for cases where many equal keys exist (Tom)\nEnable fast LIKE index processing only if index present (Tom)\nRe-use free space on index pages with duplicates (Tom)\nImprove hash join processing (Tom)\nPrevent descending sort if result is already sorted(Hiroshi)\nAllow commuting of index scan query qualifications (Tom)\nPrefer index scans in cases where ORDER BY/GROUP BY is required (Tom)\nAllocate large memory requests in fix-sized chunks for performance (Tom)\nFix vacuum's performance by reducing memory allocation requests (Tom)\nImplement constant-expression simplification (Bernard Frankpitt, Tom)\nAllow more than first column to be used to determine start of index scan\n (Hiroshi)\nPrevent quadruple use of disk space when doing internal sorting (Tom)\nFaster sorting by calling fewer functions (Tom)\nCreate system indexes to match all system caches (Bruce, Hiroshi)\nMake system caches use system indexes(Bruce)\nMake all system indexes unique(Bruce)\nImprove pg_statistics management for VACUUM speed improvement (Tom)\nFlush backend cache less frequently (Tom, Hiroshi)\nCOPY now reuses previous memory allocation, improving performance (Tom)\nImprove optimization cost estimation (Tom)\nImprove optimizer estimate of range queries x > lowbound AND x < highbound (Tom)\nUse DNF instead of CNF where appropriate (Tom, Taral)\nFurther cleanup for OR-of-AND WHERE-clauses (Tom)\nMake use of index in OR clauses (x = 1 AND y = 2) OR (x = 2 AND y = 4) (Tom)\nSmarter optimizer computations for random index page access (Tom)\nNew SET variable to control optimizer costs (Tom)\nOptimizer queries based on LIMIT, OFFSET, and EXISTS qualifications (Tom)\nReduce optimizer internal housekeeping of join paths for speedup (Tom)\n\nSource Tree Changes\n-------------------\nFix for linux PPC compile\nNew generic expression-tree-walker subroutine (Tom)\nChange form() to varargform() to prevent portability problems.\nImproved range checking for large integers on Alpha's\nClean up #include in /include directory (Bruce)\nAdd scripts for checking includes (Bruce)\nRemove un-needed #include's from *.c files (Bruce)\nChange #include's to use <> and \"\" as appropriate (Bruce)\nEnable WIN32 compilation of libpq\nAlpha spinlock fix from Uncle George <[email protected]>\nOverhaul of optimizer data structures (Tom)\nFix to cygipc library (Yutaka Tanida)\nAllow pgsql to work on newer Cygwin snapshots(Dan)\nNew catalog version number (Tom)\nAdd Linux ARM.\nRename heap_replace to heap_update\nUpdate for QNX (Kardos, Dr. Andrea)\nNew platform-specific regression handling (Tom)\nRename oid8 -> oidvector and int28 -> int2vector (Bruce)\nIncluded all yacc and lex files into the distribution (Peter E.)\nRemove lextest, no longer needed (Peter E)\nFix for libpq and psql on Win32 (Magnus)\nInternally change datetime and timespan into timestamp and interval (Thomas)\nFix for plpgsql on BSDI\nAdd SQL_ASCII test case to the regression test (Tatsuo)\nconfigure --with-mb now deprecated (Tatsuo)", "msg_date": "Mon, 28 Feb 2000 05:58:27 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "7.0 Changes list" } ]
[ { "msg_contents": "I'm comparing v6.5.2 against v7.0 and I see now:\nUPDATEs and INSERTs are faster in v7.0 than v5.6.2 but\nSELECTs are slow, specially:\nSELECT ... UNION (is 3 / 4 times slow)\nand\nSELECT...HAVING, this last for example doesn't work.\n\nI'm waiting for hours to have the result of following query:\n\nEXPLAIN select * from comuni where nome in\n(select nome from comuni group by nome having 1 < count(nome));\n\nSeq Scan on comuni (cost=0.00..3429753.65 rows=8342 width=84)\n SubPlan\n -> Aggregate (cost=0.00..822.22 rows=834 width=12)\n -> Group (cost=0.00..801.37 rows=8342 width=12)\n -> Index Scan using knome on comuni (cost=0.00..780.51\nrows=8)\n\nEXPLAIN\n\n--\nJose' Soares\nBologna, Italy [email protected]\n\n\n", "msg_date": "Mon, 28 Feb 2000 15:13:51 +0100", "msg_from": "Jose Soares <[email protected]>", "msg_from_op": true, "msg_subject": "having and union in v7beta" }, { "msg_contents": "Jose Soares <[email protected]> writes:\n> SELECT...HAVING, this last for example doesn't work.\n\nThat's a rather strong statement, and in fact a provably false one.\nHow about a detailed bug report rather than \"it doesn't work\"?\n\n> SELECT ... UNION (is 3 / 4 times slow)\n\nCan't help you on that without more details, either. What is the\nquery exactly, what plan does EXPLAIN show, and what plan did you\nget from 6.5?\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 28 Feb 2000 10:14:07 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] having and union in v7beta " }, { "msg_contents": "Tom Lane wrote:\n\n> Jose Soares <[email protected]> writes:\n> > SELECT...HAVING, this last for example doesn't work.\n>\n> That's a rather strong statement, and in fact a provably false one.\n> How about a detailed bug report rather than \"it doesn't work\"?\n>\n> > SELECT ... UNION (is 3 / 4 times slow)\n>\n> Can't help you on that without more details, either. What is the\n> query exactly, what plan does EXPLAIN show, and what plan did you\n> get from 6.5?\n>\n> regards, tom lane\n\n\n\n\n--\nJose' Soares\nBologna, Italy [email protected]", "msg_date": "Mon, 28 Feb 2000 16:51:38 +0100", "msg_from": "Jose Soares <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] having and union in v7beta" }, { "msg_contents": "Jose Soares <[email protected]> writes:\n>>>> SELECT ... UNION (is 3 / 4 times slow)\n>> \n>> Can't help you on that without more details, either. What is the\n>> query exactly, what plan does EXPLAIN show, and what plan did you\n>> get from 6.5?\n\n> psql7=> EXPLAIN select distretto from comuni union select codice_fiscale from comuni;\n> NOTICE: QUERY PLAN:\n\n> Unique (cost=1767.19..1808.90 rows=1668 width=12)\n-> Sort (cost=1767.19..1767.19 rows=16684 width=12)\n-> Append (cost=0.00..464.84 rows=16684 width=12)\n-> Seq Scan on comuni (cost=0.00..232.42 rows=8342 width=12)\n-> Seq Scan on comuni (cost=0.00..232.42 rows=8342 width=12)\n\n> [ and exactly the same plan for 6.5 ]\n\nOK, so much for my first thought that the 7.0 planner was choosing a\nbad plan.\n\nOne relevant change is that Unique nodes now invoke the proper\ntype-specific equality function(s) to decide whether tuples are distinct\nor not, instead of doing a bitwise comparison (memcmp()) like they did\nbefore. But it's tough to believe that that accounts for a 3-to-4x\nslowdown of this query; certainly I don't see much performance\ndifference on the datatypes I tried. What datatypes are your fields,\nanyway?\n\nThe other possibility is that the Sort step is a lot slower in 7.0,\nalthough I don't think it should be. Are you running both versions\nwith the same -S setting, and if so what is it? Could it be that\nthe query is right on the edge of needing to switch from memory-based\nto disk-based sort? Perhaps 7.0 is deciding that it needs to go to\ndisk a little sooner than 6.5 did.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 28 Feb 2000 19:16:15 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] having and union in v7beta " }, { "msg_contents": "Tom Lane wrote:\n\n> Jose Soares <[email protected]> writes:\n> > SELECT...HAVING, this last for example doesn't work.\n>\n> That's a rather strong statement, and in fact a provably false one.\n> How about a detailed bug report rather than \"it doesn't work\"?\n>\n> > SELECT ... UNION (is 3 / 4 times slow)\n>\n> Can't help you on that without more details, either. What is the\n> query exactly, what plan does EXPLAIN show, and what plan did you\n> get from 6.5?\n>\n> regards, tom lane\n\n--\nJose' Soares\nBologna, Italy [email protected]", "msg_date": "Tue, 29 Feb 2000 09:07:11 +0100", "msg_from": "Jose Soares <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] having and union in v7beta" }, { "msg_contents": "\n\nTom Lane wrote:\n\n> Jose Soares <[email protected]> writes:\n> >>>> SELECT ... UNION (is 3 / 4 times slow)\n> >>\n> >> Can't help you on that without more details, either. What is the\n> >> query exactly, what plan does EXPLAIN show, and what plan did you\n> >> get from 6.5?\n>\n> > psql7=> EXPLAIN select distretto from comuni union select codice_fiscale from comuni;\n> > NOTICE: QUERY PLAN:\n>\n> > Unique (cost=1767.19..1808.90 rows=1668 width=12)\n> -> Sort (cost=1767.19..1767.19 rows=16684 width=12)\n> -> Append (cost=0.00..464.84 rows=16684 width=12)\n> -> Seq Scan on comuni (cost=0.00..232.42 rows=8342 width=12)\n> -> Seq Scan on comuni (cost=0.00..232.42 rows=8342 width=12)\n>\n> > [ and exactly the same plan for 6.5 ]\n>\n> OK, so much for my first thought that the 7.0 planner was choosing a\n> bad plan.\n>\n> One relevant change is that Unique nodes now invoke the proper\n> type-specific equality function(s) to decide whether tuples are distinct\n> or not, instead of doing a bitwise comparison (memcmp()) like they did\n> before. But it's tough to believe that that accounts for a 3-to-4x\n> slowdown of this query; certainly I don't see much performance\n> difference on the datatypes I tried. What datatypes are your fields,\n> anyway?\n\n6.5 takes 0.463s\n7.0 takes 1.640s\nthe field type is CHAR(4)\n\n>\n>\n> The other possibility is that the Sort step is a lot slower in 7.0,\n> although I don't think it should be. Are you running both versions\n> with the same -S setting, and if so what is it? Could it be that\n>\n\n I'm running both of them in this way:\npostmaster -i -o -F -B 512 -S > server.log 2>&1\n\n> the query is right on the edge of needing to switch from memory-based\n> to disk-based sort? Perhaps 7.0 is deciding that it needs to go to\n> disk a little sooner than 6.5 did.\n>\n> regards, tom lane\n\n--\nJose' Soares\nBologna, Italy [email protected]\n\n\n", "msg_date": "Tue, 29 Feb 2000 09:34:59 +0100", "msg_from": "Jose Soares <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] having and union in v7beta" }, { "msg_contents": "Jose Soares <[email protected]> writes:\n>> But it's tough to believe that that accounts for a 3-to-4x\n>> slowdown of this query; certainly I don't see much performance\n>> difference on the datatypes I tried. What datatypes are your fields,\n>> anyway?\n\n> 6.5 takes 0.463s\n> 7.0 takes 1.640s\n> the field type is CHAR(4)\n\nHmm. I see no more than a few percent difference between 6.5 and\ncurrent. There's something peculiar going on on your system.\n\nCurrent code would ultimately invoke strncmp() on the two char fields,\nwhereas 6.5 used memcmp(). Is it possible that strncmp() is a huge\nperformance dog on your platform? I assume you are running in a\nnon-ASCII locale, which might reduce strncmp's performance, but still...\n\nA quick-and-dirty way for you to check this would be to change the\nstrncmp call to call memcmp (just the one-word change should work)\nin bpchareq() in src/backend/utils/adt/varchar.c, and see if that\nchanges the performance of this query materially.\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 29 Feb 2000 13:27:41 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] having and union in v7beta " }, { "msg_contents": "Jose Soares <[email protected]> writes:\n> I tried the following query :\n\n> select * from comuni where nome in (\n> select nome from comuni group by nome having 1 < count(nome)\n> );\n\n> on the above table populated with 8342 rows, PostgreSQL begins searching\n> and I wait for hours without any result.\n\nI'd expect that to be pretty slow, since it's going to execute the inner\nselect for every tuple examined by the outer select. Shouldn't be any\nworse than 6.5 though. IN (sub-SELECT) has always been slow.\n\nThe real solution is to figure out how to do this kind of thing via\njoins, but that will have to wait for the fabled querytree redesign.\n\nI have been toying with the notion of sticking a MATERIALIZE node\ninto the plan tree when we have an IN sub-select and the sub-plan is\ncomplicated, but has no parameters passed from the upper plan.\n(Not sure yet how complicated is complicated enough, but a plan that\nrequires sorting or indexscanning should qualify.) The MATERIALIZE\nnode would run the sub-plan just once and stash the output tuples in\na temp table; then we'd only need a simple scan of the temp table for\neach outer tuple. I think that would improve the speed of IN\nsub-SELECTs by a useful amount in many cases, and it'd be a lot easier\nthan the \"real\" solution.\n\nHowever, I'm not sure it's a good idea to do this when we've already\nstarted beta. Should I try it, or leave it alone until 7.1? By 7.1\nit might be moot...\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 29 Feb 2000 14:49:53 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] having and union in v7beta " }, { "msg_contents": "\n\nTom Lane wrote:\n\n> Jose Soares <[email protected]> writes:\n> >> But it's tough to believe that that accounts for a 3-to-4x\n> >> slowdown of this query; certainly I don't see much performance\n> >> difference on the datatypes I tried. What datatypes are your fields,\n> >> anyway?\n>\n> > 6.5 takes 0.463s\n> > 7.0 takes 1.640s\n> > the field type is CHAR(4)\n>\n> Hmm. I see no more than a few percent difference between 6.5 and\n> current. There's something peculiar going on on your system.\n>\n> Current code would ultimately invoke strncmp() on the two char fields,\n> whereas 6.5 used memcmp(). Is it possible that strncmp() is a huge\n> performance dog on your platform? I assume you are running in a\n> non-ASCII locale, which might reduce strncmp's performance, but still...\n>\n> A quick-and-dirty way for you to check this would be to change the\n> strncmp call to call memcmp (just the one-word change should work)\n> in bpchareq() in src/backend/utils/adt/varchar.c, and see if that\n> changes the performance of this query materially.\n>\n> regards, tom lane\n>\n\ntests with strncmp:\n^^^^^^^^^^^^^^^^^^^\n$ time psql hygea1 -c 'select * from comuni union select * from comuni' >\n/dev/n\nreal 0m1.685s\nuser 0m0.190s\nsys 0m0.050s\n$ time psql hygea1 -c 'select * from comuni union select * from comuni' >\n/dev/n\nreal 0m1.681s\nuser 0m0.200s\nsys 0m0.060s\n$ time psql hygea1 -c 'select * from comuni union select * from comuni' >\n/dev/n\nreal 0m1.680s\nuser 0m0.140s\nsys 0m0.020s\n$ time psql hygea1 -c 'select * from comuni union select * from comuni' >\n/dev/n\nreal 0m1.695s\nuser 0m0.220s\nsys 0m0.010s\n$ time psql hygea1 -c 'select * from comuni union select * from comuni' >\n/dev/n\nreal 0m1.681s\nuser 0m0.150s\nsys 0m0.020s\n=========================================\ntests with memcmp:\n^^^^^^^^^^^^^^^^^^\n$ time psql hygea1 -c 'select * from comuni union select * from comuni' >\n/dev/n\nreal 0m1.714s\nuser 0m0.220s\nsys 0m0.010s\n$ time psql hygea1 -c 'select * from comuni union select * from comuni' >\n/dev/n\nreal 0m1.696s\nuser 0m0.190s\nsys 0m0.010s\n$ time psql hygea1 -c 'select * from comuni union select * from comuni' >\n/dev/n\nreal 0m1.702s\nuser 0m0.220s\nsys 0m0.010s\n$ time psql hygea1 -c 'select * from comuni union select * from comuni' >\n/dev/n\nreal 0m1.693s\nuser 0m0.190s\nsys 0m0.020s\n$ time psql hygea1 -c 'select * from comuni union select * from comuni' >\n/dev/n\nreal 0m1.692s\nuser 0m0.180s\nsys 0m0.030s\n======================================\n\n\n\n--\nJose' Soares\nBologna, Italy [email protected]\n\n\n", "msg_date": "Wed, 01 Mar 2000 13:22:23 +0100", "msg_from": "Jose Soares <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] having and union in v7beta" }, { "msg_contents": "Tom Lane wrote:\n\n> Jose Soares <[email protected]> writes:\n> > I tried the following query :\n>\n> > select * from comuni where nome in (\n> > select nome from comuni group by nome having 1 < count(nome)\n> > );\n>\n> > on the above table populated with 8342 rows, PostgreSQL begins searching\n> > and I wait for hours without any result.\n>\n> I'd expect that to be pretty slow, since it's going to execute the inner\n> select for every tuple examined by the outer select. Shouldn't be any\n> worse than 6.5 though. IN (sub-SELECT) has always been slow.\n>\n>\n\nIn v7.0 this query takes more than 50min to execute, it doesn't work on\nv6.5...\n\nselect * from comuni where nome in (\n select nome from comuni group by nome having count(nome) > 1\n );\n\nreal 50m25.033s\nuser 0m0.010s\nsys 0m0.000s\n\n--\nJose' Soares\nBologna, Italy [email protected]\n\n\n", "msg_date": "Wed, 01 Mar 2000 14:24:14 +0100", "msg_from": "Jose Soares <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] having and union in v7beta" }, { "msg_contents": "\nLamars,\n\nit shouldn't be better to rename the package postgresql-xxx.rpm\nto postgresql-libs-xxx.rpm ??\n\nactually is quite confusing, because at first look it seems that\nthis package is the real thing (then you discover that is not,\nthat the package you really want is postgresql-server).\n\n\nSergio\n\n", "msg_date": "Wed, 1 Mar 2000 10:38:40 -0300", "msg_from": "\"Sergio A. Kessler\" <[email protected]>", "msg_from_op": false, "msg_subject": "rpms" }, { "msg_contents": "> it shouldn't be better to rename the package postgresql-xxx.rpm\n> to postgresql-libs-xxx.rpm ??\n> actually is quite confusing, because at first look it seems that\n> this package is the real thing (then you discover that is not,\n> that the package you really want is postgresql-server).\n\nActually, what you suggest was how the naming was in earlier RPMs.\nHowever, I changed the naming convention since the fundamental\ninstallation should require client-side code only, to talk to a remote\nserver. In cases where Postgres is deployed on many machines, only one\nor a few will have the server installed, while all machines will get\nthe client packages.\n\nRegards.\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Wed, 01 Mar 2000 14:00:27 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] rpms" }, { "msg_contents": "Thomas Lockhart <[email protected]> el d�a Wed, 01 Mar 2000 \n14:00:27 +0000, escribi�:\n\n>> it shouldn't be better to rename the package postgresql-xxx.rpm\n>> to postgresql-libs-xxx.rpm ??\n>> actually is quite confusing, because at first look it seems that\n>> this package is the real thing (then you discover that is not,\n>> that the package you really want is postgresql-server).\n>\n>Actually, what you suggest was how the naming was in earlier RPMs.\n>However, I changed the naming convention since the fundamental\n>installation should require client-side code only, to talk to a remote\n>server. In cases where Postgres is deployed on many machines, only one\n>or a few will have the server installed, while all machines will get\n>the client packages.\n\nhi thomas; yup, I agree that the client side is more deployed,\nand that the packages should be split into server for one side\nand libs in other side.\nand I don't have problems with this, I just have problems \nwith the =name= of the package that contain the libs.\n\nit should be clear that the package contains ONLY the client side,\na package just named \"postgresql\" appear like it contains PostgreSql,\nwhen this, in fact, is not true.\n\njust like postgresql-server.xxx.rpm, this package is well named IMO\n(is pretty clear that it contains the PostgreSql server)\n\nwhat is more clear/descriptive to you for a package that ONLY \ncontains PostgreSql libraries:\n\na) postgresql-libs.xxx.rpm (or maybe postgresql-clientlibs.xxx.rpm ?)\nb) postgresql.xxx.rpm\n\n??\n\n\nSergio\n\n", "msg_date": "Wed, 1 Mar 2000 11:25:26 -0300", "msg_from": "\"Sergio A. Kessler\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] rpms" }, { "msg_contents": "\"Sergio A. Kessler\" <[email protected]> el d�a Wed, 1 Mar 2000 \n11:25:26 -0300, escribi�:\n\n>what is more clear/descriptive to you for a package that ONLY \n>contains PostgreSql libraries:\n>\n>a) postgresql-libs.xxx.rpm (or maybe postgresql-clientlibs.xxx.rpm ?)\n>b) postgresql.xxx.rpm\n>\n>??\n\nand another argument: :)\n\nsuposse a newbie looking for a RDBM is told to install PostgreSql,\nwhat you think will be the first package he will try ?\n\nSergio\n\n", "msg_date": "Wed, 1 Mar 2000 11:39:46 -0300", "msg_from": "\"Sergio A. Kessler\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] rpms" }, { "msg_contents": "> >what is more clear/descriptive to you for a package that ONLY\n> >contains PostgreSql libraries:\n> >a) postgresql-libs.xxx.rpm (or maybe postgresql-clientlibs.xxx.rpm ?)\n> >b) postgresql.xxx.rpm\n> suposse a newbie looking for a RDBM is told to install PostgreSql,\n> what you think will be the first package he will try ?\n\nWell, the newbie would be best off if he installed every package ;)\n\nAnyway, afaik most RPM distros of a product have one .rpm file which\nhas the name of the package, and then may have other .rpm files which\nhave qualifiers, like \"-server\". So in choosing which .rpm file will\nbe the base package, it seemed most appropriate that it be the\nclient-side stuff, as opposed to docs, or server (which btw can't\nreally be run on its own without the client stuff installed\n*somewhere*), or something else.\n\nI appreciate your points, but it isn't clear to me how to eliminate\n*all* possibilities for confusion via RPM package names, so chose to\nuse names which give some appropriate functionality for each package.\n\nRegards.\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Wed, 01 Mar 2000 16:33:52 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] rpms" }, { "msg_contents": "Thomas Lockhart wrote:\n> Anyway, afaik most RPM distros of a product have one .rpm file which\n> has the name of the package, and then may have other .rpm files which\n> have qualifiers, like \"-server\". So in choosing which .rpm file will\n> be the base package, it seemed most appropriate that it be the\n> client-side stuff, as opposed to docs, or server (which btw can't\n> really be run on its own without the client stuff installed\n> *somewhere*), or something else.\n \n> I appreciate your points, but it isn't clear to me how to eliminate\n> *all* possibilities for confusion via RPM package names, so chose to\n> use names which give some appropriate functionality for each package.\n\nThanks for fielding this, Thomas. While it is certainly possible to\nhave a set of subpackages without a 'main' package (the Amanda network\nbackup package comes to mind), I personally agree with you. Besides,\nthe comments for the postgresql-x.x.x-x.i386.rpm package states that it\ncontains only the clients and docs -- or at least I think it does :-).\n\nAnd there will always be confusion with as many packages as we have. \nThe only alternative that I see is to integrate all the packages into\none -- and that is by far a worse solution, as it requires way too many\npackages installed -- it should not be necessary to have X installed to\nrun a postgresql server, for instance -- only the tk client and pgaccess\nrequire X.\n\n--\nLamar Owen\nWGCR Internet Radio\n1 Peter 4:11\n", "msg_date": "Wed, 01 Mar 2000 12:01:18 -0500", "msg_from": "Lamar Owen <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] rpms" }, { "msg_contents": ">>>>> But it's tough to believe that that accounts for a 3-to-4x\n>>>>> slowdown of this query; certainly I don't see much performance\n>>>>> difference on the datatypes I tried. What datatypes are your fields,\n>>>>> anyway?\n>> \n>>>> 6.5 takes 0.463s\n>>>> 7.0 takes 1.640s\n>>>> the field type is CHAR(4)\n>> \n>> Hmm. I see no more than a few percent difference between 6.5 and\n>> current. There's something peculiar going on on your system.\n\nI compiled up current code with profiling enabled (make PROFILE=-pg\nif you want to try it), and found that actually nearly all of the\nruntime for\n\tselect * from comuni union select * from comuni\nis spent in the sort step; so I was on the wrong track in guessing\nthat there might be a performance problem in the new Unique coding.\n\nI am not sure why you're seeing a performance differential for sorting.\nMost of the cycles are going to go into bpcharlt(), which ultimately\ncalls strcoll() if you have USE_LOCALE defined. That's probably not a\nvery fast operation, but that code's hardly changed at all since 6.5.\nIt should be the same speed...\n\nAre you sure you compiled both 6.5 and 7.0 the same way (with or without\nUSE_LOCALE)? Are you sure they're both running under the same locale\nsetting?\n\nYou might also try running the sort entirely in memory (no temp files).\nStarting psql with\n\tsetenv PGOPTIONS \"-S 10000\"\n(10 meg sort space) should do it. I'd be interested to know how 6.5\nand 7.0 stack up for you that way.\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 01 Mar 2000 12:50:12 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] having and union in v7beta " }, { "msg_contents": "I wrote:\n> I compiled up current code with profiling enabled (make PROFILE=-pg\n> if you want to try it), and found that actually nearly all of the\n> runtime for\n> \tselect * from comuni union select * from comuni\n> is spent in the sort step; so I was on the wrong track in guessing\n> that there might be a performance problem in the new Unique coding.\n\nWait a second. Stop the presses. I see what's going on here.\n\n6.5.*:\nplay=> explain select * from comuni union select * from comuni;\nNOTICE: QUERY PLAN:\n\nSeq Scan on comuni (cost=512.00 rows=10000 width=84)\n\n7.0beta1:\nregression=# explain select * from comuni union select * from comuni;\nNOTICE: QUERY PLAN:\n\nUnique (cost=149.66..184.66 rows=200 width=84)\n -> Sort (cost=149.66..149.66 rows=2000 width=84)\n -> Append (cost=0.00..40.00 rows=2000 width=84)\n -> Seq Scan on comuni (cost=0.00..20.00 rows=1000 width=84)\n -> Seq Scan on comuni (cost=0.00..20.00 rows=1000 width=84)\n\n\n7.0beta1's behavior is actually \"correct\", in the sense that it yields\nthe SQL-approved result: the UNION implies a DISTINCT pass over its\nresult, according to SQL, and 7.0beta1 is giving you a DISTINCT result.\n6.5 is failing to generate the DISTINCT operation, because it\nincorrectly simplifies \"select foo union select foo\" into \"select foo\"\nif the two select queries are identical. (There is a TODO item for this.)\nSo that's why 6.5 is a lot faster. But it gives the wrong answer.\n\n*However*, we have not fixed the bug that causes \"select foo union\nselect foo\" to be incorrectly simplified --- the UNION code is still\napplying cnfify. (Which it probably shouldn't, but I haven't wanted\nto touch that code until I have the time to rewrite it completely.)\nThe reason 7.0beta1 generates the \"right\" answer is that it has a\nrecently-introduced bug in the comparison routines that causes it to\nthink the two select subqueries aren't the same.\n\nI just fixed that bug, with the result that current CVS code is now back\nto mis-simplifying this query. (Yes, this is a step forward --- that\nbug could have caused the system to unify two queries that AREN'T the\nsame, which would definitely be a bad thing...)\n\nSo, thanks! You did indeed identify a bug! But you should expect that\nthis query *will* get slower when we fix the other bug ;-). You should\nuse a less silly test case for UNION if you want to make realistic\nperformance comparisons across versions.\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 01 Mar 2000 14:06:47 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] having and union in v7beta " }, { "msg_contents": "On Wed, 1 Mar 2000, Thomas Lockhart wrote:\n\n> Anyway, afaik most RPM distros of a product have one .rpm file which\n> has the name of the package, and then may have other .rpm files which\n> have qualifiers, like \"-server\". So in choosing which .rpm file will\n> be the base package, it seemed most appropriate that it be the\n> client-side stuff, as opposed to docs, or server (which btw can't\n> really be run on its own without the client stuff installed\n> *somewhere*), or something else.\n\nUsually, the \"base\" package somehow contains what the package centers\naround and the -xxx packages are supplements (like -headers, -devel,\n-foointerface). Arguably, PostgreSQL centers around the database server.\n\nWhy not just name the packages postgresql-server and postgresql-client and\nhave no 'postgresql' as such. That should alleviate any confusion\nwhatsoever.\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, 2 Mar 2000 16:58:42 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] rpms" }, { "msg_contents": "> Why not just name the packages postgresql-server and postgresql-client and\n> have no 'postgresql' as such. That should alleviate any confusion\n> whatsoever.\n\nThat is possible. imho it is solving a \"problem\" with no clear benefit\nin the end, so why bother? Just renaming packages doesn't, by name\nalone, clarify which packages depend on others, doesn't clarify that\n-server depends on -client, etc etc.\n\nI'd recommend going with the current scheme for some more time, and\nrather put the effort into clarifying in docs what the packages are\nand which are useful for what. I'm pretty sure that Lamar has some of\nthis in place already, and we can see about integrating some of the\ninfo for v7.0 docs...\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Thu, 02 Mar 2000 16:38:23 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] rpms" }, { "msg_contents": "Thomas Lockhart <[email protected]> el d�a Thu, 02 Mar 2000 \n16:38:23 +0000, escribi�:\n\n>> Why not just name the packages postgresql-server and postgresql-client\n[...]\n>That is possible. imho it is solving a \"problem\" with no clear benefit\n>in the end, so why bother? Just renaming packages doesn't, by name\n>alone, clarify which packages depend on others, doesn't clarify that\n>-server depends on -client, etc etc.\n\nsorry to be picky thomas, but if the name has almost no mean\n(as you imply) then why not call the package \"pirindonga\" ?\n\nanyway, is not a problem for =me=, I know now what the package\ncontains (but I've installed the postgres rpm believing I was\ninstalling the server, so count on me as one damnified that\nignored that there must be a package named just postgresql).\n\none last thing, usually users don't look at the full description\nof the package before installing it, they (and I) just do\nrpm -Uvh xxxxx.rpm (usually the name is self descriptive)\n\nsergio\n\n", "msg_date": "Fri, 3 Mar 2000 09:39:32 -0300", "msg_from": "\"Sergio A. Kessler\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] rpms" }, { "msg_contents": "At 4:39 AM -0800 3/3/00, Sergio A. Kessler wrote:\n>Thomas Lockhart <[email protected]> el d�a Thu, 02 Mar 2000\n>16:38:23 +0000, escribi�:\n>\n>>> Why not just name the packages postgresql-server and postgresql-client\n>[...]\n>>That is possible. imho it is solving a \"problem\" with no clear benefit\n>>in the end, so why bother? Just renaming packages doesn't, by name\n>>alone, clarify which packages depend on others, doesn't clarify that\n>>-server depends on -client, etc etc.\n>\n>sorry to be picky thomas, but if the name has almost no mean\n>(as you imply) then why not call the package \"pirindonga\" ?\n\nI live in NetBSD-land where the package system must be a bit different.\n(It's based on FreeBSD ports.) You can do a pkg_info and get a nice, short\nsummary of the package contents including the dependencies. For example\nTeX comes in about 5 packages and it wasn't at all hard for me to figure\nout that I needed all but one of them. If you install the package it will\nautomatically install any packages it depends on. Dependencies can be\nwild-carded so a package will accept a prerequisite package that is newer\nthan required and so on.\n\nDo I take it that RedHat packages are not this nice? Or is there some\nsubtlety to this discussion I'm missing? Isn't there some convention for\nhow these things are handled already?\n\nSignature failed Preliminary Design Review.\nFeasibility of a new signature is currently being evaluated.\[email protected], or [email protected]\n", "msg_date": "Fri, 3 Mar 2000 10:58:19 -0800", "msg_from": "\"Henry B. Hotz\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] rpms" }, { "msg_contents": "\"Henry B. Hotz\" wrote:\n> Do I take it that RedHat packages are not this nice? Or is there some\n> subtlety to this discussion I'm missing? Isn't there some convention for\n> how these things are handled already?\n\nrpm -qi postgresql\n\n--\nLamar Owen\nWGCR Internet Radio\n1 Peter 4:11\n", "msg_date": "Fri, 03 Mar 2000 15:46:05 -0500", "msg_from": "Lamar Owen <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] rpms" }, { "msg_contents": "\n>sorry to be picky thomas, but if the name has almost no mean\n>(as you imply) then why not call the package \"pirindonga\" ?\n\nThat one would certainly be a popular name in M�xico ;-)\n\n>anyway, is not a problem for =me=, I know now what the package\n>contains (but I've installed the postgres rpm believing I was\n>installing the server, so count on me as one damnified that\n>ignored that there must be a package named just postgresql).\n>\n>one last thing, usually users don't look at the full description\n>of the package before installing it, they (and I) just do\n>rpm -Uvh xxxxx.rpm (usually the name is self descriptive)\n\nMost of the final users just use the regular distributions, so the\nname could only matter to the packager. And even when you upgrade\nyou'll just do a rpm -Uh postgr*\n\nJust my two cents...\n\n\n", "msg_date": "Fri, 3 Mar 2000 18:42:46 -0600", "msg_from": "\"=?ISO-8859-1?Q?Fernando Magari=8F1os Lamas?=\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] rpms" } ]
[ { "msg_contents": "This is probably related to Lockhart's changes to allow\nnot null/not deferrable to work (foreign key stuff). I'm\nsympathetic, I looked at gram.y for awhile myself trying to\nfigure a way out of the problem and didn't find a good\nsolution.\n\nAnyway:\n\ndonb=# create table bar(i integer unique not null);\nERROR: parser: parse error at or near \"not\"\ndonb=# create table bar(i integer not null unique);\nERROR: parser: parse error at or near \"unique\"\ndonb=# create table bar(i integer unique);\nNOTICE: CREATE TABLE/UNIQUE will create implicit index 'bar_i_key' for\ntable 'bar'\nCREATE\ndonb=# \n\n\nOuch. Fails on \"primary key not null\", etc too (though the\nnot null is redundant in this case).\n\nThe data model I'm porting from Oracle fails several hundred\ntimes now because of this little problem...I guess my last\nsnapshot was just before Thomas' committed those changes,\notherwise I would've caught them before 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": "Mon, 28 Feb 2000 07:16:01 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": true, "msg_subject": "bug in 7.0" }, { "msg_contents": "Don Baccus <[email protected]> writes:\n> This is probably related to Lockhart's changes to allow\n> not null/not deferrable to work (foreign key stuff).\n\nYeah, we need a better answer for NOT DEFERRABLE. Thomas just did a\nquick & dirty kluge to allow testing of foreign keys, but as you see\nit's broken a number of other things...\n\nI still like the idea of turning NOT NULL into a single token before\nit gets to the grammar, but Thomas was dissatisfied with that plan.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 28 Feb 2000 11:11:36 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] bug in 7.0 " }, { "msg_contents": "Tom Lane wrote:\n\n> Don Baccus <[email protected]> writes:\n> > This is probably related to Lockhart's changes to allow\n> > not null/not deferrable to work (foreign key stuff).\n>\n> Yeah, we need a better answer for NOT DEFERRABLE. Thomas just did a\n> quick & dirty kluge to allow testing of foreign keys, but as you see\n> it's broken a number of other things...\n>\n> I still like the idea of turning NOT NULL into a single token before\n> it gets to the grammar, but Thomas was dissatisfied with that plan.\n\n I would be able to undo Thomas' changes to the parser (plus\n your fix for SEQUENCE) and put our idea of token lookahead\n into instead. The changes are locally to gram.y, and anything\n works as expected.\n\n It's a kludge too, mucking around with a\n\n #define yylex() pg_yylex()\n\n at the beginning, then later #undef'ining it again and\n creating a function pg_yylex() that calls the real yylex().\n Since we insist on bison and ship a gram.c for the others,\n There can't be any portability problems.\n\n I'd like to discuss this with Thomas on the phone before\n committing, but IIRC he's off right now. So what do others\n think?\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, 28 Feb 2000 23:18:34 +0100 (CET)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": false, "msg_subject": "NOT {NULL|DEFERRABLE} (was: bug in 7.0)" }, { "msg_contents": "At 11:18 PM 2/28/00 +0100, Jan Wieck wrote:\n\n> I would be able to undo Thomas' changes to the parser (plus\n> your fix for SEQUENCE) and put our idea of token lookahead\n> into instead. The changes are locally to gram.y, and anything\n> works as expected.\n\nLook-ahead's a bit cleaner in principle than doing it in the lexer,\nIMO. Still, it shouldn't be necessary.\n\nI was going to take a look at the relevant part of gram.y starting\nin about an hour, over coffee, to see if anything leaps out at me.\n\nAlso, I think Thomas ought to have a chance to chime in and he's\napparently back in touch with the world, because he's been e-mailing\ntoday.\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, 28 Feb 2000 14:37:02 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": true, "msg_subject": "Re: NOT {NULL|DEFERRABLE} (was: bug in 7.0)" }, { "msg_contents": "[email protected] (Jan Wieck) writes:\n> I would be able to undo Thomas' changes to the parser (plus\n> your fix for SEQUENCE) and put our idea of token lookahead\n> into instead. The changes are locally to gram.y, and anything\n> works as expected.\n\n> It's a kludge too, mucking around with a\n\n> #define yylex() pg_yylex()\n\n> at the beginning, then later #undef'ining it again and\n> creating a function pg_yylex() that calls the real yylex().\n> Since we insist on bison and ship a gram.c for the others,\n> There can't be any portability problems.\n\nUm. We do *not* insist on bison, and at least one platform that\nI work with would like to keep the option. Please hold off on this.\n\nThe other alternative that was discussed was to put the onus on\nanalyze.c to fix things up. Basically, we could make NOT DEFERRABLE\nand the other subclauses of foreign key clauses be independent\nclauses from the grammar's point of view; that is,\n\n\tFOREIGN KEY blah blah NOT DEFERRABLE INITIALLY IMMEDIATE\n\nwould be parsed as three separate constraint clauses producing three\nseparate nodes in the column's constraint list. Then analyze.c would\nmake a pre-pass over the list to mark the FOREIGN KEY clause with the\nright values and remove the extraneous clauses. (And to complain if\nany of them are not in the right place, of course.)\n\nThis should get rid of the shift-reduce conflict, because there's\nno longer any need to consider shifting in the context of\n\n\tFOREIGN KEY blah blah . NOT\n\nAs far as the grammar is concerned, it can always reduce the FOREIGN\nKEY clause at this point; the NOT will introduce a separate clause in\nany case, so it doesn't matter whether NULL or DEFERRABLE follows it.\n\nThis would be a little bit more work, but it would introduce no\nportability risk at all, and in theory it would let us produce better\nerror messages than the generic \"parse error near\" message, for at least\nsome kinds of mistakes.\n\nI don't recall whether Thomas liked that idea either ;-), but I'm coming\naround to the opinion that it's the best solution.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 28 Feb 2000 18:25:10 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: NOT {NULL|DEFERRABLE} (was: bug in 7.0) " }, { "msg_contents": "Tom Lane wrote:\n\n> [email protected] (Jan Wieck) writes:\n>\n> > It's a kludge too, mucking around with a\n>\n> > #define yylex() pg_yylex()\n>\n> > at the beginning, then later #undef'ining it again and\n>\n> Um. We do *not* insist on bison, and at least one platform that\n> I work with would like to keep the option. Please hold off on this.\n\n Oh - O.K. - wrong assumption. Interesting if such a construct\n works with other yacc implementations anyway.\n\n> The other alternative that was discussed was to put the onus on\n> analyze.c to fix things up. Basically, we could make NOT DEFERRABLE\n> and the other subclauses of foreign key clauses be independent\n> clauses from the grammar's point of view; that is,\n> [...]\n\n Yepp, that was the third possible solution we talked about.\n No doubt that it is the best one, and something we both wanna\n see at the end. Only that I fear we cannot build it in time\n for 7.0 schedule. Thus I assume we have to live 'now' with\n either Thomas' kludge (as you called it), restricting order\n of constraint clauses and introducing unpleasant \"Why doesn't\n my query ...\" questions, or my crude hack. From the latter\n one, I expect far less rumour because that's restricted to\n ppl NOT using bison BUT touching gram.y.\n\n At least this one will give us the option to delay the final\n solution until 7.1 or until we shuffle up the entire\n parser->rewriter->planner/optimizer->executor path. And that\n without crippling the syntax from the users PoV.\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": "Tue, 29 Feb 2000 01:28:11 +0100 (CET)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": false, "msg_subject": "Re: NOT {NULL|DEFERRABLE} (was: bug in 7.0)" }, { "msg_contents": "At 06:25 PM 2/28/00 -0500, Tom Lane wrote:\n\n>The other alternative that was discussed was to put the onus on\n>analyze.c to fix things up. Basically, we could make NOT DEFERRABLE\n>and the other subclauses of foreign key clauses be independent\n>clauses from the grammar's point of view;\n\nWhich, of course, they are in the SQL92 grammar...\n\n> that is,\n>\n>\tFOREIGN KEY blah blah NOT DEFERRABLE INITIALLY IMMEDIATE\n>\n>would be parsed as three separate constraint clauses producing three\n>separate nodes in the column's constraint list. Then analyze.c would\n>make a pre-pass over the list to mark the FOREIGN KEY clause with the\n>right values and remove the extraneous clauses. (And to complain if\n>any of them are not in the right place, of course.)\n\nI just got back from my little coffee break spent reading the relevant bit\nof gram.y, and after looking at the gyrations Thomas went through in his\npatch I'm even more convinced that doing it \"right\" is not only right,\nbut in the long run simpler.\n\nI think gram.y can be patched up to fix some of the more obvious \nmissing cases but it will make it even messier than it is now. And\nit's already extremely messy.\n\nAgain, I'm sympathetic to Thomas because I tried to find a quick and\ndirty work-around to Jan's original shift-reduce conflict several\nweeks ago, without success. Thomas' change isn't quick and dirty,\nbut rather complicated and messy and incomplete, but short of doing\nit \"right\" (i.e. as Tom explains above) there's no other way I can\nsee.\n\nOther than stepping outside the parser, so to speak, to do token\nlookahead or to do a lexer kludge. But these kludges only fix\nJan's original problem - and Jan's original grammar isn't SQL92\ncompliant...\n\n>I don't recall whether Thomas liked that idea either ;-), but I'm coming\n>around to the opinion that it's the best solution.\n\nWell, the current effort tries to avoid the general case by listing\na bunch of possible combinations, which really doesn't feel right.\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, 28 Feb 2000 16:31:41 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": true, "msg_subject": "Re: NOT {NULL|DEFERRABLE} (was: bug in 7.0) " }, { "msg_contents": "[email protected] (Jan Wieck) writes:\n> Tom Lane wrote:\n>> The other alternative that was discussed was to put the onus on\n>> analyze.c to fix things up. Basically, we could make NOT DEFERRABLE\n>> and the other subclauses of foreign key clauses be independent\n>> clauses from the grammar's point of view; that is,\n\n> Yepp, that was the third possible solution we talked about.\n> No doubt that it is the best one, and something we both wanna\n> see at the end. Only that I fear we cannot build it in time\n> for 7.0 schedule.\n\nWhy not? It's not *that* much work --- looked like maybe an\nevening's project to me. If no one else wants to do it, I will.\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 28 Feb 2000 19:45:02 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: NOT {NULL|DEFERRABLE} (was: bug in 7.0) " }, { "msg_contents": "Tom Lane wrote:\n> [email protected] (Jan Wieck) writes:\n> > Tom Lane wrote:\n> >> The other alternative that was discussed was to put the onus on\n> >> analyze.c to fix things up. Basically, we could make NOT DEFERRABLE\n> >> and the other subclauses of foreign key clauses be independent\n> >> clauses from the grammar's point of view; that is,\n>\n> > Yepp, that was the third possible solution we talked about.\n> > No doubt that it is the best one, and something we both wanna\n> > see at the end. Only that I fear we cannot build it in time\n> > for 7.0 schedule.\n>\n> Why not? It's not *that* much work --- looked like maybe an\n> evening's project to me. If no one else wants to do it, I will.\n\n Your turn.\n\n Thomas made his, IMHO already complained because crippling\n the user interface in a not stdconforming way. My one is a\n bad hack and therefore deprecated by definition.\n\n Let's look at all three possible implementations for 7.0 and\n judge after.\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": "Tue, 29 Feb 2000 01:55:09 +0100 (CET)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": false, "msg_subject": "Re: NOT {NULL|DEFERRABLE} (was: bug in 7.0)" }, { "msg_contents": "> Thomas made his, IMHO already complained because crippling\n> the user interface in a not stdconforming way. My one is a\n> bad hack and therefore deprecated by definition.\n\nI did not claim to have the final form; I ran out of time before\nheading out on vacation. istm that solving the general case by\nunrolling clauses should not be exhaustively difficult. I will\ncontinue to pursue this as time permits.\n\n> Let's look at all three possible implementations for 7.0 and\n> judge after.\n\nSounds good.\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Tue, 29 Feb 2000 05:54:56 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: NOT {NULL|DEFERRABLE} (was: bug in 7.0)" }, { "msg_contents": "At 05:54 AM 2/29/00 +0000, Thomas Lockhart wrote:\n\n>I did not claim to have the final form; I ran out of time before\n>heading out on vacation.\n\nIn retrospect, it shouldn't've gone into the beta at that point,\nthen. Crippling \"unique not null\" isn't merely an inconvenience.\nDropping a bomb like this into beta the night before release\nand leaving town for nine days perhaps wasn't the best thing to\ndo. Perhaps we should avoid doing things like this in the future.\n\nBecause of this, the web toolkit I'm porting is going out with\n6.5 only, rather than 6.5 or 7.0 beta with 7.0 beta recommended.\nIt's a pity, bugs and some of our hacks around missing features \nin 6.5 make portions of the toolkit differ in their output than\nthe Oracle version. This hurts the credibility of the port,\nto some degree, and simply adds ammunition to those who argue\nthat trying to do this kind of project on top of Postgres is\nfoolishness incarnate.\n\nIt's REALLY a pity because the Feb 18th snapshot I took and\ntested, like earlier ones, was really solid. The toolkit was\nlooking great with the snapshot.\n\n>istm that solving the general case by\n>unrolling clauses should not be exhaustively difficult.\n\nI actually did the unrolling of the worst cases last night, took\nme about an hour with \"Star Trek Voyager\" on in the background\nas a distraction from how ugly this hack is. Because, with all\ndue respect, Thomas, it is an exceedingly ugly hack. And you\ncan't unroll enough to capture the grammar anyway, it's like\ntrying to enumerate all possible expressions in the grammar\nrather than parse the general form.\n\nI ran into another problem, though, and presumed it was because\nof my hacking. So I decided to roll back gram.y to the Feb\n18 snapshot, did a clean/make of the parser, rebuilt and reinstalled,\nand the thing still segtrapped on me. \n\nI don't have time to dig deeper at the moment. I'll look later\ntonight. It would take me about 15 minutes to recreate my\nadditional unrolling clauses, as well, but I'm hoping Tom was\nserious about taking the time to do it right as unrolling is\nNOT a solution.\n\nWhat's wrong with actually accepting the SQL92 grammar, anyway?\n\n> I will\n>continue to pursue this as time permits.\n\n\"as time permits\"? This implies we live with an unusable beta\nin the interim?\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, 29 Feb 2000 06:30:59 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: NOT {NULL|DEFERRABLE} (was: bug in 7.0)" }, { "msg_contents": "On Tue, 29 Feb 2000, Don Baccus wrote:\n\n> Because of this, the web toolkit I'm porting is going out with\n> 6.5 only, rather than 6.5 or 7.0 beta with 7.0 beta recommended.\n> It's a pity, bugs and some of our hacks around missing features \n> in 6.5 make portions of the toolkit differ in their output than\n> the Oracle version. This hurts the credibility of the port,\n> to some degree, and simply adds ammunition to those who argue\n> that trying to do this kind of project on top of Postgres is\n> foolishness incarnate.\n\nIt's BETA. You're not supposed to use it in production work. Beta is a\nfeature freeze, then we try to sort out the bugs.\n\nAs far as I'm concerned it would hurt credibility of the port much more to\n\"recommend\" a beta version of a database server as its backend. If you\nneed 7.0 for your port then you should have waited a month. While I agree\nthat the parser \"fixes\" were less than ideal, we're not primarily\ndeveloping PostgreSQL to work with your toolkit.\n\n> I actually did the unrolling of the worst cases last night, took\n> me about an hour with \"Star Trek Voyager\" on in the background\n> as a distraction from how ugly this hack is. Because, with all\n> due respect, Thomas, it is an exceedingly ugly hack. And you\n> can't unroll enough to capture the grammar anyway, it's like\n> trying to enumerate all possible expressions in the grammar\n> rather than parse the general form.\n\nThe difference is that the expression space is infinite, whereas unrolling\nall column constraints should be on the order of a dozen or two. Better\nideas are welcome of course.\n\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Tue, 29 Feb 2000 17:37:08 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: NOT {NULL|DEFERRABLE} (was: bug in 7.0)" }, { "msg_contents": "> >I did not claim to have the final form; I ran out of time before\n> >heading out on vacation.\n> In retrospect, it shouldn't've gone into the beta at that point,\n> then. Crippling \"unique not null\" isn't merely an inconvenience.\n> Dropping a bomb like this into beta the night before release\n> and leaving town for nine days perhaps wasn't the best thing to\n> do. Perhaps we should avoid doing things like this in the future.\n\nLighten up Don! I put this in so Jan et al can get cracking on the\nreferential integrity stuff in the column specification, and imho the\nfeature and space of possible solutions is isolated and finite. Not a\nbig risk for the first part of beta.\n\n<snip>\n> What's wrong with actually accepting the SQL92 grammar, anyway?\n\n?? That is what we are trying to do.\n\nI'm not sure what your point is about \"having to ship 6.5 instead of\n7.0\" for your porting project. If you aren't willing to cope with\nsmall changes/features/breakage in a beta cycle you should stay away\nfrom betas.\n\nThere is *no* reason you should think that the restriction on syntax\nin this area is a permanent feature or something that will persist\nthrough beta. If you are on such a tight schedule that you can't cope\nwith a 2 week slip in a feature, or a 2 week breakage from your PoV,\nthen beta isn't for you!!\n\notoh, if you are planning on shipping after the 7.0 release, then\nthere isn't a problem. And if you need a system which has *exactly*\nthe behaviors of a couple of weeks ago, then use a snapshot from a\ncouple of weeks ago. I'll prep and send you one if you would like.\n\nRegards.\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Tue, 29 Feb 2000 16:39:52 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: NOT {NULL|DEFERRABLE} (was: bug in 7.0)" }, { "msg_contents": "At 04:39 PM 2/29/00 +0000, Thomas Lockhart wrote:\n>> >I did not claim to have the final form; I ran out of time before\n>> >heading out on vacation.\n>> In retrospect, it shouldn't've gone into the beta at that point,\n>> then. Crippling \"unique not null\" isn't merely an inconvenience.\n>> Dropping a bomb like this into beta the night before release\n>> and leaving town for nine days perhaps wasn't the best thing to\n>> do. Perhaps we should avoid doing things like this in the future.\n>\n>Lighten up Don! I put this in so Jan et al can get cracking on the\n>referential integrity stuff in the column specification, and imho the\n>feature and space of possible solutions is isolated and finite. Not a\n>big risk for the first part of beta.\n\nNo, I won't lighten up. I said \"in retrospect\", and I used those\nwords intentionally to suggest that IN THE FUTURE we might take\nmore care. What's the harm in learning from experience?\n\nAn alternative might be to remove the following sentence from the\nrelease notes:\n\n\"Don't be concerned this is a dot-zero release. PostgreSQL does its\nbest to put out only solid releases, and this one is no exception.\"\n\n><snip>\n>> What's wrong with actually accepting the SQL92 grammar, anyway?\n>\n>?? That is what we are trying to do.\n\nYour unrolling technique doesn't and can't accept the SQL92 grammar.\nThat should be obvious. You don't seriously intend to enumerate\nall possible combinations of constraints and constraint attributes,\ndo you? It's the wrong way to go about it.\n\n>I'm not sure what your point is about \"having to ship 6.5 instead of\n>7.0\" for your porting project. If you aren't willing to cope with\n>small changes/features/breakage in a beta cycle you should stay away\n>from betas.\n\nThis is NOT a small change/breakage. I'm astonished that that the\nremoval of \"unique not null\" and \"not null unique\" would be considered\n\"small\". Of course, other perfectly legal and previously accepted\nconstraints are rejected, too.\n\n>There is *no* reason you should think that the restriction on syntax\n>in this area is a permanent feature or something that will persist\n>through beta. If you are on such a tight schedule that you can't cope\n>with a 2 week slip in a feature, or a 2 week breakage from your PoV,\n>then beta isn't for you!!\n\nIn MHO delaying beta would've been better if a better solution couldn't\nbe lashed in, because this is a serious breakage. \n\nOr, make more modest claims about the stability of betas. If release\nnotes and publicity made it clear that PG betas aren't expected to be\nproduction, or near-production, quality then people like me wouldn't\nhold this expectation.\n\n>otoh, if you are planning on shipping after the 7.0 release, then\n>there isn't a problem. And if you need a system which has *exactly*\n>the behaviors of a couple of weeks ago, then use a snapshot from a\n>couple of weeks ago. I'll prep and send you one if you would like.\n\nI've got my own from three days before beta, thank you.\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, 29 Feb 2000 09:33:33 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: NOT {NULL|DEFERRABLE} (was: bug in 7.0)" }, { "msg_contents": "At 05:37 PM 2/29/00 +0100, Peter Eisentraut wrote:\n>On Tue, 29 Feb 2000, Don Baccus wrote:\n>\n>> Because of this, the web toolkit I'm porting is going out with\n>> 6.5 only, rather than 6.5 or 7.0 beta with 7.0 beta recommended.\n>> It's a pity, bugs and some of our hacks around missing features \n>> in 6.5 make portions of the toolkit differ in their output than\n>> the Oracle version. This hurts the credibility of the port,\n>> to some degree, and simply adds ammunition to those who argue\n>> that trying to do this kind of project on top of Postgres is\n>> foolishness incarnate.\n>\n>It's BETA. You're not supposed to use it in production work. Beta is a\n>feature freeze, then we try to sort out the bugs.\n\nSo is our web toolkit release. So is the AOLserver Version 3 that\nwe're using. We're putting out a beta suite, so to speak. I didn't\nmake that clear. Obviously we're not going to put out a production\nversion with all-beta componets.\n\n\"Don't be concerned this is a dot-zero release. PostgreSQL does its \nbest to put out only solid releases, and this one is no exception.\"\n\nI'm now concerned. I wasn't Feb 18th.\n\nMind you, I made my recommendation that we use 7.0 beta after having\nused it in my porting work for about a month, without problems. Just\nas I've been using AOLserver version 3, also without problem.\n\nSo it's not like I blindly made a decision out of ignorance, I worked\nwith the upcoming beta in order to make an intellegent decision. As\nof Feb 18th, the upcoming beta worked much better with our stuff\nthan 6.5, and that's the truth.\n\n>As far as I'm concerned it would hurt credibility of the port much more to\n>\"recommend\" a beta version of a database server as its backend.\n\nAgain, I didn't make it clear that our port is also a beta, and that\nwe're only encouraging that people experiment with it, not put up\nproduction web sites, for the next couple of months at least. Sorry\nfor that confusion.\n\nIn that context, I feel comfortable with using tested components even\nif they're beta.\n\nPostgres benefits from that aggressiveness as the beta will get some\nserious testing in this environment. AOLserver V3 beta won't benefit\nto the same degree because it's so (ahem) solid that it's being used\non production web sites using the Oracle version of this toolkit.\n\n...\n\n>we're not primarily\n>developing PostgreSQL to work with your toolkit.\n\nI've never suggested that. Jose Soares (sp?) found the same bug\nalmost simultaneously. We're talking vanilla SQL92. I can use my\nFeb 18th snapshot, and will if this doesn't get fixed quickly. My\nconcern's a lot more general.\n\nI'm not being small-minded or selfish.\n\n>> I actually did the unrolling of the worst cases last night, took\n>> me about an hour with \"Star Trek Voyager\" on in the background\n>> as a distraction from how ugly this hack is. Because, with all\n>> due respect, Thomas, it is an exceedingly ugly hack. And you\n>> can't unroll enough to capture the grammar anyway, it's like\n>> trying to enumerate all possible expressions in the grammar\n>> rather than parse the general form.\n>\n>The difference is that the expression space is infinite, whereas unrolling\n>all column constraints should be on the order of a dozen or two.\n\nActually, the column constraint stuff is infinite, too - in the given\nSQL92 grammar. Restrictions that exist are due to semantics. The\ntraditional means of dealing with this - pardon me for being a professional\ncompiler writer, I was born this way and can't help myself - is to\nimplement semantic restrictions via semantic analysis, not syntactic\nkludges.\n\nIt sounds like Tom intends to take a whack at this approach. I'd\noffer, but my time's tight at the moment.\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, 29 Feb 2000 09:51:09 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: NOT {NULL|DEFERRABLE} (was: bug in 7.0)" }, { "msg_contents": "Don Baccus <[email protected]> writes:\n> An alternative might be to remove the following sentence from the\n> release notes:\n> \"Don't be concerned this is a dot-zero release. PostgreSQL does its\n> best to put out only solid releases, and this one is no exception.\"\n\nUh, Don, that's wording that we expect will apply to the 7.0 *release*.\nWe did not claim that the beta version has no known bugs.\n\n> [ much ranting snipped ]\n\nThomas made an engineering judgment that supporting beta-testing of all\nthe new foreign key features was more important than having a first beta\nrelease with no regression in the parser. You can argue that he made\nthe wrong choice (I'm not sure if he did or not), but I don't think\njumping on him like this is appropriate.\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 29 Feb 2000 13:14:34 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: NOT {NULL|DEFERRABLE} (was: bug in 7.0) " }, { "msg_contents": "\nDon, I'm tired of listening to you constantly berating ppl who are doing\n*alot* of work to get PostgreSQL to a release state ... we are currently\nin a *BETA* period, which means that we are trying *fix bugs* ... some of\nthose fixes will let other bugs creep in, and it is expected by those\nplaying with *non release level* software ...\n\nIMHO, you should be on pgsql-general, not pgsql-hackers, as its obvious\nthat you need *release level* software ...\n\nI've warned once before, as has Bruce ... this is the last one. If you\ncan't report bugs without being antagonistic about it, I will have to ask\nyou to leave -hackers and wait for the release to happen ... \n\nAs all our others once said: \"if you can't say something nice, don't say\nanything at all\" ... and, quite frankly, silence from your end of the\nworld until the release is made would be appreciated by all ...\n\nIf, when we release, you are *still* having problems,please feel free to\nlet us know in a *NON* antagonistic way ...\n\nOn Tue, 29 Feb 2000, Don Baccus wrote:\n\n> At 04:39 PM 2/29/00 +0000, Thomas Lockhart wrote:\n> >> >I did not claim to have the final form; I ran out of time before\n> >> >heading out on vacation.\n> >> In retrospect, it shouldn't've gone into the beta at that point,\n> >> then. Crippling \"unique not null\" isn't merely an inconvenience.\n> >> Dropping a bomb like this into beta the night before release\n> >> and leaving town for nine days perhaps wasn't the best thing to\n> >> do. Perhaps we should avoid doing things like this in the future.\n> >\n> >Lighten up Don! I put this in so Jan et al can get cracking on the\n> >referential integrity stuff in the column specification, and imho the\n> >feature and space of possible solutions is isolated and finite. Not a\n> >big risk for the first part of beta.\n> \n> No, I won't lighten up. I said \"in retrospect\", and I used those\n> words intentionally to suggest that IN THE FUTURE we might take\n> more care. What's the harm in learning from experience?\n> \n> An alternative might be to remove the following sentence from the\n> release notes:\n> \n> \"Don't be concerned this is a dot-zero release. PostgreSQL does its\n> best to put out only solid releases, and this one is no exception.\"\n> \n> ><snip>\n> >> What's wrong with actually accepting the SQL92 grammar, anyway?\n> >\n> >?? That is what we are trying to do.\n> \n> Your unrolling technique doesn't and can't accept the SQL92 grammar.\n> That should be obvious. You don't seriously intend to enumerate\n> all possible combinations of constraints and constraint attributes,\n> do you? It's the wrong way to go about it.\n> \n> >I'm not sure what your point is about \"having to ship 6.5 instead of\n> >7.0\" for your porting project. If you aren't willing to cope with\n> >small changes/features/breakage in a beta cycle you should stay away\n> >from betas.\n> \n> This is NOT a small change/breakage. I'm astonished that that the\n> removal of \"unique not null\" and \"not null unique\" would be considered\n> \"small\". Of course, other perfectly legal and previously accepted\n> constraints are rejected, too.\n> \n> >There is *no* reason you should think that the restriction on syntax\n> >in this area is a permanent feature or something that will persist\n> >through beta. If you are on such a tight schedule that you can't cope\n> >with a 2 week slip in a feature, or a 2 week breakage from your PoV,\n> >then beta isn't for you!!\n> \n> In MHO delaying beta would've been better if a better solution couldn't\n> be lashed in, because this is a serious breakage. \n> \n> Or, make more modest claims about the stability of betas. If release\n> notes and publicity made it clear that PG betas aren't expected to be\n> production, or near-production, quality then people like me wouldn't\n> hold this expectation.\n> \n> >otoh, if you are planning on shipping after the 7.0 release, then\n> >there isn't a problem. And if you need a system which has *exactly*\n> >the behaviors of a couple of weeks ago, then use a snapshot from a\n> >couple of weeks ago. I'll prep and send you one if you would like.\n> \n> I've got my own from three days before beta, thank you.\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> \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": "Tue, 29 Feb 2000 14:34:07 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: NOT {NULL|DEFERRABLE} (was: bug in 7.0)" }, { "msg_contents": "At 01:14 PM 2/29/00 -0500, Tom Lane wrote:\n>Don Baccus <[email protected]> writes:\n>> An alternative might be to remove the following sentence from the\n>> release notes:\n>> \"Don't be concerned this is a dot-zero release. PostgreSQL does its\n>> best to put out only solid releases, and this one is no exception.\"\n>\n>Uh, Don, that's wording that we expect will apply to the 7.0 *release*.\n>We did not claim that the beta version has no known bugs.\n\nHmmm...OK, I can see this. It's not clear, though, because you get\nthere from the main web page which is discussing the beta. \n\n>\n>> [ much ranting snipped ]\n>\n>Thomas made an engineering judgment that supporting beta-testing of all\n>the new foreign key features was more important than having a first beta\n>release with no regression in the parser. You can argue that he made\n>the wrong choice (I'm not sure if he did or not), but I don't think\n>jumping on him like this is appropriate.\n\nI said \"in retrospect\" and \"in the future\" ... I'm merely suggesting\nthat perhaps in the future we might be more conservative. \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, 29 Feb 2000 10:51:06 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: NOT {NULL|DEFERRABLE} (was: bug in 7.0) " }, { "msg_contents": "At 02:34 PM 2/29/00 -0400, The Hermit Hacker wrote:\n\n>IMHO, you should be on pgsql-general, not pgsql-hackers, as its obvious\n>that you need *release level* software ...\n\nNo problem, I'll unsubscribe.\n\n>If, when we release, you are *still* having problems,please feel free to\n>let us know in a *NON* antagonistic way ...\n\nSave bug reports until release? OK, if that's what you want.\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, 29 Feb 2000 11:06:22 -0800", "msg_from": "Don Baccus <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: NOT {NULL|DEFERRABLE} (was: bug in 7.0)" }, { "msg_contents": "\nOn 29-Feb-00 Don Baccus wrote:\n> At 01:14 PM 2/29/00 -0500, Tom Lane wrote:\n>>Don Baccus <[email protected]> writes:\n>>> An alternative might be to remove the following sentence from the\n>>> release notes:\n>>> \"Don't be concerned this is a dot-zero release. PostgreSQL does its\n>>> best to put out only solid releases, and this one is no exception.\"\n>>\n>>Uh, Don, that's wording that we expect will apply to the 7.0 *release*.\n>>We did not claim that the beta version has no known bugs.\n> \n> Hmmm...OK, I can see this. It's not clear, though, because you get\n> there from the main web page which is discussing the beta. \n\nWith the key word here being \"beta\". \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": "Tue, 29 Feb 2000 14:18:41 -0500 (EST)", "msg_from": "Vince Vielhaber <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: NOT {NULL|DEFERRABLE} (was: bug in 7.0)" }, { "msg_contents": "On Tue, 29 Feb 2000, Don Baccus wrote:\n\n> At 02:34 PM 2/29/00 -0400, The Hermit Hacker wrote:\n> \n> >IMHO, you should be on pgsql-general, not pgsql-hackers, as its obvious\n> >that you need *release level* software ...\n> \n> No problem, I'll unsubscribe.\n> \n> >If, when we release, you are *still* having problems,please feel free to\n> >let us know in a *NON* antagonistic way ...\n> \n> Save bug reports until release? OK, if that's what you want.\n\nNo, bug reports are most welcome, antagonistic comments aren't ... big\ndifference ...\n\n\n", "msg_date": "Tue, 29 Feb 2000 16:05:23 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: NOT {NULL|DEFERRABLE} (was: bug in 7.0)" }, { "msg_contents": "> At 02:34 PM 2/29/00 -0400, The Hermit Hacker wrote:\n>\n> >IMHO, you should be on pgsql-general, not pgsql-hackers, as its obvious\n> >that you need *release level* software ...\n>\n> No problem, I'll unsubscribe.\n\n NO!\n\n Your input and code-contribution to the FK project was far\n too important. In fact, without you FK would have been\n implemented fundamentally wrong. So I would miss you on\n -hackers.\n\n> >If, when we release, you are *still* having problems,please feel free to\n> >let us know in a *NON* antagonistic way ...\n>\n> Save bug reports until release? OK, if that's what you want.\n\n It's not wat I want at least.\n\n Back to the roots. Thomas, from my personal PoV, is a little\n too much after \"do it in the grammar if possible at all\". But\n he's the core member to take care about compliance and the\n like. Hackers (like me) tend to let go with something that\n works, but it's him to assure the parsers future is great,\n wide open. Finally it's the mixture in the core team that\n makes Postgres successful, so I'm happy with Thomas having a\n sharp eye on it.\n\n In the actual case, we need to see what can be done until 7.0\n release. If we cannot produce a clean solution during the\n next weeks, I'm sure that \"backward compatibility\" has the\n higher weight than avoiding my crude hack into the parser\n (it'll stay for one release only anyway).\n\n What I suggest is, take it as it is. We use to have a\n friendly and nice ground noise in our mailing lists. So this\n kind of discussion, tending to become flame wars, should be\n taken off list at least (IMHO avoided at all, but I'm farest\n the last person to judge).\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": "Wed, 1 Mar 2000 00:52:58 +0100 (CET)", "msg_from": "[email protected] (Jan Wieck)", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: NOT {NULL|DEFERRABLE} (was: bug in 7.0)" }, { "msg_contents": "Jan Wieck wrote:\n> \n> What I suggest is, take it as it is. We use to have a\n> friendly and nice ground noise in our mailing lists. So this\n> kind of discussion, tending to become flame wars, should be\n> taken off list at least (IMHO avoided at all, but I'm farest\n> the last person to judge).\n>\n\nMaybe we need [email protected] where we could migrate \nthese threads ? or even [email protected] ;)\n\nI just read on NYTimes direct that a consulting firm has started \neducating businesmens wives to not slurp soup or misbehave in other \nways.\n\nWe could possibly hire them to consult the hackers list too ;)\n\nI'm sure PostgreSQL Inc. would accept donations to that end ;-p\n\n---------\nHannu\n(answers to [email protected] please)\n", "msg_date": "Wed, 01 Mar 2000 22:13:20 +0200", "msg_from": "Hannu Krosing <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: NOT {NULL|DEFERRABLE} (was: bug in 7.0)" }, { "msg_contents": "\nOn 01-Mar-00 Hannu Krosing wrote:\n> (answers to [email protected] please)\n\nI wonder if we could get Marc to create psql-flamewars and just route it\nto /dev/null :)\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": "Wed, 01 Mar 2000 15:24:34 -0500 (EST)", "msg_from": "Vince Vielhaber <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: NOT {NULL|DEFERRABLE} (was: bug in 7.0)" } ]
[ { "msg_contents": "Seems there is a problem with parser on NOT NULL...\n\nCREATE TABLE distributors4 (\n did DECIMAL(3) CONSTRAINT no_nullo NOT NULL,\n name VARCHAR(40) NOT NULL\n );\n\n$ psql hygea1 -f not_null.ref\npsql:not_null.ref:6: ERROR: parser: parse error at or near \"not\"\n\n\nCREATE TABLE actors (\n did DECIMAL(03) PRIMARY KEY not null,\n name VARCHAR(40)\n );\nverde:~/ref/tmp$ psql hygea1 -f primary_key.ref\npsql:primary_key.ref:4: ERROR: parser: parse error at or near \"not\"\n\n\n--\nJose' Soares\nBologna, Italy [email protected]\n\n\n", "msg_date": "Mon, 28 Feb 2000 16:27:56 +0100", "msg_from": "Jose Soares <[email protected]>", "msg_from_op": true, "msg_subject": "NOT NULL doesn't work in v7" }, { "msg_contents": "Jose Soares <[email protected]> writes:\n> Seems there is a problem with parser on NOT NULL...\n\nYeah, known problem, will be fixed (somehow ;-)).\n\n\t\t\tregards, tom lane\n", "msg_date": "Mon, 28 Feb 2000 11:12:43 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] NOT NULL doesn't work in v7 " } ]
[ { "msg_contents": "Karel Zak - Zakkr writes:\n\n> This patch add to current code NOCREATETABLE and NOLOCKTABLE feature:\n> \n> CREATE USER username\n> [ WITH\n> [ SYSID uid ]\n> [ PASSWORD 'password' ] ]\n> [ CREATEDB | NOCREATEDB ] [ CREATEUSER | NOCREATEUSER ]\n> -> [ CREATETABLE | NOCREATETABLE ] [ LOCKTABLE | NOLOCKTABLE ]\n> ...etc.\n\nIMHO, the syntax for create user is a hell and a half. Adding more\nkeywords in the current fashion is a dead end. (Note: you have to remember\nthe order in which the user \"features\" have to be entered.)\n\nI might as well propose that now, I'd like to see a syntax like\n\nCREATE USER name (\n password = 'xxx',\n sysid = 99,\n superuser = true,\n ...\n);\n\nThat's much more flexible and extensible. The old syntax could coexist\nwith this too.\n\n\nRegarding your two new features:\n\nIf you disallow table locking you might as well tell users not to use the\ndatabase. People need locks to operate a relational database. You will end\nup disabling the entire transaction mechanism if you want this to work\nproperly. There already is a sufficient amount of checks for users not\nclaiming exlusive locks on tables they shouldn't.\n\nDisallowing table creation might seem like a decent idea, but if at all,\nit should go into the grant/revoke realm. Incidentally, this is quite at\nodds with the SQL idea of how things should work, and I had hoped we could\nget there some day.\n\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Tue, 29 Feb 2000 00:19:57 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [PATCHES] NO-CREATE-TABLE and NO-LOCK-TABLE" }, { "msg_contents": "\nOn Tue, 29 Feb 2000, Peter Eisentraut wrote:\n\n> Karel Zak - Zakkr writes:\n> \n> > This patch add to current code NOCREATETABLE and NOLOCKTABLE feature:\n> > \n> > CREATE USER username\n> > [ WITH\n> > [ SYSID uid ]\n> > [ PASSWORD 'password' ] ]\n> > [ CREATEDB | NOCREATEDB ] [ CREATEUSER | NOCREATEUSER ]\n> > -> [ CREATETABLE | NOCREATETABLE ] [ LOCKTABLE | NOLOCKTABLE ]\n> > ...etc.\n> \n> IMHO, the syntax for create user is a hell and a half. Adding more\n> keywords in the current fashion is a dead end. (Note: you have to remember\n> the order in which the user \"features\" have to be entered.)\n> \n> I might as well propose that now, I'd like to see a syntax like\n> \n> CREATE USER name (\n> password = 'xxx',\n> sysid = 99,\n> superuser = true,\n> ...\n> );\n> \n> That's much more flexible and extensible. The old syntax could coexist\n> with this too.\n\n Agree (Why is it not in TODO?). Do you work on this? \n\n> Regarding your two new features:\n> \n> If you disallow table locking you might as well tell users not to use the\n> database. People need locks to operate a relational database. You will end\n\n Here I not agree. I need users account with read-only/non-lock access. Very \nsimple is say \"..not to use the database..\", but you not \"remake\" my users, \nyou not admin for these users .. :-)\n\nMy NOLOCK implementation disallow LOCK TABLE command only, it not change\na low-level locking management.\n\n> Disallowing table creation might seem like a decent idea, but if at all,\n> it should go into the grant/revoke realm. Incidentally, this is quite at\n> odds with the SQL idea of how things should work, and I had hoped we could\n> get there some day.\n\n The grant/revoke is good, but it is not global setting.\n\n The PostgreSQL needs more options/settings for administration, a current \nfeatures is very unsatisfactory for real using for large and multiuser\naplication.\n\n My suggestion for PG's priv./accounts:\n\n\t1/ global setting which overwrite local (acl) settings\n\t\t- read-only account\n\t\t- disable account (oracle: ACCOUNT LOCK)\n\t\t- create table priv.\n\t\t- user's quotas (but without tablespace?)\n \n\t2/ spit current super-user privileges to \n\t\t- (dis)allow create functions/opretors/trigers\n\t\t- (dis)allow create user\n\t\t? (dis)allow change system tables\n\n\t3/ ? - remove current hda.conf to system catalogs\n\t\n\t4/ user profiles \n\t\t- CONNECT_TIME\n\t\t- IDLE_TIME\n\t\t- PASSWORD_LIFE_TIME\n\t\t- PASSWORD_VERIFY_FUNCTION (trust/password/kerberos..)\n\t\t- ..etc\n\t\t(- CPU SPENTING ?)\n\n\t5/ acl mask - default privilege for new table \n\n \n\t\t\t\t\t\tKarel\n\n", "msg_date": "Tue, 29 Feb 2000 11:38:52 +0100 (CET)", "msg_from": "Karel Zak - Zakkr <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [PATCHES] NO-CREATE-TABLE and NO-LOCK-TABLE" }, { "msg_contents": "On Tue, 29 Feb 2000, Karel Zak - Zakkr wrote:\n\n> > I might as well propose that now, I'd like to see a syntax like\n> > \n> > CREATE USER name (\n> > password = 'xxx',\n> > sysid = 99,\n> > superuser = true,\n> > ...\n> > );\n> > \n> > That's much more flexible and extensible. The old syntax could coexist\n> > with this too.\n> \n> Agree (Why is it not in TODO?). Do you work on this? \n\nNot right now but I'm planning on reworking the privilege system to get in\ncompliance with SQL whenever we are through the beta phase. The creation\nof users is implementation defined but I guess I'm proposing this to those\nwho care.\n\n> > If you disallow table locking you might as well tell users not to use the\n> > database. People need locks to operate a relational database. You will end\n\n> My NOLOCK implementation disallow LOCK TABLE command only, it not change\n> a low-level locking management.\n\nExactly. The only goal that this will reach is to prevent people from\nfully using all the features available to them. It does not prevent them\nfrom doing denial of service attacks (which is presumably what motivated\nthis). As a simple example:\n\nBEGIN;\nSELECT a FROM b FOR UPDATE; -- or some such\n-- twiddle thumbs\n\nwill also claim locks on b. Or consider people wanting to use serializable\ntransactions (SQL requirement, mind you). Then you can't even really guess\nwhat will be locked when. To summarize, just disallow using the LOCK\ncommand is not a good way to prevent locks.\n\nI recall that there already is some permission checking done in the lock\nmanager. For example, you can't claim an exclusive lock on someone else's\ntable. A logical extension to this (which might be done already) would be\nto disallow write-related locks on a table you don't have write access to\nin the first place. Preventing malicious locking should be well-integrated\nwith the other privileges.\n\n> > Disallowing table creation might seem like a decent idea, but if at all,\n> > it should go into the grant/revoke realm. Incidentally, this is quite at\n> > odds with the SQL idea of how things should work, and I had hoped we could\n> > get there some day.\n> \n> The grant/revoke is good, but it is not global setting.\n\nExactly. But create user is a global thing. The only reason to have any\nprileges at all in pg_shadow is because some cannot be database-specific\n(such as the right to create a database). I wouldn't object to a GRANT\nCREATE, if it applies to all creates, not just tables. People clearly want\nthat, and we're not going to have schemas soon. Incidentally, I believe\nthat the privileges necessary to create a table are left to the\nimplementation, so I withdraw part of my argument above.\n\n> My suggestion for PG's priv./accounts:\n\nGreat, as I said, I've been meaning to look into this. I'd be happy to\nhear any \"demands\".\n\n> \t\t- read-only account\n\nJust don't give anyone write permissions to anything. Unix doesn't have\nread-only accounts. I'm not so excited about non-orthogonal privileges.\n\n> \t\t- disable account (oracle: ACCOUNT LOCK)\n\nHmm, that sounds reasonable.\n\n> \t\t- create table priv.\n\nOn its way. ;)\n\n> \t\t- user's quotas (but without tablespace?)\n\nProbably very hard to do. The day you started using a relational database\nyou largely gave up on tightly controlling storage constraints. See the\nnever ending debate on 2x disk usage on drop column. Certainly useful,\nthough.\n\n> \t\t- (dis)allow create functions/opretors/trigers\n\nCould/should be integrated in grant create.\n\n> \t\t- (dis)allow create user\n> \t\t? (dis)allow change system tables\n\nExist already.\n\n> \t3/ ? - remove current hda.conf to system catalogs\n\nWon't work. The postmaster must authenticate the user before the database\nstarts up. Well, it doesn't absolutely have to but redesigning that would\nbe a pain.\n\n> \t\t- CONNECT_TIME\n> \t\t- IDLE_TIME\n\nInteresting. That would probably require a lot of work, though.\n\n> \t\t- PASSWORD_LIFE_TIME\n\nGot that.\n\n> \t\t- PASSWORD_VERIFY_FUNCTION (trust/password/kerberos..)\n> \t\t- ..etc\n> \t\t(- CPU SPENTING ?)\n\n> \t5/ acl mask - default privilege for new table \n\nDefinitely.\n\n\nSeems like we have a full bag of plans. Let's argue it out! ;)\n\n-- \nPeter Eisentraut Sernanders vaeg 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Tue, 29 Feb 2000 12:14:06 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [PATCHES] NO-CREATE-TABLE and NO-LOCK-TABLE" }, { "msg_contents": "On Tue, 29 Feb 2000, Peter Eisentraut wrote:\n\n> > My suggestion for PG's priv./accounts:\n> \n> Great, as I said, I've been meaning to look into this. I'd be happy to\n> hear any \"demands\".\n> \n> > \t\t- read-only account\n> \n> Just don't give anyone write permissions to anything. Unix doesn't have\n> read-only accounts. I'm not so excited about non-orthogonal privileges.\n> \n> > \t\t- disable account (oracle: ACCOUNT LOCK)\n> \n> Hmm, that sounds reasonable.\n> \n> > \t\t- create table priv.\n> \n> On its way. ;)\n> \n> > \t\t- user's quotas (but without tablespace?)\n> \n> Probably very hard to do. The day you started using a relational database\n> you largely gave up on tightly controlling storage constraints. See the\n> never ending debate on 2x disk usage on drop column. Certainly useful,\n> though.\n> \n> > \t\t- (dis)allow create functions/opretors/trigers\n> \n> Could/should be integrated in grant create.\n> \n> > \t\t- (dis)allow create user\n> > \t\t? (dis)allow change system tables\n> \n> Exist already.\n> \n> > \t3/ ? - remove current hda.conf to system catalogs\n> \n> Won't work. The postmaster must authenticate the user before the database\n> starts up. Well, it doesn't absolutely have to but redesigning that would\n> be a pain.\n> \n> > \t\t- CONNECT_TIME\n> > \t\t- IDLE_TIME\n> \n> Interesting. That would probably require a lot of work, though.\n> \n> > \t\t- PASSWORD_LIFE_TIME\n> \n> Got that.\n\nI said about a PROFILE, it is more flexible than current simple CREATE USER. \n\n> \n> > \t\t- PASSWORD_VERIFY_FUNCTION (trust/password/kerberos..)\n> > \t\t- ..etc\n> > \t\t(- CPU SPENTING ?)\n> \n> > \t5/ acl mask - default privilege for new table \n> \n> Definitely.\n> \n> \n> Seems like we have a full bag of plans. Let's argue it out! ;)\n\n I not only want new features and send suggestion, I can help with \"full \nbag of plans\". But it is really great work and I not sure if is possible\ncreate it as one-man project, it needs consensus between developers. If you\nplan make changes to acl/account code it must be non-isolate change (it \nmust include user-profiles ..etc). (IMO of course :-)\n\n A question: who is not user account defined for db and is it global? The \nglobal account is probably not a problem, a problem is account settings. \nIMHO is better use global account in 'pg_shadow' (with passwords, basic \noptions ..) and non-global 'pg_accountoption' in specific DB (with \nCONNECT_TIME, IDLE_TIME, acl_mask ...etc.). This concept is better \nextendable... \n\n(We have free hands for this, it is not in SQL92 :-))\n \n\t\t\t\t\t\tKarel\n\n\n\n\n\n\n", "msg_date": "Tue, 29 Feb 2000 13:24:37 +0100 (CET)", "msg_from": "Karel Zak - Zakkr <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [PATCHES] NO-CREATE-TABLE and NO-LOCK-TABLE" }, { "msg_contents": "> plan make changes to acl/account code it must be non-isolate change (it\n> must include user-profiles ..etc). (IMO of course :-)\n\nWhile I'm thinking about it...\n\nThe current acl storage scheme flattens the acl info into a single\nstring, with a special character (\"=\" as I recall) to delimit the\nuser/group name from the permissions. But by quoting the user name, it\nis possible to create a user name which contains an equals sign,\nscrewing up the acl handling.\n\nIf you are redoing the acls, a good first step is to fix this, perhaps\nby recoding the acl field into a structure with at least two fields\nfor username and permissions.\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Tue, 29 Feb 2000 14:19:47 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [PATCHES] NO-CREATE-TABLE and NO-LOCK-TABLE" }, { "msg_contents": "\nOn Tue, 29 Feb 2000, Thomas Lockhart wrote:\n\n> > plan make changes to acl/account code it must be non-isolate change (it\n> > must include user-profiles ..etc). (IMO of course :-)\n> \n> While I'm thinking about it...\n> \n> The current acl storage scheme flattens the acl info into a single\n> string, with a special character (\"=\" as I recall) to delimit the\n> user/group name from the permissions. But by quoting the user name, it\n> is possible to create a user name which contains an equals sign,\n> screwing up the acl handling.\n> \n> If you are redoing the acls, a good first step is to fix this, perhaps\n> by recoding the acl field into a structure with at least two fields\n> for username and permissions.\n\n Yes. And..the current schema (acl in pg_class) is not relation schema, in \nthe pg_class is username not user's oid...ect. Is possible create it as\nrelation? (Example, in pg_group we haven't username, we use oid here.) \n\nMy acl idea:\n\nWhy not create specific pg_acl table and split a current monolitic\nacl string to more columns? Example:\n\n Columns in pg_acl table:\n\n\treloid\t\t(oid)\t - relation (table) oid\n\tuser_insert\t(text[]) - privilege for users for insert\n\t\t\t\t - in text array is \n\t\t\t{\"username1\",\"username2\"... \t}\n\t\t\t(or use user's oid instead username) \n\n\tgroup_insert\t- simular as previous, but for group\n\tuser_delete\t- ....etc.\n\t...\n\nexample:\n\nSELECT * from pg_acl;\n\nreloid | user_insert | group_insert | user_delete ..........etc\n---------------------------------------------------------\n12345 | {\"karel\", \"peter\"} | {\"group1\"} | {\"karel\"} ..........etc\n\n\nIs it bad idea? (It never needs any specific acl string parser, take \ninformatios from this table is very simple and very standard \n\"tuple-operation\".) Yes, it is a little \"talkative\", but if instead\nuser/group name we use oid, it will right and nice.\n\n ...as I said: is the current acl/account schema good? \n\n\t\t\t\t\tKarel\n\n", "msg_date": "Tue, 29 Feb 2000 15:40:40 +0100 (CET)", "msg_from": "Karel Zak - Zakkr <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [PATCHES] NO-CREATE-TABLE and NO-LOCK-TABLE" }, { "msg_contents": "On Tue, 29 Feb 2000, Karel Zak - Zakkr wrote:\n\n> On Tue, 29 Feb 2000, Thomas Lockhart wrote:\n\n(I didn't get this email, but anyway ...)\n\n> > The current acl storage scheme flattens the acl info into a single\n> > string, with a special character (\"=\" as I recall) to delimit the\n> > user/group name from the permissions. But by quoting the user name, it\n> > is possible to create a user name which contains an equals sign,\n> > screwing up the acl handling.\n\nTry creating a user \"group xxx\" ...\n\n> > If you are redoing the acls, a good first step is to fix this, perhaps\n> > by recoding the acl field into a structure with at least two fields\n> > for username and permissions.\n\nThis was precisely the idea. Everything else should fall in place more\neasily after that.\n\n> My acl idea:\n\n> reloid | user_insert | group_insert | user_delete ..........etc\n> ---------------------------------------------------------\n> 12345 | {\"karel\", \"peter\"} | {\"group1\"} | {\"karel\"} ..........etc\n\nThis still has arrays. (shudder) Try getting the information 'Does Peter\nhave access to x?' out of that. I was thinking along the lines of\n\ncreate table pg_privilege/pg_acl/? (\n objoid oid, -- not only reloid, but types, functions, etc.\n userid int,\n privilege char, -- maybe 'U' update, 'I' insert, etc.\n grant_option bool\n)\n\nTo be extended to cover column access as well. (Might have to be yet\nanother table.) Mathematically, this will be slower (especially since you\ncan't use SysCache on composite keys(???)) but similar schemas are\nemployed throughout by triggers etc.\n\n> ...as I said: is the current acl/account schema good? \n\nThe SCHEME is good. The SCHEMA isn't.\n\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Tue, 29 Feb 2000 17:48:33 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [PATCHES] NO-CREATE-TABLE and NO-LOCK-TABLE" }, { "msg_contents": "\nOn Tue, 29 Feb 2000, Peter Eisentraut wrote:\n\n> On Tue, 29 Feb 2000, Karel Zak - Zakkr wrote:\n> \n> > My acl idea:\n> \n> > reloid | user_insert | group_insert | user_delete ..........etc\n> > ---------------------------------------------------------\n> > 12345 | {\"karel\", \"peter\"} | {\"group1\"} | {\"karel\"} ..........etc\n> \n> This still has arrays. (shudder) Try getting the information 'Does Peter\n> have access to x?' out of that. I was thinking along the lines of\n\n As I say: we can use oid or string with oids instead array.\n\nExample \n\n reloid | user_insert | group_insert |\n --------------------------------------\n 12345 | \"1111,2222\" | \"545454\" |\n\n .. parse these strings a easy and 'Does Peter have access to x?' is realy\nsimple.\n\n> \n> create table pg_privilege/pg_acl/? (\n> objoid oid, -- not only reloid, but types, functions, etc.\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n\t\t\tyes, yes, yes ! (the oracle allow grant priv. to\n\t\t\t\t25(!) different features)\n\n> userid int,\n\n If I understend you, you want save to one line information about one\nuser only (?), if yes this table will huge (sum(object) * sum(users)),\nbut probably fastly (because it not needs parse any array or string).\nHmm, perhaps it is not bad idea. What say the other?\n\n> privilege char, -- maybe 'U' update, 'I' insert, etc.\n\n I really not sure if is good still create this monolithic string,\nwhy not use one (bool) column for update one for insert ..etc?\nIt is fastly and easy (a string needs parse, etc).\n\n> grant_option bool\n> )\n\n It is goods if you agree with separate acl table :-)\n \n> To be extended to cover column access as well. (Might have to be yet\n> another table.) Mathematically, this will be slower (especially since you\n> can't use SysCache on composite keys(???)) but similar schemas are\n> employed throughout by triggers etc.\n\nYes, a speed will problem, it must be cached (in an separate acl cache?),\nor after (connection) start create a temp table with acl for a current user \nand with relevant information only.\n \n\t\t\t\t\t\t\tKarel\n\n\n\n", "msg_date": "Wed, 1 Mar 2000 11:14:12 +0100 (CET)", "msg_from": "Karel Zak - Zakkr <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [PATCHES] NO-CREATE-TABLE and NO-LOCK-TABLE" }, { "msg_contents": "On Wed, 1 Mar 2000, Karel Zak - Zakkr wrote:\n\n> Example \n> \n> reloid | user_insert | group_insert |\n> --------------------------------------\n> 12345 | \"1111,2222\" | \"545454\" |\n> \n> .. parse these strings a easy and 'Does Peter have access to x?' is realy\n> simple.\n\n> > privilege char, -- maybe 'U' update, 'I' insert, etc.\n> \n> I really not sure if is good still create this monolithic string,\n> why not use one (bool) column for update one for insert ..etc?\n> It is fastly and easy (a string needs parse, etc).\n\nSpace. A char column takes one byte (when using the internal char1 type),\nfive or six bool columns take five or six bytes plus all the overhead.\nAlso you get into the problem where certain flag combinations are not even\nvalid.\n\n> Yes, a speed will problem, it must be cached (in an separate acl cache?),\n> or after (connection) start create a temp table with acl for a current user \n> and with relevant information only.\n\nSteal the code on how triggers are looked up. It does an index scan. This\ntable will be huge (on average probably O(#tables * #users)) but it has\nthe advantage that it is a direct mapping from what SQL calls a \"privilege\ndescriptor\", so implementation could be easier.\n\nI would like to take a look at SQL3 first, because they define some more\nprivilege stuff which we could take into account (ROLES, for example).\n\n\nBy the way: Regarding your original patch that disallowed LOCK to users, I\nlooked it up in the source and it turns out that in order to lock a table\nyou need write access to it. Isn't that sufficient?\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, 1 Mar 2000 16:03:11 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [PATCHES] NO-CREATE-TABLE and NO-LOCK-TABLE" }, { "msg_contents": "\n> I would like to take a look at SQL3 first, because they define some more\n> privilege stuff which we could take into account (ROLES, for example).\n\n Yes. Just today I look at Oracle's documentation for ROLEs, PROFILEs\n... my idea is prepare acl/account code for this freatures too. What?\n\nIMHO this discussion good adept for any new-acl&accout project. Agree?\n\n> By the way: Regarding your original patch that disallowed LOCK to users, I\n\n ... and I see your web page, you listen good music :-)\n\n> looked it up in the source and it turns out that in order to lock a table\n> you need write access to it. Isn't that sufficient?\n\n You mean this original PG's code (?):\n\n if (lockstmt->mode == AccessShareLock)\n aclresult = pg_aclcheck(lockstmt->relname, GetPgUserName(), ACL\n else\n aclresult = pg_aclcheck(lockstmt->relname, GetPgUserName(), ACL\n\n if (aclresult != ACLCHECK_OK)\n elog(ERROR, \"LOCK TABLE: permission denied\");\n\n \n Yes. The my patch create a lock-permission level over this current code. \nIt is global setting and example for all non-AccessShareLocks you must have \npg_shadow->locktable privilege and 'write' privilage for table. \n\n It is because I have users which needs update/insert access to tables, but \nI not want allow a lock command for these users. \n\n\t\t\t\t\t\tKarel\n\n", "msg_date": "Wed, 1 Mar 2000 16:44:49 +0100 (CET)", "msg_from": "Karel Zak - Zakkr <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [PATCHES] NO-CREATE-TABLE and NO-LOCK-TABLE" }, { "msg_contents": "On Wed, 1 Mar 2000, Karel Zak - Zakkr wrote:\n\n> Yes. Just today I look at Oracle's documentation for ROLEs, PROFILEs\n> ... my idea is prepare acl/account code for this freatures too. What?\n\nI read about that in SQL3 yesterday and I think we could transparently\nadapt the current group scheme to it.\n\n> > looked it up in the source and it turns out that in order to lock a table\n> > you need write access to it. Isn't that sufficient?\n\n> Yes. The my patch create a lock-permission level over this current code. \n> It is global setting and example for all non-AccessShareLocks you must have \n> pg_shadow->locktable privilege and 'write' privilage for table. \n> \n> It is because I have users which needs update/insert access to tables, but \n> I not want allow a lock command for these users. \n\nWhy?\n\nYou are saying to these users, \"You can write data to these tables but I\ncan't guarantee you that anything you do will actually be written,\nconsistent, and non-corrupted.\" And as I said before, this doesn't prevent\nusers from actually *locking* tables either, because there are several\nother methods to do that.\n\nOne thing I thought about is that you might want to reserve exclusive\nlocks and access exclusive locks, and possibily ShareRowExclusiveLock\n(that name makes a lot of sense to me, btw.) and ShareLock to table owners\nand superusers. That way vanilla users with write access can only do a\nRowExclusiveLock at best. Perhaps there could be a grant fancylock on\ntable command (kind of :), but that would have to be reviewed closely.\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Thu, 2 Mar 2000 15:18:03 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [PATCHES] NO-CREATE-TABLE and NO-LOCK-TABLE" }, { "msg_contents": "\nOn Thu, 2 Mar 2000, Peter Eisentraut wrote:\n\n> You are saying to these users, \"You can write data to these tables but I\n> can't guarantee you that anything you do will actually be written,\n> consistent, and non-corrupted.\" And as I said before, this doesn't prevent\n\n No. How often you LOCKing table? If you work in transaction block and DB \ndesign is good (or very simple), you not need very often the LOCK. \n\n I'm working with my large DB every day and without locking and my DB is\nconsistent (example for me is more iteresting full-time full-access to table\nthan any a transaclion abort.) The LOCK command is not primary tool for\ndata integrity (primary it is transaction,primary/foreign \nkeys/check-triggers..etc). \n\nSet/Not-Set NOLOCK is admin choice, if you not want it you not must set \nit... OK?\n\n I good understand you, but life and a SQL DB is not black or white, the \nworld is coloured :-)\n\n IMHO will better LOCK privilage add to \"local\" table acl and differentiate\nbetween write-access and lock-access (a good item to TODO). This acl option\nwill better than my NOLOCK.\n \n \n IMHO will better \"recast\" this discussion to discussion about new \nacl/account features. Agree?\n\n I a little speculated about it and IHO is real possible make CRATE ROLE,\nCREATE PROFILE and global pg_acl table and extend GRANT (function,alter..).\nSee example Oracle8 documentation (example on: http://mravenec.jcu.cz/oracle),\nit is more readable than SQL standards :-)\n\n\t\t\t\t\t\t\tKarel\n\n\n", "msg_date": "Thu, 2 Mar 2000 16:12:41 +0100 (CET)", "msg_from": "Karel Zak - Zakkr <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [PATCHES] NO-CREATE-TABLE and NO-LOCK-TABLE" }, { "msg_contents": "\nOn Thu, 2 Mar 2000, Peter Eisentraut wrote:\n\n> On Wed, 1 Mar 2000, Karel Zak - Zakkr wrote:\n> \n> > Yes. Just today I look at Oracle's documentation for ROLEs, PROFILEs\n> > ... my idea is prepare acl/account code for this freatures too. What?\n> \n> I read about that in SQL3 yesterday and I think we could transparently\n> adapt the current group scheme to it.\n\n Sorry, I skip this part in my previous letter. Why you mean adaptation\nto current group scheme?\n\n\t\t\t\t\t\tKarel\n\n", "msg_date": "Thu, 2 Mar 2000 16:16:17 +0100 (CET)", "msg_from": "Karel Zak - Zakkr <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [PATCHES] NO-CREATE-TABLE and NO-LOCK-TABLE" }, { "msg_contents": "Karel Zak - Zakkr writes:\n\n> > I read about that in SQL3 yesterday and I think we could transparently\n> > adapt the current group scheme to it.\n> \n> Sorry, I skip this part in my previous letter. Why you mean adaptation\n> to current group scheme?\n\nI said adapt the current group scheme to roles. The current groups are a\nfunctional subset of what roles do.\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, 4 Mar 2000 18:06:43 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: [PATCHES] NO-CREATE-TABLE and NO-LOCK-TABLE" }, { "msg_contents": "Karel Zak - Zakkr writes:\n\n> No. How often you LOCKing table? If you work in transaction block and DB \n> design is good (or very simple), you not need very often the LOCK. \n\nI agree with providing access restrictions for locking tables in ShareLock\nand above, perhaps via a GRANT LOCK ON TABLE command. But just saying\n\"Don't use LOCK\" isn't going to cut it, it must be done throughout *all*\ncommands that do any locking, otherwise it's just inconsistent.\n\nYou have a point that these higher level locks aren't really anybody's\nbusiness other than the table owner, superusers, and those explicitly\ngranted access to them. But saying that you can run your database without\nlocks is false because even plain UPDATE gets a row exclusive lock.\n\n> I a little speculated about it and IHO is real possible make CRATE ROLE,\n> CREATE PROFILE and global pg_acl table and extend GRANT (function,alter..).\n> See example Oracle8 documentation (example on: http://mravenec.jcu.cz/oracle),\n> it is more readable than SQL standards :-)\n\nI don't have any real problems with reading SQL standards. I'd rather do\nthat than submit to some vendor's ideas. Having said that, I'll still read\nthe above, especially because profiles are not in SQL.\n\nI have given some more thought to the design of the pg_acl table (which\nshould not be global if it wants to be SQL compliant). I realize that the\nsize of my proposed 'one row per user/object/privilege' can grow rather\nhuge (20 users, 100 tables/things -> probably ca. 5000 rows) but I see\nthis as the best way some of the things (column access, grant options,\nroles) can be implemented in the first place and it will be much easier to\nverify the implementation because you can read it right out of SQL.\n\nI think caching can be done pretty effectively, too, since ACL items\nrarely change once they're set up. I'm inclined to ask other people's\nopinions on this item. Other than that, I think we have a winner\nhere. Time to bring this up the the rest of the folks and draw up a\nproject page ...\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Sat, 4 Mar 2000 18:07:16 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": true, "msg_subject": "ACL enhancements (was Re: [HACKERS] Re: [PATCHES] NO-CREATE-TABLE\n\tand NO-LOCK-TABLE)" }, { "msg_contents": "\n\nOn Sat, 4 Mar 2000, Peter Eisentraut wrote:\n\n> Karel Zak - Zakkr writes:\n\n> I have given some more thought to the design of the pg_acl table (which\n> should not be global if it wants to be SQL compliant). I realize that the\n> size of my proposed 'one row per user/object/privilege' can grow rather\n> huge (20 users, 100 tables/things -> probably ca. 5000 rows) but I see\n> this as the best way some of the things (column access, grant options,\n> roles) can be implemented in the first place and it will be much easier to\n> verify the implementation because you can read it right out of SQL.\n\nIt must be fast! It is watchword for this project. The ACL is checked\nfor each query. I agree with one global pg_acl for one DB.\n\n> I think caching can be done pretty effectively, too, since ACL items\n> rarely change once they're set up. I'm inclined to ask other people's\n\nYes. IMHO will good initialize more user's information after connection start. \nNow is init only username, but we can save to any persistent struct full\nuser's pg_shadow row. (My bash (shell) not see the /etc/password before \neach command, it is initialize after bash start and it is persistent to \nits end.) The current code look at pg_shadow very often...etc.\n\n> opinions on this item. Other than that, I think we have a winner\n> here. Time to bring this up the the rest of the folks and draw up a\n> project page ...\n\nAgree. ...a project page with more details, implementation steps ..etc.\n\n\t\t\t\t\t\t\tKarel\n\n", "msg_date": "Mon, 6 Mar 2000 14:47:36 +0100 (CET)", "msg_from": "Karel Zak - Zakkr <[email protected]>", "msg_from_op": false, "msg_subject": "Re: ACL enhancements" }, { "msg_contents": "On Mon, Mar 06, 2000 at 02:47:36PM +0100, Karel Zak - Zakkr wrote:\n> \n> \n> On Sat, 4 Mar 2000, Peter Eisentraut wrote:\n> \n> > Karel Zak - Zakkr writes:\n> \n> > I have given some more thought to the design of the pg_acl table (which\n> > should not be global if it wants to be SQL compliant). I realize that the\n> > size of my proposed 'one row per user/object/privilege' can grow rather\n> > huge (20 users, 100 tables/things -> probably ca. 5000 rows) but I see\n> > this as the best way some of the things (column access, grant options,\n> > roles) can be implemented in the first place and it will be much easier to\n> > verify the implementation because you can read it right out of SQL.\n> \n> It must be fast! It is watchword for this project. The ACL is checked\n> for each query. I agree with one global pg_acl for one DB.\n\nPeter's point, if I understand it, is that pg_acl _cannot_ be global\nper DB if we're striving for SQL compliance.\n\nOn the topic of SQL compliance: I spent some time this weekend looking\nat the NIST's test suite for FIPS 127-2 (Federal Information Processing\nStandard) This is the reg. that controls US gov't procurement of RDBMS\nsoftware, and includes by reference SQL92 (via ANSI and ISO docs.)\n\nNIST was in the business of actually verifying conformance, until they\nlost funding for it (Version 6.0 was released December 31, 1996). The test\nsuite is available from their website, and being a product of U.S. Gov't,\nhas no copyright. \n\nhttp://www.itl.nist.gov/div897/ctg/sql_form.htm\n\nMy inital take is that the tests will be useful internally to test our\nSQL92 conformance. So far, I've tried building the test schemas. During\nbuilding these, the privilege system get's a workout, with lots of GRANT\n... WITH GRANT OPTION, etc. The other problem is accepting column specific\nprivileges, as well as column aliases in views specified like so:\n\n CREATE VIEW viewname (alias1, alias2, alias3) AS ...\n\nI rewrote those to use the SELECT something AS alias1 ... syntax.\n\nI can continue on and run the 899 interactive SQL tests, as soon as I\nfigure out how the lack of SCHEMA support will impact them. It strikes me\nthat (future) SCHEMA support should impact the design for the ACL system.\n\n> \n> > I think caching can be done pretty effectively, too, since ACL items\n> > rarely change once they're set up. I'm inclined to ask other people's\n> > opinions on this item. Other than that, I think we have a winner\n> > here. Time to bring this up the the rest of the folks and draw up a\n> > project page ...\n> \n\nI think the general maxim: \"Design for function, tune for performance\"\nmay fit in here.\n\n> Agree. ...a project page with more details, implementation steps ..etc.\n> \n\nI'd be willing to assist in discussing what the SQL92 standard seems to \nrequire for privileges.\n\nPeter, you were just saying something about having three weeks free ... ;-)\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": "Mon, 6 Mar 2000 12:38:23 -0600", "msg_from": "\"Ross J. Reedstrom\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: ACL enhancements" } ]
[ { "msg_contents": "\n> > > If not, I'd vote for pulling it out. That's a heck of a \n> poor word to\n> > > reserve.\n> > I am afraid of lots of user complaints, even if we had not \n> already used\n> > TEMP.\n> \n> OK, but we've already got \"user complaints\" about TEMP being a\n> reserved word, so that part seems to balance out. There is apparently\n> no basis in published standards for TEMP being a reserved word. And\n> btw it is not currently documented as a reserved word in\n> syntax.sgml...\n\nTEMP is not a reserved word in informix, so there seems to be the\npossibility to do a \ngrammar trick.\n\nThe portability syntax that would be needed is only:\n\nselect * from table where ..... INTO TEMP _mytemp;\n\nYour example had the into temp after the select list, which does \nnot work in informix.\n\nAndreas\n", "msg_date": "Tue, 29 Feb 2000 15:14:34 +0100", "msg_from": "Zeugswetter Andreas SB <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: [SQL] prob with aggregate and group by - return\n\ts multiplesh" } ]
[ { "msg_contents": "\nCan someone look into this, and followup with Don? :)\n\n====================\nFrom: Don Baccus <[email protected]>\n\nSlightly less minor bug. Forward this to the right place, too.\n\nacs=# create function foo() returns integer as '\nacs'# begin\nacs'# create table bar(i integer);\nacs'# return 1;\nacs'# end;' language 'plpgsql';\nCREATE\nacs=# select foo();\npqReadData() -- backend closed the channel unexpectedly.\n This probably means the backend terminated abnormally\n before or while processing the request.\nThe connection to the server was lost. Attempting reset: Failed.\n!# \n\n\nDML statements apparently aren't meant to be supported in plpgsql,\nsince any I try crash. This, again, is PG7.0 beta.\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": "Tue, 29 Feb 2000 21:11:45 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "Bug report for 7.0beta1 in 'CREATE FUNCTION...'" }, { "msg_contents": "> -----Original Message-----\n> From: [email protected]\n> [mailto:[email protected]]On Behalf Of The Hermit\n> Hacker\n> \n> \n> Can someone look into this, and followup with Don? :)\n>\n\nCurrently utility commands aren't executable in PL/pgSQL.\nIn short,it's due the lack of implementation of copyObject()\nfor UtilityStatements.\nHowever,there's another essential problem.\n\nPL/pgSQL caches prepared plans for fucntions at their\nfirst execution time. Though many oids/numbers ... exist\nin the cached plans,they are changed by DML statements\nand cached plans would become invalid. Currently once\na plan is cached,it stays in TopMemoryContext forever\nand would never be removed/changed.\n\nJan could give more precise comments on this topic.\n\nRegards.\n\nHiroshi Inoue\[email protected]\n \n> ====================\n> From: Don Baccus <[email protected]>\n> \n> Slightly less minor bug. Forward this to the right place, too.\n> \n> acs=# create function foo() returns integer as '\n> acs'# begin\n> acs'# create table bar(i integer);\n> acs'# return 1;\n> acs'# end;' language 'plpgsql';\n> CREATE\n> acs=# select foo();\n> pqReadData() -- backend closed the channel unexpectedly.\n> This probably means the backend terminated abnormally\n> before or while processing the request.\n> The connection to the server was lost. Attempting reset: Failed.\n> !# \n> \n> \n> DML statements apparently aren't meant to be supported in plpgsql,\n> since any I try crash. This, again, is PG7.0 beta.\n> =====================\n> \n> \n> \n> Marc G. Fournier ICQ#7615664 IRC \n> Nick: Scrappy\n> Systems Administrator @ hub.org \n> primary: [email protected] secondary: \n> scrappy@{freebsd|postgresql}.org \n> \n> \n> ************\n> \n", "msg_date": "Wed, 1 Mar 2000 11:05:56 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] Bug report for 7.0beta1 in 'CREATE FUNCTION...'" }, { "msg_contents": "[Charset iso-8859-1 unsupported, filtering to ASCII...]\n> > -----Original Message-----\n> > From: [email protected]\n> > [mailto:[email protected]]On Behalf Of The Hermit\n> > Hacker\n> > \n> > \n> > Can someone look into this, and followup with Don? :)\n> >\n> \n> Currently utility commands aren't executable in PL/pgSQL.\n> In short,it's due the lack of implementation of copyObject()\n> for UtilityStatements.\n> However,there's another essential problem.\n> \n\nRemoved from HISTORY file:\n\n-Allow utility statements in plpgsql (Tom)\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": "Tue, 29 Feb 2000 21:42:00 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Bug report for 7.0beta1 in 'CREATE FUNCTION...'" }, { "msg_contents": "> -----Original Message-----\n> From: [email protected]\n> [mailto:[email protected]]On Behalf Of Hiroshi Inoue\n> Sent: Wednesday, March 01, 2000 11:06 AM\n> To: The Hermit Hacker\n> Cc: [email protected]\n> Subject: RE: [HACKERS] Bug report for 7.0beta1 in 'CREATE FUNCTION...'\n> \n> \n> > -----Original Message-----\n> > From: [email protected]\n> > [mailto:[email protected]]On Behalf Of The Hermit\n> > Hacker\n> > \n> > \n> > Can someone look into this, and followup with Don? :)\n> >\n> \n> Currently utility commands aren't executable in PL/pgSQL.\n> In short,it's due the lack of implementation of copyObject()\n> for UtilityStatements.\n> However,there's another essential problem.\n> \n> PL/pgSQL caches prepared plans for fucntions at their\n> first execution time. Though many oids/numbers ... exist\n> in the cached plans,they are changed by DML statements\n ^^^^^^^^^^^^^\nOops sorry,DDL not DML statement.\n\n> and cached plans would become invalid. Currently once\n> a plan is cached,it stays in TopMemoryContext forever\n> and would never be removed/changed.\n> \n\n", "msg_date": "Wed, 1 Mar 2000 14:56:43 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] Bug report for 7.0beta1 in 'CREATE FUNCTION...'" }, { "msg_contents": "\nOn Wed, 1 Mar 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> > \n> > Can someone look into this, and followup with Don? :)\n> >\n> \n> Currently utility commands aren't executable in PL/pgSQL.\n> In short,it's due the lack of implementation of copyObject()\n> for UtilityStatements.\n> However,there's another essential problem.\n\nHmm, I see that copyObject() and freeObject() is really problematic \nroutines.\n\n> PL/pgSQL caches prepared plans for fucntions at their\n> first execution time. Though many oids/numbers ... exist\n> in the cached plans,they are changed by DML statements\n> and cached plans would become invalid. Currently once\n> a plan is cached,it stays in TopMemoryContext forever\n> and would never be removed/changed.\n\n .. another TopMemoryContext feeder :-) The solution is\ncontext-per-plan cache and small change in SPI (SPI_freeplan..).\n\nI believe that it (SPI) will fixed in any next release.\n\n\n\t\t\t\t\tKarel\n\n\n \n\n", "msg_date": "Wed, 1 Mar 2000 11:38:08 +0100 (CET)", "msg_from": "Karel Zak - Zakkr <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] Bug report for 7.0beta1 in 'CREATE FUNCTION...'" } ]
[ { "msg_contents": "\nAnother one here ...\n\n=============\nFrom: Don Baccus <[email protected]>\n\nAt 04:05 PM 2/29/00 -0400, you wrote:\n\n>No, bug reports are most welcome, antagonistic comments aren't ... big\n>difference ...\n\ndonb=# create table foo(c char(2), v varchar(2));\nCREATE\ndonb=# select * from foo where c::varchar = v::varchar;\nERROR: Unable to identify an operator '=' for types 'bpchar' and 'varchar'\n You will have to retype this query using an explicit cast\ndonb=# select * from foo where cast(c as varchar) = cast(v as varchar);\nERROR: Unable to identify an operator '=' for types 'bpchar' and 'varchar'\n You will have to retype this query using an explicit cast\ndonb=# select * from foo where cast(c as text) = cast(v as text);\nERROR: Unable to identify an operator '=' for types 'bpchar' and 'varchar'\n You will have to retype this query using an explicit cast\n\nIf conversion isn't going to be supported, the error message should\nbe improved (feel free to forward this to the appropriate person).\n\nIn this case, the working application actually fills both variables\n(in practice, from different tables) with two-character state codes,\nso the cast would work. Should casts presume the user doesn't know\nwhat they're doing? I don't know. I can fix this, of course, by\nchanging the data model I've inherited from Oracle to consistently\nuse either char(2) or varchar(2).\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=====================\n\n", "msg_date": "Tue, 29 Feb 2000 21:14:01 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "minor bug in 7.0: casting" }, { "msg_contents": "The Hermit Hacker <[email protected]> writes:\n> Another one here ...\n\n> From: Don Baccus <[email protected]>\n> donb=# create table foo(c char(2), v varchar(2));\n> CREATE\n> donb=# select * from foo where c::varchar = v::varchar;\n> ERROR: Unable to identify an operator '=' for types 'bpchar' and 'varchar'\n> You will have to retype this query using an explicit cast\n\nAs of current sources:\n\nregression=# create table foo(c char(2), v varchar(2));\nCREATE\nregression=# select * from foo where c::varchar = v::varchar;\n c | v\n---+---\n(0 rows)\n\nI thought I fixed that before 7.0beta1, but am not feeling eager to\nrummage through cvs logs to prove it.\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 01 Mar 2000 00:42:14 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] minor bug in 7.0: casting " } ]
[ { "msg_contents": "\n==============================\nFrom: Don Baccus <[email protected]>\n\nThe query \"select exists (select oid from users)\" is very\nnon-standard and I'm surprised it works. I can accept that\nsome very weird queries might mess up PL/pgSQL, but it would\nbe nice if the backend wouldn't crash.\n\nAgain, PG7.0 beta (actually, a snapshot taken four days earlier,\nI've given up on the official beta for the time being)\n\nacs=# select exists (select oid from users);\n ?column? \n----------\n t\n(1 row)\n\nacs=# create function foo(integer) returns boolean as '\nacs'# begin\nacs'# return exists (select oid from users);\nacs'# end;' language 'plpgsql';\nCREATE\nacs=# select foo(3);\npqReadData() -- backend closed the channel unexpectedly.\n This probably means the backend terminated abnormally\n before or while processing the request.\nThe connection to the server was lost. Attempting reset: Failed.\n!# \\q\n[acs@gyrfalcon acs]$ psql\nWelcome to psql, the PostgreSQL interactive terminal.\n...\nacs=# create function bar(integer) returns boolean as '\nacs'# begin\nacs'# return ''t'' where exists (select oid from users);\nacs'# end;' language 'plpgsql';\nCREATE\nacs=# select bar(3);\n bar \n-----\n t\n(1 row)\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\n\n", "msg_date": "Tue, 29 Feb 2000 23:17:37 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "select exists (select oid from users)" } ]
[ { "msg_contents": "\nAs Jeff mentioned earlier today, there is a poll going on at\nhttp://www.linux.com that asks:\n\nSeveral high-quality databases are available for Linux. Which database,\nif any, does your company primarily use with its Linux servers?\n\nRight now, PostgreSQL is lagging MySQL 21% to 48% ...\n\nWho hasn't voted? :) Get out there and make yourself heard, eh? \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, 1 Mar 2000 00:02:44 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "Poll: Databases for Linux " }, { "msg_contents": "> \n> As Jeff mentioned earlier today, there is a poll going on at\n> http://www.linux.com that asks:\n> \n> Several high-quality databases are available for Linux. Which database,\n> if any, does your company primarily use with its Linux servers?\n> \n> Right now, PostgreSQL is lagging MySQL 21% to 48% ...\n> \n> Who hasn't voted? :) Get out there and make yourself heard, eh? \n\nReading the web page recent comments, MySQL is getting blasted for lack\nof features. Glad to see it. I think we have them on the run. They\nare not advancing at the same speed as PostgreSQL, so it is only a\nmatter of time.\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, 29 Feb 2000 23:20:17 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Poll: Databases for Linux" }, { "msg_contents": "On Wed, 1 Mar 2000, The Hermit Hacker wrote:\n> As Jeff mentioned earlier today, there is a poll going on at\n> http://www.linux.com that asks:\n> \n> Several high-quality databases are available for Linux. Which database,\n> if any, does your company primarily use with its Linux servers?\n> \n> Right now, PostgreSQL is lagging MySQL 21% to 48% ...\n> \n> Who hasn't voted? :) Get out there and make yourself heard, eh? \n\n Yesterday I spent a few minutes trying to choose the DB to vote for. I\nam using both Postgres and MySQL - different tasks require different\naproaches and solutions - and I am satisfied with both DBs. There are\nniches for both of them.\n Finally I voted for Postgres - just because MySQL already has its votes :)\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": "Wed, 1 Mar 2000 09:20:35 +0000 (GMT)", "msg_from": "Oleg Broytmann <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Poll: Databases for Linux " } ]
[ { "msg_contents": "Thanks for the information Thorsten. \n\nI'm forwarding this message to the \"hackers\" list for further comment.\nafaik, the IPC issue on Solaris is a FAQ, and the fix requires\nconfiguring IPC in the Sun kernel with sufficient size, or starting\nPostgres with smaller buffers (see the docs on starting the\npostmaster).\n\nThe plpgsql function problem sounds like an issue with an index on a\nsystem table, and may have been fixed for the upcoming release, but I\ndon't recall anything specifically. Perhaps others will recall more\ndetail.\n\nRegards.\n\n - Thomas\n\n> I encountered some problems during the use of of Postgres 6.5.3.\n> I'm a student in Germany and I'm currently working on a project\n> together with two other students. In our project we use Postgres\n> as a database server.\n> \n> During our work we encountered two problems:\n> \n> - We removed an existing plpgsql-function from our database.\n> After trying to re-create it, the postmaster printed a message\n> like: \"btree: unable to add item to the page\". The only solution\n> was to delete the entire database and to recreate it.\n> \n> - Postgres 6.5.3 has problems on sparc-sun-solaris2.7 systems.\n> Compilation is successful and databases can be initialized, but\n> starting the postmaster produces the following error message:\n> \n> IpcMemoryCreate: shmget failed (Invalid argument) key=7107001,\n> size=1073152,\n> permission=600\n> FATAL 1: ShmemCreate: cannot create region\n> \n> This message does not occur under Linux.\n> \n> Let me know if you need further information to reproduce the bugs.\n> \n> yours,\n> Thorsten Lingk\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Wed, 01 Mar 2000 13:56:04 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": true, "msg_subject": "Re: Bugs in Postgres" }, { "msg_contents": "Thomas Lockhart <[email protected]> writes:\n> The plpgsql function problem sounds like an issue with an index on a\n> system table, and may have been fixed for the upcoming release, but I\n> don't recall anything specifically.\n\nYes, that sure sounds like an index-tuple-size overflow in the index\nthat 6.5.* and prior versions kept on pg_proc's prosrc field. 7.0\ndoesn't keep such an index, so it's proof against this particular limit.\n\nIIRC, the maximum safe length of a procedure definition in <=6.5 is\n2700 bytes. Sometimes you will get away with more, sometimes not,\ndepending on what winds up on the same index page with your procedure...\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 01 Mar 2000 10:36:14 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: Bugs in Postgres " } ]
[ { "msg_contents": "Here is a new MAkefile.PL for plperl.\n\nIt not only solves the problem for the missing symbol,\nbut there is also now a 'make install'.\n\nBy the way, earlier, I sent a patch to add plperl\nto createlang, droplang. Those patches haven't made\nit into the source tree yet. Do I need to resend them?\n\n\n-- \nMark Hollomon\[email protected]", "msg_date": "Wed, 1 Mar 2000 09:17:49 -0500", "msg_from": "Mark Hollomon <[email protected]>", "msg_from_op": true, "msg_subject": "patch for plperl Makefile.PL" }, { "msg_contents": "Applied. I assume you made this version from the current Makefile.PL in\nthe source tree, and not the one you originally sent. The current one\nhad some fixes in it. I can't figure out if they are still there\nbecause of the size of the changes.\n\n\n> Here is a new MAkefile.PL for plperl.\n> \n> It not only solves the problem for the missing symbol,\n> but there is also now a 'make install'.\n> \n> By the way, earlier, I sent a patch to add plperl\n> to createlang, droplang. Those patches haven't made\n> it into the source tree yet. Do I need to resend them?\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": "Wed, 1 Mar 2000 14:13:11 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] patch for plperl Makefile.PL" } ]
[ { "msg_contents": "Can somebody point me to a place where I can get one of those public\ndrafts of SQL3? I heard DEC has the somewhere, but where?\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Wed, 1 Mar 2000 16:04:19 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": true, "msg_subject": "Where's the SQL3 spec?" }, { "msg_contents": "http://ftp.digital.com/pub/standards/sql/\n\nfrom August, 1994.\n\nAndreas Kardos\n\n-----Urspr�ngliche Nachricht-----\nVon: Peter Eisentraut <[email protected]>\nAn: <[email protected]>\nGesendet: Mittwoch, 1. M�rz 2000 16:04\nBetreff: [HACKERS] Where's the SQL3 spec?\n\n\nCan somebody point me to a place where I can get one of those public\ndrafts of SQL3? I heard DEC has the somewhere, but where?\n\n--\nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n\n************\n\n\n", "msg_date": "Wed, 1 Mar 2000 16:35:22 +0100", "msg_from": "\"Kardos, Dr. Andreas\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Where's the SQL3 spec?" }, { "msg_contents": "On Wed, Mar 01, 2000 at 04:04:19PM +0100, Peter Eisentraut wrote:\n> Can somebody point me to a place where I can get one of those public\n> drafts of SQL3? I heard DEC has the somewhere, but where?\n\nHmm, a quick google search seems to indicate that the various SQL draft\nstandards have been picked up by the dbperl package, and distributed to\nCPAN mirror sites as the directory refinfo inside the module \"dbperl\". The\nhome directory seems to be one that may be close (in netspace) to Sweden:\n\nhttp://src.doc.ic.ac.uk/packages/dbperl/refinfo/\n\nHmm, there's an interesting Manifesto in there, authored by Darwen and \nDate (no copyright date on it, though): Seems they doesn't care for SQL\nvery much as an implementation of the Relational Model.\n\nAhh, web search engines are getting good (or is that bad?) enough to\nrevive a favorite game of mine from childhood: \"Things I learned on the\nway to looking up other things\":\n\nA google search on a bare 'SQL3' turns up this link:\n\nhttp://www.objs.com/x3h7/fmindex.htm\n\nIt's a couple years old, but has some white papers giving interpretations\nof the object models from different systems, including SQL3.\n\nThe Manifesto I mentioned above also talks about OO (there, cheekly\ndefined as an abreviation of Other Orthogonal, so the paper talks about RM\nPrescriptions and Proscriptions, and OO Prescriptions and Proscriptions)\nSpecifically, how the Relational and Object Models might (not) interact.\n\nThere's also a \"state of the standards\" page, though it's last modified\ndate is 1997, and it talks about \"upcoming votes\" in '97. Still, an\ninteresting take on the standards setting processes:\n\nhttp://www.jcc.com/SQLPages/jccs_sql.htm\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\n", "msg_date": "Wed, 1 Mar 2000 10:35:11 -0600", "msg_from": "\"Ross J. Reedstrom\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Where's the SQL3 spec?" } ]
[ { "msg_contents": "Hello,\n\nI have a report from compiling PostgreSQL 6.5.3 on Solaris/SPARC with gcc/ld\n(it was not run by me, I was ask to help to solve this problem). Everything\ngoes OK (with template solaris_sparc_gcc autodetected when running\nconfigure) but when trying to load plpgsql or other loaded module it woes\nwith \n\nERROR: Load of file /usr/local/pgsql/lib/plpgsql.so failed: ld.so.1:\n/usr/local/pgsql/bin/postmaster: fatal: relocation error: file\n/usr/local/pgsql/lib/plpgsql.so: symbol CurrentMemoryContext: referenced\nsymbol not found\n\nit is caused by the fact that the symbol CurrentMemoryContext is not\nexported from the main executable (postmaster). The solution is to use\n\"-export-dynamic\" switch when linking postgres executable (it is used on\nLinux).\n\nI think it will require a new system specific makefile. The\nMakefile.solaris_sparc is done for solaric_sparc_cc template. More details\ncan be send.\n\n\n\t\t\tDan\n\n----------------------------------------------\nDaniel Horak\nnetwork and system administrator\ne-mail: [email protected]\nprivat e-mail: [email protected] ICQ:36448176\n----------------------------------------------\n", "msg_date": "Wed, 1 Mar 2000 17:01:10 +0100 ", "msg_from": "=?iso-8859-2?Q?Hor=E1k_Daniel?= <[email protected]>", "msg_from_op": true, "msg_subject": "PostgreSQL on Solaris/SPARC with gcc" }, { "msg_contents": "On Wed, 1 Mar 2000, [iso-8859-2] HorО©╫k Daniel wrote:\n> I have a report from compiling PostgreSQL 6.5.3 on Solaris/SPARC with gcc/ld\n> (it was not run by me, I was ask to help to solve this problem). Everything\n> goes OK (with template solaris_sparc_gcc autodetected when running\n> configure) but when trying to load plpgsql or other loaded module it woes\n> with \n> \n> ERROR: Load of file /usr/local/pgsql/lib/plpgsql.so failed: ld.so.1:\n> /usr/local/pgsql/bin/postmaster: fatal: relocation error: file\n> /usr/local/pgsql/lib/plpgsql.so: symbol CurrentMemoryContext: referenced\n> symbol not found\n> \n> it is caused by the fact that the symbol CurrentMemoryContext is not\n> exported from the main executable (postmaster). The solution is to use\n> \"-export-dynamic\" switch when linking postgres executable (it is used on\n> Linux).\n> \n> I think it will require a new system specific makefile. The\n> Makefile.solaris_sparc is done for solaric_sparc_cc template. More details\n> can be send.\n\n I ran many versions of Postgres (6.4.2, 6.5, 6.5.2, 7.0beta1) on Sun\nSPARC Solaris 2.5.1, compiled with gcc 2.8.1 and never saw any such\nproblem...\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": "Wed, 1 Mar 2000 16:14:10 +0000 (GMT)", "msg_from": "Oleg Broytmann <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] PostgreSQL on Solaris/SPARC with gcc" }, { "msg_contents": "On Wed, 1 Mar 2000, [iso-8859-2] Hor�k Daniel wrote:\n\n> it is caused by the fact that the symbol CurrentMemoryContext is not\n> exported from the main executable (postmaster). The solution is to use\n> \"-export-dynamic\" switch when linking postgres executable (it is used on\n> Linux).\n> \n> I think it will require a new system specific makefile. The\n> Makefile.solaris_sparc is done for solaric_sparc_cc template. More details\n> can be send.\n\nCouldn't we just test for gcc in general on any platform? For right now\nyou might get away with doing a little ifeq($(CC),gcc) action in the\nsolaris makefile, but that's bogus in the long run.\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Thu, 2 Mar 2000 17:13:55 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] PostgreSQL on Solaris/SPARC with gcc" } ]
[ { "msg_contents": "> Bruce,\n> \n> The bit-type that is in contrib is useless as it stands. Those are\n> only C-routines to implement the functionality, and there are none of\n> the SQL functions to actually make these usable. This really needs to be\n> integrated with postgres proper. I don't know how to go about this and\n> that is why I asked for help. I'm prepared to do whatever SQL function\n> definitions are needed, do the regression tests etc. Would it be better\n> to go back to the hackers mailing list to ask for help? Has this missed\n> 7.0 now? If so, we'd better remove the bit-type from contrib.\n\nI clearly dropped the ball on this one. Don't think it can go into 7.0\nbecause it would require catalog changes/initdb. However, I would like\nto keep it in contrib and add it as soon as 7.0 finalizes and we move to\n7.1.\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, 1 Mar 2000 11:36:52 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: bit types" }, { "msg_contents": "On Wed, Mar 01, 2000 at 11:36:52AM -0500, Bruce Momjian wrote:\n> > Bruce,\n> > \n> > The bit-type that is in contrib is useless as it stands. Those are\n> > only C-routines to implement the functionality, and there are none of\n> > the SQL functions to actually make these usable. This really needs to be\n> > integrated with postgres proper. I don't know how to go about this and\n> > that is why I asked for help. I'm prepared to do whatever SQL function\n> > definitions are needed, do the regression tests etc. Would it be better\n> > to go back to the hackers mailing list to ask for help? Has this missed\n> > 7.0 now? If so, we'd better remove the bit-type from contrib.\n> \n> I clearly dropped the ball on this one. Don't think it can go into 7.0\n> because it would require catalog changes/initdb. However, I would like\n\nHmm, I thought the hard and fast rule was no initdb _after_ release. Surely\nthis sort of thing is what beta (especially beta1) is for?\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": "Wed, 1 Mar 2000 11:24:54 -0600", "msg_from": "\"Ross J. Reedstrom\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: bit types" }, { "msg_contents": "\"Ross J. Reedstrom\" <[email protected]> writes:\n>> I clearly dropped the ball on this one. Don't think it can go into 7.0\n>> because it would require catalog changes/initdb. However, I would like\n\n> Hmm, I thought the hard and fast rule was no initdb _after_ release. Surely\n> this sort of thing is what beta (especially beta1) is for?\n\nActually, it's not the initdb that bothers me --- it's that we'd be\ntalking about dropping in code that is not only not tested, but not\neven written yet. It seems a tad late in the 7.0 cycle for that.\n\nSpecifically, what's in contrib is only the C functions to support a BIT\ndata type. Not only do we not have the SQL function definitions, but we\ndon't have the datatype, nor do we have the parser support needed for\nBIT and BIT VARYING (or have you forgotten that those require special\nsyntax for their length specifications?) So this code is a long way\nfrom being ready for prime time; it's only part of what's needed,\nnot all of it.\n\nPossibly I misunderstand the rules we set for beta phase, but my\nunderstanding was not so much \"no initdbs\" as \"no new-feature\ndevelopment\". This sure looks like it needs some more feature\ndevelopment...\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 01 Mar 2000 13:46:00 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: bit types " }, { "msg_contents": "On Wed, Mar 01, 2000 at 01:46:00PM -0500, Tom Lane wrote:\n> \"Ross J. Reedstrom\" <[email protected]> writes:\n> >> I clearly dropped the ball on this one. Don't think it can go into 7.0\n> >> because it would require catalog changes/initdb. However, I would like\n> \n> > Hmm, I thought the hard and fast rule was no initdb _after_ release. Surely\n> > this sort of thing is what beta (especially beta1) is for?\n> \n> Actually, it's not the initdb that bothers me --- it's that we'd be\n> talking about dropping in code that is not only not tested, but not\n> even written yet. It seems a tad late in the 7.0 cycle for that.\n> \n\nAgreed.\n\n> Specifically, what's in contrib is only the C functions to support a BIT\n> data type. Not only do we not have the SQL function definitions, but we\n> don't have the datatype, nor do we have the parser support needed for\n> BIT and BIT VARYING (or have you forgotten that those require special\n> syntax for their length specifications?) So this code is a long way\n> from being ready for prime time; it's only part of what's needed,\n> not all of it.\n\nRight, that's the _other_ current thread. ;-)\n\n> \n> Possibly I misunderstand the rules we set for beta phase, but my\n> understanding was not so much \"no initdbs\" as \"no new-feature\n> development\". This sure looks like it needs some more feature\n> development...\n\nThat's how I understood it, as well. It's just that Bruce had (at one\ntime) offered to do the intergration/development of this type, and one\ninterpretation of what he posted was that he had the code, but hadn't\nintegrated it, because of the \"no initdb\" rule. Since Bruce tends to be\nthe man for submissions from non-core developers, I just wanted to make\nsure everyone was on the same page.\n\nOn a completely unrelated note: Apparently, there was a \"bug fix\" to\nSQL92, published in 1996, that goes by the name:\n\nTechnical Corrigendum 1:1996 to ISO/IEC 9075:1992 \n\nAccording to the www.iso.ch site in Switzerland, this thing is 80\npages long. Even given the usual front matter, indices, and appendices,\nthere's got to be something in there that we need to know. Hmm, it's\nmarked as free. Perhaps I'll see if I can order it somewhere.\n\nAnyone seen this?\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": "Wed, 1 Mar 2000 13:11:32 -0600", "msg_from": "\"Ross J. Reedstrom\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: bit types" }, { "msg_contents": "> > > The bit-type that is in contrib is useless as it stands. Those are\n> > > only C-routines to implement the functionality, and there are none of\n> > > the SQL functions to actually make these usable. This really needs to be\n> > > integrated with postgres proper. I don't know how to go about this and\n> > > that is why I asked for help. I'm prepared to do whatever SQL function\n> > > definitions are needed, do the regression tests etc. Would it be better\n> > > to go back to the hackers mailing list to ask for help? Has this missed\n> > > 7.0 now? If so, we'd better remove the bit-type from contrib.\n> > \n> > I clearly dropped the ball on this one. Don't think it can go into 7.0\n> > because it would require catalog changes/initdb. However, I would like\n> \n> Hmm, I thought the hard and fast rule was no initdb _after_ release. Surely\n> this sort of thing is what beta (especially beta1) is for?\n\nNo, we usually avoid initdb if at all possible during beta. A new data\ntype is not enough reason for 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": "Wed, 1 Mar 2000 14:23:27 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: bit types" }, { "msg_contents": "> > Possibly I misunderstand the rules we set for beta phase, but my\n> > understanding was not so much \"no initdbs\" as \"no new-feature\n> > development\". This sure looks like it needs some more feature\n> > development...\n> \n> That's how I understood it, as well. It's just that Bruce had (at one\n> time) offered to do the intergration/development of this type, and one\n> interpretation of what he posted was that he had the code, but hadn't\n> integrated it, because of the \"no initdb\" rule. Since Bruce tends to be\n> the man for submissions from non-core developers, I just wanted to make\n> sure everyone was on the same page.\n\nNo, I have not written the code. I have been pretty busy and did not go\nthough my mailbox like I normally do before beta time.\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, 1 Mar 2000 14:28:02 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Re: bit types" }, { "msg_contents": "On Wed, Mar 01, 2000 at 01:11:32PM -0600, Ross J. Reedstrom wrote:\n> \n> On a completely unrelated note: Apparently, there was a \"bug fix\" to\n> SQL92, published in 1996, that goes by the name:\n> \n> Technical Corrigendum 1:1996 to ISO/IEC 9075:1992 \n> \n> According to the www.iso.ch site in Switzerland, this thing is 80\n> pages long. Even given the usual front matter, indices, and appendices,\n> there's got to be something in there that we need to know. Hmm, it's\n> marked as free. Perhaps I'll see if I can order it somewhere.\n> \n> Anyone seen this?\n> \n\nFollowing up to myself: Turns out there was _another_ TC published in\n1999:\n\nISO/IEC 9075:1992/Cor 3:1999 (Don't ask _me_ where Cor 2 went ;-)\n\nThis one's 112 pages. Hmm, time to call my local librarian and see how one\ngets a hold of ISO standards around here.\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\n", "msg_date": "Wed, 1 Mar 2000 13:30:14 -0600", "msg_from": "\"Ross J. Reedstrom\" <[email protected]>", "msg_from_op": false, "msg_subject": "SQL92 standard corrections" }, { "msg_contents": "Bruce Momjian wrote:\n\n> > Bruce,\n> >\n> > The bit-type that is in contrib is useless as it stands. Those are\n> > only C-routines to implement the functionality, and there are none of\n> > the SQL functions to actually make these usable. This really needs to be\n> > integrated with postgres proper. I don't know how to go about this and\n> > that is why I asked for help. I'm prepared to do whatever SQL function\n> > definitions are needed, do the regression tests etc. Would it be better\n> > to go back to the hackers mailing list to ask for help? Has this missed\n> > 7.0 now? If so, we'd better remove the bit-type from contrib.\n>\n> I clearly dropped the ball on this one. Don't think it can go into 7.0\n> because it would require catalog changes/initdb. However, I would like\n> to keep it in contrib and add it as soon as 7.0 finalizes and we move to\n> 7.1.\n\nFine by me either way. My systems still run on a non-SQL compliant bit-type I\ndid earlier. Whenever you get round to it, give me a shout and I'll do\nwhatever I can to help.\n\nCheers,\n\nAdriaan\n\n", "msg_date": "Wed, 01 Mar 2000 22:23:27 +0200", "msg_from": "Adriaan Joubert <[email protected]>", "msg_from_op": false, "msg_subject": "Re: bit types" } ]
[ { "msg_contents": "Psql \\? does not show \\H option to turn on HTML output.\n\nWhat other options are missing from \\? Can someone add them? 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": "Wed, 1 Mar 2000 11:45:08 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": true, "msg_subject": "Psql and \\H option" } ]
[ { "msg_contents": "Hi folks,\n\n I posted this on docs and didn't get a reply, so i'm throwing it in here.\n\n======================\n\nHi,\n\nI was reading the MVCC docs and came across this statement\n\n\"Postgres doesn't remember any information about\nmodified rows in memory and so has no limit to the\nnumber of rows locked without lock escalation. \"\n\nAnd this is how i interpreted it.\n\nyou can have unlimited rows locked with out it going to a 'table\nlock'\n\nDo these two staements say the samething ?\n\n\nJeff MacDonald\[email protected]\n\n", "msg_date": "Wed, 1 Mar 2000 14:10:22 -0400 (AST)", "msg_from": "Jeff MacDonald <[email protected]>", "msg_from_op": true, "msg_subject": "Locking" } ]
[ { "msg_contents": "Hi,\n\nFirst of all I want to congratulate all the people working on PostgreSQL for a job well done.\n\nNow my problem.\n\nI want to change the default behaviour of the data_in function without recompiling postgres.\nthe functionality is the following.\n\ncreate table test (d date);\ninsert into test values ('');\n\nthis should result in the field d containing NULL and the insert command should work without returning an error.\n\nIs this possible and how do I do this.\n\n\n", "msg_date": "Wed, 1 Mar 2000 20:58:07 +0100", "msg_from": "Willy De la Court <[email protected]>", "msg_from_op": true, "msg_subject": "empty dates and changing the default date behaviour" }, { "msg_contents": "Willy De la Court <[email protected]> writes:\n> I want to change the default behaviour of the data_in function without\n> recompiling postgres. the functionality is the following.\n\n> create table test (d date);\n> insert into test values ('');\n\n> this should result in the field d containing NULL and the insert\n> command should work without returning an error.\n\nNot possible at present, since a datatype's typinput function can't\nreturn a NULL. I suppose it will be possible after we redo the\nfunction manager interface, but in any case you'd have no hope of\nchanging the behavior \"without recompiling postgres\".\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 01 Mar 2000 15:23:47 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] empty dates and changing the default date behaviour " } ]
[ { "msg_contents": "> Tom Lane [SMTP:[email protected]] wrote:\n> Willy De la Court <[email protected]> writes:\n> > I want to change the default behaviour of the data_in function without\n> > recompiling postgres. the functionality is the following.\n> \n> > create table test (d date);\n> > insert into test values ('');\n> \n> > this should result in the field d containing NULL and the insert\n> > command should work without returning an error.\n> \n> Not possible at present, since a datatype's typinput function can't\n> return a NULL. I suppose it will be possible after we redo the\n> function manager interface, but in any case you'd have no hope of\n> changing the behavior \"without recompiling postgres\".\n\nOk how do i do it with recompiling postgres I badly need this functionality.\nI know some C programming but not enough to dive into the source of postgres.\n\nany suggestions.\n\n", "msg_date": "Wed, 1 Mar 2000 21:43:21 +0100", "msg_from": "Willy De la Court <[email protected]>", "msg_from_op": true, "msg_subject": "RE: [HACKERS] empty dates and changing the default date behaviour " } ]
[ { "msg_contents": "I found a solution\nyou are right tom with the NULLs but I think I found an elegant solution to this\n\nFirst of all I patch the date_in function like this\n--- postgresql-6.5.2/src/backend/utils/adt/datetime.c\tMon Aug 2 07:24:51 1999\n+++ postgresql-6.5.2-new/src/backend/utils/adt/datetime.c\tThu Mar 2 00:55:54 2000\n@@ -51,8 +51,15 @@\n #ifdef DATEDEBUG\n \tprintf(\"date_in- input string is %s\\n\", str);\n #endif\n-\tif ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0)\n-\t || (DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, &tzp) != 0))\n+\tif (strlen(str) == 0 ) {\n+\t tm->tm_year = 9999;\n+\t tm->tm_mon = 1;\n+\t tm->tm_mday = 1;\n+\t dtype = DTK_DATE;\n+\t}\n+\telse\n+\t if ((ParseDateTime(str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0)\n+\t || (DecodeDateTime(field, ftype, nf, &dtype, tm, &fsec, &tzp) != 0))\n \t\telog(ERROR, \"Bad date external representation '%s'\", str);\n \n \tswitch (dtype)\n\nand the I write some functions (used in triggers) to convert the date 9999/01/01 to nulls.\nlike this\n\ncreate function check_date(date) returns date as '\n begin\n if $1 = ''9999-01-01''::date then\n return NULL;\n else\n return $1;\n end if;\n end;\n' language 'plpgsql';\n\ncreate function check_peo_dates () returns opaque as '\n begin\n NEW.PEO_MAIL = check_date(NEW.PEO_MAIL);\n NEW.PEO_VISIT = check_date(NEW.PEO_VISIT);\n NEW.PEO_SP = check_date(NEW.PEO_SP);\n NEW.PEO_VAL = check_date(NEW.PEO_VAL);\n NEW.PEO_CRE = check_date(NEW.PEO_CRE);\n return NEW;\n end;\n' language 'plpgsql';\n\nis this a good solution or is it plain dumb.\nThe only problem with this is you need to write triggers for all tables that have date fields.\n\nWhat is the SQL92 rule about emty dates? Does anyone know?\n\nWilly De la Court [SMTP:[email protected]] wrote:\n> > Tom Lane [SMTP:[email protected]] wrote:\n> > Willy De la Court <[email protected]> writes:\n> > > I want to change the default behaviour of the data_in function without\n> > > recompiling postgres. the functionality is the following.\n> > \n> > > create table test (d date);\n> > > insert into test values ('');\n> > \n> > > this should result in the field d containing NULL and the insert\n> > > command should work without returning an error.\n> > \n> > Not possible at present, since a datatype's typinput function can't\n> > return a NULL. I suppose it will be possible after we redo the\n> > function manager interface, but in any case you'd have no hope of\n> > changing the behavior \"without recompiling postgres\".\n\n\n", "msg_date": "Thu, 2 Mar 2000 01:49:55 +0100", "msg_from": "Willy De la Court <[email protected]>", "msg_from_op": true, "msg_subject": "RE: [HACKERS] empty dates and changing the default date behaviour " }, { "msg_contents": "Willy De la Court <[email protected]> writes:\n> you are right tom with the NULLs but I think I found an elegant\n> solution to this\n\nInteresting; I didn't realize that plpgsql supported functions returning\nNULLs.\n\nI wouldn't call it an \"elegant\" solution, by any means ;-). But if it\ngets the job done for you, it'll do as a stopgap until datein() can\nreturn a NULL itself.\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 01 Mar 2000 22:51:42 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] empty dates and changing the default date behaviour " } ]
[ { "msg_contents": "Alfred Perlstein <[email protected]> writes:\n> Getting to the point, wouldn't it be easier on the users if either:\n\n> a) at release time the www docs are frozen but a link is made to the\n> HEAD branch of the docs so people can see what's going on in \n> current development.\n> b) maintain a -stable (off the 6.5 branch) of the docs that gets \n> fixes put into it relative to the release while still having a link\n> to the most current docs. I know the inconvience of maintaining\n> a branch is annoying but this is the best way imo.\n\nThis was discussed a while ago. I thought we had agreed that we needed\nto keep two sets of docs on the website, one for the last stable release\n(ie, 6.5 currently) and one for the current development tip. But I\nguess nothing's been done about it yet...\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 01 Mar 2000 23:18:02 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] bitten by docs " }, { "msg_contents": "Hey I just got bitten by something in the docs:\n http://www.postgresql.org/docs/user/datatype1029.htm\n\nspecifically:\n\n Note: To ensure compatibility to earlier versions of PostgreSQL\n we also continue to provide datetime (equivalent to timestamp)\n and timespan (equivalent to interval).\n The types abstime and reltime are lower precision types which\n are used internally. You are discouraged from using any of these\n types in new applications and move any old ones over when\n appropriate. Any or all of these type might disappear in a future\n release.\n\nafter reading this I quickly converted all my datetime into timestamp\nthen I got bitten because a lot of my scripts were using date functions\nthat don't seem to support timestamp as an argument, specifically\ndate_part().\n\nNow if date_part() doesn't take timestamps in 7.0 that needs to be\naddressed, however it seems that this change took place some time\nafter the 6.5 release.\n\nI also realized that my changes to the docs in re async libpq functions\nprobably are confusing the hell out of people using the 'stable' 6.5.\n\nGetting to the point, wouldn't it be easier on the users if either:\n\na) at release time the www docs are frozen but a link is made to the\n HEAD branch of the docs so people can see what's going on in \n current development.\nb) maintain a -stable (off the 6.5 branch) of the docs that gets \n fixes put into it relative to the release while still having a link\n to the most current docs. I know the inconvience of maintaining\n a branch is annoying but this is the best way imo.\n\nI think providing for this when 7.0 comes out would really assist\nusers, as the next release rolls around it's going to be just too\neasy to get confused.\n\nthanks,\n-- \n-Alfred Perlstein - [[email protected]|[email protected]]\n", "msg_date": "Wed, 1 Mar 2000 20:33:34 -0800", "msg_from": "Alfred Perlstein <[email protected]>", "msg_from_op": false, "msg_subject": "bitten by docs" }, { "msg_contents": "> This was discussed a while ago. I thought we had agreed that we needed\n> to keep two sets of docs on the website, one for the last stable release\n> (ie, 6.5 currently) and one for the current development tip. But I\n> guess nothing's been done about it yet...\n\nPerhaps we agreed what should be done, but I'm not sure anyone agreed\nto actually do it.\n\nVince, could you take ownership of this issue (at least to get it on a\nToDo list so we don't forget)? I'm happy to help (will probably need\nto redirect the nightly html production to another area of the web\nsite) but I'm reluctant to muck around with the overall structure of\nthe site, at least without some adult supervision...\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Thu, 02 Mar 2000 06:46:47 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] bitten by docs" }, { "msg_contents": "> Note: To ensure compatibility to earlier versions of PostgreSQL\n> we also continue to provide datetime (equivalent to timestamp)\n> and timespan (equivalent to interval).\n> The types abstime and reltime are lower precision types which\n> are used internally. You are discouraged from using any of these\n> types in new applications and move any old ones over when\n> appropriate. Any or all of these type might disappear in a future\n> release.\n\nI'll probably rephrase this to emphasize that datetime et al are now\ndeprecated and will eventually disappear.\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Thu, 02 Mar 2000 06:48:07 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] bitten by docs" }, { "msg_contents": "On Thu, 2 Mar 2000, Thomas Lockhart wrote:\n\n> > This was discussed a while ago. I thought we had agreed that we needed\n> > to keep two sets of docs on the website, one for the last stable release\n> > (ie, 6.5 currently) and one for the current development tip. But I\n> > guess nothing's been done about it yet...\n> \n> Perhaps we agreed what should be done, but I'm not sure anyone agreed\n> to actually do it.\n> \n> Vince, could you take ownership of this issue (at least to get it on a\n> ToDo list so we don't forget)? I'm happy to help (will probably need\n> to redirect the nightly html production to another area of the web\n> site) but I'm reluctant to muck around with the overall structure of\n> the site, at least without some adult supervision...\n\nActually I had planned on doing it with the 7.0 release. I have a number\nof website changes to do and things like two sets of docs are considered\na major change - or at least I consider it one. If you can redirect any\nrelease docs to the release-doc directory I just created on the website\nthat'd help - otherwise it'll hafta wait till 7.0 goes to release.\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": "Thu, 2 Mar 2000 06:14:22 -0500 (EST)", "msg_from": "Vince Vielhaber <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] bitten by docs" }, { "msg_contents": "* Vince Vielhaber <[email protected]> [000302 03:45] wrote:\n> On Thu, 2 Mar 2000, Thomas Lockhart wrote:\n> \n> > > This was discussed a while ago. I thought we had agreed that we needed\n> > > to keep two sets of docs on the website, one for the last stable release\n> > > (ie, 6.5 currently) and one for the current development tip. But I\n> > > guess nothing's been done about it yet...\n> > \n> > Perhaps we agreed what should be done, but I'm not sure anyone agreed\n> > to actually do it.\n> > \n> > Vince, could you take ownership of this issue (at least to get it on a\n> > ToDo list so we don't forget)? I'm happy to help (will probably need\n> > to redirect the nightly html production to another area of the web\n> > site) but I'm reluctant to muck around with the overall structure of\n> > the site, at least without some adult supervision...\n> \n> Actually I had planned on doing it with the 7.0 release. I have a number\n> of website changes to do and things like two sets of docs are considered\n> a major change - or at least I consider it one. If you can redirect any\n> release docs to the release-doc directory I just created on the website\n> that'd help - otherwise it'll hafta wait till 7.0 goes to release.\n\nHaving it happen at the 7.0 release would be optimal and most appreciated.\n\nthanks,\n-Alfred\n", "msg_date": "Thu, 2 Mar 2000 03:48:32 -0800", "msg_from": "Alfred Perlstein <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] bitten by docs" }, { "msg_contents": "]> > This was discussed a while ago. I thought we had agreed that we needed\n> > to keep two sets of docs on the website, one for the last stable release\n> > (ie, 6.5 currently) and one for the current development tip. But I\n> > guess nothing's been done about it yet...\n> \n> Perhaps we agreed what should be done, but I'm not sure anyone agreed\n> to actually do it.\n> \n> Vince, could you take ownership of this issue (at least to get it on a\n> ToDo list so we don't forget)? I'm happy to help (will probably need\n> to redirect the nightly html production to another area of the web\n> site) but I'm reluctant to muck around with the overall structure of\n> the site, at least without some adult supervision...\n\nI can update the HTML now. No problem.\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, 2 Mar 2000 10:20:26 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] bitten by docs" } ]
[ { "msg_contents": " \n> I was reading the MVCC docs and came across this statement\n> \n> \"Postgres doesn't remember any information about\n> modified rows in memory and so has no limit to the\n> number of rows locked without lock escalation. \"\n> \n> And this is how i interpreted it.\n> \n> you can have unlimited rows locked with out it going to a 'table\n> lock'\n> \n> Do these two staements say the samething ?\n\nYes, exactly.\n\nAndreas\n", "msg_date": "Thu, 2 Mar 2000 09:54:57 +0100 ", "msg_from": "Zeugswetter Andreas SB <[email protected]>", "msg_from_op": true, "msg_subject": "AW: [HACKERS] Locking" } ]
[ { "msg_contents": ">> play=> explain select * from comuni union select * from comuni;\n> *However*, we have not fixed the bug that causes \"select foo union\n> select foo\" to be incorrectly simplified --- the UNION code is still\n> applying cnfify. (Which it probably shouldn't, but I haven't wanted\n> to touch that code until I have the time to rewrite it completely.)\n> The reason 7.0beta1 generates the \"right\" answer is that it has a\n> recently-introduced bug in the comparison routines that causes it to\n> think the two select subqueries aren't the same.\n\nBut if the two queries are the same, the union CAN be simplified,\nsince the union of two identical masses (I don't know the correct word here)\nis still that one mass.\n\nThus 6.5 simplification is correct in this particular case.\n\nAndreas\n", "msg_date": "Thu, 2 Mar 2000 10:03:14 +0100 ", "msg_from": "Zeugswetter Andreas SB <[email protected]>", "msg_from_op": true, "msg_subject": "AW: [HACKERS] having and union in v7beta " }, { "msg_contents": "Zeugswetter Andreas SB <[email protected]> writes:\n>>> play=> explain select * from comuni union select * from comuni;\n\n>> *However*, we have not fixed the bug that causes \"select foo union\n>> select foo\" to be incorrectly simplified --- the UNION code is still\n>> applying cnfify.\n\n> But if the two queries are the same, the union CAN be simplified,\n> since the union of two identical masses (I don't know the correct word here)\n> is still that one mass.\n\n> Thus 6.5 simplification is correct in this particular case.\n\nNo, it is NOT right, because we're dealing with multisets not sets\n(I think \"set\" is the English word you were looking for).\n\nThe SQL spec specifies that UNION implies DISTINCT, ie, removal of\nduplicate rows:\n\n i) Let R be a row that is a duplicate of some row in T1 or of\n some row in T2 or both. Let m be the number of duplicates\n of R in T1 and let n be the number of duplicates of R in\n T2, where m ii) If ALL is not specified, then\n\n Case:\n\n 1) If UNION is specified, then\n\n Case:\n\n A) If m > 0 or n > 0, then T contains exactly one dupli-\n cate of R.\n\n B) Otherwise, T contains no duplicate of R.\n\nIf query \"select foo\" would produce X, Y, Y, Z, then the correct result\nof \"select foo UNION select foo\" is X, Y, Z. But that's not what 6.5\nwill give you.\n\nI think it would be correct to simplify the union to \"select DISTINCT foo\"\nbut that requires all-new simplification code, as well as some thought\nabout how it'd interact with any DISTINCT or DISTINCT ON already present.\n\n\t\t\tregards, tom lane\n", "msg_date": "Thu, 02 Mar 2000 10:12:21 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: [HACKERS] having and union in v7beta " }, { "msg_contents": "On Thu, 2 Mar 2000, Zeugswetter Andreas SB wrote:\n\n> But if the two queries are the same, the union CAN be simplified,\n> since the union of two identical masses (I don't know the correct word here)\n> is still that one mass.\n\n\"set\" :)\n\n> \n> Thus 6.5 simplification is correct in this particular case.\n\nThe issue here seems to be that the queries could have side-effects, such\nas\n\nselect nextval('sequence1')\n union\nselect nextval('sequence1')\n\nwhich should arguably return two distinct rows. I gotta reread SQL's\nopinion on this, but I'm sure Tom has already done that. From a\nmathematical point of view, I believe your assumption \"lexically equal\nqueries yield mathematically equal sets\" is wrong.\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Thu, 2 Mar 2000 17:23:35 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: [HACKERS] having and union in v7beta " } ]
[ { "msg_contents": "Hi,\n\nfirst I'm sorry to not fill the form, I'm too lazy, and it's not platform\nnor version dependent AFAIK.\n\nI recently posted a question (on Feb 23rd) to pgsql-sql concerning the\nfact that update and insert are considered the same thing when you modify\npermissions with grant and revoke. (Maybe it was the wrong place to post\nit.)\n\nfor example a \"grant delete\" also grants \"update\" which is completely\nwrong. More importantly the user is not informed, and this could lead to\nVERY IMPORTANT SECURITY PROBLEMS, like someone who should only be able to\nupdate existing records, have the permission to delete all records... \n\nI've read postgresql documentation, especially the grant and revoke\nmanpages, and I've found no mention of this bug, which is IMHO a Big\nMistake (tm).\n\nattached to this message you'll find a patch for version 6.5.2 wich\ndifferentiate delete and update, because before they were considered as\n\"write\". The patch only modifies .c .y and .h files, but no documentation.\n\nthe new acl rights look like: arRdu \na for append\nr for read\nR for rules\nd for delete\nu for update\n\ninstead of: arwR\na for append\nr for read\nw for update AND delete\nR for rules\n\nThis patch seems to work at least with what I've tested, you'll find a\ntest session at the end of this message.\n\nI hope this patch will help and that it will be easy to incorporate it in\n7.0, which I haven't the time to do for now. \n\nAnd for the bug report I posted on Feb 23rd on \"drop user\" which keeps the\nuser's acl in the database, and the deleted user id being reused, I've not\ndone anything, but I consider this a major problem. Please consider it for\na next version.\n\nBecause I'm not an expert, I suggest you remove gram.c before applying the\npatch, in order for this file to be generated again from gram.y, but maybe\nthis is not necessary.\n\nI'd be very pleased if some people could test this more than I can,\nbecause I don't use postgresql intensively with special permissions.\n\nI'm not sure for some parts of the patch, especially in execMain.c\nso if a postgresql hacker could examine it, this would be fine.\n \ndump of test session:\n---------------------\n\n------- CUT -------\n\ntemplate1=> create database db;\nCREATEDB\ntemplate1=> create user john;\nCREATE USER\ntemplate1=> \\connect db\nconnecting to new database: db\ndb=> create table t (id INT4, name TEXT);\nCREATE\ndb=> \\z\nDatabase = db\n +----------+--------------------------+\n | Relation | Grant/Revoke Permissions |\n +----------+--------------------------+\n | t | |\n +----------+--------------------------+\ndb=> grant all on t to john;\nCHANGE\ndb=> \\z\nDatabase = db\n +----------+--------------------------+\n | Relation | Grant/Revoke Permissions |\n +----------+--------------------------+\n | t | {\"=\",\"john=arduR\"} |\n +----------+--------------------------+\ndb=> \\connect db john\nconnecting to new database: db as user: john\ndb=> insert into t (id, name) values (1, 'xxx');\nINSERT 18560 1\ndb=> update t set name = 'yyy' where id=1;\nUPDATE 1\ndb=> select * from t;\nid|name\n--+----\n 1|yyy\n(1 row)\n\ndb=> delete from t;\nDELETE 1\ndb=> select * from t;\nid|name\n--+----\n(0 rows)\n\ndb=> insert into t (id, name) values (1, 'xxx');\nINSERT 18561 1\ndb=> \\connect db postgres\nconnecting to new database: db as user: postgres\ndb=> revoke update on t from john;\nCHANGE\ndb=> \\z\nDatabase = db\n +----------+--------------------------+\n | Relation | Grant/Revoke Permissions |\n +----------+--------------------------+\n | t | {\"=\",\"john=ardR\"} |\n +----------+--------------------------+\ndb=> \\connect db john;\nconnecting to new database: db as user: john\ndb=> insert into t (id, name) values (2, 'yyy');\nINSERT 18592 1\ndb=> update t set name='modified by john' where id=2;\nERROR: t: Permission denied.\ndb=> delete from t where id=2;\nDELETE 1\ndb=> select * from t;\nid|name\n--+----\n 1|xxx\n(1 row)\n\ndb=> \\connect db postgres\nconnecting to new database: db as user: postgres\ndb=> revoke insert on t from john;\nCHANGE\ndb=> \\connect db john;\nconnecting to new database: db as user: john\ndb=> \\z\nDatabase = db\n +----------+--------------------------+\n | Relation | Grant/Revoke Permissions |\n +----------+--------------------------+\n | t | {\"=\",\"john=rdR\"} |\n +----------+--------------------------+\ndb=> insert into t (id, name) values (3, 'I try to insert something');\nERROR: t: Permission denied.\ndb=> delete from t;\nDELETE 1\ndb=> select * from t;\nid|name\n--+----\n(0 rows)\n\ndb=> \\connect db postgres\nconnecting to new database: db as user: postgres\ndb=> insert into t (id, name) values (1, 'xxx');\nINSERT 18624 1\ndb=> \\connect db john;\nconnecting to new database: db as user: john\ndb=> update t set name='john' where id =1;\nERROR: t: Permission denied.\ndb=> \\connect db postgres\nconnecting to new database: db as user: postgres\ndb=> revoke delete on t from john;\nCHANGE\ndb=> grant update on t to john;\nCHANGE\ndb=> \\connect db john;\nconnecting to new database: db as user: john\ndb=> delete from t;\nERROR: t: Permission denied.\ndb=> update t set name='john' where id=1;\nUPDATE 1\ndb=> select * from t;\nid|name\n--+----\n 1|john\n(1 row)\n\n------- CUT -------\n \nThank you for reading.\n\nbye,\n\nJerome ALET - [email protected] - http://cortex.unice.fr/~jerome\nFaculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 \n28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE", "msg_date": "Thu, 2 Mar 2000 12:47:13 +0100 (MET)", "msg_from": "Jerome ALET <[email protected]>", "msg_from_op": true, "msg_subject": "grant/revoke bug with delete/update" }, { "msg_contents": "Looks very nice, but we can't apply it during beta. Only bug fixes, and\nthis looks a little tricky. We can try it for 7.1. Maybe you can get\nus a 7.0 based patch.\n\n\n> Hi,\n> \n> first I'm sorry to not fill the form, I'm too lazy, and it's not platform\n> nor version dependent AFAIK.\n> \n> I recently posted a question (on Feb 23rd) to pgsql-sql concerning the\n> fact that update and insert are considered the same thing when you modify\n> permissions with grant and revoke. (Maybe it was the wrong place to post\n> it.)\n> \n> for example a \"grant delete\" also grants \"update\" which is completely\n> wrong. More importantly the user is not informed, and this could lead to\n> VERY IMPORTANT SECURITY PROBLEMS, like someone who should only be able to\n> update existing records, have the permission to delete all records... \n> \n> I've read postgresql documentation, especially the grant and revoke\n> manpages, and I've found no mention of this bug, which is IMHO a Big\n> Mistake (tm).\n> \n> attached to this message you'll find a patch for version 6.5.2 wich\n> differentiate delete and update, because before they were considered as\n> \"write\". The patch only modifies .c .y and .h files, but no documentation.\n> \n> the new acl rights look like: arRdu \n> a for append\n> r for read\n> R for rules\n> d for delete\n> u for update\n> \n> instead of: arwR\n> a for append\n> r for read\n> w for update AND delete\n> R for rules\n> \n> This patch seems to work at least with what I've tested, you'll find a\n> test session at the end of this message.\n> \n> I hope this patch will help and that it will be easy to incorporate it in\n> 7.0, which I haven't the time to do for now. \n> \n> And for the bug report I posted on Feb 23rd on \"drop user\" which keeps the\n> user's acl in the database, and the deleted user id being reused, I've not\n> done anything, but I consider this a major problem. Please consider it for\n> a next version.\n> \n> Because I'm not an expert, I suggest you remove gram.c before applying the\n> patch, in order for this file to be generated again from gram.y, but maybe\n> this is not necessary.\n> \n> I'd be very pleased if some people could test this more than I can,\n> because I don't use postgresql intensively with special permissions.\n> \n> I'm not sure for some parts of the patch, especially in execMain.c\n> so if a postgresql hacker could examine it, this would be fine.\n> \n> dump of test session:\n> ---------------------\n> \n> ------- CUT -------\n> \n> template1=> create database db;\n> CREATEDB\n> template1=> create user john;\n> CREATE USER\n> template1=> \\connect db\n> connecting to new database: db\n> db=> create table t (id INT4, name TEXT);\n> CREATE\n> db=> \\z\n> Database = db\n> +----------+--------------------------+\n> | Relation | Grant/Revoke Permissions |\n> +----------+--------------------------+\n> | t | |\n> +----------+--------------------------+\n> db=> grant all on t to john;\n> CHANGE\n> db=> \\z\n> Database = db\n> +----------+--------------------------+\n> | Relation | Grant/Revoke Permissions |\n> +----------+--------------------------+\n> | t | {\"=\",\"john=arduR\"} |\n> +----------+--------------------------+\n> db=> \\connect db john\n> connecting to new database: db as user: john\n> db=> insert into t (id, name) values (1, 'xxx');\n> INSERT 18560 1\n> db=> update t set name = 'yyy' where id=1;\n> UPDATE 1\n> db=> select * from t;\n> id|name\n> --+----\n> 1|yyy\n> (1 row)\n> \n> db=> delete from t;\n> DELETE 1\n> db=> select * from t;\n> id|name\n> --+----\n> (0 rows)\n> \n> db=> insert into t (id, name) values (1, 'xxx');\n> INSERT 18561 1\n> db=> \\connect db postgres\n> connecting to new database: db as user: postgres\n> db=> revoke update on t from john;\n> CHANGE\n> db=> \\z\n> Database = db\n> +----------+--------------------------+\n> | Relation | Grant/Revoke Permissions |\n> +----------+--------------------------+\n> | t | {\"=\",\"john=ardR\"} |\n> +----------+--------------------------+\n> db=> \\connect db john;\n> connecting to new database: db as user: john\n> db=> insert into t (id, name) values (2, 'yyy');\n> INSERT 18592 1\n> db=> update t set name='modified by john' where id=2;\n> ERROR: t: Permission denied.\n> db=> delete from t where id=2;\n> DELETE 1\n> db=> select * from t;\n> id|name\n> --+----\n> 1|xxx\n> (1 row)\n> \n> db=> \\connect db postgres\n> connecting to new database: db as user: postgres\n> db=> revoke insert on t from john;\n> CHANGE\n> db=> \\connect db john;\n> connecting to new database: db as user: john\n> db=> \\z\n> Database = db\n> +----------+--------------------------+\n> | Relation | Grant/Revoke Permissions |\n> +----------+--------------------------+\n> | t | {\"=\",\"john=rdR\"} |\n> +----------+--------------------------+\n> db=> insert into t (id, name) values (3, 'I try to insert something');\n> ERROR: t: Permission denied.\n> db=> delete from t;\n> DELETE 1\n> db=> select * from t;\n> id|name\n> --+----\n> (0 rows)\n> \n> db=> \\connect db postgres\n> connecting to new database: db as user: postgres\n> db=> insert into t (id, name) values (1, 'xxx');\n> INSERT 18624 1\n> db=> \\connect db john;\n> connecting to new database: db as user: john\n> db=> update t set name='john' where id =1;\n> ERROR: t: Permission denied.\n> db=> \\connect db postgres\n> connecting to new database: db as user: postgres\n> db=> revoke delete on t from john;\n> CHANGE\n> db=> grant update on t to john;\n> CHANGE\n> db=> \\connect db john;\n> connecting to new database: db as user: john\n> db=> delete from t;\n> ERROR: t: Permission denied.\n> db=> update t set name='john' where id=1;\n> UPDATE 1\n> db=> select * from t;\n> id|name\n> --+----\n> 1|john\n> (1 row)\n> \n> ------- CUT -------\n> \n> Thank you for reading.\n> \n> bye,\n> \n> Jerome ALET - [email protected] - http://cortex.unice.fr/~jerome\n> Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 \n> 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE\nContent-Description: the 6.5.2 patch\n\n> diff -urbw postgresql-6.5.2/src/backend/catalog/aclchk.c postgresql-6.5.2-patched/src/backend/catalog/aclchk.c\n> --- postgresql-6.5.2/src/backend/catalog/aclchk.c\tMon Aug 2 07:56:53 1999\n> +++ postgresql-6.5.2-patched/src/backend/catalog/aclchk.c\tWed Mar 1 16:39:44 2000\n> @@ -381,7 +381,7 @@\n> \t\t * pg_database table, there is still additional permissions\n> \t\t * checking in dbcommands.c\n> \t\t */\n> -\t\tif ((mode & ACL_WR) || (mode & ACL_AP))\n> +\t\tif (mode & ACL_AP)\n> \t\t\treturn ACLCHECK_OK;\n> \t}\n> \n> @@ -390,7 +390,7 @@\n> \t * pg_shadow.usecatupd is set.\t(This is to let superusers protect\n> \t * themselves from themselves.)\n> \t */\n> -\tif (((mode & ACL_WR) || (mode & ACL_AP)) &&\n> +\tif ((mode & ACL_AP) &&\n> \t\t!allowSystemTableMods && IsSystemRelationName(relname) &&\n> \t\t!((Form_pg_shadow) GETSTRUCT(tuple))->usecatupd)\n> \t{\n> diff -urbw postgresql-6.5.2/src/backend/commands/command.c postgresql-6.5.2-patched/src/backend/commands/command.c\n> --- postgresql-6.5.2/src/backend/commands/command.c\tMon Aug 2 07:56:57 1999\n> +++ postgresql-6.5.2-patched/src/backend/commands/command.c\tWed Mar 1 16:30:23 2000\n> @@ -524,7 +524,9 @@\n> \tif (lockstmt->mode == AccessShareLock)\n> \t\taclresult = pg_aclcheck(lockstmt->relname, GetPgUserName(), ACL_RD);\n> \telse\n> -\t\taclresult = pg_aclcheck(lockstmt->relname, GetPgUserName(), ACL_WR);\n> +\t\t/* do we really need to have all these permissions at the same time ? */\n> +\t\t/* shouldn't we test lockstmt->mode first ? */\n> +\t\taclresult = pg_aclcheck(lockstmt->relname, GetPgUserName(), (ACL_AP | ACL_DE | ACL_UP));\n> \n> \tif (aclresult != ACLCHECK_OK)\n> \t\telog(ERROR, \"LOCK TABLE: permission denied\");\n> diff -urbw postgresql-6.5.2/src/backend/commands/copy.c postgresql-6.5.2-patched/src/backend/commands/copy.c\n> --- postgresql-6.5.2/src/backend/commands/copy.c\tSat Jul 3 02:32:39 1999\n> +++ postgresql-6.5.2-patched/src/backend/commands/copy.c\tWed Mar 1 16:30:35 2000\n> @@ -242,7 +242,8 @@\n> \tFILE\t *fp;\n> \tRelation\trel;\n> \textern char *UserName;\t\t/* defined in global.c */\n> -\tconst AclMode required_access = from ? ACL_WR : ACL_RD;\n> +\t/* why should we need other permissions than APPEND ? */\n> +\tconst AclMode required_access = from ? ACL_AP : ACL_RD;\n> \tint\t\t\tresult;\n> \n> \trel = heap_openr(relname);\n> diff -urbw postgresql-6.5.2/src/backend/commands/sequence.c postgresql-6.5.2-patched/src/backend/commands/sequence.c\n> --- postgresql-6.5.2/src/backend/commands/sequence.c\tMon Aug 2 07:56:59 1999\n> +++ postgresql-6.5.2-patched/src/backend/commands/sequence.c\tWed Mar 1 16:31:05 2000\n> @@ -314,7 +314,8 @@\n> \tForm_pg_sequence seq;\n> \n> #ifndef NO_SECURITY\n> -\tif (pg_aclcheck(seqname, getpgusername(), ACL_WR) != ACLCHECK_OK)\n> +\t/* why should we need more than UPDATE permission ? */\n> +\tif (pg_aclcheck(seqname, getpgusername(), ACL_UP) != ACLCHECK_OK)\n> \t\telog(ERROR, \"%s.setval: you don't have permissions to set sequence %s\",\n> \t\t\t seqname, seqname);\n> #endif\n> diff -urbw postgresql-6.5.2/src/backend/commands/user.c postgresql-6.5.2-patched/src/backend/commands/user.c\n> --- postgresql-6.5.2/src/backend/commands/user.c\tMon Aug 2 07:56:59 1999\n> +++ postgresql-6.5.2-patched/src/backend/commands/user.c\tWed Mar 1 16:31:38 2000\n> @@ -115,7 +115,7 @@\n> \t * pg_shadow relation.\n> \t */\n> \tpg_shadow = GetPgUserName();\n> -\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_WR | ACL_AP) != ACLCHECK_OK)\n> +\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_AP | ACL_DE | ACL_UP) != ACLCHECK_OK)\n> \t{\n> \t\tUserAbortTransactionBlock();\n> \t\telog(ERROR, \"defineUser: user \\\"%s\\\" does not have SELECT and INSERT privilege for \\\"%s\\\"\",\n> @@ -227,7 +227,8 @@\n> \t * pg_shadow relation.\n> \t */\n> \tpg_shadow = GetPgUserName();\n> -\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_WR) != ACLCHECK_OK)\n> +\t/* why should we need more than UPDATE ? */\n> +\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_UP) != ACLCHECK_OK)\n> \t{\n> \t\tUserAbortTransactionBlock();\n> \t\telog(ERROR, \"alterUser: user \\\"%s\\\" does not have SELECT and UPDATE privilege for \\\"%s\\\"\",\n> @@ -329,11 +330,12 @@\n> \t\tBeginTransactionBlock();\n> \n> \t/*\n> -\t * Make sure the user attempting to create a user can delete from the\n> +\t * Make sure the user attempting to delete a user can delete from the\n> \t * pg_shadow relation.\n> \t */\n> \tpg_shadow = GetPgUserName();\n> -\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_WR) != ACLCHECK_OK)\n> +\t/* why should we need more than DELETE ? */\n> +\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_DE) != ACLCHECK_OK)\n> \t{\n> \t\tUserAbortTransactionBlock();\n> \t\telog(ERROR, \"removeUser: user \\\"%s\\\" does not have SELECT and DELETE privilege for \\\"%s\\\"\",\n> diff -urbw postgresql-6.5.2/src/backend/executor/execMain.c postgresql-6.5.2-patched/src/backend/executor/execMain.c\n> --- postgresql-6.5.2/src/backend/executor/execMain.c\tThu Jun 17 17:15:49 1999\n> +++ postgresql-6.5.2-patched/src/backend/executor/execMain.c\tWed Mar 1 18:31:31 2000\n> @@ -464,14 +464,16 @@\n> \t\t\tswitch (operation)\n> \t\t\t{\n> \t\t\t\tcase CMD_INSERT:\n> -\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_AP)) == ACLCHECK_OK) ||\n> -\t\t\t\t\t\t((aclcheck_result = CHECK(ACL_WR)) == ACLCHECK_OK);\n> +\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_AP)) == ACLCHECK_OK);\n> \t\t\t\t\topstr = \"append\";\n> \t\t\t\t\tbreak;\n> \t\t\t\tcase CMD_DELETE:\n> +\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_DE)) == ACLCHECK_OK);\n> +\t\t\t\t\topstr = \"delete\";\n> +\t\t\t\t\tbreak;\n> \t\t\t\tcase CMD_UPDATE:\n> -\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_WR)) == ACLCHECK_OK);\n> -\t\t\t\t\topstr = \"write\";\n> +\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_UP)) == ACLCHECK_OK);\n> +\t\t\t\t\topstr = \"update\";\n> \t\t\t\t\tbreak;\n> \t\t\t\tdefault:\n> \t\t\t\t\telog(ERROR, \"ExecCheckPerms: bogus operation %d\",\n> @@ -508,8 +510,9 @@\n> \t\t\tStrNCpy(rname.data,\n> \t\t\t\t\t((Form_pg_class) GETSTRUCT(htup))->relname.data,\n> \t\t\t\t\tNAMEDATALEN);\n> -\t\t\tok = ((aclcheck_result = CHECK(ACL_WR)) == ACLCHECK_OK);\n> -\t\t\topstr = \"write\";\n> +\t\t\t/* is it the right thing to do ? */\n> +\t\t\tok = ((aclcheck_result = CHECK((ACL_AP | ACL_DE | ACL_UP))) == ACLCHECK_OK);\n> +\t\t\topstr = \"write\";\t/* unused ? */\n> \t\t\tif (!ok)\n> \t\t\t\telog(ERROR, \"%s: %s\", rname.data, aclcheck_error_strings[aclcheck_result]);\n> \t\t}\n> diff -urbw postgresql-6.5.2/src/backend/parser/gram.y postgresql-6.5.2-patched/src/backend/parser/gram.y\n> --- postgresql-6.5.2/src/backend/parser/gram.y\tTue Sep 14 08:07:35 1999\n> +++ postgresql-6.5.2-patched/src/backend/parser/gram.y\tWed Mar 1 16:33:34 2000\n> @@ -1694,11 +1694,11 @@\n> \n> privileges: ALL PRIVILEGES\n> \t\t\t\t{\n> -\t\t\t\t $$ = aclmakepriv(\"rwaR\",0);\n> +\t\t\t\t $$ = aclmakepriv(\"raduR\",0);\n> \t\t\t\t}\n> \t\t| ALL\n> \t\t\t\t{\n> -\t\t\t\t $$ = aclmakepriv(\"rwaR\",0);\n> +\t\t\t\t $$ = aclmakepriv(\"raduR\",0);\n> \t\t\t\t}\n> \t\t| operation_commalist\n> \t\t\t\t{\n> @@ -1726,11 +1726,11 @@\n> \t\t\t\t}\n> \t\t| UPDATE\n> \t\t\t\t{\n> -\t\t\t\t\t\t$$ = ACL_MODE_WR_CHR;\n> +\t\t\t\t\t\t$$ = ACL_MODE_UP_CHR;\n> \t\t\t\t}\n> \t\t| DELETE\n> \t\t\t\t{\n> -\t\t\t\t\t\t$$ = ACL_MODE_WR_CHR;\n> +\t\t\t\t\t\t$$ = ACL_MODE_DE_CHR;\n> \t\t\t\t}\n> \t\t| RULE\n> \t\t\t\t{\n> diff -urbw postgresql-6.5.2/src/backend/parser/parse.h postgresql-6.5.2-patched/src/backend/parser/parse.h\n> --- postgresql-6.5.2/src/backend/parser/parse.h\tThu Sep 16 02:23:39 1999\n> +++ postgresql-6.5.2-patched/src/backend/parser/parse.h\tWed Mar 1 18:34:46 2000\n> @@ -29,236 +29,236 @@\n> \tRuleStmt\t\t\t*rstmt;\n> \tInsertStmt\t\t\t*astmt;\n> } YYSTYPE;\n> -#define\tABSOLUTE\t257\n> -#define\tACTION\t258\n> -#define\tADD\t259\n> -#define\tALL\t260\n> -#define\tALTER\t261\n> -#define\tAND\t262\n> -#define\tANY\t263\n> -#define\tAS\t264\n> -#define\tASC\t265\n> -#define\tBEGIN_TRANS\t266\n> -#define\tBETWEEN\t267\n> -#define\tBOTH\t268\n> -#define\tBY\t269\n> -#define\tCASCADE\t270\n> -#define\tCASE\t271\n> -#define\tCAST\t272\n> -#define\tCHAR\t273\n> -#define\tCHARACTER\t274\n> -#define\tCHECK\t275\n> -#define\tCLOSE\t276\n> -#define\tCOALESCE\t277\n> -#define\tCOLLATE\t278\n> -#define\tCOLUMN\t279\n> -#define\tCOMMIT\t280\n> -#define\tCONSTRAINT\t281\n> -#define\tCREATE\t282\n> -#define\tCROSS\t283\n> -#define\tCURRENT\t284\n> -#define\tCURRENT_DATE\t285\n> -#define\tCURRENT_TIME\t286\n> -#define\tCURRENT_TIMESTAMP\t287\n> -#define\tCURRENT_USER\t288\n> -#define\tCURSOR\t289\n> -#define\tDAY_P\t290\n> -#define\tDECIMAL\t291\n> -#define\tDECLARE\t292\n> -#define\tDEFAULT\t293\n> -#define\tDELETE\t294\n> -#define\tDESC\t295\n> -#define\tDISTINCT\t296\n> -#define\tDOUBLE\t297\n> -#define\tDROP\t298\n> -#define\tELSE\t299\n> -#define\tEND_TRANS\t300\n> -#define\tEXCEPT\t301\n> -#define\tEXECUTE\t302\n> -#define\tEXISTS\t303\n> -#define\tEXTRACT\t304\n> -#define\tFALSE_P\t305\n> -#define\tFETCH\t306\n> -#define\tFLOAT\t307\n> -#define\tFOR\t308\n> -#define\tFOREIGN\t309\n> -#define\tFROM\t310\n> -#define\tFULL\t311\n> -#define\tGLOBAL\t312\n> -#define\tGRANT\t313\n> -#define\tGROUP\t314\n> -#define\tHAVING\t315\n> -#define\tHOUR_P\t316\n> -#define\tIN\t317\n> -#define\tINNER_P\t318\n> -#define\tINSENSITIVE\t319\n> -#define\tINSERT\t320\n> -#define\tINTERSECT\t321\n> -#define\tINTERVAL\t322\n> -#define\tINTO\t323\n> -#define\tIS\t324\n> -#define\tISOLATION\t325\n> -#define\tJOIN\t326\n> -#define\tKEY\t327\n> -#define\tLANGUAGE\t328\n> -#define\tLEADING\t329\n> -#define\tLEFT\t330\n> -#define\tLEVEL\t331\n> -#define\tLIKE\t332\n> -#define\tLOCAL\t333\n> -#define\tMATCH\t334\n> -#define\tMINUTE_P\t335\n> -#define\tMONTH_P\t336\n> -#define\tNAMES\t337\n> -#define\tNATIONAL\t338\n> -#define\tNATURAL\t339\n> -#define\tNCHAR\t340\n> -#define\tNEXT\t341\n> -#define\tNO\t342\n> -#define\tNOT\t343\n> -#define\tNULLIF\t344\n> -#define\tNULL_P\t345\n> -#define\tNUMERIC\t346\n> -#define\tOF\t347\n> -#define\tON\t348\n> -#define\tONLY\t349\n> -#define\tOPTION\t350\n> -#define\tOR\t351\n> -#define\tORDER\t352\n> -#define\tOUTER_P\t353\n> -#define\tPARTIAL\t354\n> -#define\tPOSITION\t355\n> -#define\tPRECISION\t356\n> -#define\tPRIMARY\t357\n> -#define\tPRIOR\t358\n> -#define\tPRIVILEGES\t359\n> -#define\tPROCEDURE\t360\n> -#define\tPUBLIC\t361\n> -#define\tREAD\t362\n> -#define\tREFERENCES\t363\n> -#define\tRELATIVE\t364\n> -#define\tREVOKE\t365\n> -#define\tRIGHT\t366\n> -#define\tROLLBACK\t367\n> -#define\tSCROLL\t368\n> -#define\tSECOND_P\t369\n> -#define\tSELECT\t370\n> -#define\tSET\t371\n> -#define\tSUBSTRING\t372\n> -#define\tTABLE\t373\n> -#define\tTEMP\t374\n> -#define\tTEMPORARY\t375\n> -#define\tTHEN\t376\n> -#define\tTIME\t377\n> -#define\tTIMESTAMP\t378\n> -#define\tTIMEZONE_HOUR\t379\n> -#define\tTIMEZONE_MINUTE\t380\n> -#define\tTO\t381\n> -#define\tTRAILING\t382\n> -#define\tTRANSACTION\t383\n> -#define\tTRIM\t384\n> -#define\tTRUE_P\t385\n> -#define\tUNION\t386\n> -#define\tUNIQUE\t387\n> -#define\tUPDATE\t388\n> -#define\tUSER\t389\n> -#define\tUSING\t390\n> -#define\tVALUES\t391\n> -#define\tVARCHAR\t392\n> -#define\tVARYING\t393\n> -#define\tVIEW\t394\n> -#define\tWHEN\t395\n> -#define\tWHERE\t396\n> -#define\tWITH\t397\n> -#define\tWORK\t398\n> -#define\tYEAR_P\t399\n> -#define\tZONE\t400\n> -#define\tTRIGGER\t401\n> -#define\tCOMMITTED\t402\n> -#define\tSERIALIZABLE\t403\n> -#define\tTYPE_P\t404\n> -#define\tABORT_TRANS\t405\n> -#define\tACCESS\t406\n> -#define\tAFTER\t407\n> -#define\tAGGREGATE\t408\n> -#define\tANALYZE\t409\n> -#define\tBACKWARD\t410\n> -#define\tBEFORE\t411\n> -#define\tBINARY\t412\n> -#define\tCACHE\t413\n> -#define\tCLUSTER\t414\n> -#define\tCOPY\t415\n> -#define\tCREATEDB\t416\n> -#define\tCREATEUSER\t417\n> -#define\tCYCLE\t418\n> -#define\tDATABASE\t419\n> -#define\tDELIMITERS\t420\n> -#define\tDO\t421\n> -#define\tEACH\t422\n> -#define\tENCODING\t423\n> -#define\tEXCLUSIVE\t424\n> -#define\tEXPLAIN\t425\n> -#define\tEXTEND\t426\n> -#define\tFORWARD\t427\n> -#define\tFUNCTION\t428\n> -#define\tHANDLER\t429\n> -#define\tINCREMENT\t430\n> -#define\tINDEX\t431\n> -#define\tINHERITS\t432\n> -#define\tINSTEAD\t433\n> -#define\tISNULL\t434\n> -#define\tLANCOMPILER\t435\n> -#define\tLIMIT\t436\n> -#define\tLISTEN\t437\n> -#define\tLOAD\t438\n> -#define\tLOCATION\t439\n> -#define\tLOCK_P\t440\n> -#define\tMAXVALUE\t441\n> -#define\tMINVALUE\t442\n> -#define\tMODE\t443\n> -#define\tMOVE\t444\n> -#define\tNEW\t445\n> -#define\tNOCREATEDB\t446\n> -#define\tNOCREATEUSER\t447\n> -#define\tNONE\t448\n> -#define\tNOTHING\t449\n> -#define\tNOTIFY\t450\n> -#define\tNOTNULL\t451\n> -#define\tOFFSET\t452\n> -#define\tOIDS\t453\n> -#define\tOPERATOR\t454\n> -#define\tPASSWORD\t455\n> -#define\tPROCEDURAL\t456\n> -#define\tRENAME\t457\n> -#define\tRESET\t458\n> -#define\tRETURNS\t459\n> -#define\tROW\t460\n> -#define\tRULE\t461\n> -#define\tSEQUENCE\t462\n> -#define\tSERIAL\t463\n> -#define\tSETOF\t464\n> -#define\tSHARE\t465\n> -#define\tSHOW\t466\n> -#define\tSTART\t467\n> -#define\tSTATEMENT\t468\n> -#define\tSTDIN\t469\n> -#define\tSTDOUT\t470\n> -#define\tTRUSTED\t471\n> -#define\tUNLISTEN\t472\n> -#define\tUNTIL\t473\n> -#define\tVACUUM\t474\n> -#define\tVALID\t475\n> -#define\tVERBOSE\t476\n> -#define\tVERSION\t477\n> -#define\tIDENT\t478\n> -#define\tSCONST\t479\n> -#define\tOp\t480\n> -#define\tICONST\t481\n> -#define\tPARAM\t482\n> -#define\tFCONST\t483\n> -#define\tOP\t484\n> -#define\tUMINUS\t485\n> -#define\tTYPECAST\t486\n> +#define\tABSOLUTE\t258\n> +#define\tACTION\t259\n> +#define\tADD\t260\n> +#define\tALL\t261\n> +#define\tALTER\t262\n> +#define\tAND\t263\n> +#define\tANY\t264\n> +#define\tAS\t265\n> +#define\tASC\t266\n> +#define\tBEGIN_TRANS\t267\n> +#define\tBETWEEN\t268\n> +#define\tBOTH\t269\n> +#define\tBY\t270\n> +#define\tCASCADE\t271\n> +#define\tCASE\t272\n> +#define\tCAST\t273\n> +#define\tCHAR\t274\n> +#define\tCHARACTER\t275\n> +#define\tCHECK\t276\n> +#define\tCLOSE\t277\n> +#define\tCOALESCE\t278\n> +#define\tCOLLATE\t279\n> +#define\tCOLUMN\t280\n> +#define\tCOMMIT\t281\n> +#define\tCONSTRAINT\t282\n> +#define\tCREATE\t283\n> +#define\tCROSS\t284\n> +#define\tCURRENT\t285\n> +#define\tCURRENT_DATE\t286\n> +#define\tCURRENT_TIME\t287\n> +#define\tCURRENT_TIMESTAMP\t288\n> +#define\tCURRENT_USER\t289\n> +#define\tCURSOR\t290\n> +#define\tDAY_P\t291\n> +#define\tDECIMAL\t292\n> +#define\tDECLARE\t293\n> +#define\tDEFAULT\t294\n> +#define\tDELETE\t295\n> +#define\tDESC\t296\n> +#define\tDISTINCT\t297\n> +#define\tDOUBLE\t298\n> +#define\tDROP\t299\n> +#define\tELSE\t300\n> +#define\tEND_TRANS\t301\n> +#define\tEXCEPT\t302\n> +#define\tEXECUTE\t303\n> +#define\tEXISTS\t304\n> +#define\tEXTRACT\t305\n> +#define\tFALSE_P\t306\n> +#define\tFETCH\t307\n> +#define\tFLOAT\t308\n> +#define\tFOR\t309\n> +#define\tFOREIGN\t310\n> +#define\tFROM\t311\n> +#define\tFULL\t312\n> +#define\tGLOBAL\t313\n> +#define\tGRANT\t314\n> +#define\tGROUP\t315\n> +#define\tHAVING\t316\n> +#define\tHOUR_P\t317\n> +#define\tIN\t318\n> +#define\tINNER_P\t319\n> +#define\tINSENSITIVE\t320\n> +#define\tINSERT\t321\n> +#define\tINTERSECT\t322\n> +#define\tINTERVAL\t323\n> +#define\tINTO\t324\n> +#define\tIS\t325\n> +#define\tISOLATION\t326\n> +#define\tJOIN\t327\n> +#define\tKEY\t328\n> +#define\tLANGUAGE\t329\n> +#define\tLEADING\t330\n> +#define\tLEFT\t331\n> +#define\tLEVEL\t332\n> +#define\tLIKE\t333\n> +#define\tLOCAL\t334\n> +#define\tMATCH\t335\n> +#define\tMINUTE_P\t336\n> +#define\tMONTH_P\t337\n> +#define\tNAMES\t338\n> +#define\tNATIONAL\t339\n> +#define\tNATURAL\t340\n> +#define\tNCHAR\t341\n> +#define\tNEXT\t342\n> +#define\tNO\t343\n> +#define\tNOT\t344\n> +#define\tNULLIF\t345\n> +#define\tNULL_P\t346\n> +#define\tNUMERIC\t347\n> +#define\tOF\t348\n> +#define\tON\t349\n> +#define\tONLY\t350\n> +#define\tOPTION\t351\n> +#define\tOR\t352\n> +#define\tORDER\t353\n> +#define\tOUTER_P\t354\n> +#define\tPARTIAL\t355\n> +#define\tPOSITION\t356\n> +#define\tPRECISION\t357\n> +#define\tPRIMARY\t358\n> +#define\tPRIOR\t359\n> +#define\tPRIVILEGES\t360\n> +#define\tPROCEDURE\t361\n> +#define\tPUBLIC\t362\n> +#define\tREAD\t363\n> +#define\tREFERENCES\t364\n> +#define\tRELATIVE\t365\n> +#define\tREVOKE\t366\n> +#define\tRIGHT\t367\n> +#define\tROLLBACK\t368\n> +#define\tSCROLL\t369\n> +#define\tSECOND_P\t370\n> +#define\tSELECT\t371\n> +#define\tSET\t372\n> +#define\tSUBSTRING\t373\n> +#define\tTABLE\t374\n> +#define\tTEMP\t375\n> +#define\tTEMPORARY\t376\n> +#define\tTHEN\t377\n> +#define\tTIME\t378\n> +#define\tTIMESTAMP\t379\n> +#define\tTIMEZONE_HOUR\t380\n> +#define\tTIMEZONE_MINUTE\t381\n> +#define\tTO\t382\n> +#define\tTRAILING\t383\n> +#define\tTRANSACTION\t384\n> +#define\tTRIM\t385\n> +#define\tTRUE_P\t386\n> +#define\tUNION\t387\n> +#define\tUNIQUE\t388\n> +#define\tUPDATE\t389\n> +#define\tUSER\t390\n> +#define\tUSING\t391\n> +#define\tVALUES\t392\n> +#define\tVARCHAR\t393\n> +#define\tVARYING\t394\n> +#define\tVIEW\t395\n> +#define\tWHEN\t396\n> +#define\tWHERE\t397\n> +#define\tWITH\t398\n> +#define\tWORK\t399\n> +#define\tYEAR_P\t400\n> +#define\tZONE\t401\n> +#define\tTRIGGER\t402\n> +#define\tCOMMITTED\t403\n> +#define\tSERIALIZABLE\t404\n> +#define\tTYPE_P\t405\n> +#define\tABORT_TRANS\t406\n> +#define\tACCESS\t407\n> +#define\tAFTER\t408\n> +#define\tAGGREGATE\t409\n> +#define\tANALYZE\t410\n> +#define\tBACKWARD\t411\n> +#define\tBEFORE\t412\n> +#define\tBINARY\t413\n> +#define\tCACHE\t414\n> +#define\tCLUSTER\t415\n> +#define\tCOPY\t416\n> +#define\tCREATEDB\t417\n> +#define\tCREATEUSER\t418\n> +#define\tCYCLE\t419\n> +#define\tDATABASE\t420\n> +#define\tDELIMITERS\t421\n> +#define\tDO\t422\n> +#define\tEACH\t423\n> +#define\tENCODING\t424\n> +#define\tEXCLUSIVE\t425\n> +#define\tEXPLAIN\t426\n> +#define\tEXTEND\t427\n> +#define\tFORWARD\t428\n> +#define\tFUNCTION\t429\n> +#define\tHANDLER\t430\n> +#define\tINCREMENT\t431\n> +#define\tINDEX\t432\n> +#define\tINHERITS\t433\n> +#define\tINSTEAD\t434\n> +#define\tISNULL\t435\n> +#define\tLANCOMPILER\t436\n> +#define\tLIMIT\t437\n> +#define\tLISTEN\t438\n> +#define\tLOAD\t439\n> +#define\tLOCATION\t440\n> +#define\tLOCK_P\t441\n> +#define\tMAXVALUE\t442\n> +#define\tMINVALUE\t443\n> +#define\tMODE\t444\n> +#define\tMOVE\t445\n> +#define\tNEW\t446\n> +#define\tNOCREATEDB\t447\n> +#define\tNOCREATEUSER\t448\n> +#define\tNONE\t449\n> +#define\tNOTHING\t450\n> +#define\tNOTIFY\t451\n> +#define\tNOTNULL\t452\n> +#define\tOFFSET\t453\n> +#define\tOIDS\t454\n> +#define\tOPERATOR\t455\n> +#define\tPASSWORD\t456\n> +#define\tPROCEDURAL\t457\n> +#define\tRENAME\t458\n> +#define\tRESET\t459\n> +#define\tRETURNS\t460\n> +#define\tROW\t461\n> +#define\tRULE\t462\n> +#define\tSEQUENCE\t463\n> +#define\tSERIAL\t464\n> +#define\tSETOF\t465\n> +#define\tSHARE\t466\n> +#define\tSHOW\t467\n> +#define\tSTART\t468\n> +#define\tSTATEMENT\t469\n> +#define\tSTDIN\t470\n> +#define\tSTDOUT\t471\n> +#define\tTRUSTED\t472\n> +#define\tUNLISTEN\t473\n> +#define\tUNTIL\t474\n> +#define\tVACUUM\t475\n> +#define\tVALID\t476\n> +#define\tVERBOSE\t477\n> +#define\tVERSION\t478\n> +#define\tIDENT\t479\n> +#define\tSCONST\t480\n> +#define\tOp\t481\n> +#define\tICONST\t482\n> +#define\tPARAM\t483\n> +#define\tFCONST\t484\n> +#define\tOP\t485\n> +#define\tUMINUS\t486\n> +#define\tTYPECAST\t487\n> \n> \n> extern YYSTYPE yylval;\n> diff -urbw postgresql-6.5.2/src/backend/parser/parse_func.c postgresql-6.5.2-patched/src/backend/parser/parse_func.c\n> --- postgresql-6.5.2/src/backend/parser/parse_func.c\tFri Jun 18 00:21:40 1999\n> +++ postgresql-6.5.2-patched/src/backend/parser/parse_func.c\tWed Mar 1 16:33:53 2000\n> @@ -601,7 +601,8 @@\n> \n> \t\tif ((aclcheck_result = pg_aclcheck(seqrel, GetPgUserName(),\n> \t\t\t\t\t (((funcid == F_NEXTVAL) || (funcid == F_SETVAL)) ?\n> -\t\t\t\t\t\tACL_WR : ACL_RD)))\n> +\t\t\t\t\t\t/* if nextval and setval are atomic, which I don't know, update should be enough */\n> +\t\t\t\t\t\tACL_UP : ACL_RD)))\n> \t\t\t!= ACLCHECK_OK)\n> \t\t\telog(ERROR, \"%s.%s: %s\",\n> \t\t\t seqrel, funcname, aclcheck_error_strings[aclcheck_result]);\n> diff -urbw postgresql-6.5.2/src/backend/rewrite/locks.c postgresql-6.5.2-patched/src/backend/rewrite/locks.c\n> --- postgresql-6.5.2/src/backend/rewrite/locks.c\tSun Feb 14 00:17:44 1999\n> +++ postgresql-6.5.2-patched/src/backend/rewrite/locks.c\tWed Mar 1 16:34:20 2000\n> @@ -228,8 +228,15 @@\n> \t\t\t\t\t\tcase CMD_INSERT:\n> \t\t\t\t\t\t\treqperm = ACL_AP;\n> \t\t\t\t\t\t\tbreak;\n> +\t\t\t\t\t\tcase CMD_DELETE:\n> +\t\t\t\t\t\t\treqperm = ACL_DE;\n> +\t\t\t\t\t\t\tbreak;\n> +\t\t\t\t\t\tcase CMD_UPDATE:\n> +\t\t\t\t\t\t\treqperm = ACL_UP;\n> +\t\t\t\t\t\t\tbreak;\n> \t\t\t\t\t\tdefault:\n> -\t\t\t\t\t\t\treqperm = ACL_WR;\n> +\t\t\t\t\t\t\t/* is it The Right Thing To Do (tm) ? */\n> +\t\t\t\t\t\t\treqperm = ACL_AP | ACL_DE | ACL_UP;\n> \t\t\t\t\t\t\tbreak;\n> \t\t\t\t\t}\n> \t\t\t\telse\n> diff -urbw postgresql-6.5.2/src/backend/rewrite/rewriteHandler.c postgresql-6.5.2-patched/src/backend/rewrite/rewriteHandler.c\n> --- postgresql-6.5.2/src/backend/rewrite/rewriteHandler.c\tSun Jul 11 19:54:30 1999\n> +++ postgresql-6.5.2-patched/src/backend/rewrite/rewriteHandler.c\tWed Mar 1 16:35:01 2000\n> @@ -2282,8 +2282,15 @@\n> \t\t\t\tcase CMD_INSERT:\n> \t\t\t\t\treqperm = ACL_AP;\n> \t\t\t\t\tbreak;\n> +\t\t\t\tcase CMD_DELETE:\n> +\t\t\t\t\treqperm = ACL_DE;\n> +\t\t\t\t\tbreak;\n> +\t\t\t\tcase CMD_UPDATE:\n> +\t\t\t\t\treqperm = ACL_UP;\n> +\t\t\t\t\tbreak;\n> \t\t\t\tdefault:\n> -\t\t\t\t\treqperm = ACL_WR;\n> +\t\t\t\t\t/* is it The Right Thing To Do (tm) ? */\n> +\t\t\t\t\treqperm = ACL_AP | ACL_DE | ACL_UP;\n> \t\t\t\t\tbreak;\n> \t\t\t}\n> \n> diff -urbw postgresql-6.5.2/src/backend/storage/file/fd.c postgresql-6.5.2-patched/src/backend/storage/file/fd.c\n> diff -urbw postgresql-6.5.2/src/backend/utils/adt/acl.c postgresql-6.5.2-patched/src/backend/utils/adt/acl.c\n> --- postgresql-6.5.2/src/backend/utils/adt/acl.c\tMon Aug 2 07:24:49 1999\n> +++ postgresql-6.5.2-patched/src/backend/utils/adt/acl.c\tWed Mar 1 16:35:53 2000\n> @@ -154,8 +154,11 @@\n> \t\t\tcase ACL_MODE_RD_CHR:\n> \t\t\t\taip->ai_mode |= ACL_RD;\n> \t\t\t\tbreak;\n> -\t\t\tcase ACL_MODE_WR_CHR:\n> -\t\t\t\taip->ai_mode |= ACL_WR;\n> +\t\t\tcase ACL_MODE_DE_CHR:\n> +\t\t\t\taip->ai_mode |= ACL_DE;\n> +\t\t\t\tbreak;\n> +\t\t\tcase ACL_MODE_UP_CHR:\n> +\t\t\t\taip->ai_mode |= ACL_UP;\n> \t\t\t\tbreak;\n> \t\t\tcase ACL_MODE_RU_CHR:\n> \t\t\t\taip->ai_mode |= ACL_RU;\n> @@ -272,7 +275,7 @@\n> \tif (!aip)\n> \t\taip = &default_aclitem;\n> \n> -\tp = out = palloc(strlen(\"group =arwR \") + 1 + NAMEDATALEN);\n> +\tp = out = palloc(strlen(\"group =arRdu \") + 1 + NAMEDATALEN);\n> \tif (!out)\n> \t\telog(ERROR, \"aclitemout: palloc failed\");\n> \t*p = '\\0';\n> @@ -605,9 +608,8 @@\n> \tint\t\t\ti;\n> \tint\t\t\tl;\n> \n> -\tAssert(strlen(old_privlist) < 5);\n> -\tpriv = palloc(5); /* at most \"rwaR\" */ ;\n> -\n> +\tAssert(strlen(old_privlist) < 6);\n> +\tpriv = palloc(6); /* at most \"arduR\" */ ;\n> \tif (old_privlist == NULL || old_privlist[0] == '\\0')\n> \t{\n> \t\tpriv[0] = new_priv;\n> @@ -619,7 +621,7 @@\n> \n> \tl = strlen(old_privlist);\n> \n> -\tif (l == 4)\n> +\tif (l == 5)\n> \t{\t\t\t\t\t\t\t/* can't add any more privileges */\n> \t\treturn priv;\n> \t}\n> diff -urbw postgresql-6.5.2/src/include/utils/acl.h postgresql-6.5.2-patched/src/include/utils/acl.h\n> --- postgresql-6.5.2/src/include/utils/acl.h\tFri Jul 30 19:07:22 1999\n> +++ postgresql-6.5.2-patched/src/include/utils/acl.h\tWed Mar 1 16:40:50 2000\n> @@ -54,9 +54,10 @@\n> #define ACL_NO\t\t\t0\t\t/* no permissions */\n> #define ACL_AP\t\t\t(1<<0)\t/* append */\n> #define ACL_RD\t\t\t(1<<1)\t/* read */\n> -#define ACL_WR\t\t\t(1<<2)\t/* write (append/delete/replace) */\n> -#define ACL_RU\t\t\t(1<<3)\t/* place rules */\n> -#define N_ACL_MODES\t\t4\n> +#define ACL_DE\t\t\t(1<<2)\t/* delete */\n> +#define ACL_UP\t\t\t(1<<3)\t/* update/replace */\n> +#define ACL_RU\t\t\t(1<<4)\t/* place rules */\n> +#define N_ACL_MODES\t\t5\n> \n> #define ACL_MODECHG_ADD\t\t\t1\n> #define ACL_MODECHG_DEL\t\t\t2\n> @@ -65,7 +66,8 @@\n> /* change this line if you want to set the default acl permission */\n> #define ACL_WORLD_DEFAULT\t\t(ACL_NO)\n> /* #define\t\tACL_WORLD_DEFAULT\t\t(ACL_RD|ACL_WR|ACL_AP|ACL_RU) */\n> -#define ACL_OWNER_DEFAULT\t\t(ACL_RD|ACL_WR|ACL_AP|ACL_RU)\n> +\n> +#define ACL_OWNER_DEFAULT\t\t(ACL_AP|ACL_RD|ACL_RU|ACL_DE|ACL_UP)\n> \n> /*\n> * AclItem\n> @@ -118,10 +120,12 @@\n> #define ACL_MODECHG_ADD_CHR\t\t'+'\n> #define ACL_MODECHG_DEL_CHR\t\t'-'\n> #define ACL_MODECHG_EQL_CHR\t\t'='\n> -#define ACL_MODE_STR\t\t\t\"arwR\"\t/* list of valid characters */\n> +\n> +#define ACL_MODE_STR\t\t\t\"arduR\"\t /* list of valid characters */\n> #define ACL_MODE_AP_CHR\t\t\t'a'\n> #define ACL_MODE_RD_CHR\t\t\t'r'\n> -#define ACL_MODE_WR_CHR\t\t\t'w'\n> +#define ACL_MODE_DE_CHR\t\t\t'd'\n> +#define ACL_MODE_UP_CHR\t\t\t'u'\n> #define ACL_MODE_RU_CHR\t\t\t'R'\n> \n> /* result codes for pg_aclcheck */\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, 2 Mar 2000 10:24:56 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [BUGS] grant/revoke bug with delete/update" }, { "msg_contents": "Bruce Momjian writes:\n\n> Looks very nice, but we can't apply it during beta. Only bug fixes, and\n> this looks a little tricky. We can try it for 7.1. Maybe you can get\n> us a 7.0 based patch.\n\nIt was me that encouraged him to send in this patch now because Karel and\nI are currently talking about redoing the ACL stuff for 7.1.\n\nI considered this a bug and the fix looks pretty straightforward. Perhaps\nit should go into 7.0.1?\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Sat, 4 Mar 2000 18:05:54 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [BUGS] grant/revoke bug with delete/update" }, { "msg_contents": "Peter, thanks for your support !\n\nI'm surprised this bug isn't taken seriously by other people. \n\nabout the fact that this isn't considered as a bug fix, I disagree\nentirely: it's a fix to an important security issue. \n\nIt adds nothing. The only thing it changes is \"du\" instead of \"w\" in the\nacls, so people would have to dump and restore their databases when\nupgrading to a fixed version, but that's probably already the case for\nupgrading from 6.5x to 7.x (I don't know). Of course I agree that this fix\nneeds a lot more testing than most bug fixes, and I haven't tested all the\npossibilities (particularly with sequences, which I have not tested at\nall).\n\nI'm even more surprised this wasn't noticed before, or do all users deal\nwith databases as superuser ? For those of you who have any doubt, I\nsuggest you look at a recent thread on BUGTRAQ (find it on\nhttp://www.securityfocus.com) to know what problems this bug can generate\nif used by bad people. \n\nI've even received a mail trying to explain me that update and delete are\nthe same thing because you can update a record you want to delete but have\nno right to, to change its data... of course this is possible, but\nnevertheless the record isn't deleted, so update and delete really are two\ndifferent things, not to mention you may want to give delete permission\nbut not insert nor update. \n\nAs I told previously in private to Bruce, I won't be able to make this\npatch for 7.0 until a week or two, so if someone do it before (please do,\nbecause you better know postgresql code than me, so you'll make less\nmistakes), just tell me because I don't really want to duplicate the\neffort. \n\nbye,\n\nPS: could someone explain me what \"tricky\" means ?\n\nJerome ALET - [email protected] - http://cortex.unice.fr/~jerome\nFaculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 \n28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE\n\nOn Sat, 4 Mar 2000, Peter Eisentraut wrote:\n\n> Bruce Momjian writes:\n> \n> > Looks very nice, but we can't apply it during beta. Only bug fixes, and\n> > this looks a little tricky. We can try it for 7.1. Maybe you can get\n> > us a 7.0 based patch.\n> \n> It was me that encouraged him to send in this patch now because Karel and\n> I are currently talking about redoing the ACL stuff for 7.1.\n> \n> I considered this a bug and the fix looks pretty straightforward. Perhaps\n> it should go into 7.0.1?\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", "msg_date": "Mon, 6 Mar 2000 10:12:52 +0100 (MET)", "msg_from": "Jerome ALET <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [BUGS] grant/revoke bug with delete/update" }, { "msg_contents": "Peter Eisentraut <[email protected]> writes:\n> Bruce Momjian writes:\n>> Looks very nice, but we can't apply it during beta. Only bug fixes, and\n>> this looks a little tricky. We can try it for 7.1. Maybe you can get\n>> us a 7.0 based patch.\n\n> It was me that encouraged him to send in this patch now because Karel and\n> I are currently talking about redoing the ACL stuff for 7.1.\n\n> I considered this a bug and the fix looks pretty straightforward. Perhaps\n> it should go into 7.0.1?\n\nIt looked to me like a definition change that hadn't been adequately\ndiscussed. We tend to be especially leery of those during beta;\nrushing in a \"bug fix\" that may prove to have been a bad idea is\nnot productive.\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 07 Mar 2000 01:51:32 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [BUGS] grant/revoke bug with delete/update " }, { "msg_contents": "On Tue, 7 Mar 2000, Tom Lane wrote:\n> It looked to me like a definition change that hadn't been adequately\n> discussed. We tend to be especially leery of those during beta;\n> rushing in a \"bug fix\" that may prove to have been a bad idea is\n> not productive.\n\nok, but what are you planning to do and when to correct this security\nissue ?\n\nI agree it's not a complete rewrite of acls in postgresql, which maybe (I\ndon't know) need to be rewritten from scratch, because I'm really not able\nto do this. However saying that a quick fix to correct a major security\nproblem is a bad idea makes me laugh loudly (or cry, if you prefer).\n\nfor now and until someone acts correctly regarding this problem, I'll\npatch my good old 6.5.2 version and use it, and you can throw my patch in\nyour ass or wherever you prefer if you don't want it.\n\nDon't even expect me to rewrite this patch for 7.0, because it's not my\nproblem anymore, it's yours (and other postgresql users') !\n\nI really don't mind you don't include my patch in postgresql, what I'm\nconcerned about is that you don't plan anything to quickly solve this\nproblem. Maybe you don't know, which would surprise me, but some people\nwrite programs which rely on acls and other SQL features working\ncorrectly.\n\nAt least you should document this security problem.\n\nDon't try to tell me to use another product, because unfortunately for you\nI really like postgresql. \n\nthank you for reading.\n\nPeter: thanks again for your support.\n\nbye,\n\nJerome\n\n\n", "msg_date": "Tue, 7 Mar 2000 11:05:46 +0100 (MET)", "msg_from": "Jerome ALET <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [BUGS] grant/revoke bug with delete/update " }, { "msg_contents": "[Charset ISO-8859-1 unsupported, filtering to ASCII...]\n> Bruce Momjian writes:\n> \n> > Looks very nice, but we can't apply it during beta. Only bug fixes, and\n> > this looks a little tricky. We can try it for 7.1. Maybe you can get\n> > us a 7.0 based patch.\n> \n> It was me that encouraged him to send in this patch now because Karel and\n> I are currently talking about redoing the ACL stuff for 7.1.\n> \n> I considered this a bug and the fix looks pretty straightforward. Perhaps\n> it should go into 7.0.1?\n\nIt will never make it into 7.0.1. Beta is your only chance, and I don't\nthink it is do-able. It will take a few weeks to get a 7.0 based patch,\nand I don't see the reason to add a feature at this time.\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, 7 Mar 2000 18:24:21 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [BUGS] grant/revoke bug with delete/update" }, { "msg_contents": "> I've even received a mail trying to explain me that update and delete are\n> the same thing because you can update a record you want to delete but have\n> no right to, to change its data... of course this is possible, but\n> nevertheless the record isn't deleted, so update and delete really are two\n> different things, not to mention you may want to give delete permission\n> but not insert nor update. \n> \n> As I told previously in private to Bruce, I won't be able to make this\n> patch for 7.0 until a week or two, so if someone do it before (please do,\n> because you better know postgresql code than me, so you'll make less\n> mistakes), just tell me because I don't really want to duplicate the\n> effort. \n> \n> bye,\n> \n> PS: could someone explain me what \"tricky\" means ?\n\nTricky means not based on 7.0, and it mucks with the internals, and that\nit may require an initdb.\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, 7 Mar 2000 18:53:41 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [BUGS] grant/revoke bug with delete/update" }, { "msg_contents": "Jerome ALET writes:\n\n[censored stuff snipped]\n\n> Don't even expect me to rewrite this patch for 7.0, because it's not my\n> problem anymore, it's yours (and other postgresql users') !\n\nI don't think that personal attacks like this are warranted. Tom points\nout that this is a relatively big code change by an \"outsider\" during beta\nwhich would also require users to re-initdb their database. It's an\nunfortunate situation but if a plurality of core developers says that this\nwould be too much potential burden during beta you have to accept it. You\nare free to publish your patch via other mechanisms if you like, or\ncontribute it to 7.1.\n\nAnd patches based on older versions can't be used in general.\n\n> At least you should document this security problem.\n\nAgreed.\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": "Thu, 9 Mar 2000 01:38:20 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [BUGS] grant/revoke bug with delete/update " }, { "msg_contents": "Are we addressing this?\n\n\n> Hi,\n> \n> first I'm sorry to not fill the form, I'm too lazy, and it's not platform\n> nor version dependent AFAIK.\n> \n> I recently posted a question (on Feb 23rd) to pgsql-sql concerning the\n> fact that update and insert are considered the same thing when you modify\n> permissions with grant and revoke. (Maybe it was the wrong place to post\n> it.)\n> \n> for example a \"grant delete\" also grants \"update\" which is completely\n> wrong. More importantly the user is not informed, and this could lead to\n> VERY IMPORTANT SECURITY PROBLEMS, like someone who should only be able to\n> update existing records, have the permission to delete all records... \n> \n> I've read postgresql documentation, especially the grant and revoke\n> manpages, and I've found no mention of this bug, which is IMHO a Big\n> Mistake (tm).\n> \n> attached to this message you'll find a patch for version 6.5.2 wich\n> differentiate delete and update, because before they were considered as\n> \"write\". The patch only modifies .c .y and .h files, but no documentation.\n> \n> the new acl rights look like: arRdu \n> a for append\n> r for read\n> R for rules\n> d for delete\n> u for update\n> \n> instead of: arwR\n> a for append\n> r for read\n> w for update AND delete\n> R for rules\n> \n> This patch seems to work at least with what I've tested, you'll find a\n> test session at the end of this message.\n> \n> I hope this patch will help and that it will be easy to incorporate it in\n> 7.0, which I haven't the time to do for now. \n> \n> And for the bug report I posted on Feb 23rd on \"drop user\" which keeps the\n> user's acl in the database, and the deleted user id being reused, I've not\n> done anything, but I consider this a major problem. Please consider it for\n> a next version.\n> \n> Because I'm not an expert, I suggest you remove gram.c before applying the\n> patch, in order for this file to be generated again from gram.y, but maybe\n> this is not necessary.\n> \n> I'd be very pleased if some people could test this more than I can,\n> because I don't use postgresql intensively with special permissions.\n> \n> I'm not sure for some parts of the patch, especially in execMain.c\n> so if a postgresql hacker could examine it, this would be fine.\n> \n> dump of test session:\n> ---------------------\n> \n> ------- CUT -------\n> \n> template1=> create database db;\n> CREATEDB\n> template1=> create user john;\n> CREATE USER\n> template1=> \\connect db\n> connecting to new database: db\n> db=> create table t (id INT4, name TEXT);\n> CREATE\n> db=> \\z\n> Database = db\n> +----------+--------------------------+\n> | Relation | Grant/Revoke Permissions |\n> +----------+--------------------------+\n> | t | |\n> +----------+--------------------------+\n> db=> grant all on t to john;\n> CHANGE\n> db=> \\z\n> Database = db\n> +----------+--------------------------+\n> | Relation | Grant/Revoke Permissions |\n> +----------+--------------------------+\n> | t | {\"=\",\"john=arduR\"} |\n> +----------+--------------------------+\n> db=> \\connect db john\n> connecting to new database: db as user: john\n> db=> insert into t (id, name) values (1, 'xxx');\n> INSERT 18560 1\n> db=> update t set name = 'yyy' where id=1;\n> UPDATE 1\n> db=> select * from t;\n> id|name\n> --+----\n> 1|yyy\n> (1 row)\n> \n> db=> delete from t;\n> DELETE 1\n> db=> select * from t;\n> id|name\n> --+----\n> (0 rows)\n> \n> db=> insert into t (id, name) values (1, 'xxx');\n> INSERT 18561 1\n> db=> \\connect db postgres\n> connecting to new database: db as user: postgres\n> db=> revoke update on t from john;\n> CHANGE\n> db=> \\z\n> Database = db\n> +----------+--------------------------+\n> | Relation | Grant/Revoke Permissions |\n> +----------+--------------------------+\n> | t | {\"=\",\"john=ardR\"} |\n> +----------+--------------------------+\n> db=> \\connect db john;\n> connecting to new database: db as user: john\n> db=> insert into t (id, name) values (2, 'yyy');\n> INSERT 18592 1\n> db=> update t set name='modified by john' where id=2;\n> ERROR: t: Permission denied.\n> db=> delete from t where id=2;\n> DELETE 1\n> db=> select * from t;\n> id|name\n> --+----\n> 1|xxx\n> (1 row)\n> \n> db=> \\connect db postgres\n> connecting to new database: db as user: postgres\n> db=> revoke insert on t from john;\n> CHANGE\n> db=> \\connect db john;\n> connecting to new database: db as user: john\n> db=> \\z\n> Database = db\n> +----------+--------------------------+\n> | Relation | Grant/Revoke Permissions |\n> +----------+--------------------------+\n> | t | {\"=\",\"john=rdR\"} |\n> +----------+--------------------------+\n> db=> insert into t (id, name) values (3, 'I try to insert something');\n> ERROR: t: Permission denied.\n> db=> delete from t;\n> DELETE 1\n> db=> select * from t;\n> id|name\n> --+----\n> (0 rows)\n> \n> db=> \\connect db postgres\n> connecting to new database: db as user: postgres\n> db=> insert into t (id, name) values (1, 'xxx');\n> INSERT 18624 1\n> db=> \\connect db john;\n> connecting to new database: db as user: john\n> db=> update t set name='john' where id =1;\n> ERROR: t: Permission denied.\n> db=> \\connect db postgres\n> connecting to new database: db as user: postgres\n> db=> revoke delete on t from john;\n> CHANGE\n> db=> grant update on t to john;\n> CHANGE\n> db=> \\connect db john;\n> connecting to new database: db as user: john\n> db=> delete from t;\n> ERROR: t: Permission denied.\n> db=> update t set name='john' where id=1;\n> UPDATE 1\n> db=> select * from t;\n> id|name\n> --+----\n> 1|john\n> (1 row)\n> \n> ------- CUT -------\n> \n> Thank you for reading.\n> \n> bye,\n> \n> Jerome ALET - [email protected] - http://cortex.unice.fr/~jerome\n> Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 \n> 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE\nContent-Description: the 6.5.2 patch\n\n> diff -urbw postgresql-6.5.2/src/backend/catalog/aclchk.c postgresql-6.5.2-patched/src/backend/catalog/aclchk.c\n> --- postgresql-6.5.2/src/backend/catalog/aclchk.c\tMon Aug 2 07:56:53 1999\n> +++ postgresql-6.5.2-patched/src/backend/catalog/aclchk.c\tWed Mar 1 16:39:44 2000\n> @@ -381,7 +381,7 @@\n> \t\t * pg_database table, there is still additional permissions\n> \t\t * checking in dbcommands.c\n> \t\t */\n> -\t\tif ((mode & ACL_WR) || (mode & ACL_AP))\n> +\t\tif (mode & ACL_AP)\n> \t\t\treturn ACLCHECK_OK;\n> \t}\n> \n> @@ -390,7 +390,7 @@\n> \t * pg_shadow.usecatupd is set.\t(This is to let superusers protect\n> \t * themselves from themselves.)\n> \t */\n> -\tif (((mode & ACL_WR) || (mode & ACL_AP)) &&\n> +\tif ((mode & ACL_AP) &&\n> \t\t!allowSystemTableMods && IsSystemRelationName(relname) &&\n> \t\t!((Form_pg_shadow) GETSTRUCT(tuple))->usecatupd)\n> \t{\n> diff -urbw postgresql-6.5.2/src/backend/commands/command.c postgresql-6.5.2-patched/src/backend/commands/command.c\n> --- postgresql-6.5.2/src/backend/commands/command.c\tMon Aug 2 07:56:57 1999\n> +++ postgresql-6.5.2-patched/src/backend/commands/command.c\tWed Mar 1 16:30:23 2000\n> @@ -524,7 +524,9 @@\n> \tif (lockstmt->mode == AccessShareLock)\n> \t\taclresult = pg_aclcheck(lockstmt->relname, GetPgUserName(), ACL_RD);\n> \telse\n> -\t\taclresult = pg_aclcheck(lockstmt->relname, GetPgUserName(), ACL_WR);\n> +\t\t/* do we really need to have all these permissions at the same time ? */\n> +\t\t/* shouldn't we test lockstmt->mode first ? */\n> +\t\taclresult = pg_aclcheck(lockstmt->relname, GetPgUserName(), (ACL_AP | ACL_DE | ACL_UP));\n> \n> \tif (aclresult != ACLCHECK_OK)\n> \t\telog(ERROR, \"LOCK TABLE: permission denied\");\n> diff -urbw postgresql-6.5.2/src/backend/commands/copy.c postgresql-6.5.2-patched/src/backend/commands/copy.c\n> --- postgresql-6.5.2/src/backend/commands/copy.c\tSat Jul 3 02:32:39 1999\n> +++ postgresql-6.5.2-patched/src/backend/commands/copy.c\tWed Mar 1 16:30:35 2000\n> @@ -242,7 +242,8 @@\n> \tFILE\t *fp;\n> \tRelation\trel;\n> \textern char *UserName;\t\t/* defined in global.c */\n> -\tconst AclMode required_access = from ? ACL_WR : ACL_RD;\n> +\t/* why should we need other permissions than APPEND ? */\n> +\tconst AclMode required_access = from ? ACL_AP : ACL_RD;\n> \tint\t\t\tresult;\n> \n> \trel = heap_openr(relname);\n> diff -urbw postgresql-6.5.2/src/backend/commands/sequence.c postgresql-6.5.2-patched/src/backend/commands/sequence.c\n> --- postgresql-6.5.2/src/backend/commands/sequence.c\tMon Aug 2 07:56:59 1999\n> +++ postgresql-6.5.2-patched/src/backend/commands/sequence.c\tWed Mar 1 16:31:05 2000\n> @@ -314,7 +314,8 @@\n> \tForm_pg_sequence seq;\n> \n> #ifndef NO_SECURITY\n> -\tif (pg_aclcheck(seqname, getpgusername(), ACL_WR) != ACLCHECK_OK)\n> +\t/* why should we need more than UPDATE permission ? */\n> +\tif (pg_aclcheck(seqname, getpgusername(), ACL_UP) != ACLCHECK_OK)\n> \t\telog(ERROR, \"%s.setval: you don't have permissions to set sequence %s\",\n> \t\t\t seqname, seqname);\n> #endif\n> diff -urbw postgresql-6.5.2/src/backend/commands/user.c postgresql-6.5.2-patched/src/backend/commands/user.c\n> --- postgresql-6.5.2/src/backend/commands/user.c\tMon Aug 2 07:56:59 1999\n> +++ postgresql-6.5.2-patched/src/backend/commands/user.c\tWed Mar 1 16:31:38 2000\n> @@ -115,7 +115,7 @@\n> \t * pg_shadow relation.\n> \t */\n> \tpg_shadow = GetPgUserName();\n> -\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_WR | ACL_AP) != ACLCHECK_OK)\n> +\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_AP | ACL_DE | ACL_UP) != ACLCHECK_OK)\n> \t{\n> \t\tUserAbortTransactionBlock();\n> \t\telog(ERROR, \"defineUser: user \\\"%s\\\" does not have SELECT and INSERT privilege for \\\"%s\\\"\",\n> @@ -227,7 +227,8 @@\n> \t * pg_shadow relation.\n> \t */\n> \tpg_shadow = GetPgUserName();\n> -\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_WR) != ACLCHECK_OK)\n> +\t/* why should we need more than UPDATE ? */\n> +\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_UP) != ACLCHECK_OK)\n> \t{\n> \t\tUserAbortTransactionBlock();\n> \t\telog(ERROR, \"alterUser: user \\\"%s\\\" does not have SELECT and UPDATE privilege for \\\"%s\\\"\",\n> @@ -329,11 +330,12 @@\n> \t\tBeginTransactionBlock();\n> \n> \t/*\n> -\t * Make sure the user attempting to create a user can delete from the\n> +\t * Make sure the user attempting to delete a user can delete from the\n> \t * pg_shadow relation.\n> \t */\n> \tpg_shadow = GetPgUserName();\n> -\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_WR) != ACLCHECK_OK)\n> +\t/* why should we need more than DELETE ? */\n> +\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_DE) != ACLCHECK_OK)\n> \t{\n> \t\tUserAbortTransactionBlock();\n> \t\telog(ERROR, \"removeUser: user \\\"%s\\\" does not have SELECT and DELETE privilege for \\\"%s\\\"\",\n> diff -urbw postgresql-6.5.2/src/backend/executor/execMain.c postgresql-6.5.2-patched/src/backend/executor/execMain.c\n> --- postgresql-6.5.2/src/backend/executor/execMain.c\tThu Jun 17 17:15:49 1999\n> +++ postgresql-6.5.2-patched/src/backend/executor/execMain.c\tWed Mar 1 18:31:31 2000\n> @@ -464,14 +464,16 @@\n> \t\t\tswitch (operation)\n> \t\t\t{\n> \t\t\t\tcase CMD_INSERT:\n> -\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_AP)) == ACLCHECK_OK) ||\n> -\t\t\t\t\t\t((aclcheck_result = CHECK(ACL_WR)) == ACLCHECK_OK);\n> +\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_AP)) == ACLCHECK_OK);\n> \t\t\t\t\topstr = \"append\";\n> \t\t\t\t\tbreak;\n> \t\t\t\tcase CMD_DELETE:\n> +\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_DE)) == ACLCHECK_OK);\n> +\t\t\t\t\topstr = \"delete\";\n> +\t\t\t\t\tbreak;\n> \t\t\t\tcase CMD_UPDATE:\n> -\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_WR)) == ACLCHECK_OK);\n> -\t\t\t\t\topstr = \"write\";\n> +\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_UP)) == ACLCHECK_OK);\n> +\t\t\t\t\topstr = \"update\";\n> \t\t\t\t\tbreak;\n> \t\t\t\tdefault:\n> \t\t\t\t\telog(ERROR, \"ExecCheckPerms: bogus operation %d\",\n> @@ -508,8 +510,9 @@\n> \t\t\tStrNCpy(rname.data,\n> \t\t\t\t\t((Form_pg_class) GETSTRUCT(htup))->relname.data,\n> \t\t\t\t\tNAMEDATALEN);\n> -\t\t\tok = ((aclcheck_result = CHECK(ACL_WR)) == ACLCHECK_OK);\n> -\t\t\topstr = \"write\";\n> +\t\t\t/* is it the right thing to do ? */\n> +\t\t\tok = ((aclcheck_result = CHECK((ACL_AP | ACL_DE | ACL_UP))) == ACLCHECK_OK);\n> +\t\t\topstr = \"write\";\t/* unused ? */\n> \t\t\tif (!ok)\n> \t\t\t\telog(ERROR, \"%s: %s\", rname.data, aclcheck_error_strings[aclcheck_result]);\n> \t\t}\n> diff -urbw postgresql-6.5.2/src/backend/parser/gram.y postgresql-6.5.2-patched/src/backend/parser/gram.y\n> --- postgresql-6.5.2/src/backend/parser/gram.y\tTue Sep 14 08:07:35 1999\n> +++ postgresql-6.5.2-patched/src/backend/parser/gram.y\tWed Mar 1 16:33:34 2000\n> @@ -1694,11 +1694,11 @@\n> \n> privileges: ALL PRIVILEGES\n> \t\t\t\t{\n> -\t\t\t\t $$ = aclmakepriv(\"rwaR\",0);\n> +\t\t\t\t $$ = aclmakepriv(\"raduR\",0);\n> \t\t\t\t}\n> \t\t| ALL\n> \t\t\t\t{\n> -\t\t\t\t $$ = aclmakepriv(\"rwaR\",0);\n> +\t\t\t\t $$ = aclmakepriv(\"raduR\",0);\n> \t\t\t\t}\n> \t\t| operation_commalist\n> \t\t\t\t{\n> @@ -1726,11 +1726,11 @@\n> \t\t\t\t}\n> \t\t| UPDATE\n> \t\t\t\t{\n> -\t\t\t\t\t\t$$ = ACL_MODE_WR_CHR;\n> +\t\t\t\t\t\t$$ = ACL_MODE_UP_CHR;\n> \t\t\t\t}\n> \t\t| DELETE\n> \t\t\t\t{\n> -\t\t\t\t\t\t$$ = ACL_MODE_WR_CHR;\n> +\t\t\t\t\t\t$$ = ACL_MODE_DE_CHR;\n> \t\t\t\t}\n> \t\t| RULE\n> \t\t\t\t{\n> diff -urbw postgresql-6.5.2/src/backend/parser/parse.h postgresql-6.5.2-patched/src/backend/parser/parse.h\n> --- postgresql-6.5.2/src/backend/parser/parse.h\tThu Sep 16 02:23:39 1999\n> +++ postgresql-6.5.2-patched/src/backend/parser/parse.h\tWed Mar 1 18:34:46 2000\n> @@ -29,236 +29,236 @@\n> \tRuleStmt\t\t\t*rstmt;\n> \tInsertStmt\t\t\t*astmt;\n> } YYSTYPE;\n> -#define\tABSOLUTE\t257\n> -#define\tACTION\t258\n> -#define\tADD\t259\n> -#define\tALL\t260\n> -#define\tALTER\t261\n> -#define\tAND\t262\n> -#define\tANY\t263\n> -#define\tAS\t264\n> -#define\tASC\t265\n> -#define\tBEGIN_TRANS\t266\n> -#define\tBETWEEN\t267\n> -#define\tBOTH\t268\n> -#define\tBY\t269\n> -#define\tCASCADE\t270\n> -#define\tCASE\t271\n> -#define\tCAST\t272\n> -#define\tCHAR\t273\n> -#define\tCHARACTER\t274\n> -#define\tCHECK\t275\n> -#define\tCLOSE\t276\n> -#define\tCOALESCE\t277\n> -#define\tCOLLATE\t278\n> -#define\tCOLUMN\t279\n> -#define\tCOMMIT\t280\n> -#define\tCONSTRAINT\t281\n> -#define\tCREATE\t282\n> -#define\tCROSS\t283\n> -#define\tCURRENT\t284\n> -#define\tCURRENT_DATE\t285\n> -#define\tCURRENT_TIME\t286\n> -#define\tCURRENT_TIMESTAMP\t287\n> -#define\tCURRENT_USER\t288\n> -#define\tCURSOR\t289\n> -#define\tDAY_P\t290\n> -#define\tDECIMAL\t291\n> -#define\tDECLARE\t292\n> -#define\tDEFAULT\t293\n> -#define\tDELETE\t294\n> -#define\tDESC\t295\n> -#define\tDISTINCT\t296\n> -#define\tDOUBLE\t297\n> -#define\tDROP\t298\n> -#define\tELSE\t299\n> -#define\tEND_TRANS\t300\n> -#define\tEXCEPT\t301\n> -#define\tEXECUTE\t302\n> -#define\tEXISTS\t303\n> -#define\tEXTRACT\t304\n> -#define\tFALSE_P\t305\n> -#define\tFETCH\t306\n> -#define\tFLOAT\t307\n> -#define\tFOR\t308\n> -#define\tFOREIGN\t309\n> -#define\tFROM\t310\n> -#define\tFULL\t311\n> -#define\tGLOBAL\t312\n> -#define\tGRANT\t313\n> -#define\tGROUP\t314\n> -#define\tHAVING\t315\n> -#define\tHOUR_P\t316\n> -#define\tIN\t317\n> -#define\tINNER_P\t318\n> -#define\tINSENSITIVE\t319\n> -#define\tINSERT\t320\n> -#define\tINTERSECT\t321\n> -#define\tINTERVAL\t322\n> -#define\tINTO\t323\n> -#define\tIS\t324\n> -#define\tISOLATION\t325\n> -#define\tJOIN\t326\n> -#define\tKEY\t327\n> -#define\tLANGUAGE\t328\n> -#define\tLEADING\t329\n> -#define\tLEFT\t330\n> -#define\tLEVEL\t331\n> -#define\tLIKE\t332\n> -#define\tLOCAL\t333\n> -#define\tMATCH\t334\n> -#define\tMINUTE_P\t335\n> -#define\tMONTH_P\t336\n> -#define\tNAMES\t337\n> -#define\tNATIONAL\t338\n> -#define\tNATURAL\t339\n> -#define\tNCHAR\t340\n> -#define\tNEXT\t341\n> -#define\tNO\t342\n> -#define\tNOT\t343\n> -#define\tNULLIF\t344\n> -#define\tNULL_P\t345\n> -#define\tNUMERIC\t346\n> -#define\tOF\t347\n> -#define\tON\t348\n> -#define\tONLY\t349\n> -#define\tOPTION\t350\n> -#define\tOR\t351\n> -#define\tORDER\t352\n> -#define\tOUTER_P\t353\n> -#define\tPARTIAL\t354\n> -#define\tPOSITION\t355\n> -#define\tPRECISION\t356\n> -#define\tPRIMARY\t357\n> -#define\tPRIOR\t358\n> -#define\tPRIVILEGES\t359\n> -#define\tPROCEDURE\t360\n> -#define\tPUBLIC\t361\n> -#define\tREAD\t362\n> -#define\tREFERENCES\t363\n> -#define\tRELATIVE\t364\n> -#define\tREVOKE\t365\n> -#define\tRIGHT\t366\n> -#define\tROLLBACK\t367\n> -#define\tSCROLL\t368\n> -#define\tSECOND_P\t369\n> -#define\tSELECT\t370\n> -#define\tSET\t371\n> -#define\tSUBSTRING\t372\n> -#define\tTABLE\t373\n> -#define\tTEMP\t374\n> -#define\tTEMPORARY\t375\n> -#define\tTHEN\t376\n> -#define\tTIME\t377\n> -#define\tTIMESTAMP\t378\n> -#define\tTIMEZONE_HOUR\t379\n> -#define\tTIMEZONE_MINUTE\t380\n> -#define\tTO\t381\n> -#define\tTRAILING\t382\n> -#define\tTRANSACTION\t383\n> -#define\tTRIM\t384\n> -#define\tTRUE_P\t385\n> -#define\tUNION\t386\n> -#define\tUNIQUE\t387\n> -#define\tUPDATE\t388\n> -#define\tUSER\t389\n> -#define\tUSING\t390\n> -#define\tVALUES\t391\n> -#define\tVARCHAR\t392\n> -#define\tVARYING\t393\n> -#define\tVIEW\t394\n> -#define\tWHEN\t395\n> -#define\tWHERE\t396\n> -#define\tWITH\t397\n> -#define\tWORK\t398\n> -#define\tYEAR_P\t399\n> -#define\tZONE\t400\n> -#define\tTRIGGER\t401\n> -#define\tCOMMITTED\t402\n> -#define\tSERIALIZABLE\t403\n> -#define\tTYPE_P\t404\n> -#define\tABORT_TRANS\t405\n> -#define\tACCESS\t406\n> -#define\tAFTER\t407\n> -#define\tAGGREGATE\t408\n> -#define\tANALYZE\t409\n> -#define\tBACKWARD\t410\n> -#define\tBEFORE\t411\n> -#define\tBINARY\t412\n> -#define\tCACHE\t413\n> -#define\tCLUSTER\t414\n> -#define\tCOPY\t415\n> -#define\tCREATEDB\t416\n> -#define\tCREATEUSER\t417\n> -#define\tCYCLE\t418\n> -#define\tDATABASE\t419\n> -#define\tDELIMITERS\t420\n> -#define\tDO\t421\n> -#define\tEACH\t422\n> -#define\tENCODING\t423\n> -#define\tEXCLUSIVE\t424\n> -#define\tEXPLAIN\t425\n> -#define\tEXTEND\t426\n> -#define\tFORWARD\t427\n> -#define\tFUNCTION\t428\n> -#define\tHANDLER\t429\n> -#define\tINCREMENT\t430\n> -#define\tINDEX\t431\n> -#define\tINHERITS\t432\n> -#define\tINSTEAD\t433\n> -#define\tISNULL\t434\n> -#define\tLANCOMPILER\t435\n> -#define\tLIMIT\t436\n> -#define\tLISTEN\t437\n> -#define\tLOAD\t438\n> -#define\tLOCATION\t439\n> -#define\tLOCK_P\t440\n> -#define\tMAXVALUE\t441\n> -#define\tMINVALUE\t442\n> -#define\tMODE\t443\n> -#define\tMOVE\t444\n> -#define\tNEW\t445\n> -#define\tNOCREATEDB\t446\n> -#define\tNOCREATEUSER\t447\n> -#define\tNONE\t448\n> -#define\tNOTHING\t449\n> -#define\tNOTIFY\t450\n> -#define\tNOTNULL\t451\n> -#define\tOFFSET\t452\n> -#define\tOIDS\t453\n> -#define\tOPERATOR\t454\n> -#define\tPASSWORD\t455\n> -#define\tPROCEDURAL\t456\n> -#define\tRENAME\t457\n> -#define\tRESET\t458\n> -#define\tRETURNS\t459\n> -#define\tROW\t460\n> -#define\tRULE\t461\n> -#define\tSEQUENCE\t462\n> -#define\tSERIAL\t463\n> -#define\tSETOF\t464\n> -#define\tSHARE\t465\n> -#define\tSHOW\t466\n> -#define\tSTART\t467\n> -#define\tSTATEMENT\t468\n> -#define\tSTDIN\t469\n> -#define\tSTDOUT\t470\n> -#define\tTRUSTED\t471\n> -#define\tUNLISTEN\t472\n> -#define\tUNTIL\t473\n> -#define\tVACUUM\t474\n> -#define\tVALID\t475\n> -#define\tVERBOSE\t476\n> -#define\tVERSION\t477\n> -#define\tIDENT\t478\n> -#define\tSCONST\t479\n> -#define\tOp\t480\n> -#define\tICONST\t481\n> -#define\tPARAM\t482\n> -#define\tFCONST\t483\n> -#define\tOP\t484\n> -#define\tUMINUS\t485\n> -#define\tTYPECAST\t486\n> +#define\tABSOLUTE\t258\n> +#define\tACTION\t259\n> +#define\tADD\t260\n> +#define\tALL\t261\n> +#define\tALTER\t262\n> +#define\tAND\t263\n> +#define\tANY\t264\n> +#define\tAS\t265\n> +#define\tASC\t266\n> +#define\tBEGIN_TRANS\t267\n> +#define\tBETWEEN\t268\n> +#define\tBOTH\t269\n> +#define\tBY\t270\n> +#define\tCASCADE\t271\n> +#define\tCASE\t272\n> +#define\tCAST\t273\n> +#define\tCHAR\t274\n> +#define\tCHARACTER\t275\n> +#define\tCHECK\t276\n> +#define\tCLOSE\t277\n> +#define\tCOALESCE\t278\n> +#define\tCOLLATE\t279\n> +#define\tCOLUMN\t280\n> +#define\tCOMMIT\t281\n> +#define\tCONSTRAINT\t282\n> +#define\tCREATE\t283\n> +#define\tCROSS\t284\n> +#define\tCURRENT\t285\n> +#define\tCURRENT_DATE\t286\n> +#define\tCURRENT_TIME\t287\n> +#define\tCURRENT_TIMESTAMP\t288\n> +#define\tCURRENT_USER\t289\n> +#define\tCURSOR\t290\n> +#define\tDAY_P\t291\n> +#define\tDECIMAL\t292\n> +#define\tDECLARE\t293\n> +#define\tDEFAULT\t294\n> +#define\tDELETE\t295\n> +#define\tDESC\t296\n> +#define\tDISTINCT\t297\n> +#define\tDOUBLE\t298\n> +#define\tDROP\t299\n> +#define\tELSE\t300\n> +#define\tEND_TRANS\t301\n> +#define\tEXCEPT\t302\n> +#define\tEXECUTE\t303\n> +#define\tEXISTS\t304\n> +#define\tEXTRACT\t305\n> +#define\tFALSE_P\t306\n> +#define\tFETCH\t307\n> +#define\tFLOAT\t308\n> +#define\tFOR\t309\n> +#define\tFOREIGN\t310\n> +#define\tFROM\t311\n> +#define\tFULL\t312\n> +#define\tGLOBAL\t313\n> +#define\tGRANT\t314\n> +#define\tGROUP\t315\n> +#define\tHAVING\t316\n> +#define\tHOUR_P\t317\n> +#define\tIN\t318\n> +#define\tINNER_P\t319\n> +#define\tINSENSITIVE\t320\n> +#define\tINSERT\t321\n> +#define\tINTERSECT\t322\n> +#define\tINTERVAL\t323\n> +#define\tINTO\t324\n> +#define\tIS\t325\n> +#define\tISOLATION\t326\n> +#define\tJOIN\t327\n> +#define\tKEY\t328\n> +#define\tLANGUAGE\t329\n> +#define\tLEADING\t330\n> +#define\tLEFT\t331\n> +#define\tLEVEL\t332\n> +#define\tLIKE\t333\n> +#define\tLOCAL\t334\n> +#define\tMATCH\t335\n> +#define\tMINUTE_P\t336\n> +#define\tMONTH_P\t337\n> +#define\tNAMES\t338\n> +#define\tNATIONAL\t339\n> +#define\tNATURAL\t340\n> +#define\tNCHAR\t341\n> +#define\tNEXT\t342\n> +#define\tNO\t343\n> +#define\tNOT\t344\n> +#define\tNULLIF\t345\n> +#define\tNULL_P\t346\n> +#define\tNUMERIC\t347\n> +#define\tOF\t348\n> +#define\tON\t349\n> +#define\tONLY\t350\n> +#define\tOPTION\t351\n> +#define\tOR\t352\n> +#define\tORDER\t353\n> +#define\tOUTER_P\t354\n> +#define\tPARTIAL\t355\n> +#define\tPOSITION\t356\n> +#define\tPRECISION\t357\n> +#define\tPRIMARY\t358\n> +#define\tPRIOR\t359\n> +#define\tPRIVILEGES\t360\n> +#define\tPROCEDURE\t361\n> +#define\tPUBLIC\t362\n> +#define\tREAD\t363\n> +#define\tREFERENCES\t364\n> +#define\tRELATIVE\t365\n> +#define\tREVOKE\t366\n> +#define\tRIGHT\t367\n> +#define\tROLLBACK\t368\n> +#define\tSCROLL\t369\n> +#define\tSECOND_P\t370\n> +#define\tSELECT\t371\n> +#define\tSET\t372\n> +#define\tSUBSTRING\t373\n> +#define\tTABLE\t374\n> +#define\tTEMP\t375\n> +#define\tTEMPORARY\t376\n> +#define\tTHEN\t377\n> +#define\tTIME\t378\n> +#define\tTIMESTAMP\t379\n> +#define\tTIMEZONE_HOUR\t380\n> +#define\tTIMEZONE_MINUTE\t381\n> +#define\tTO\t382\n> +#define\tTRAILING\t383\n> +#define\tTRANSACTION\t384\n> +#define\tTRIM\t385\n> +#define\tTRUE_P\t386\n> +#define\tUNION\t387\n> +#define\tUNIQUE\t388\n> +#define\tUPDATE\t389\n> +#define\tUSER\t390\n> +#define\tUSING\t391\n> +#define\tVALUES\t392\n> +#define\tVARCHAR\t393\n> +#define\tVARYING\t394\n> +#define\tVIEW\t395\n> +#define\tWHEN\t396\n> +#define\tWHERE\t397\n> +#define\tWITH\t398\n> +#define\tWORK\t399\n> +#define\tYEAR_P\t400\n> +#define\tZONE\t401\n> +#define\tTRIGGER\t402\n> +#define\tCOMMITTED\t403\n> +#define\tSERIALIZABLE\t404\n> +#define\tTYPE_P\t405\n> +#define\tABORT_TRANS\t406\n> +#define\tACCESS\t407\n> +#define\tAFTER\t408\n> +#define\tAGGREGATE\t409\n> +#define\tANALYZE\t410\n> +#define\tBACKWARD\t411\n> +#define\tBEFORE\t412\n> +#define\tBINARY\t413\n> +#define\tCACHE\t414\n> +#define\tCLUSTER\t415\n> +#define\tCOPY\t416\n> +#define\tCREATEDB\t417\n> +#define\tCREATEUSER\t418\n> +#define\tCYCLE\t419\n> +#define\tDATABASE\t420\n> +#define\tDELIMITERS\t421\n> +#define\tDO\t422\n> +#define\tEACH\t423\n> +#define\tENCODING\t424\n> +#define\tEXCLUSIVE\t425\n> +#define\tEXPLAIN\t426\n> +#define\tEXTEND\t427\n> +#define\tFORWARD\t428\n> +#define\tFUNCTION\t429\n> +#define\tHANDLER\t430\n> +#define\tINCREMENT\t431\n> +#define\tINDEX\t432\n> +#define\tINHERITS\t433\n> +#define\tINSTEAD\t434\n> +#define\tISNULL\t435\n> +#define\tLANCOMPILER\t436\n> +#define\tLIMIT\t437\n> +#define\tLISTEN\t438\n> +#define\tLOAD\t439\n> +#define\tLOCATION\t440\n> +#define\tLOCK_P\t441\n> +#define\tMAXVALUE\t442\n> +#define\tMINVALUE\t443\n> +#define\tMODE\t444\n> +#define\tMOVE\t445\n> +#define\tNEW\t446\n> +#define\tNOCREATEDB\t447\n> +#define\tNOCREATEUSER\t448\n> +#define\tNONE\t449\n> +#define\tNOTHING\t450\n> +#define\tNOTIFY\t451\n> +#define\tNOTNULL\t452\n> +#define\tOFFSET\t453\n> +#define\tOIDS\t454\n> +#define\tOPERATOR\t455\n> +#define\tPASSWORD\t456\n> +#define\tPROCEDURAL\t457\n> +#define\tRENAME\t458\n> +#define\tRESET\t459\n> +#define\tRETURNS\t460\n> +#define\tROW\t461\n> +#define\tRULE\t462\n> +#define\tSEQUENCE\t463\n> +#define\tSERIAL\t464\n> +#define\tSETOF\t465\n> +#define\tSHARE\t466\n> +#define\tSHOW\t467\n> +#define\tSTART\t468\n> +#define\tSTATEMENT\t469\n> +#define\tSTDIN\t470\n> +#define\tSTDOUT\t471\n> +#define\tTRUSTED\t472\n> +#define\tUNLISTEN\t473\n> +#define\tUNTIL\t474\n> +#define\tVACUUM\t475\n> +#define\tVALID\t476\n> +#define\tVERBOSE\t477\n> +#define\tVERSION\t478\n> +#define\tIDENT\t479\n> +#define\tSCONST\t480\n> +#define\tOp\t481\n> +#define\tICONST\t482\n> +#define\tPARAM\t483\n> +#define\tFCONST\t484\n> +#define\tOP\t485\n> +#define\tUMINUS\t486\n> +#define\tTYPECAST\t487\n> \n> \n> extern YYSTYPE yylval;\n> diff -urbw postgresql-6.5.2/src/backend/parser/parse_func.c postgresql-6.5.2-patched/src/backend/parser/parse_func.c\n> --- postgresql-6.5.2/src/backend/parser/parse_func.c\tFri Jun 18 00:21:40 1999\n> +++ postgresql-6.5.2-patched/src/backend/parser/parse_func.c\tWed Mar 1 16:33:53 2000\n> @@ -601,7 +601,8 @@\n> \n> \t\tif ((aclcheck_result = pg_aclcheck(seqrel, GetPgUserName(),\n> \t\t\t\t\t (((funcid == F_NEXTVAL) || (funcid == F_SETVAL)) ?\n> -\t\t\t\t\t\tACL_WR : ACL_RD)))\n> +\t\t\t\t\t\t/* if nextval and setval are atomic, which I don't know, update should be enough */\n> +\t\t\t\t\t\tACL_UP : ACL_RD)))\n> \t\t\t!= ACLCHECK_OK)\n> \t\t\telog(ERROR, \"%s.%s: %s\",\n> \t\t\t seqrel, funcname, aclcheck_error_strings[aclcheck_result]);\n> diff -urbw postgresql-6.5.2/src/backend/rewrite/locks.c postgresql-6.5.2-patched/src/backend/rewrite/locks.c\n> --- postgresql-6.5.2/src/backend/rewrite/locks.c\tSun Feb 14 00:17:44 1999\n> +++ postgresql-6.5.2-patched/src/backend/rewrite/locks.c\tWed Mar 1 16:34:20 2000\n> @@ -228,8 +228,15 @@\n> \t\t\t\t\t\tcase CMD_INSERT:\n> \t\t\t\t\t\t\treqperm = ACL_AP;\n> \t\t\t\t\t\t\tbreak;\n> +\t\t\t\t\t\tcase CMD_DELETE:\n> +\t\t\t\t\t\t\treqperm = ACL_DE;\n> +\t\t\t\t\t\t\tbreak;\n> +\t\t\t\t\t\tcase CMD_UPDATE:\n> +\t\t\t\t\t\t\treqperm = ACL_UP;\n> +\t\t\t\t\t\t\tbreak;\n> \t\t\t\t\t\tdefault:\n> -\t\t\t\t\t\t\treqperm = ACL_WR;\n> +\t\t\t\t\t\t\t/* is it The Right Thing To Do (tm) ? */\n> +\t\t\t\t\t\t\treqperm = ACL_AP | ACL_DE | ACL_UP;\n> \t\t\t\t\t\t\tbreak;\n> \t\t\t\t\t}\n> \t\t\t\telse\n> diff -urbw postgresql-6.5.2/src/backend/rewrite/rewriteHandler.c postgresql-6.5.2-patched/src/backend/rewrite/rewriteHandler.c\n> --- postgresql-6.5.2/src/backend/rewrite/rewriteHandler.c\tSun Jul 11 19:54:30 1999\n> +++ postgresql-6.5.2-patched/src/backend/rewrite/rewriteHandler.c\tWed Mar 1 16:35:01 2000\n> @@ -2282,8 +2282,15 @@\n> \t\t\t\tcase CMD_INSERT:\n> \t\t\t\t\treqperm = ACL_AP;\n> \t\t\t\t\tbreak;\n> +\t\t\t\tcase CMD_DELETE:\n> +\t\t\t\t\treqperm = ACL_DE;\n> +\t\t\t\t\tbreak;\n> +\t\t\t\tcase CMD_UPDATE:\n> +\t\t\t\t\treqperm = ACL_UP;\n> +\t\t\t\t\tbreak;\n> \t\t\t\tdefault:\n> -\t\t\t\t\treqperm = ACL_WR;\n> +\t\t\t\t\t/* is it The Right Thing To Do (tm) ? */\n> +\t\t\t\t\treqperm = ACL_AP | ACL_DE | ACL_UP;\n> \t\t\t\t\tbreak;\n> \t\t\t}\n> \n> diff -urbw postgresql-6.5.2/src/backend/storage/file/fd.c postgresql-6.5.2-patched/src/backend/storage/file/fd.c\n> diff -urbw postgresql-6.5.2/src/backend/utils/adt/acl.c postgresql-6.5.2-patched/src/backend/utils/adt/acl.c\n> --- postgresql-6.5.2/src/backend/utils/adt/acl.c\tMon Aug 2 07:24:49 1999\n> +++ postgresql-6.5.2-patched/src/backend/utils/adt/acl.c\tWed Mar 1 16:35:53 2000\n> @@ -154,8 +154,11 @@\n> \t\t\tcase ACL_MODE_RD_CHR:\n> \t\t\t\taip->ai_mode |= ACL_RD;\n> \t\t\t\tbreak;\n> -\t\t\tcase ACL_MODE_WR_CHR:\n> -\t\t\t\taip->ai_mode |= ACL_WR;\n> +\t\t\tcase ACL_MODE_DE_CHR:\n> +\t\t\t\taip->ai_mode |= ACL_DE;\n> +\t\t\t\tbreak;\n> +\t\t\tcase ACL_MODE_UP_CHR:\n> +\t\t\t\taip->ai_mode |= ACL_UP;\n> \t\t\t\tbreak;\n> \t\t\tcase ACL_MODE_RU_CHR:\n> \t\t\t\taip->ai_mode |= ACL_RU;\n> @@ -272,7 +275,7 @@\n> \tif (!aip)\n> \t\taip = &default_aclitem;\n> \n> -\tp = out = palloc(strlen(\"group =arwR \") + 1 + NAMEDATALEN);\n> +\tp = out = palloc(strlen(\"group =arRdu \") + 1 + NAMEDATALEN);\n> \tif (!out)\n> \t\telog(ERROR, \"aclitemout: palloc failed\");\n> \t*p = '\\0';\n> @@ -605,9 +608,8 @@\n> \tint\t\t\ti;\n> \tint\t\t\tl;\n> \n> -\tAssert(strlen(old_privlist) < 5);\n> -\tpriv = palloc(5); /* at most \"rwaR\" */ ;\n> -\n> +\tAssert(strlen(old_privlist) < 6);\n> +\tpriv = palloc(6); /* at most \"arduR\" */ ;\n> \tif (old_privlist == NULL || old_privlist[0] == '\\0')\n> \t{\n> \t\tpriv[0] = new_priv;\n> @@ -619,7 +621,7 @@\n> \n> \tl = strlen(old_privlist);\n> \n> -\tif (l == 4)\n> +\tif (l == 5)\n> \t{\t\t\t\t\t\t\t/* can't add any more privileges */\n> \t\treturn priv;\n> \t}\n> diff -urbw postgresql-6.5.2/src/include/utils/acl.h postgresql-6.5.2-patched/src/include/utils/acl.h\n> --- postgresql-6.5.2/src/include/utils/acl.h\tFri Jul 30 19:07:22 1999\n> +++ postgresql-6.5.2-patched/src/include/utils/acl.h\tWed Mar 1 16:40:50 2000\n> @@ -54,9 +54,10 @@\n> #define ACL_NO\t\t\t0\t\t/* no permissions */\n> #define ACL_AP\t\t\t(1<<0)\t/* append */\n> #define ACL_RD\t\t\t(1<<1)\t/* read */\n> -#define ACL_WR\t\t\t(1<<2)\t/* write (append/delete/replace) */\n> -#define ACL_RU\t\t\t(1<<3)\t/* place rules */\n> -#define N_ACL_MODES\t\t4\n> +#define ACL_DE\t\t\t(1<<2)\t/* delete */\n> +#define ACL_UP\t\t\t(1<<3)\t/* update/replace */\n> +#define ACL_RU\t\t\t(1<<4)\t/* place rules */\n> +#define N_ACL_MODES\t\t5\n> \n> #define ACL_MODECHG_ADD\t\t\t1\n> #define ACL_MODECHG_DEL\t\t\t2\n> @@ -65,7 +66,8 @@\n> /* change this line if you want to set the default acl permission */\n> #define ACL_WORLD_DEFAULT\t\t(ACL_NO)\n> /* #define\t\tACL_WORLD_DEFAULT\t\t(ACL_RD|ACL_WR|ACL_AP|ACL_RU) */\n> -#define ACL_OWNER_DEFAULT\t\t(ACL_RD|ACL_WR|ACL_AP|ACL_RU)\n> +\n> +#define ACL_OWNER_DEFAULT\t\t(ACL_AP|ACL_RD|ACL_RU|ACL_DE|ACL_UP)\n> \n> /*\n> * AclItem\n> @@ -118,10 +120,12 @@\n> #define ACL_MODECHG_ADD_CHR\t\t'+'\n> #define ACL_MODECHG_DEL_CHR\t\t'-'\n> #define ACL_MODECHG_EQL_CHR\t\t'='\n> -#define ACL_MODE_STR\t\t\t\"arwR\"\t/* list of valid characters */\n> +\n> +#define ACL_MODE_STR\t\t\t\"arduR\"\t /* list of valid characters */\n> #define ACL_MODE_AP_CHR\t\t\t'a'\n> #define ACL_MODE_RD_CHR\t\t\t'r'\n> -#define ACL_MODE_WR_CHR\t\t\t'w'\n> +#define ACL_MODE_DE_CHR\t\t\t'd'\n> +#define ACL_MODE_UP_CHR\t\t\t'u'\n> #define ACL_MODE_RU_CHR\t\t\t'R'\n> \n> /* result codes for pg_aclcheck */\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 11:56:11 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: grant/revoke bug with delete/update" }, { "msg_contents": "On Fri, 9 Jun 2000, Bruce Momjian wrote:\n\n> Are we addressing this?\n\nYes, please do.\n\nAnd please don't forget the following: \n\nwhen dropping an user postgresql (actually the superuser must do it\nmanually) should first revoke all user's permissions on all databases,\nbecause the deleted userid is reused on the next create user so the new\nuser inherits all permissions from the deleted user => may be very very\nbad (an example of what can be done is not necessary I suppose ?)\n\n> > And for the bug report I posted on Feb 23rd on \"drop user\" which keeps the\n> > user's acl in the database, and the deleted user id being reused, I've not\n> > done anything, but I consider this a major problem. Please consider it for\n> > a next version.\n\nbye,\nJerome ALET - [email protected] - http://cortex.unice.fr/~jerome\nFaculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 \n28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE\n\n\n", "msg_date": "Tue, 13 Jun 2000 09:20:26 +0200 (MET DST)", "msg_from": "Jerome Alet <[email protected]>", "msg_from_op": false, "msg_subject": "Re: grant/revoke bug with delete/update" }, { "msg_contents": "OK, this was a good point. Were did we leave this, folks?\n\n\n> Hi,\n> \n> first I'm sorry to not fill the form, I'm too lazy, and it's not platform\n> nor version dependent AFAIK.\n> \n> I recently posted a question (on Feb 23rd) to pgsql-sql concerning the\n> fact that update and insert are considered the same thing when you modify\n> permissions with grant and revoke. (Maybe it was the wrong place to post\n> it.)\n> \n> for example a \"grant delete\" also grants \"update\" which is completely\n> wrong. More importantly the user is not informed, and this could lead to\n> VERY IMPORTANT SECURITY PROBLEMS, like someone who should only be able to\n> update existing records, have the permission to delete all records... \n> \n> I've read postgresql documentation, especially the grant and revoke\n> manpages, and I've found no mention of this bug, which is IMHO a Big\n> Mistake (tm).\n> \n> attached to this message you'll find a patch for version 6.5.2 wich\n> differentiate delete and update, because before they were considered as\n> \"write\". The patch only modifies .c .y and .h files, but no documentation.\n> \n> the new acl rights look like: arRdu \n> a for append\n> r for read\n> R for rules\n> d for delete\n> u for update\n> \n> instead of: arwR\n> a for append\n> r for read\n> w for update AND delete\n> R for rules\n> \n> This patch seems to work at least with what I've tested, you'll find a\n> test session at the end of this message.\n> \n> I hope this patch will help and that it will be easy to incorporate it in\n> 7.0, which I haven't the time to do for now. \n> \n> And for the bug report I posted on Feb 23rd on \"drop user\" which keeps the\n> user's acl in the database, and the deleted user id being reused, I've not\n> done anything, but I consider this a major problem. Please consider it for\n> a next version.\n> \n> Because I'm not an expert, I suggest you remove gram.c before applying the\n> patch, in order for this file to be generated again from gram.y, but maybe\n> this is not necessary.\n> \n> I'd be very pleased if some people could test this more than I can,\n> because I don't use postgresql intensively with special permissions.\n> \n> I'm not sure for some parts of the patch, especially in execMain.c\n> so if a postgresql hacker could examine it, this would be fine.\n> \n> dump of test session:\n> ---------------------\n> \n> ------- CUT -------\n> \n> template1=> create database db;\n> CREATEDB\n> template1=> create user john;\n> CREATE USER\n> template1=> \\connect db\n> connecting to new database: db\n> db=> create table t (id INT4, name TEXT);\n> CREATE\n> db=> \\z\n> Database = db\n> +----------+--------------------------+\n> | Relation | Grant/Revoke Permissions |\n> +----------+--------------------------+\n> | t | |\n> +----------+--------------------------+\n> db=> grant all on t to john;\n> CHANGE\n> db=> \\z\n> Database = db\n> +----------+--------------------------+\n> | Relation | Grant/Revoke Permissions |\n> +----------+--------------------------+\n> | t | {\"=\",\"john=arduR\"} |\n> +----------+--------------------------+\n> db=> \\connect db john\n> connecting to new database: db as user: john\n> db=> insert into t (id, name) values (1, 'xxx');\n> INSERT 18560 1\n> db=> update t set name = 'yyy' where id=1;\n> UPDATE 1\n> db=> select * from t;\n> id|name\n> --+----\n> 1|yyy\n> (1 row)\n> \n> db=> delete from t;\n> DELETE 1\n> db=> select * from t;\n> id|name\n> --+----\n> (0 rows)\n> \n> db=> insert into t (id, name) values (1, 'xxx');\n> INSERT 18561 1\n> db=> \\connect db postgres\n> connecting to new database: db as user: postgres\n> db=> revoke update on t from john;\n> CHANGE\n> db=> \\z\n> Database = db\n> +----------+--------------------------+\n> | Relation | Grant/Revoke Permissions |\n> +----------+--------------------------+\n> | t | {\"=\",\"john=ardR\"} |\n> +----------+--------------------------+\n> db=> \\connect db john;\n> connecting to new database: db as user: john\n> db=> insert into t (id, name) values (2, 'yyy');\n> INSERT 18592 1\n> db=> update t set name='modified by john' where id=2;\n> ERROR: t: Permission denied.\n> db=> delete from t where id=2;\n> DELETE 1\n> db=> select * from t;\n> id|name\n> --+----\n> 1|xxx\n> (1 row)\n> \n> db=> \\connect db postgres\n> connecting to new database: db as user: postgres\n> db=> revoke insert on t from john;\n> CHANGE\n> db=> \\connect db john;\n> connecting to new database: db as user: john\n> db=> \\z\n> Database = db\n> +----------+--------------------------+\n> | Relation | Grant/Revoke Permissions |\n> +----------+--------------------------+\n> | t | {\"=\",\"john=rdR\"} |\n> +----------+--------------------------+\n> db=> insert into t (id, name) values (3, 'I try to insert something');\n> ERROR: t: Permission denied.\n> db=> delete from t;\n> DELETE 1\n> db=> select * from t;\n> id|name\n> --+----\n> (0 rows)\n> \n> db=> \\connect db postgres\n> connecting to new database: db as user: postgres\n> db=> insert into t (id, name) values (1, 'xxx');\n> INSERT 18624 1\n> db=> \\connect db john;\n> connecting to new database: db as user: john\n> db=> update t set name='john' where id =1;\n> ERROR: t: Permission denied.\n> db=> \\connect db postgres\n> connecting to new database: db as user: postgres\n> db=> revoke delete on t from john;\n> CHANGE\n> db=> grant update on t to john;\n> CHANGE\n> db=> \\connect db john;\n> connecting to new database: db as user: john\n> db=> delete from t;\n> ERROR: t: Permission denied.\n> db=> update t set name='john' where id=1;\n> UPDATE 1\n> db=> select * from t;\n> id|name\n> --+----\n> 1|john\n> (1 row)\n> \n> ------- CUT -------\n> \n> Thank you for reading.\n> \n> bye,\n> \n> Jerome ALET - [email protected] - http://cortex.unice.fr/~jerome\n> Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 \n> 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE\nContent-Description: the 6.5.2 patch\n\n> diff -urbw postgresql-6.5.2/src/backend/catalog/aclchk.c postgresql-6.5.2-patched/src/backend/catalog/aclchk.c\n> --- postgresql-6.5.2/src/backend/catalog/aclchk.c\tMon Aug 2 07:56:53 1999\n> +++ postgresql-6.5.2-patched/src/backend/catalog/aclchk.c\tWed Mar 1 16:39:44 2000\n> @@ -381,7 +381,7 @@\n> \t\t * pg_database table, there is still additional permissions\n> \t\t * checking in dbcommands.c\n> \t\t */\n> -\t\tif ((mode & ACL_WR) || (mode & ACL_AP))\n> +\t\tif (mode & ACL_AP)\n> \t\t\treturn ACLCHECK_OK;\n> \t}\n> \n> @@ -390,7 +390,7 @@\n> \t * pg_shadow.usecatupd is set.\t(This is to let superusers protect\n> \t * themselves from themselves.)\n> \t */\n> -\tif (((mode & ACL_WR) || (mode & ACL_AP)) &&\n> +\tif ((mode & ACL_AP) &&\n> \t\t!allowSystemTableMods && IsSystemRelationName(relname) &&\n> \t\t!((Form_pg_shadow) GETSTRUCT(tuple))->usecatupd)\n> \t{\n> diff -urbw postgresql-6.5.2/src/backend/commands/command.c postgresql-6.5.2-patched/src/backend/commands/command.c\n> --- postgresql-6.5.2/src/backend/commands/command.c\tMon Aug 2 07:56:57 1999\n> +++ postgresql-6.5.2-patched/src/backend/commands/command.c\tWed Mar 1 16:30:23 2000\n> @@ -524,7 +524,9 @@\n> \tif (lockstmt->mode == AccessShareLock)\n> \t\taclresult = pg_aclcheck(lockstmt->relname, GetPgUserName(), ACL_RD);\n> \telse\n> -\t\taclresult = pg_aclcheck(lockstmt->relname, GetPgUserName(), ACL_WR);\n> +\t\t/* do we really need to have all these permissions at the same time ? */\n> +\t\t/* shouldn't we test lockstmt->mode first ? */\n> +\t\taclresult = pg_aclcheck(lockstmt->relname, GetPgUserName(), (ACL_AP | ACL_DE | ACL_UP));\n> \n> \tif (aclresult != ACLCHECK_OK)\n> \t\telog(ERROR, \"LOCK TABLE: permission denied\");\n> diff -urbw postgresql-6.5.2/src/backend/commands/copy.c postgresql-6.5.2-patched/src/backend/commands/copy.c\n> --- postgresql-6.5.2/src/backend/commands/copy.c\tSat Jul 3 02:32:39 1999\n> +++ postgresql-6.5.2-patched/src/backend/commands/copy.c\tWed Mar 1 16:30:35 2000\n> @@ -242,7 +242,8 @@\n> \tFILE\t *fp;\n> \tRelation\trel;\n> \textern char *UserName;\t\t/* defined in global.c */\n> -\tconst AclMode required_access = from ? ACL_WR : ACL_RD;\n> +\t/* why should we need other permissions than APPEND ? */\n> +\tconst AclMode required_access = from ? ACL_AP : ACL_RD;\n> \tint\t\t\tresult;\n> \n> \trel = heap_openr(relname);\n> diff -urbw postgresql-6.5.2/src/backend/commands/sequence.c postgresql-6.5.2-patched/src/backend/commands/sequence.c\n> --- postgresql-6.5.2/src/backend/commands/sequence.c\tMon Aug 2 07:56:59 1999\n> +++ postgresql-6.5.2-patched/src/backend/commands/sequence.c\tWed Mar 1 16:31:05 2000\n> @@ -314,7 +314,8 @@\n> \tForm_pg_sequence seq;\n> \n> #ifndef NO_SECURITY\n> -\tif (pg_aclcheck(seqname, getpgusername(), ACL_WR) != ACLCHECK_OK)\n> +\t/* why should we need more than UPDATE permission ? */\n> +\tif (pg_aclcheck(seqname, getpgusername(), ACL_UP) != ACLCHECK_OK)\n> \t\telog(ERROR, \"%s.setval: you don't have permissions to set sequence %s\",\n> \t\t\t seqname, seqname);\n> #endif\n> diff -urbw postgresql-6.5.2/src/backend/commands/user.c postgresql-6.5.2-patched/src/backend/commands/user.c\n> --- postgresql-6.5.2/src/backend/commands/user.c\tMon Aug 2 07:56:59 1999\n> +++ postgresql-6.5.2-patched/src/backend/commands/user.c\tWed Mar 1 16:31:38 2000\n> @@ -115,7 +115,7 @@\n> \t * pg_shadow relation.\n> \t */\n> \tpg_shadow = GetPgUserName();\n> -\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_WR | ACL_AP) != ACLCHECK_OK)\n> +\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_AP | ACL_DE | ACL_UP) != ACLCHECK_OK)\n> \t{\n> \t\tUserAbortTransactionBlock();\n> \t\telog(ERROR, \"defineUser: user \\\"%s\\\" does not have SELECT and INSERT privilege for \\\"%s\\\"\",\n> @@ -227,7 +227,8 @@\n> \t * pg_shadow relation.\n> \t */\n> \tpg_shadow = GetPgUserName();\n> -\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_WR) != ACLCHECK_OK)\n> +\t/* why should we need more than UPDATE ? */\n> +\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_UP) != ACLCHECK_OK)\n> \t{\n> \t\tUserAbortTransactionBlock();\n> \t\telog(ERROR, \"alterUser: user \\\"%s\\\" does not have SELECT and UPDATE privilege for \\\"%s\\\"\",\n> @@ -329,11 +330,12 @@\n> \t\tBeginTransactionBlock();\n> \n> \t/*\n> -\t * Make sure the user attempting to create a user can delete from the\n> +\t * Make sure the user attempting to delete a user can delete from the\n> \t * pg_shadow relation.\n> \t */\n> \tpg_shadow = GetPgUserName();\n> -\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_WR) != ACLCHECK_OK)\n> +\t/* why should we need more than DELETE ? */\n> +\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_DE) != ACLCHECK_OK)\n> \t{\n> \t\tUserAbortTransactionBlock();\n> \t\telog(ERROR, \"removeUser: user \\\"%s\\\" does not have SELECT and DELETE privilege for \\\"%s\\\"\",\n> diff -urbw postgresql-6.5.2/src/backend/executor/execMain.c postgresql-6.5.2-patched/src/backend/executor/execMain.c\n> --- postgresql-6.5.2/src/backend/executor/execMain.c\tThu Jun 17 17:15:49 1999\n> +++ postgresql-6.5.2-patched/src/backend/executor/execMain.c\tWed Mar 1 18:31:31 2000\n> @@ -464,14 +464,16 @@\n> \t\t\tswitch (operation)\n> \t\t\t{\n> \t\t\t\tcase CMD_INSERT:\n> -\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_AP)) == ACLCHECK_OK) ||\n> -\t\t\t\t\t\t((aclcheck_result = CHECK(ACL_WR)) == ACLCHECK_OK);\n> +\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_AP)) == ACLCHECK_OK);\n> \t\t\t\t\topstr = \"append\";\n> \t\t\t\t\tbreak;\n> \t\t\t\tcase CMD_DELETE:\n> +\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_DE)) == ACLCHECK_OK);\n> +\t\t\t\t\topstr = \"delete\";\n> +\t\t\t\t\tbreak;\n> \t\t\t\tcase CMD_UPDATE:\n> -\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_WR)) == ACLCHECK_OK);\n> -\t\t\t\t\topstr = \"write\";\n> +\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_UP)) == ACLCHECK_OK);\n> +\t\t\t\t\topstr = \"update\";\n> \t\t\t\t\tbreak;\n> \t\t\t\tdefault:\n> \t\t\t\t\telog(ERROR, \"ExecCheckPerms: bogus operation %d\",\n> @@ -508,8 +510,9 @@\n> \t\t\tStrNCpy(rname.data,\n> \t\t\t\t\t((Form_pg_class) GETSTRUCT(htup))->relname.data,\n> \t\t\t\t\tNAMEDATALEN);\n> -\t\t\tok = ((aclcheck_result = CHECK(ACL_WR)) == ACLCHECK_OK);\n> -\t\t\topstr = \"write\";\n> +\t\t\t/* is it the right thing to do ? */\n> +\t\t\tok = ((aclcheck_result = CHECK((ACL_AP | ACL_DE | ACL_UP))) == ACLCHECK_OK);\n> +\t\t\topstr = \"write\";\t/* unused ? */\n> \t\t\tif (!ok)\n> \t\t\t\telog(ERROR, \"%s: %s\", rname.data, aclcheck_error_strings[aclcheck_result]);\n> \t\t}\n> diff -urbw postgresql-6.5.2/src/backend/parser/gram.y postgresql-6.5.2-patched/src/backend/parser/gram.y\n> --- postgresql-6.5.2/src/backend/parser/gram.y\tTue Sep 14 08:07:35 1999\n> +++ postgresql-6.5.2-patched/src/backend/parser/gram.y\tWed Mar 1 16:33:34 2000\n> @@ -1694,11 +1694,11 @@\n> \n> privileges: ALL PRIVILEGES\n> \t\t\t\t{\n> -\t\t\t\t $$ = aclmakepriv(\"rwaR\",0);\n> +\t\t\t\t $$ = aclmakepriv(\"raduR\",0);\n> \t\t\t\t}\n> \t\t| ALL\n> \t\t\t\t{\n> -\t\t\t\t $$ = aclmakepriv(\"rwaR\",0);\n> +\t\t\t\t $$ = aclmakepriv(\"raduR\",0);\n> \t\t\t\t}\n> \t\t| operation_commalist\n> \t\t\t\t{\n> @@ -1726,11 +1726,11 @@\n> \t\t\t\t}\n> \t\t| UPDATE\n> \t\t\t\t{\n> -\t\t\t\t\t\t$$ = ACL_MODE_WR_CHR;\n> +\t\t\t\t\t\t$$ = ACL_MODE_UP_CHR;\n> \t\t\t\t}\n> \t\t| DELETE\n> \t\t\t\t{\n> -\t\t\t\t\t\t$$ = ACL_MODE_WR_CHR;\n> +\t\t\t\t\t\t$$ = ACL_MODE_DE_CHR;\n> \t\t\t\t}\n> \t\t| RULE\n> \t\t\t\t{\n> diff -urbw postgresql-6.5.2/src/backend/parser/parse.h postgresql-6.5.2-patched/src/backend/parser/parse.h\n> --- postgresql-6.5.2/src/backend/parser/parse.h\tThu Sep 16 02:23:39 1999\n> +++ postgresql-6.5.2-patched/src/backend/parser/parse.h\tWed Mar 1 18:34:46 2000\n> @@ -29,236 +29,236 @@\n> \tRuleStmt\t\t\t*rstmt;\n> \tInsertStmt\t\t\t*astmt;\n> } YYSTYPE;\n> -#define\tABSOLUTE\t257\n> -#define\tACTION\t258\n> -#define\tADD\t259\n> -#define\tALL\t260\n> -#define\tALTER\t261\n> -#define\tAND\t262\n> -#define\tANY\t263\n> -#define\tAS\t264\n> -#define\tASC\t265\n> -#define\tBEGIN_TRANS\t266\n> -#define\tBETWEEN\t267\n> -#define\tBOTH\t268\n> -#define\tBY\t269\n> -#define\tCASCADE\t270\n> -#define\tCASE\t271\n> -#define\tCAST\t272\n> -#define\tCHAR\t273\n> -#define\tCHARACTER\t274\n> -#define\tCHECK\t275\n> -#define\tCLOSE\t276\n> -#define\tCOALESCE\t277\n> -#define\tCOLLATE\t278\n> -#define\tCOLUMN\t279\n> -#define\tCOMMIT\t280\n> -#define\tCONSTRAINT\t281\n> -#define\tCREATE\t282\n> -#define\tCROSS\t283\n> -#define\tCURRENT\t284\n> -#define\tCURRENT_DATE\t285\n> -#define\tCURRENT_TIME\t286\n> -#define\tCURRENT_TIMESTAMP\t287\n> -#define\tCURRENT_USER\t288\n> -#define\tCURSOR\t289\n> -#define\tDAY_P\t290\n> -#define\tDECIMAL\t291\n> -#define\tDECLARE\t292\n> -#define\tDEFAULT\t293\n> -#define\tDELETE\t294\n> -#define\tDESC\t295\n> -#define\tDISTINCT\t296\n> -#define\tDOUBLE\t297\n> -#define\tDROP\t298\n> -#define\tELSE\t299\n> -#define\tEND_TRANS\t300\n> -#define\tEXCEPT\t301\n> -#define\tEXECUTE\t302\n> -#define\tEXISTS\t303\n> -#define\tEXTRACT\t304\n> -#define\tFALSE_P\t305\n> -#define\tFETCH\t306\n> -#define\tFLOAT\t307\n> -#define\tFOR\t308\n> -#define\tFOREIGN\t309\n> -#define\tFROM\t310\n> -#define\tFULL\t311\n> -#define\tGLOBAL\t312\n> -#define\tGRANT\t313\n> -#define\tGROUP\t314\n> -#define\tHAVING\t315\n> -#define\tHOUR_P\t316\n> -#define\tIN\t317\n> -#define\tINNER_P\t318\n> -#define\tINSENSITIVE\t319\n> -#define\tINSERT\t320\n> -#define\tINTERSECT\t321\n> -#define\tINTERVAL\t322\n> -#define\tINTO\t323\n> -#define\tIS\t324\n> -#define\tISOLATION\t325\n> -#define\tJOIN\t326\n> -#define\tKEY\t327\n> -#define\tLANGUAGE\t328\n> -#define\tLEADING\t329\n> -#define\tLEFT\t330\n> -#define\tLEVEL\t331\n> -#define\tLIKE\t332\n> -#define\tLOCAL\t333\n> -#define\tMATCH\t334\n> -#define\tMINUTE_P\t335\n> -#define\tMONTH_P\t336\n> -#define\tNAMES\t337\n> -#define\tNATIONAL\t338\n> -#define\tNATURAL\t339\n> -#define\tNCHAR\t340\n> -#define\tNEXT\t341\n> -#define\tNO\t342\n> -#define\tNOT\t343\n> -#define\tNULLIF\t344\n> -#define\tNULL_P\t345\n> -#define\tNUMERIC\t346\n> -#define\tOF\t347\n> -#define\tON\t348\n> -#define\tONLY\t349\n> -#define\tOPTION\t350\n> -#define\tOR\t351\n> -#define\tORDER\t352\n> -#define\tOUTER_P\t353\n> -#define\tPARTIAL\t354\n> -#define\tPOSITION\t355\n> -#define\tPRECISION\t356\n> -#define\tPRIMARY\t357\n> -#define\tPRIOR\t358\n> -#define\tPRIVILEGES\t359\n> -#define\tPROCEDURE\t360\n> -#define\tPUBLIC\t361\n> -#define\tREAD\t362\n> -#define\tREFERENCES\t363\n> -#define\tRELATIVE\t364\n> -#define\tREVOKE\t365\n> -#define\tRIGHT\t366\n> -#define\tROLLBACK\t367\n> -#define\tSCROLL\t368\n> -#define\tSECOND_P\t369\n> -#define\tSELECT\t370\n> -#define\tSET\t371\n> -#define\tSUBSTRING\t372\n> -#define\tTABLE\t373\n> -#define\tTEMP\t374\n> -#define\tTEMPORARY\t375\n> -#define\tTHEN\t376\n> -#define\tTIME\t377\n> -#define\tTIMESTAMP\t378\n> -#define\tTIMEZONE_HOUR\t379\n> -#define\tTIMEZONE_MINUTE\t380\n> -#define\tTO\t381\n> -#define\tTRAILING\t382\n> -#define\tTRANSACTION\t383\n> -#define\tTRIM\t384\n> -#define\tTRUE_P\t385\n> -#define\tUNION\t386\n> -#define\tUNIQUE\t387\n> -#define\tUPDATE\t388\n> -#define\tUSER\t389\n> -#define\tUSING\t390\n> -#define\tVALUES\t391\n> -#define\tVARCHAR\t392\n> -#define\tVARYING\t393\n> -#define\tVIEW\t394\n> -#define\tWHEN\t395\n> -#define\tWHERE\t396\n> -#define\tWITH\t397\n> -#define\tWORK\t398\n> -#define\tYEAR_P\t399\n> -#define\tZONE\t400\n> -#define\tTRIGGER\t401\n> -#define\tCOMMITTED\t402\n> -#define\tSERIALIZABLE\t403\n> -#define\tTYPE_P\t404\n> -#define\tABORT_TRANS\t405\n> -#define\tACCESS\t406\n> -#define\tAFTER\t407\n> -#define\tAGGREGATE\t408\n> -#define\tANALYZE\t409\n> -#define\tBACKWARD\t410\n> -#define\tBEFORE\t411\n> -#define\tBINARY\t412\n> -#define\tCACHE\t413\n> -#define\tCLUSTER\t414\n> -#define\tCOPY\t415\n> -#define\tCREATEDB\t416\n> -#define\tCREATEUSER\t417\n> -#define\tCYCLE\t418\n> -#define\tDATABASE\t419\n> -#define\tDELIMITERS\t420\n> -#define\tDO\t421\n> -#define\tEACH\t422\n> -#define\tENCODING\t423\n> -#define\tEXCLUSIVE\t424\n> -#define\tEXPLAIN\t425\n> -#define\tEXTEND\t426\n> -#define\tFORWARD\t427\n> -#define\tFUNCTION\t428\n> -#define\tHANDLER\t429\n> -#define\tINCREMENT\t430\n> -#define\tINDEX\t431\n> -#define\tINHERITS\t432\n> -#define\tINSTEAD\t433\n> -#define\tISNULL\t434\n> -#define\tLANCOMPILER\t435\n> -#define\tLIMIT\t436\n> -#define\tLISTEN\t437\n> -#define\tLOAD\t438\n> -#define\tLOCATION\t439\n> -#define\tLOCK_P\t440\n> -#define\tMAXVALUE\t441\n> -#define\tMINVALUE\t442\n> -#define\tMODE\t443\n> -#define\tMOVE\t444\n> -#define\tNEW\t445\n> -#define\tNOCREATEDB\t446\n> -#define\tNOCREATEUSER\t447\n> -#define\tNONE\t448\n> -#define\tNOTHING\t449\n> -#define\tNOTIFY\t450\n> -#define\tNOTNULL\t451\n> -#define\tOFFSET\t452\n> -#define\tOIDS\t453\n> -#define\tOPERATOR\t454\n> -#define\tPASSWORD\t455\n> -#define\tPROCEDURAL\t456\n> -#define\tRENAME\t457\n> -#define\tRESET\t458\n> -#define\tRETURNS\t459\n> -#define\tROW\t460\n> -#define\tRULE\t461\n> -#define\tSEQUENCE\t462\n> -#define\tSERIAL\t463\n> -#define\tSETOF\t464\n> -#define\tSHARE\t465\n> -#define\tSHOW\t466\n> -#define\tSTART\t467\n> -#define\tSTATEMENT\t468\n> -#define\tSTDIN\t469\n> -#define\tSTDOUT\t470\n> -#define\tTRUSTED\t471\n> -#define\tUNLISTEN\t472\n> -#define\tUNTIL\t473\n> -#define\tVACUUM\t474\n> -#define\tVALID\t475\n> -#define\tVERBOSE\t476\n> -#define\tVERSION\t477\n> -#define\tIDENT\t478\n> -#define\tSCONST\t479\n> -#define\tOp\t480\n> -#define\tICONST\t481\n> -#define\tPARAM\t482\n> -#define\tFCONST\t483\n> -#define\tOP\t484\n> -#define\tUMINUS\t485\n> -#define\tTYPECAST\t486\n> +#define\tABSOLUTE\t258\n> +#define\tACTION\t259\n> +#define\tADD\t260\n> +#define\tALL\t261\n> +#define\tALTER\t262\n> +#define\tAND\t263\n> +#define\tANY\t264\n> +#define\tAS\t265\n> +#define\tASC\t266\n> +#define\tBEGIN_TRANS\t267\n> +#define\tBETWEEN\t268\n> +#define\tBOTH\t269\n> +#define\tBY\t270\n> +#define\tCASCADE\t271\n> +#define\tCASE\t272\n> +#define\tCAST\t273\n> +#define\tCHAR\t274\n> +#define\tCHARACTER\t275\n> +#define\tCHECK\t276\n> +#define\tCLOSE\t277\n> +#define\tCOALESCE\t278\n> +#define\tCOLLATE\t279\n> +#define\tCOLUMN\t280\n> +#define\tCOMMIT\t281\n> +#define\tCONSTRAINT\t282\n> +#define\tCREATE\t283\n> +#define\tCROSS\t284\n> +#define\tCURRENT\t285\n> +#define\tCURRENT_DATE\t286\n> +#define\tCURRENT_TIME\t287\n> +#define\tCURRENT_TIMESTAMP\t288\n> +#define\tCURRENT_USER\t289\n> +#define\tCURSOR\t290\n> +#define\tDAY_P\t291\n> +#define\tDECIMAL\t292\n> +#define\tDECLARE\t293\n> +#define\tDEFAULT\t294\n> +#define\tDELETE\t295\n> +#define\tDESC\t296\n> +#define\tDISTINCT\t297\n> +#define\tDOUBLE\t298\n> +#define\tDROP\t299\n> +#define\tELSE\t300\n> +#define\tEND_TRANS\t301\n> +#define\tEXCEPT\t302\n> +#define\tEXECUTE\t303\n> +#define\tEXISTS\t304\n> +#define\tEXTRACT\t305\n> +#define\tFALSE_P\t306\n> +#define\tFETCH\t307\n> +#define\tFLOAT\t308\n> +#define\tFOR\t309\n> +#define\tFOREIGN\t310\n> +#define\tFROM\t311\n> +#define\tFULL\t312\n> +#define\tGLOBAL\t313\n> +#define\tGRANT\t314\n> +#define\tGROUP\t315\n> +#define\tHAVING\t316\n> +#define\tHOUR_P\t317\n> +#define\tIN\t318\n> +#define\tINNER_P\t319\n> +#define\tINSENSITIVE\t320\n> +#define\tINSERT\t321\n> +#define\tINTERSECT\t322\n> +#define\tINTERVAL\t323\n> +#define\tINTO\t324\n> +#define\tIS\t325\n> +#define\tISOLATION\t326\n> +#define\tJOIN\t327\n> +#define\tKEY\t328\n> +#define\tLANGUAGE\t329\n> +#define\tLEADING\t330\n> +#define\tLEFT\t331\n> +#define\tLEVEL\t332\n> +#define\tLIKE\t333\n> +#define\tLOCAL\t334\n> +#define\tMATCH\t335\n> +#define\tMINUTE_P\t336\n> +#define\tMONTH_P\t337\n> +#define\tNAMES\t338\n> +#define\tNATIONAL\t339\n> +#define\tNATURAL\t340\n> +#define\tNCHAR\t341\n> +#define\tNEXT\t342\n> +#define\tNO\t343\n> +#define\tNOT\t344\n> +#define\tNULLIF\t345\n> +#define\tNULL_P\t346\n> +#define\tNUMERIC\t347\n> +#define\tOF\t348\n> +#define\tON\t349\n> +#define\tONLY\t350\n> +#define\tOPTION\t351\n> +#define\tOR\t352\n> +#define\tORDER\t353\n> +#define\tOUTER_P\t354\n> +#define\tPARTIAL\t355\n> +#define\tPOSITION\t356\n> +#define\tPRECISION\t357\n> +#define\tPRIMARY\t358\n> +#define\tPRIOR\t359\n> +#define\tPRIVILEGES\t360\n> +#define\tPROCEDURE\t361\n> +#define\tPUBLIC\t362\n> +#define\tREAD\t363\n> +#define\tREFERENCES\t364\n> +#define\tRELATIVE\t365\n> +#define\tREVOKE\t366\n> +#define\tRIGHT\t367\n> +#define\tROLLBACK\t368\n> +#define\tSCROLL\t369\n> +#define\tSECOND_P\t370\n> +#define\tSELECT\t371\n> +#define\tSET\t372\n> +#define\tSUBSTRING\t373\n> +#define\tTABLE\t374\n> +#define\tTEMP\t375\n> +#define\tTEMPORARY\t376\n> +#define\tTHEN\t377\n> +#define\tTIME\t378\n> +#define\tTIMESTAMP\t379\n> +#define\tTIMEZONE_HOUR\t380\n> +#define\tTIMEZONE_MINUTE\t381\n> +#define\tTO\t382\n> +#define\tTRAILING\t383\n> +#define\tTRANSACTION\t384\n> +#define\tTRIM\t385\n> +#define\tTRUE_P\t386\n> +#define\tUNION\t387\n> +#define\tUNIQUE\t388\n> +#define\tUPDATE\t389\n> +#define\tUSER\t390\n> +#define\tUSING\t391\n> +#define\tVALUES\t392\n> +#define\tVARCHAR\t393\n> +#define\tVARYING\t394\n> +#define\tVIEW\t395\n> +#define\tWHEN\t396\n> +#define\tWHERE\t397\n> +#define\tWITH\t398\n> +#define\tWORK\t399\n> +#define\tYEAR_P\t400\n> +#define\tZONE\t401\n> +#define\tTRIGGER\t402\n> +#define\tCOMMITTED\t403\n> +#define\tSERIALIZABLE\t404\n> +#define\tTYPE_P\t405\n> +#define\tABORT_TRANS\t406\n> +#define\tACCESS\t407\n> +#define\tAFTER\t408\n> +#define\tAGGREGATE\t409\n> +#define\tANALYZE\t410\n> +#define\tBACKWARD\t411\n> +#define\tBEFORE\t412\n> +#define\tBINARY\t413\n> +#define\tCACHE\t414\n> +#define\tCLUSTER\t415\n> +#define\tCOPY\t416\n> +#define\tCREATEDB\t417\n> +#define\tCREATEUSER\t418\n> +#define\tCYCLE\t419\n> +#define\tDATABASE\t420\n> +#define\tDELIMITERS\t421\n> +#define\tDO\t422\n> +#define\tEACH\t423\n> +#define\tENCODING\t424\n> +#define\tEXCLUSIVE\t425\n> +#define\tEXPLAIN\t426\n> +#define\tEXTEND\t427\n> +#define\tFORWARD\t428\n> +#define\tFUNCTION\t429\n> +#define\tHANDLER\t430\n> +#define\tINCREMENT\t431\n> +#define\tINDEX\t432\n> +#define\tINHERITS\t433\n> +#define\tINSTEAD\t434\n> +#define\tISNULL\t435\n> +#define\tLANCOMPILER\t436\n> +#define\tLIMIT\t437\n> +#define\tLISTEN\t438\n> +#define\tLOAD\t439\n> +#define\tLOCATION\t440\n> +#define\tLOCK_P\t441\n> +#define\tMAXVALUE\t442\n> +#define\tMINVALUE\t443\n> +#define\tMODE\t444\n> +#define\tMOVE\t445\n> +#define\tNEW\t446\n> +#define\tNOCREATEDB\t447\n> +#define\tNOCREATEUSER\t448\n> +#define\tNONE\t449\n> +#define\tNOTHING\t450\n> +#define\tNOTIFY\t451\n> +#define\tNOTNULL\t452\n> +#define\tOFFSET\t453\n> +#define\tOIDS\t454\n> +#define\tOPERATOR\t455\n> +#define\tPASSWORD\t456\n> +#define\tPROCEDURAL\t457\n> +#define\tRENAME\t458\n> +#define\tRESET\t459\n> +#define\tRETURNS\t460\n> +#define\tROW\t461\n> +#define\tRULE\t462\n> +#define\tSEQUENCE\t463\n> +#define\tSERIAL\t464\n> +#define\tSETOF\t465\n> +#define\tSHARE\t466\n> +#define\tSHOW\t467\n> +#define\tSTART\t468\n> +#define\tSTATEMENT\t469\n> +#define\tSTDIN\t470\n> +#define\tSTDOUT\t471\n> +#define\tTRUSTED\t472\n> +#define\tUNLISTEN\t473\n> +#define\tUNTIL\t474\n> +#define\tVACUUM\t475\n> +#define\tVALID\t476\n> +#define\tVERBOSE\t477\n> +#define\tVERSION\t478\n> +#define\tIDENT\t479\n> +#define\tSCONST\t480\n> +#define\tOp\t481\n> +#define\tICONST\t482\n> +#define\tPARAM\t483\n> +#define\tFCONST\t484\n> +#define\tOP\t485\n> +#define\tUMINUS\t486\n> +#define\tTYPECAST\t487\n> \n> \n> extern YYSTYPE yylval;\n> diff -urbw postgresql-6.5.2/src/backend/parser/parse_func.c postgresql-6.5.2-patched/src/backend/parser/parse_func.c\n> --- postgresql-6.5.2/src/backend/parser/parse_func.c\tFri Jun 18 00:21:40 1999\n> +++ postgresql-6.5.2-patched/src/backend/parser/parse_func.c\tWed Mar 1 16:33:53 2000\n> @@ -601,7 +601,8 @@\n> \n> \t\tif ((aclcheck_result = pg_aclcheck(seqrel, GetPgUserName(),\n> \t\t\t\t\t (((funcid == F_NEXTVAL) || (funcid == F_SETVAL)) ?\n> -\t\t\t\t\t\tACL_WR : ACL_RD)))\n> +\t\t\t\t\t\t/* if nextval and setval are atomic, which I don't know, update should be enough */\n> +\t\t\t\t\t\tACL_UP : ACL_RD)))\n> \t\t\t!= ACLCHECK_OK)\n> \t\t\telog(ERROR, \"%s.%s: %s\",\n> \t\t\t seqrel, funcname, aclcheck_error_strings[aclcheck_result]);\n> diff -urbw postgresql-6.5.2/src/backend/rewrite/locks.c postgresql-6.5.2-patched/src/backend/rewrite/locks.c\n> --- postgresql-6.5.2/src/backend/rewrite/locks.c\tSun Feb 14 00:17:44 1999\n> +++ postgresql-6.5.2-patched/src/backend/rewrite/locks.c\tWed Mar 1 16:34:20 2000\n> @@ -228,8 +228,15 @@\n> \t\t\t\t\t\tcase CMD_INSERT:\n> \t\t\t\t\t\t\treqperm = ACL_AP;\n> \t\t\t\t\t\t\tbreak;\n> +\t\t\t\t\t\tcase CMD_DELETE:\n> +\t\t\t\t\t\t\treqperm = ACL_DE;\n> +\t\t\t\t\t\t\tbreak;\n> +\t\t\t\t\t\tcase CMD_UPDATE:\n> +\t\t\t\t\t\t\treqperm = ACL_UP;\n> +\t\t\t\t\t\t\tbreak;\n> \t\t\t\t\t\tdefault:\n> -\t\t\t\t\t\t\treqperm = ACL_WR;\n> +\t\t\t\t\t\t\t/* is it The Right Thing To Do (tm) ? */\n> +\t\t\t\t\t\t\treqperm = ACL_AP | ACL_DE | ACL_UP;\n> \t\t\t\t\t\t\tbreak;\n> \t\t\t\t\t}\n> \t\t\t\telse\n> diff -urbw postgresql-6.5.2/src/backend/rewrite/rewriteHandler.c postgresql-6.5.2-patched/src/backend/rewrite/rewriteHandler.c\n> --- postgresql-6.5.2/src/backend/rewrite/rewriteHandler.c\tSun Jul 11 19:54:30 1999\n> +++ postgresql-6.5.2-patched/src/backend/rewrite/rewriteHandler.c\tWed Mar 1 16:35:01 2000\n> @@ -2282,8 +2282,15 @@\n> \t\t\t\tcase CMD_INSERT:\n> \t\t\t\t\treqperm = ACL_AP;\n> \t\t\t\t\tbreak;\n> +\t\t\t\tcase CMD_DELETE:\n> +\t\t\t\t\treqperm = ACL_DE;\n> +\t\t\t\t\tbreak;\n> +\t\t\t\tcase CMD_UPDATE:\n> +\t\t\t\t\treqperm = ACL_UP;\n> +\t\t\t\t\tbreak;\n> \t\t\t\tdefault:\n> -\t\t\t\t\treqperm = ACL_WR;\n> +\t\t\t\t\t/* is it The Right Thing To Do (tm) ? */\n> +\t\t\t\t\treqperm = ACL_AP | ACL_DE | ACL_UP;\n> \t\t\t\t\tbreak;\n> \t\t\t}\n> \n> diff -urbw postgresql-6.5.2/src/backend/storage/file/fd.c postgresql-6.5.2-patched/src/backend/storage/file/fd.c\n> diff -urbw postgresql-6.5.2/src/backend/utils/adt/acl.c postgresql-6.5.2-patched/src/backend/utils/adt/acl.c\n> --- postgresql-6.5.2/src/backend/utils/adt/acl.c\tMon Aug 2 07:24:49 1999\n> +++ postgresql-6.5.2-patched/src/backend/utils/adt/acl.c\tWed Mar 1 16:35:53 2000\n> @@ -154,8 +154,11 @@\n> \t\t\tcase ACL_MODE_RD_CHR:\n> \t\t\t\taip->ai_mode |= ACL_RD;\n> \t\t\t\tbreak;\n> -\t\t\tcase ACL_MODE_WR_CHR:\n> -\t\t\t\taip->ai_mode |= ACL_WR;\n> +\t\t\tcase ACL_MODE_DE_CHR:\n> +\t\t\t\taip->ai_mode |= ACL_DE;\n> +\t\t\t\tbreak;\n> +\t\t\tcase ACL_MODE_UP_CHR:\n> +\t\t\t\taip->ai_mode |= ACL_UP;\n> \t\t\t\tbreak;\n> \t\t\tcase ACL_MODE_RU_CHR:\n> \t\t\t\taip->ai_mode |= ACL_RU;\n> @@ -272,7 +275,7 @@\n> \tif (!aip)\n> \t\taip = &default_aclitem;\n> \n> -\tp = out = palloc(strlen(\"group =arwR \") + 1 + NAMEDATALEN);\n> +\tp = out = palloc(strlen(\"group =arRdu \") + 1 + NAMEDATALEN);\n> \tif (!out)\n> \t\telog(ERROR, \"aclitemout: palloc failed\");\n> \t*p = '\\0';\n> @@ -605,9 +608,8 @@\n> \tint\t\t\ti;\n> \tint\t\t\tl;\n> \n> -\tAssert(strlen(old_privlist) < 5);\n> -\tpriv = palloc(5); /* at most \"rwaR\" */ ;\n> -\n> +\tAssert(strlen(old_privlist) < 6);\n> +\tpriv = palloc(6); /* at most \"arduR\" */ ;\n> \tif (old_privlist == NULL || old_privlist[0] == '\\0')\n> \t{\n> \t\tpriv[0] = new_priv;\n> @@ -619,7 +621,7 @@\n> \n> \tl = strlen(old_privlist);\n> \n> -\tif (l == 4)\n> +\tif (l == 5)\n> \t{\t\t\t\t\t\t\t/* can't add any more privileges */\n> \t\treturn priv;\n> \t}\n> diff -urbw postgresql-6.5.2/src/include/utils/acl.h postgresql-6.5.2-patched/src/include/utils/acl.h\n> --- postgresql-6.5.2/src/include/utils/acl.h\tFri Jul 30 19:07:22 1999\n> +++ postgresql-6.5.2-patched/src/include/utils/acl.h\tWed Mar 1 16:40:50 2000\n> @@ -54,9 +54,10 @@\n> #define ACL_NO\t\t\t0\t\t/* no permissions */\n> #define ACL_AP\t\t\t(1<<0)\t/* append */\n> #define ACL_RD\t\t\t(1<<1)\t/* read */\n> -#define ACL_WR\t\t\t(1<<2)\t/* write (append/delete/replace) */\n> -#define ACL_RU\t\t\t(1<<3)\t/* place rules */\n> -#define N_ACL_MODES\t\t4\n> +#define ACL_DE\t\t\t(1<<2)\t/* delete */\n> +#define ACL_UP\t\t\t(1<<3)\t/* update/replace */\n> +#define ACL_RU\t\t\t(1<<4)\t/* place rules */\n> +#define N_ACL_MODES\t\t5\n> \n> #define ACL_MODECHG_ADD\t\t\t1\n> #define ACL_MODECHG_DEL\t\t\t2\n> @@ -65,7 +66,8 @@\n> /* change this line if you want to set the default acl permission */\n> #define ACL_WORLD_DEFAULT\t\t(ACL_NO)\n> /* #define\t\tACL_WORLD_DEFAULT\t\t(ACL_RD|ACL_WR|ACL_AP|ACL_RU) */\n> -#define ACL_OWNER_DEFAULT\t\t(ACL_RD|ACL_WR|ACL_AP|ACL_RU)\n> +\n> +#define ACL_OWNER_DEFAULT\t\t(ACL_AP|ACL_RD|ACL_RU|ACL_DE|ACL_UP)\n> \n> /*\n> * AclItem\n> @@ -118,10 +120,12 @@\n> #define ACL_MODECHG_ADD_CHR\t\t'+'\n> #define ACL_MODECHG_DEL_CHR\t\t'-'\n> #define ACL_MODECHG_EQL_CHR\t\t'='\n> -#define ACL_MODE_STR\t\t\t\"arwR\"\t/* list of valid characters */\n> +\n> +#define ACL_MODE_STR\t\t\t\"arduR\"\t /* list of valid characters */\n> #define ACL_MODE_AP_CHR\t\t\t'a'\n> #define ACL_MODE_RD_CHR\t\t\t'r'\n> -#define ACL_MODE_WR_CHR\t\t\t'w'\n> +#define ACL_MODE_DE_CHR\t\t\t'd'\n> +#define ACL_MODE_UP_CHR\t\t\t'u'\n> #define ACL_MODE_RU_CHR\t\t\t'R'\n> \n> /* result codes for pg_aclcheck */\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, 29 Sep 2000 22:32:29 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: grant/revoke bug with delete/update" }, { "msg_contents": "Bruce Momjian writes:\n\n> OK, this was a good point. Were did we leave this, folks?\n\nI was going to do some extensive work on the privilege system, but if you\nguys always postpone beta for a month just a day before it was supposed to\nbe I'll never know when to start.\n\n-- \nPeter Eisentraut [email protected] http://yi.org/peter-e/\n\n", "msg_date": "Sat, 30 Sep 2000 13:03:31 +0200 (CEST)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: grant/revoke bug with delete/update" }, { "msg_contents": "Nevertheless, you should probably consider installing the patch.\n\nBruce Momjian writes:\n\n> OK, this was a good point. Were did we leave this, folks?\n> \n> \n> > Hi,\n> > \n> > first I'm sorry to not fill the form, I'm too lazy, and it's not platform\n> > nor version dependent AFAIK.\n> > \n> > I recently posted a question (on Feb 23rd) to pgsql-sql concerning the\n> > fact that update and insert are considered the same thing when you modify\n> > permissions with grant and revoke. (Maybe it was the wrong place to post\n> > it.)\n> > \n> > for example a \"grant delete\" also grants \"update\" which is completely\n> > wrong. More importantly the user is not informed, and this could lead to\n> > VERY IMPORTANT SECURITY PROBLEMS, like someone who should only be able to\n> > update existing records, have the permission to delete all records... \n> > \n> > I've read postgresql documentation, especially the grant and revoke\n> > manpages, and I've found no mention of this bug, which is IMHO a Big\n> > Mistake (tm).\n> > \n> > attached to this message you'll find a patch for version 6.5.2 wich\n> > differentiate delete and update, because before they were considered as\n> > \"write\". The patch only modifies .c .y and .h files, but no documentation.\n> > \n> > the new acl rights look like: arRdu \n> > a for append\n> > r for read\n> > R for rules\n> > d for delete\n> > u for update\n> > \n> > instead of: arwR\n> > a for append\n> > r for read\n> > w for update AND delete\n> > R for rules\n> > \n> > This patch seems to work at least with what I've tested, you'll find a\n> > test session at the end of this message.\n> > \n> > I hope this patch will help and that it will be easy to incorporate it in\n> > 7.0, which I haven't the time to do for now. \n> > \n> > And for the bug report I posted on Feb 23rd on \"drop user\" which keeps the\n> > user's acl in the database, and the deleted user id being reused, I've not\n> > done anything, but I consider this a major problem. Please consider it for\n> > a next version.\n> > \n> > Because I'm not an expert, I suggest you remove gram.c before applying the\n> > patch, in order for this file to be generated again from gram.y, but maybe\n> > this is not necessary.\n> > \n> > I'd be very pleased if some people could test this more than I can,\n> > because I don't use postgresql intensively with special permissions.\n> > \n> > I'm not sure for some parts of the patch, especially in execMain.c\n> > so if a postgresql hacker could examine it, this would be fine.\n> > \n> > dump of test session:\n> > ---------------------\n> > \n> > ------- CUT -------\n> > \n> > template1=> create database db;\n> > CREATEDB\n> > template1=> create user john;\n> > CREATE USER\n> > template1=> \\connect db\n> > connecting to new database: db\n> > db=> create table t (id INT4, name TEXT);\n> > CREATE\n> > db=> \\z\n> > Database = db\n> > +----------+--------------------------+\n> > | Relation | Grant/Revoke Permissions |\n> > +----------+--------------------------+\n> > | t | |\n> > +----------+--------------------------+\n> > db=> grant all on t to john;\n> > CHANGE\n> > db=> \\z\n> > Database = db\n> > +----------+--------------------------+\n> > | Relation | Grant/Revoke Permissions |\n> > +----------+--------------------------+\n> > | t | {\"=\",\"john=arduR\"} |\n> > +----------+--------------------------+\n> > db=> \\connect db john\n> > connecting to new database: db as user: john\n> > db=> insert into t (id, name) values (1, 'xxx');\n> > INSERT 18560 1\n> > db=> update t set name = 'yyy' where id=1;\n> > UPDATE 1\n> > db=> select * from t;\n> > id|name\n> > --+----\n> > 1|yyy\n> > (1 row)\n> > \n> > db=> delete from t;\n> > DELETE 1\n> > db=> select * from t;\n> > id|name\n> > --+----\n> > (0 rows)\n> > \n> > db=> insert into t (id, name) values (1, 'xxx');\n> > INSERT 18561 1\n> > db=> \\connect db postgres\n> > connecting to new database: db as user: postgres\n> > db=> revoke update on t from john;\n> > CHANGE\n> > db=> \\z\n> > Database = db\n> > +----------+--------------------------+\n> > | Relation | Grant/Revoke Permissions |\n> > +----------+--------------------------+\n> > | t | {\"=\",\"john=ardR\"} |\n> > +----------+--------------------------+\n> > db=> \\connect db john;\n> > connecting to new database: db as user: john\n> > db=> insert into t (id, name) values (2, 'yyy');\n> > INSERT 18592 1\n> > db=> update t set name='modified by john' where id=2;\n> > ERROR: t: Permission denied.\n> > db=> delete from t where id=2;\n> > DELETE 1\n> > db=> select * from t;\n> > id|name\n> > --+----\n> > 1|xxx\n> > (1 row)\n> > \n> > db=> \\connect db postgres\n> > connecting to new database: db as user: postgres\n> > db=> revoke insert on t from john;\n> > CHANGE\n> > db=> \\connect db john;\n> > connecting to new database: db as user: john\n> > db=> \\z\n> > Database = db\n> > +----------+--------------------------+\n> > | Relation | Grant/Revoke Permissions |\n> > +----------+--------------------------+\n> > | t | {\"=\",\"john=rdR\"} |\n> > +----------+--------------------------+\n> > db=> insert into t (id, name) values (3, 'I try to insert something');\n> > ERROR: t: Permission denied.\n> > db=> delete from t;\n> > DELETE 1\n> > db=> select * from t;\n> > id|name\n> > --+----\n> > (0 rows)\n> > \n> > db=> \\connect db postgres\n> > connecting to new database: db as user: postgres\n> > db=> insert into t (id, name) values (1, 'xxx');\n> > INSERT 18624 1\n> > db=> \\connect db john;\n> > connecting to new database: db as user: john\n> > db=> update t set name='john' where id =1;\n> > ERROR: t: Permission denied.\n> > db=> \\connect db postgres\n> > connecting to new database: db as user: postgres\n> > db=> revoke delete on t from john;\n> > CHANGE\n> > db=> grant update on t to john;\n> > CHANGE\n> > db=> \\connect db john;\n> > connecting to new database: db as user: john\n> > db=> delete from t;\n> > ERROR: t: Permission denied.\n> > db=> update t set name='john' where id=1;\n> > UPDATE 1\n> > db=> select * from t;\n> > id|name\n> > --+----\n> > 1|john\n> > (1 row)\n> > \n> > ------- CUT -------\n> > \n> > Thank you for reading.\n> > \n> > bye,\n> > \n> > Jerome ALET - [email protected] - http://cortex.unice.fr/~jerome\n> > Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 \n> > 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE\n> Content-Description: the 6.5.2 patch\n> \n> > diff -urbw postgresql-6.5.2/src/backend/catalog/aclchk.c postgresql-6.5.2-patched/src/backend/catalog/aclchk.c\n> > --- postgresql-6.5.2/src/backend/catalog/aclchk.c\tMon Aug 2 07:56:53 1999\n> > +++ postgresql-6.5.2-patched/src/backend/catalog/aclchk.c\tWed Mar 1 16:39:44 2000\n> > @@ -381,7 +381,7 @@\n> > \t\t * pg_database table, there is still additional permissions\n> > \t\t * checking in dbcommands.c\n> > \t\t */\n> > -\t\tif ((mode & ACL_WR) || (mode & ACL_AP))\n> > +\t\tif (mode & ACL_AP)\n> > \t\t\treturn ACLCHECK_OK;\n> > \t}\n> > \n> > @@ -390,7 +390,7 @@\n> > \t * pg_shadow.usecatupd is set.\t(This is to let superusers protect\n> > \t * themselves from themselves.)\n> > \t */\n> > -\tif (((mode & ACL_WR) || (mode & ACL_AP)) &&\n> > +\tif ((mode & ACL_AP) &&\n> > \t\t!allowSystemTableMods && IsSystemRelationName(relname) &&\n> > \t\t!((Form_pg_shadow) GETSTRUCT(tuple))->usecatupd)\n> > \t{\n> > diff -urbw postgresql-6.5.2/src/backend/commands/command.c postgresql-6.5.2-patched/src/backend/commands/command.c\n> > --- postgresql-6.5.2/src/backend/commands/command.c\tMon Aug 2 07:56:57 1999\n> > +++ postgresql-6.5.2-patched/src/backend/commands/command.c\tWed Mar 1 16:30:23 2000\n> > @@ -524,7 +524,9 @@\n> > \tif (lockstmt->mode == AccessShareLock)\n> > \t\taclresult = pg_aclcheck(lockstmt->relname, GetPgUserName(), ACL_RD);\n> > \telse\n> > -\t\taclresult = pg_aclcheck(lockstmt->relname, GetPgUserName(), ACL_WR);\n> > +\t\t/* do we really need to have all these permissions at the same time ? */\n> > +\t\t/* shouldn't we test lockstmt->mode first ? */\n> > +\t\taclresult = pg_aclcheck(lockstmt->relname, GetPgUserName(), (ACL_AP | ACL_DE | ACL_UP));\n> > \n> > \tif (aclresult != ACLCHECK_OK)\n> > \t\telog(ERROR, \"LOCK TABLE: permission denied\");\n> > diff -urbw postgresql-6.5.2/src/backend/commands/copy.c postgresql-6.5.2-patched/src/backend/commands/copy.c\n> > --- postgresql-6.5.2/src/backend/commands/copy.c\tSat Jul 3 02:32:39 1999\n> > +++ postgresql-6.5.2-patched/src/backend/commands/copy.c\tWed Mar 1 16:30:35 2000\n> > @@ -242,7 +242,8 @@\n> > \tFILE\t *fp;\n> > \tRelation\trel;\n> > \textern char *UserName;\t\t/* defined in global.c */\n> > -\tconst AclMode required_access = from ? ACL_WR : ACL_RD;\n> > +\t/* why should we need other permissions than APPEND ? */\n> > +\tconst AclMode required_access = from ? ACL_AP : ACL_RD;\n> > \tint\t\t\tresult;\n> > \n> > \trel = heap_openr(relname);\n> > diff -urbw postgresql-6.5.2/src/backend/commands/sequence.c postgresql-6.5.2-patched/src/backend/commands/sequence.c\n> > --- postgresql-6.5.2/src/backend/commands/sequence.c\tMon Aug 2 07:56:59 1999\n> > +++ postgresql-6.5.2-patched/src/backend/commands/sequence.c\tWed Mar 1 16:31:05 2000\n> > @@ -314,7 +314,8 @@\n> > \tForm_pg_sequence seq;\n> > \n> > #ifndef NO_SECURITY\n> > -\tif (pg_aclcheck(seqname, getpgusername(), ACL_WR) != ACLCHECK_OK)\n> > +\t/* why should we need more than UPDATE permission ? */\n> > +\tif (pg_aclcheck(seqname, getpgusername(), ACL_UP) != ACLCHECK_OK)\n> > \t\telog(ERROR, \"%s.setval: you don't have permissions to set sequence %s\",\n> > \t\t\t seqname, seqname);\n> > #endif\n> > diff -urbw postgresql-6.5.2/src/backend/commands/user.c postgresql-6.5.2-patched/src/backend/commands/user.c\n> > --- postgresql-6.5.2/src/backend/commands/user.c\tMon Aug 2 07:56:59 1999\n> > +++ postgresql-6.5.2-patched/src/backend/commands/user.c\tWed Mar 1 16:31:38 2000\n> > @@ -115,7 +115,7 @@\n> > \t * pg_shadow relation.\n> > \t */\n> > \tpg_shadow = GetPgUserName();\n> > -\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_WR | ACL_AP) != ACLCHECK_OK)\n> > +\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_AP | ACL_DE | ACL_UP) != ACLCHECK_OK)\n> > \t{\n> > \t\tUserAbortTransactionBlock();\n> > \t\telog(ERROR, \"defineUser: user \\\"%s\\\" does not have SELECT and INSERT privilege for \\\"%s\\\"\",\n> > @@ -227,7 +227,8 @@\n> > \t * pg_shadow relation.\n> > \t */\n> > \tpg_shadow = GetPgUserName();\n> > -\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_WR) != ACLCHECK_OK)\n> > +\t/* why should we need more than UPDATE ? */\n> > +\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_UP) != ACLCHECK_OK)\n> > \t{\n> > \t\tUserAbortTransactionBlock();\n> > \t\telog(ERROR, \"alterUser: user \\\"%s\\\" does not have SELECT and UPDATE privilege for \\\"%s\\\"\",\n> > @@ -329,11 +330,12 @@\n> > \t\tBeginTransactionBlock();\n> > \n> > \t/*\n> > -\t * Make sure the user attempting to create a user can delete from the\n> > +\t * Make sure the user attempting to delete a user can delete from the\n> > \t * pg_shadow relation.\n> > \t */\n> > \tpg_shadow = GetPgUserName();\n> > -\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_WR) != ACLCHECK_OK)\n> > +\t/* why should we need more than DELETE ? */\n> > +\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_DE) != ACLCHECK_OK)\n> > \t{\n> > \t\tUserAbortTransactionBlock();\n> > \t\telog(ERROR, \"removeUser: user \\\"%s\\\" does not have SELECT and DELETE privilege for \\\"%s\\\"\",\n> > diff -urbw postgresql-6.5.2/src/backend/executor/execMain.c postgresql-6.5.2-patched/src/backend/executor/execMain.c\n> > --- postgresql-6.5.2/src/backend/executor/execMain.c\tThu Jun 17 17:15:49 1999\n> > +++ postgresql-6.5.2-patched/src/backend/executor/execMain.c\tWed Mar 1 18:31:31 2000\n> > @@ -464,14 +464,16 @@\n> > \t\t\tswitch (operation)\n> > \t\t\t{\n> > \t\t\t\tcase CMD_INSERT:\n> > -\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_AP)) == ACLCHECK_OK) ||\n> > -\t\t\t\t\t\t((aclcheck_result = CHECK(ACL_WR)) == ACLCHECK_OK);\n> > +\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_AP)) == ACLCHECK_OK);\n> > \t\t\t\t\topstr = \"append\";\n> > \t\t\t\t\tbreak;\n> > \t\t\t\tcase CMD_DELETE:\n> > +\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_DE)) == ACLCHECK_OK);\n> > +\t\t\t\t\topstr = \"delete\";\n> > +\t\t\t\t\tbreak;\n> > \t\t\t\tcase CMD_UPDATE:\n> > -\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_WR)) == ACLCHECK_OK);\n> > -\t\t\t\t\topstr = \"write\";\n> > +\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_UP)) == ACLCHECK_OK);\n> > +\t\t\t\t\topstr = \"update\";\n> > \t\t\t\t\tbreak;\n> > \t\t\t\tdefault:\n> > \t\t\t\t\telog(ERROR, \"ExecCheckPerms: bogus operation %d\",\n> > @@ -508,8 +510,9 @@\n> > \t\t\tStrNCpy(rname.data,\n> > \t\t\t\t\t((Form_pg_class) GETSTRUCT(htup))->relname.data,\n> > \t\t\t\t\tNAMEDATALEN);\n> > -\t\t\tok = ((aclcheck_result = CHECK(ACL_WR)) == ACLCHECK_OK);\n> > -\t\t\topstr = \"write\";\n> > +\t\t\t/* is it the right thing to do ? */\n> > +\t\t\tok = ((aclcheck_result = CHECK((ACL_AP | ACL_DE | ACL_UP))) == ACLCHECK_OK);\n> > +\t\t\topstr = \"write\";\t/* unused ? */\n> > \t\t\tif (!ok)\n> > \t\t\t\telog(ERROR, \"%s: %s\", rname.data, aclcheck_error_strings[aclcheck_result]);\n> > \t\t}\n> > diff -urbw postgresql-6.5.2/src/backend/parser/gram.y postgresql-6.5.2-patched/src/backend/parser/gram.y\n> > --- postgresql-6.5.2/src/backend/parser/gram.y\tTue Sep 14 08:07:35 1999\n> > +++ postgresql-6.5.2-patched/src/backend/parser/gram.y\tWed Mar 1 16:33:34 2000\n> > @@ -1694,11 +1694,11 @@\n> > \n> > privileges: ALL PRIVILEGES\n> > \t\t\t\t{\n> > -\t\t\t\t $$ = aclmakepriv(\"rwaR\",0);\n> > +\t\t\t\t $$ = aclmakepriv(\"raduR\",0);\n> > \t\t\t\t}\n> > \t\t| ALL\n> > \t\t\t\t{\n> > -\t\t\t\t $$ = aclmakepriv(\"rwaR\",0);\n> > +\t\t\t\t $$ = aclmakepriv(\"raduR\",0);\n> > \t\t\t\t}\n> > \t\t| operation_commalist\n> > \t\t\t\t{\n> > @@ -1726,11 +1726,11 @@\n> > \t\t\t\t}\n> > \t\t| UPDATE\n> > \t\t\t\t{\n> > -\t\t\t\t\t\t$$ = ACL_MODE_WR_CHR;\n> > +\t\t\t\t\t\t$$ = ACL_MODE_UP_CHR;\n> > \t\t\t\t}\n> > \t\t| DELETE\n> > \t\t\t\t{\n> > -\t\t\t\t\t\t$$ = ACL_MODE_WR_CHR;\n> > +\t\t\t\t\t\t$$ = ACL_MODE_DE_CHR;\n> > \t\t\t\t}\n> > \t\t| RULE\n> > \t\t\t\t{\n> > diff -urbw postgresql-6.5.2/src/backend/parser/parse.h postgresql-6.5.2-patched/src/backend/parser/parse.h\n> > --- postgresql-6.5.2/src/backend/parser/parse.h\tThu Sep 16 02:23:39 1999\n> > +++ postgresql-6.5.2-patched/src/backend/parser/parse.h\tWed Mar 1 18:34:46 2000\n> > @@ -29,236 +29,236 @@\n> > \tRuleStmt\t\t\t*rstmt;\n> > \tInsertStmt\t\t\t*astmt;\n> > } YYSTYPE;\n> > -#define\tABSOLUTE\t257\n> > -#define\tACTION\t258\n> > -#define\tADD\t259\n> > -#define\tALL\t260\n> > -#define\tALTER\t261\n> > -#define\tAND\t262\n> > -#define\tANY\t263\n> > -#define\tAS\t264\n> > -#define\tASC\t265\n> > -#define\tBEGIN_TRANS\t266\n> > -#define\tBETWEEN\t267\n> > -#define\tBOTH\t268\n> > -#define\tBY\t269\n> > -#define\tCASCADE\t270\n> > -#define\tCASE\t271\n> > -#define\tCAST\t272\n> > -#define\tCHAR\t273\n> > -#define\tCHARACTER\t274\n> > -#define\tCHECK\t275\n> > -#define\tCLOSE\t276\n> > -#define\tCOALESCE\t277\n> > -#define\tCOLLATE\t278\n> > -#define\tCOLUMN\t279\n> > -#define\tCOMMIT\t280\n> > -#define\tCONSTRAINT\t281\n> > -#define\tCREATE\t282\n> > -#define\tCROSS\t283\n> > -#define\tCURRENT\t284\n> > -#define\tCURRENT_DATE\t285\n> > -#define\tCURRENT_TIME\t286\n> > -#define\tCURRENT_TIMESTAMP\t287\n> > -#define\tCURRENT_USER\t288\n> > -#define\tCURSOR\t289\n> > -#define\tDAY_P\t290\n> > -#define\tDECIMAL\t291\n> > -#define\tDECLARE\t292\n> > -#define\tDEFAULT\t293\n> > -#define\tDELETE\t294\n> > -#define\tDESC\t295\n> > -#define\tDISTINCT\t296\n> > -#define\tDOUBLE\t297\n> > -#define\tDROP\t298\n> > -#define\tELSE\t299\n> > -#define\tEND_TRANS\t300\n> > -#define\tEXCEPT\t301\n> > -#define\tEXECUTE\t302\n> > -#define\tEXISTS\t303\n> > -#define\tEXTRACT\t304\n> > -#define\tFALSE_P\t305\n> > -#define\tFETCH\t306\n> > -#define\tFLOAT\t307\n> > -#define\tFOR\t308\n> > -#define\tFOREIGN\t309\n> > -#define\tFROM\t310\n> > -#define\tFULL\t311\n> > -#define\tGLOBAL\t312\n> > -#define\tGRANT\t313\n> > -#define\tGROUP\t314\n> > -#define\tHAVING\t315\n> > -#define\tHOUR_P\t316\n> > -#define\tIN\t317\n> > -#define\tINNER_P\t318\n> > -#define\tINSENSITIVE\t319\n> > -#define\tINSERT\t320\n> > -#define\tINTERSECT\t321\n> > -#define\tINTERVAL\t322\n> > -#define\tINTO\t323\n> > -#define\tIS\t324\n> > -#define\tISOLATION\t325\n> > -#define\tJOIN\t326\n> > -#define\tKEY\t327\n> > -#define\tLANGUAGE\t328\n> > -#define\tLEADING\t329\n> > -#define\tLEFT\t330\n> > -#define\tLEVEL\t331\n> > -#define\tLIKE\t332\n> > -#define\tLOCAL\t333\n> > -#define\tMATCH\t334\n> > -#define\tMINUTE_P\t335\n> > -#define\tMONTH_P\t336\n> > -#define\tNAMES\t337\n> > -#define\tNATIONAL\t338\n> > -#define\tNATURAL\t339\n> > -#define\tNCHAR\t340\n> > -#define\tNEXT\t341\n> > -#define\tNO\t342\n> > -#define\tNOT\t343\n> > -#define\tNULLIF\t344\n> > -#define\tNULL_P\t345\n> > -#define\tNUMERIC\t346\n> > -#define\tOF\t347\n> > -#define\tON\t348\n> > -#define\tONLY\t349\n> > -#define\tOPTION\t350\n> > -#define\tOR\t351\n> > -#define\tORDER\t352\n> > -#define\tOUTER_P\t353\n> > -#define\tPARTIAL\t354\n> > -#define\tPOSITION\t355\n> > -#define\tPRECISION\t356\n> > -#define\tPRIMARY\t357\n> > -#define\tPRIOR\t358\n> > -#define\tPRIVILEGES\t359\n> > -#define\tPROCEDURE\t360\n> > -#define\tPUBLIC\t361\n> > -#define\tREAD\t362\n> > -#define\tREFERENCES\t363\n> > -#define\tRELATIVE\t364\n> > -#define\tREVOKE\t365\n> > -#define\tRIGHT\t366\n> > -#define\tROLLBACK\t367\n> > -#define\tSCROLL\t368\n> > -#define\tSECOND_P\t369\n> > -#define\tSELECT\t370\n> > -#define\tSET\t371\n> > -#define\tSUBSTRING\t372\n> > -#define\tTABLE\t373\n> > -#define\tTEMP\t374\n> > -#define\tTEMPORARY\t375\n> > -#define\tTHEN\t376\n> > -#define\tTIME\t377\n> > -#define\tTIMESTAMP\t378\n> > -#define\tTIMEZONE_HOUR\t379\n> > -#define\tTIMEZONE_MINUTE\t380\n> > -#define\tTO\t381\n> > -#define\tTRAILING\t382\n> > -#define\tTRANSACTION\t383\n> > -#define\tTRIM\t384\n> > -#define\tTRUE_P\t385\n> > -#define\tUNION\t386\n> > -#define\tUNIQUE\t387\n> > -#define\tUPDATE\t388\n> > -#define\tUSER\t389\n> > -#define\tUSING\t390\n> > -#define\tVALUES\t391\n> > -#define\tVARCHAR\t392\n> > -#define\tVARYING\t393\n> > -#define\tVIEW\t394\n> > -#define\tWHEN\t395\n> > -#define\tWHERE\t396\n> > -#define\tWITH\t397\n> > -#define\tWORK\t398\n> > -#define\tYEAR_P\t399\n> > -#define\tZONE\t400\n> > -#define\tTRIGGER\t401\n> > -#define\tCOMMITTED\t402\n> > -#define\tSERIALIZABLE\t403\n> > -#define\tTYPE_P\t404\n> > -#define\tABORT_TRANS\t405\n> > -#define\tACCESS\t406\n> > -#define\tAFTER\t407\n> > -#define\tAGGREGATE\t408\n> > -#define\tANALYZE\t409\n> > -#define\tBACKWARD\t410\n> > -#define\tBEFORE\t411\n> > -#define\tBINARY\t412\n> > -#define\tCACHE\t413\n> > -#define\tCLUSTER\t414\n> > -#define\tCOPY\t415\n> > -#define\tCREATEDB\t416\n> > -#define\tCREATEUSER\t417\n> > -#define\tCYCLE\t418\n> > -#define\tDATABASE\t419\n> > -#define\tDELIMITERS\t420\n> > -#define\tDO\t421\n> > -#define\tEACH\t422\n> > -#define\tENCODING\t423\n> > -#define\tEXCLUSIVE\t424\n> > -#define\tEXPLAIN\t425\n> > -#define\tEXTEND\t426\n> > -#define\tFORWARD\t427\n> > -#define\tFUNCTION\t428\n> > -#define\tHANDLER\t429\n> > -#define\tINCREMENT\t430\n> > -#define\tINDEX\t431\n> > -#define\tINHERITS\t432\n> > -#define\tINSTEAD\t433\n> > -#define\tISNULL\t434\n> > -#define\tLANCOMPILER\t435\n> > -#define\tLIMIT\t436\n> > -#define\tLISTEN\t437\n> > -#define\tLOAD\t438\n> > -#define\tLOCATION\t439\n> > -#define\tLOCK_P\t440\n> > -#define\tMAXVALUE\t441\n> > -#define\tMINVALUE\t442\n> > -#define\tMODE\t443\n> > -#define\tMOVE\t444\n> > -#define\tNEW\t445\n> > -#define\tNOCREATEDB\t446\n> > -#define\tNOCREATEUSER\t447\n> > -#define\tNONE\t448\n> > -#define\tNOTHING\t449\n> > -#define\tNOTIFY\t450\n> > -#define\tNOTNULL\t451\n> > -#define\tOFFSET\t452\n> > -#define\tOIDS\t453\n> > -#define\tOPERATOR\t454\n> > -#define\tPASSWORD\t455\n> > -#define\tPROCEDURAL\t456\n> > -#define\tRENAME\t457\n> > -#define\tRESET\t458\n> > -#define\tRETURNS\t459\n> > -#define\tROW\t460\n> > -#define\tRULE\t461\n> > -#define\tSEQUENCE\t462\n> > -#define\tSERIAL\t463\n> > -#define\tSETOF\t464\n> > -#define\tSHARE\t465\n> > -#define\tSHOW\t466\n> > -#define\tSTART\t467\n> > -#define\tSTATEMENT\t468\n> > -#define\tSTDIN\t469\n> > -#define\tSTDOUT\t470\n> > -#define\tTRUSTED\t471\n> > -#define\tUNLISTEN\t472\n> > -#define\tUNTIL\t473\n> > -#define\tVACUUM\t474\n> > -#define\tVALID\t475\n> > -#define\tVERBOSE\t476\n> > -#define\tVERSION\t477\n> > -#define\tIDENT\t478\n> > -#define\tSCONST\t479\n> > -#define\tOp\t480\n> > -#define\tICONST\t481\n> > -#define\tPARAM\t482\n> > -#define\tFCONST\t483\n> > -#define\tOP\t484\n> > -#define\tUMINUS\t485\n> > -#define\tTYPECAST\t486\n> > +#define\tABSOLUTE\t258\n> > +#define\tACTION\t259\n> > +#define\tADD\t260\n> > +#define\tALL\t261\n> > +#define\tALTER\t262\n> > +#define\tAND\t263\n> > +#define\tANY\t264\n> > +#define\tAS\t265\n> > +#define\tASC\t266\n> > +#define\tBEGIN_TRANS\t267\n> > +#define\tBETWEEN\t268\n> > +#define\tBOTH\t269\n> > +#define\tBY\t270\n> > +#define\tCASCADE\t271\n> > +#define\tCASE\t272\n> > +#define\tCAST\t273\n> > +#define\tCHAR\t274\n> > +#define\tCHARACTER\t275\n> > +#define\tCHECK\t276\n> > +#define\tCLOSE\t277\n> > +#define\tCOALESCE\t278\n> > +#define\tCOLLATE\t279\n> > +#define\tCOLUMN\t280\n> > +#define\tCOMMIT\t281\n> > +#define\tCONSTRAINT\t282\n> > +#define\tCREATE\t283\n> > +#define\tCROSS\t284\n> > +#define\tCURRENT\t285\n> > +#define\tCURRENT_DATE\t286\n> > +#define\tCURRENT_TIME\t287\n> > +#define\tCURRENT_TIMESTAMP\t288\n> > +#define\tCURRENT_USER\t289\n> > +#define\tCURSOR\t290\n> > +#define\tDAY_P\t291\n> > +#define\tDECIMAL\t292\n> > +#define\tDECLARE\t293\n> > +#define\tDEFAULT\t294\n> > +#define\tDELETE\t295\n> > +#define\tDESC\t296\n> > +#define\tDISTINCT\t297\n> > +#define\tDOUBLE\t298\n> > +#define\tDROP\t299\n> > +#define\tELSE\t300\n> > +#define\tEND_TRANS\t301\n> > +#define\tEXCEPT\t302\n> > +#define\tEXECUTE\t303\n> > +#define\tEXISTS\t304\n> > +#define\tEXTRACT\t305\n> > +#define\tFALSE_P\t306\n> > +#define\tFETCH\t307\n> > +#define\tFLOAT\t308\n> > +#define\tFOR\t309\n> > +#define\tFOREIGN\t310\n> > +#define\tFROM\t311\n> > +#define\tFULL\t312\n> > +#define\tGLOBAL\t313\n> > +#define\tGRANT\t314\n> > +#define\tGROUP\t315\n> > +#define\tHAVING\t316\n> > +#define\tHOUR_P\t317\n> > +#define\tIN\t318\n> > +#define\tINNER_P\t319\n> > +#define\tINSENSITIVE\t320\n> > +#define\tINSERT\t321\n> > +#define\tINTERSECT\t322\n> > +#define\tINTERVAL\t323\n> > +#define\tINTO\t324\n> > +#define\tIS\t325\n> > +#define\tISOLATION\t326\n> > +#define\tJOIN\t327\n> > +#define\tKEY\t328\n> > +#define\tLANGUAGE\t329\n> > +#define\tLEADING\t330\n> > +#define\tLEFT\t331\n> > +#define\tLEVEL\t332\n> > +#define\tLIKE\t333\n> > +#define\tLOCAL\t334\n> > +#define\tMATCH\t335\n> > +#define\tMINUTE_P\t336\n> > +#define\tMONTH_P\t337\n> > +#define\tNAMES\t338\n> > +#define\tNATIONAL\t339\n> > +#define\tNATURAL\t340\n> > +#define\tNCHAR\t341\n> > +#define\tNEXT\t342\n> > +#define\tNO\t343\n> > +#define\tNOT\t344\n> > +#define\tNULLIF\t345\n> > +#define\tNULL_P\t346\n> > +#define\tNUMERIC\t347\n> > +#define\tOF\t348\n> > +#define\tON\t349\n> > +#define\tONLY\t350\n> > +#define\tOPTION\t351\n> > +#define\tOR\t352\n> > +#define\tORDER\t353\n> > +#define\tOUTER_P\t354\n> > +#define\tPARTIAL\t355\n> > +#define\tPOSITION\t356\n> > +#define\tPRECISION\t357\n> > +#define\tPRIMARY\t358\n> > +#define\tPRIOR\t359\n> > +#define\tPRIVILEGES\t360\n> > +#define\tPROCEDURE\t361\n> > +#define\tPUBLIC\t362\n> > +#define\tREAD\t363\n> > +#define\tREFERENCES\t364\n> > +#define\tRELATIVE\t365\n> > +#define\tREVOKE\t366\n> > +#define\tRIGHT\t367\n> > +#define\tROLLBACK\t368\n> > +#define\tSCROLL\t369\n> > +#define\tSECOND_P\t370\n> > +#define\tSELECT\t371\n> > +#define\tSET\t372\n> > +#define\tSUBSTRING\t373\n> > +#define\tTABLE\t374\n> > +#define\tTEMP\t375\n> > +#define\tTEMPORARY\t376\n> > +#define\tTHEN\t377\n> > +#define\tTIME\t378\n> > +#define\tTIMESTAMP\t379\n> > +#define\tTIMEZONE_HOUR\t380\n> > +#define\tTIMEZONE_MINUTE\t381\n> > +#define\tTO\t382\n> > +#define\tTRAILING\t383\n> > +#define\tTRANSACTION\t384\n> > +#define\tTRIM\t385\n> > +#define\tTRUE_P\t386\n> > +#define\tUNION\t387\n> > +#define\tUNIQUE\t388\n> > +#define\tUPDATE\t389\n> > +#define\tUSER\t390\n> > +#define\tUSING\t391\n> > +#define\tVALUES\t392\n> > +#define\tVARCHAR\t393\n> > +#define\tVARYING\t394\n> > +#define\tVIEW\t395\n> > +#define\tWHEN\t396\n> > +#define\tWHERE\t397\n> > +#define\tWITH\t398\n> > +#define\tWORK\t399\n> > +#define\tYEAR_P\t400\n> > +#define\tZONE\t401\n> > +#define\tTRIGGER\t402\n> > +#define\tCOMMITTED\t403\n> > +#define\tSERIALIZABLE\t404\n> > +#define\tTYPE_P\t405\n> > +#define\tABORT_TRANS\t406\n> > +#define\tACCESS\t407\n> > +#define\tAFTER\t408\n> > +#define\tAGGREGATE\t409\n> > +#define\tANALYZE\t410\n> > +#define\tBACKWARD\t411\n> > +#define\tBEFORE\t412\n> > +#define\tBINARY\t413\n> > +#define\tCACHE\t414\n> > +#define\tCLUSTER\t415\n> > +#define\tCOPY\t416\n> > +#define\tCREATEDB\t417\n> > +#define\tCREATEUSER\t418\n> > +#define\tCYCLE\t419\n> > +#define\tDATABASE\t420\n> > +#define\tDELIMITERS\t421\n> > +#define\tDO\t422\n> > +#define\tEACH\t423\n> > +#define\tENCODING\t424\n> > +#define\tEXCLUSIVE\t425\n> > +#define\tEXPLAIN\t426\n> > +#define\tEXTEND\t427\n> > +#define\tFORWARD\t428\n> > +#define\tFUNCTION\t429\n> > +#define\tHANDLER\t430\n> > +#define\tINCREMENT\t431\n> > +#define\tINDEX\t432\n> > +#define\tINHERITS\t433\n> > +#define\tINSTEAD\t434\n> > +#define\tISNULL\t435\n> > +#define\tLANCOMPILER\t436\n> > +#define\tLIMIT\t437\n> > +#define\tLISTEN\t438\n> > +#define\tLOAD\t439\n> > +#define\tLOCATION\t440\n> > +#define\tLOCK_P\t441\n> > +#define\tMAXVALUE\t442\n> > +#define\tMINVALUE\t443\n> > +#define\tMODE\t444\n> > +#define\tMOVE\t445\n> > +#define\tNEW\t446\n> > +#define\tNOCREATEDB\t447\n> > +#define\tNOCREATEUSER\t448\n> > +#define\tNONE\t449\n> > +#define\tNOTHING\t450\n> > +#define\tNOTIFY\t451\n> > +#define\tNOTNULL\t452\n> > +#define\tOFFSET\t453\n> > +#define\tOIDS\t454\n> > +#define\tOPERATOR\t455\n> > +#define\tPASSWORD\t456\n> > +#define\tPROCEDURAL\t457\n> > +#define\tRENAME\t458\n> > +#define\tRESET\t459\n> > +#define\tRETURNS\t460\n> > +#define\tROW\t461\n> > +#define\tRULE\t462\n> > +#define\tSEQUENCE\t463\n> > +#define\tSERIAL\t464\n> > +#define\tSETOF\t465\n> > +#define\tSHARE\t466\n> > +#define\tSHOW\t467\n> > +#define\tSTART\t468\n> > +#define\tSTATEMENT\t469\n> > +#define\tSTDIN\t470\n> > +#define\tSTDOUT\t471\n> > +#define\tTRUSTED\t472\n> > +#define\tUNLISTEN\t473\n> > +#define\tUNTIL\t474\n> > +#define\tVACUUM\t475\n> > +#define\tVALID\t476\n> > +#define\tVERBOSE\t477\n> > +#define\tVERSION\t478\n> > +#define\tIDENT\t479\n> > +#define\tSCONST\t480\n> > +#define\tOp\t481\n> > +#define\tICONST\t482\n> > +#define\tPARAM\t483\n> > +#define\tFCONST\t484\n> > +#define\tOP\t485\n> > +#define\tUMINUS\t486\n> > +#define\tTYPECAST\t487\n> > \n> > \n> > extern YYSTYPE yylval;\n> > diff -urbw postgresql-6.5.2/src/backend/parser/parse_func.c postgresql-6.5.2-patched/src/backend/parser/parse_func.c\n> > --- postgresql-6.5.2/src/backend/parser/parse_func.c\tFri Jun 18 00:21:40 1999\n> > +++ postgresql-6.5.2-patched/src/backend/parser/parse_func.c\tWed Mar 1 16:33:53 2000\n> > @@ -601,7 +601,8 @@\n> > \n> > \t\tif ((aclcheck_result = pg_aclcheck(seqrel, GetPgUserName(),\n> > \t\t\t\t\t (((funcid == F_NEXTVAL) || (funcid == F_SETVAL)) ?\n> > -\t\t\t\t\t\tACL_WR : ACL_RD)))\n> > +\t\t\t\t\t\t/* if nextval and setval are atomic, which I don't know, update should be enough */\n> > +\t\t\t\t\t\tACL_UP : ACL_RD)))\n> > \t\t\t!= ACLCHECK_OK)\n> > \t\t\telog(ERROR, \"%s.%s: %s\",\n> > \t\t\t seqrel, funcname, aclcheck_error_strings[aclcheck_result]);\n> > diff -urbw postgresql-6.5.2/src/backend/rewrite/locks.c postgresql-6.5.2-patched/src/backend/rewrite/locks.c\n> > --- postgresql-6.5.2/src/backend/rewrite/locks.c\tSun Feb 14 00:17:44 1999\n> > +++ postgresql-6.5.2-patched/src/backend/rewrite/locks.c\tWed Mar 1 16:34:20 2000\n> > @@ -228,8 +228,15 @@\n> > \t\t\t\t\t\tcase CMD_INSERT:\n> > \t\t\t\t\t\t\treqperm = ACL_AP;\n> > \t\t\t\t\t\t\tbreak;\n> > +\t\t\t\t\t\tcase CMD_DELETE:\n> > +\t\t\t\t\t\t\treqperm = ACL_DE;\n> > +\t\t\t\t\t\t\tbreak;\n> > +\t\t\t\t\t\tcase CMD_UPDATE:\n> > +\t\t\t\t\t\t\treqperm = ACL_UP;\n> > +\t\t\t\t\t\t\tbreak;\n> > \t\t\t\t\t\tdefault:\n> > -\t\t\t\t\t\t\treqperm = ACL_WR;\n> > +\t\t\t\t\t\t\t/* is it The Right Thing To Do (tm) ? */\n> > +\t\t\t\t\t\t\treqperm = ACL_AP | ACL_DE | ACL_UP;\n> > \t\t\t\t\t\t\tbreak;\n> > \t\t\t\t\t}\n> > \t\t\t\telse\n> > diff -urbw postgresql-6.5.2/src/backend/rewrite/rewriteHandler.c postgresql-6.5.2-patched/src/backend/rewrite/rewriteHandler.c\n> > --- postgresql-6.5.2/src/backend/rewrite/rewriteHandler.c\tSun Jul 11 19:54:30 1999\n> > +++ postgresql-6.5.2-patched/src/backend/rewrite/rewriteHandler.c\tWed Mar 1 16:35:01 2000\n> > @@ -2282,8 +2282,15 @@\n> > \t\t\t\tcase CMD_INSERT:\n> > \t\t\t\t\treqperm = ACL_AP;\n> > \t\t\t\t\tbreak;\n> > +\t\t\t\tcase CMD_DELETE:\n> > +\t\t\t\t\treqperm = ACL_DE;\n> > +\t\t\t\t\tbreak;\n> > +\t\t\t\tcase CMD_UPDATE:\n> > +\t\t\t\t\treqperm = ACL_UP;\n> > +\t\t\t\t\tbreak;\n> > \t\t\t\tdefault:\n> > -\t\t\t\t\treqperm = ACL_WR;\n> > +\t\t\t\t\t/* is it The Right Thing To Do (tm) ? */\n> > +\t\t\t\t\treqperm = ACL_AP | ACL_DE | ACL_UP;\n> > \t\t\t\t\tbreak;\n> > \t\t\t}\n> > \n> > diff -urbw postgresql-6.5.2/src/backend/storage/file/fd.c postgresql-6.5.2-patched/src/backend/storage/file/fd.c\n> > diff -urbw postgresql-6.5.2/src/backend/utils/adt/acl.c postgresql-6.5.2-patched/src/backend/utils/adt/acl.c\n> > --- postgresql-6.5.2/src/backend/utils/adt/acl.c\tMon Aug 2 07:24:49 1999\n> > +++ postgresql-6.5.2-patched/src/backend/utils/adt/acl.c\tWed Mar 1 16:35:53 2000\n> > @@ -154,8 +154,11 @@\n> > \t\t\tcase ACL_MODE_RD_CHR:\n> > \t\t\t\taip->ai_mode |= ACL_RD;\n> > \t\t\t\tbreak;\n> > -\t\t\tcase ACL_MODE_WR_CHR:\n> > -\t\t\t\taip->ai_mode |= ACL_WR;\n> > +\t\t\tcase ACL_MODE_DE_CHR:\n> > +\t\t\t\taip->ai_mode |= ACL_DE;\n> > +\t\t\t\tbreak;\n> > +\t\t\tcase ACL_MODE_UP_CHR:\n> > +\t\t\t\taip->ai_mode |= ACL_UP;\n> > \t\t\t\tbreak;\n> > \t\t\tcase ACL_MODE_RU_CHR:\n> > \t\t\t\taip->ai_mode |= ACL_RU;\n> > @@ -272,7 +275,7 @@\n> > \tif (!aip)\n> > \t\taip = &default_aclitem;\n> > \n> > -\tp = out = palloc(strlen(\"group =arwR \") + 1 + NAMEDATALEN);\n> > +\tp = out = palloc(strlen(\"group =arRdu \") + 1 + NAMEDATALEN);\n> > \tif (!out)\n> > \t\telog(ERROR, \"aclitemout: palloc failed\");\n> > \t*p = '\\0';\n> > @@ -605,9 +608,8 @@\n> > \tint\t\t\ti;\n> > \tint\t\t\tl;\n> > \n> > -\tAssert(strlen(old_privlist) < 5);\n> > -\tpriv = palloc(5); /* at most \"rwaR\" */ ;\n> > -\n> > +\tAssert(strlen(old_privlist) < 6);\n> > +\tpriv = palloc(6); /* at most \"arduR\" */ ;\n> > \tif (old_privlist == NULL || old_privlist[0] == '\\0')\n> > \t{\n> > \t\tpriv[0] = new_priv;\n> > @@ -619,7 +621,7 @@\n> > \n> > \tl = strlen(old_privlist);\n> > \n> > -\tif (l == 4)\n> > +\tif (l == 5)\n> > \t{\t\t\t\t\t\t\t/* can't add any more privileges */\n> > \t\treturn priv;\n> > \t}\n> > diff -urbw postgresql-6.5.2/src/include/utils/acl.h postgresql-6.5.2-patched/src/include/utils/acl.h\n> > --- postgresql-6.5.2/src/include/utils/acl.h\tFri Jul 30 19:07:22 1999\n> > +++ postgresql-6.5.2-patched/src/include/utils/acl.h\tWed Mar 1 16:40:50 2000\n> > @@ -54,9 +54,10 @@\n> > #define ACL_NO\t\t\t0\t\t/* no permissions */\n> > #define ACL_AP\t\t\t(1<<0)\t/* append */\n> > #define ACL_RD\t\t\t(1<<1)\t/* read */\n> > -#define ACL_WR\t\t\t(1<<2)\t/* write (append/delete/replace) */\n> > -#define ACL_RU\t\t\t(1<<3)\t/* place rules */\n> > -#define N_ACL_MODES\t\t4\n> > +#define ACL_DE\t\t\t(1<<2)\t/* delete */\n> > +#define ACL_UP\t\t\t(1<<3)\t/* update/replace */\n> > +#define ACL_RU\t\t\t(1<<4)\t/* place rules */\n> > +#define N_ACL_MODES\t\t5\n> > \n> > #define ACL_MODECHG_ADD\t\t\t1\n> > #define ACL_MODECHG_DEL\t\t\t2\n> > @@ -65,7 +66,8 @@\n> > /* change this line if you want to set the default acl permission */\n> > #define ACL_WORLD_DEFAULT\t\t(ACL_NO)\n> > /* #define\t\tACL_WORLD_DEFAULT\t\t(ACL_RD|ACL_WR|ACL_AP|ACL_RU) */\n> > -#define ACL_OWNER_DEFAULT\t\t(ACL_RD|ACL_WR|ACL_AP|ACL_RU)\n> > +\n> > +#define ACL_OWNER_DEFAULT\t\t(ACL_AP|ACL_RD|ACL_RU|ACL_DE|ACL_UP)\n> > \n> > /*\n> > * AclItem\n> > @@ -118,10 +120,12 @@\n> > #define ACL_MODECHG_ADD_CHR\t\t'+'\n> > #define ACL_MODECHG_DEL_CHR\t\t'-'\n> > #define ACL_MODECHG_EQL_CHR\t\t'='\n> > -#define ACL_MODE_STR\t\t\t\"arwR\"\t/* list of valid characters */\n> > +\n> > +#define ACL_MODE_STR\t\t\t\"arduR\"\t /* list of valid characters */\n> > #define ACL_MODE_AP_CHR\t\t\t'a'\n> > #define ACL_MODE_RD_CHR\t\t\t'r'\n> > -#define ACL_MODE_WR_CHR\t\t\t'w'\n> > +#define ACL_MODE_DE_CHR\t\t\t'd'\n> > +#define ACL_MODE_UP_CHR\t\t\t'u'\n> > #define ACL_MODE_RU_CHR\t\t\t'R'\n> > \n> > /* result codes for pg_aclcheck */\n> > \n> \n> \n> \n\n-- \nPeter Eisentraut [email protected] http://yi.org/peter-e/\n\n", "msg_date": "Sun, 1 Oct 2000 22:49:51 +0200 (CEST)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: grant/revoke bug with delete/update" }, { "msg_contents": "I tried to apply this patch to the current tree, but unfortunately,\nchanges made in permission handling prevent it from being applied.\n\nSeems we were too far into testing to apply this long ago, and now we\nare too far away from the original patch to apply it now. If you are\nstill intersted, we would like to get this patch against the current\nsource tree. \n\nSorry this got lost in the patch process for so long.\n\n> Hi,\n> \n> first I'm sorry to not fill the form, I'm too lazy, and it's not platform\n> nor version dependent AFAIK.\n> \n> I recently posted a question (on Feb 23rd) to pgsql-sql concerning the\n> fact that update and insert are considered the same thing when you modify\n> permissions with grant and revoke. (Maybe it was the wrong place to post\n> it.)\n> \n> for example a \"grant delete\" also grants \"update\" which is completely\n> wrong. More importantly the user is not informed, and this could lead to\n> VERY IMPORTANT SECURITY PROBLEMS, like someone who should only be able to\n> update existing records, have the permission to delete all records... \n> \n> I've read postgresql documentation, especially the grant and revoke\n> manpages, and I've found no mention of this bug, which is IMHO a Big\n> Mistake (tm).\n> \n> attached to this message you'll find a patch for version 6.5.2 wich\n> differentiate delete and update, because before they were considered as\n> \"write\". The patch only modifies .c .y and .h files, but no documentation.\n> \n> the new acl rights look like: arRdu \n> a for append\n> r for read\n> R for rules\n> d for delete\n> u for update\n> \n> instead of: arwR\n> a for append\n> r for read\n> w for update AND delete\n> R for rules\n> \n> This patch seems to work at least with what I've tested, you'll find a\n> test session at the end of this message.\n> \n> I hope this patch will help and that it will be easy to incorporate it in\n> 7.0, which I haven't the time to do for now. \n> \n> And for the bug report I posted on Feb 23rd on \"drop user\" which keeps the\n> user's acl in the database, and the deleted user id being reused, I've not\n> done anything, but I consider this a major problem. Please consider it for\n> a next version.\n> \n> Because I'm not an expert, I suggest you remove gram.c before applying the\n> patch, in order for this file to be generated again from gram.y, but maybe\n> this is not necessary.\n> \n> I'd be very pleased if some people could test this more than I can,\n> because I don't use postgresql intensively with special permissions.\n> \n> I'm not sure for some parts of the patch, especially in execMain.c\n> so if a postgresql hacker could examine it, this would be fine.\n> \n> dump of test session:\n> ---------------------\n> \n> ------- CUT -------\n> \n> template1=> create database db;\n> CREATEDB\n> template1=> create user john;\n> CREATE USER\n> template1=> \\connect db\n> connecting to new database: db\n> db=> create table t (id INT4, name TEXT);\n> CREATE\n> db=> \\z\n> Database = db\n> +----------+--------------------------+\n> | Relation | Grant/Revoke Permissions |\n> +----------+--------------------------+\n> | t | |\n> +----------+--------------------------+\n> db=> grant all on t to john;\n> CHANGE\n> db=> \\z\n> Database = db\n> +----------+--------------------------+\n> | Relation | Grant/Revoke Permissions |\n> +----------+--------------------------+\n> | t | {\"=\",\"john=arduR\"} |\n> +----------+--------------------------+\n> db=> \\connect db john\n> connecting to new database: db as user: john\n> db=> insert into t (id, name) values (1, 'xxx');\n> INSERT 18560 1\n> db=> update t set name = 'yyy' where id=1;\n> UPDATE 1\n> db=> select * from t;\n> id|name\n> --+----\n> 1|yyy\n> (1 row)\n> \n> db=> delete from t;\n> DELETE 1\n> db=> select * from t;\n> id|name\n> --+----\n> (0 rows)\n> \n> db=> insert into t (id, name) values (1, 'xxx');\n> INSERT 18561 1\n> db=> \\connect db postgres\n> connecting to new database: db as user: postgres\n> db=> revoke update on t from john;\n> CHANGE\n> db=> \\z\n> Database = db\n> +----------+--------------------------+\n> | Relation | Grant/Revoke Permissions |\n> +----------+--------------------------+\n> | t | {\"=\",\"john=ardR\"} |\n> +----------+--------------------------+\n> db=> \\connect db john;\n> connecting to new database: db as user: john\n> db=> insert into t (id, name) values (2, 'yyy');\n> INSERT 18592 1\n> db=> update t set name='modified by john' where id=2;\n> ERROR: t: Permission denied.\n> db=> delete from t where id=2;\n> DELETE 1\n> db=> select * from t;\n> id|name\n> --+----\n> 1|xxx\n> (1 row)\n> \n> db=> \\connect db postgres\n> connecting to new database: db as user: postgres\n> db=> revoke insert on t from john;\n> CHANGE\n> db=> \\connect db john;\n> connecting to new database: db as user: john\n> db=> \\z\n> Database = db\n> +----------+--------------------------+\n> | Relation | Grant/Revoke Permissions |\n> +----------+--------------------------+\n> | t | {\"=\",\"john=rdR\"} |\n> +----------+--------------------------+\n> db=> insert into t (id, name) values (3, 'I try to insert something');\n> ERROR: t: Permission denied.\n> db=> delete from t;\n> DELETE 1\n> db=> select * from t;\n> id|name\n> --+----\n> (0 rows)\n> \n> db=> \\connect db postgres\n> connecting to new database: db as user: postgres\n> db=> insert into t (id, name) values (1, 'xxx');\n> INSERT 18624 1\n> db=> \\connect db john;\n> connecting to new database: db as user: john\n> db=> update t set name='john' where id =1;\n> ERROR: t: Permission denied.\n> db=> \\connect db postgres\n> connecting to new database: db as user: postgres\n> db=> revoke delete on t from john;\n> CHANGE\n> db=> grant update on t to john;\n> CHANGE\n> db=> \\connect db john;\n> connecting to new database: db as user: john\n> db=> delete from t;\n> ERROR: t: Permission denied.\n> db=> update t set name='john' where id=1;\n> UPDATE 1\n> db=> select * from t;\n> id|name\n> --+----\n> 1|john\n> (1 row)\n> \n> ------- CUT -------\n> \n> Thank you for reading.\n> \n> bye,\n> \n> Jerome ALET - [email protected] - http://cortex.unice.fr/~jerome\n> Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 \n> 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE\nContent-Description: the 6.5.2 patch\n\n> diff -urbw postgresql-6.5.2/src/backend/catalog/aclchk.c postgresql-6.5.2-patched/src/backend/catalog/aclchk.c\n> --- postgresql-6.5.2/src/backend/catalog/aclchk.c\tMon Aug 2 07:56:53 1999\n> +++ postgresql-6.5.2-patched/src/backend/catalog/aclchk.c\tWed Mar 1 16:39:44 2000\n> @@ -381,7 +381,7 @@\n> \t\t * pg_database table, there is still additional permissions\n> \t\t * checking in dbcommands.c\n> \t\t */\n> -\t\tif ((mode & ACL_WR) || (mode & ACL_AP))\n> +\t\tif (mode & ACL_AP)\n> \t\t\treturn ACLCHECK_OK;\n> \t}\n> \n> @@ -390,7 +390,7 @@\n> \t * pg_shadow.usecatupd is set.\t(This is to let superusers protect\n> \t * themselves from themselves.)\n> \t */\n> -\tif (((mode & ACL_WR) || (mode & ACL_AP)) &&\n> +\tif ((mode & ACL_AP) &&\n> \t\t!allowSystemTableMods && IsSystemRelationName(relname) &&\n> \t\t!((Form_pg_shadow) GETSTRUCT(tuple))->usecatupd)\n> \t{\n> diff -urbw postgresql-6.5.2/src/backend/commands/command.c postgresql-6.5.2-patched/src/backend/commands/command.c\n> --- postgresql-6.5.2/src/backend/commands/command.c\tMon Aug 2 07:56:57 1999\n> +++ postgresql-6.5.2-patched/src/backend/commands/command.c\tWed Mar 1 16:30:23 2000\n> @@ -524,7 +524,9 @@\n> \tif (lockstmt->mode == AccessShareLock)\n> \t\taclresult = pg_aclcheck(lockstmt->relname, GetPgUserName(), ACL_RD);\n> \telse\n> -\t\taclresult = pg_aclcheck(lockstmt->relname, GetPgUserName(), ACL_WR);\n> +\t\t/* do we really need to have all these permissions at the same time ? */\n> +\t\t/* shouldn't we test lockstmt->mode first ? */\n> +\t\taclresult = pg_aclcheck(lockstmt->relname, GetPgUserName(), (ACL_AP | ACL_DE | ACL_UP));\n> \n> \tif (aclresult != ACLCHECK_OK)\n> \t\telog(ERROR, \"LOCK TABLE: permission denied\");\n> diff -urbw postgresql-6.5.2/src/backend/commands/copy.c postgresql-6.5.2-patched/src/backend/commands/copy.c\n> --- postgresql-6.5.2/src/backend/commands/copy.c\tSat Jul 3 02:32:39 1999\n> +++ postgresql-6.5.2-patched/src/backend/commands/copy.c\tWed Mar 1 16:30:35 2000\n> @@ -242,7 +242,8 @@\n> \tFILE\t *fp;\n> \tRelation\trel;\n> \textern char *UserName;\t\t/* defined in global.c */\n> -\tconst AclMode required_access = from ? ACL_WR : ACL_RD;\n> +\t/* why should we need other permissions than APPEND ? */\n> +\tconst AclMode required_access = from ? ACL_AP : ACL_RD;\n> \tint\t\t\tresult;\n> \n> \trel = heap_openr(relname);\n> diff -urbw postgresql-6.5.2/src/backend/commands/sequence.c postgresql-6.5.2-patched/src/backend/commands/sequence.c\n> --- postgresql-6.5.2/src/backend/commands/sequence.c\tMon Aug 2 07:56:59 1999\n> +++ postgresql-6.5.2-patched/src/backend/commands/sequence.c\tWed Mar 1 16:31:05 2000\n> @@ -314,7 +314,8 @@\n> \tForm_pg_sequence seq;\n> \n> #ifndef NO_SECURITY\n> -\tif (pg_aclcheck(seqname, getpgusername(), ACL_WR) != ACLCHECK_OK)\n> +\t/* why should we need more than UPDATE permission ? */\n> +\tif (pg_aclcheck(seqname, getpgusername(), ACL_UP) != ACLCHECK_OK)\n> \t\telog(ERROR, \"%s.setval: you don't have permissions to set sequence %s\",\n> \t\t\t seqname, seqname);\n> #endif\n> diff -urbw postgresql-6.5.2/src/backend/commands/user.c postgresql-6.5.2-patched/src/backend/commands/user.c\n> --- postgresql-6.5.2/src/backend/commands/user.c\tMon Aug 2 07:56:59 1999\n> +++ postgresql-6.5.2-patched/src/backend/commands/user.c\tWed Mar 1 16:31:38 2000\n> @@ -115,7 +115,7 @@\n> \t * pg_shadow relation.\n> \t */\n> \tpg_shadow = GetPgUserName();\n> -\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_WR | ACL_AP) != ACLCHECK_OK)\n> +\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_AP | ACL_DE | ACL_UP) != ACLCHECK_OK)\n> \t{\n> \t\tUserAbortTransactionBlock();\n> \t\telog(ERROR, \"defineUser: user \\\"%s\\\" does not have SELECT and INSERT privilege for \\\"%s\\\"\",\n> @@ -227,7 +227,8 @@\n> \t * pg_shadow relation.\n> \t */\n> \tpg_shadow = GetPgUserName();\n> -\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_WR) != ACLCHECK_OK)\n> +\t/* why should we need more than UPDATE ? */\n> +\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_UP) != ACLCHECK_OK)\n> \t{\n> \t\tUserAbortTransactionBlock();\n> \t\telog(ERROR, \"alterUser: user \\\"%s\\\" does not have SELECT and UPDATE privilege for \\\"%s\\\"\",\n> @@ -329,11 +330,12 @@\n> \t\tBeginTransactionBlock();\n> \n> \t/*\n> -\t * Make sure the user attempting to create a user can delete from the\n> +\t * Make sure the user attempting to delete a user can delete from the\n> \t * pg_shadow relation.\n> \t */\n> \tpg_shadow = GetPgUserName();\n> -\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_WR) != ACLCHECK_OK)\n> +\t/* why should we need more than DELETE ? */\n> +\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_DE) != ACLCHECK_OK)\n> \t{\n> \t\tUserAbortTransactionBlock();\n> \t\telog(ERROR, \"removeUser: user \\\"%s\\\" does not have SELECT and DELETE privilege for \\\"%s\\\"\",\n> diff -urbw postgresql-6.5.2/src/backend/executor/execMain.c postgresql-6.5.2-patched/src/backend/executor/execMain.c\n> --- postgresql-6.5.2/src/backend/executor/execMain.c\tThu Jun 17 17:15:49 1999\n> +++ postgresql-6.5.2-patched/src/backend/executor/execMain.c\tWed Mar 1 18:31:31 2000\n> @@ -464,14 +464,16 @@\n> \t\t\tswitch (operation)\n> \t\t\t{\n> \t\t\t\tcase CMD_INSERT:\n> -\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_AP)) == ACLCHECK_OK) ||\n> -\t\t\t\t\t\t((aclcheck_result = CHECK(ACL_WR)) == ACLCHECK_OK);\n> +\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_AP)) == ACLCHECK_OK);\n> \t\t\t\t\topstr = \"append\";\n> \t\t\t\t\tbreak;\n> \t\t\t\tcase CMD_DELETE:\n> +\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_DE)) == ACLCHECK_OK);\n> +\t\t\t\t\topstr = \"delete\";\n> +\t\t\t\t\tbreak;\n> \t\t\t\tcase CMD_UPDATE:\n> -\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_WR)) == ACLCHECK_OK);\n> -\t\t\t\t\topstr = \"write\";\n> +\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_UP)) == ACLCHECK_OK);\n> +\t\t\t\t\topstr = \"update\";\n> \t\t\t\t\tbreak;\n> \t\t\t\tdefault:\n> \t\t\t\t\telog(ERROR, \"ExecCheckPerms: bogus operation %d\",\n> @@ -508,8 +510,9 @@\n> \t\t\tStrNCpy(rname.data,\n> \t\t\t\t\t((Form_pg_class) GETSTRUCT(htup))->relname.data,\n> \t\t\t\t\tNAMEDATALEN);\n> -\t\t\tok = ((aclcheck_result = CHECK(ACL_WR)) == ACLCHECK_OK);\n> -\t\t\topstr = \"write\";\n> +\t\t\t/* is it the right thing to do ? */\n> +\t\t\tok = ((aclcheck_result = CHECK((ACL_AP | ACL_DE | ACL_UP))) == ACLCHECK_OK);\n> +\t\t\topstr = \"write\";\t/* unused ? */\n> \t\t\tif (!ok)\n> \t\t\t\telog(ERROR, \"%s: %s\", rname.data, aclcheck_error_strings[aclcheck_result]);\n> \t\t}\n> diff -urbw postgresql-6.5.2/src/backend/parser/gram.y postgresql-6.5.2-patched/src/backend/parser/gram.y\n> --- postgresql-6.5.2/src/backend/parser/gram.y\tTue Sep 14 08:07:35 1999\n> +++ postgresql-6.5.2-patched/src/backend/parser/gram.y\tWed Mar 1 16:33:34 2000\n> @@ -1694,11 +1694,11 @@\n> \n> privileges: ALL PRIVILEGES\n> \t\t\t\t{\n> -\t\t\t\t $$ = aclmakepriv(\"rwaR\",0);\n> +\t\t\t\t $$ = aclmakepriv(\"raduR\",0);\n> \t\t\t\t}\n> \t\t| ALL\n> \t\t\t\t{\n> -\t\t\t\t $$ = aclmakepriv(\"rwaR\",0);\n> +\t\t\t\t $$ = aclmakepriv(\"raduR\",0);\n> \t\t\t\t}\n> \t\t| operation_commalist\n> \t\t\t\t{\n> @@ -1726,11 +1726,11 @@\n> \t\t\t\t}\n> \t\t| UPDATE\n> \t\t\t\t{\n> -\t\t\t\t\t\t$$ = ACL_MODE_WR_CHR;\n> +\t\t\t\t\t\t$$ = ACL_MODE_UP_CHR;\n> \t\t\t\t}\n> \t\t| DELETE\n> \t\t\t\t{\n> -\t\t\t\t\t\t$$ = ACL_MODE_WR_CHR;\n> +\t\t\t\t\t\t$$ = ACL_MODE_DE_CHR;\n> \t\t\t\t}\n> \t\t| RULE\n> \t\t\t\t{\n> diff -urbw postgresql-6.5.2/src/backend/parser/parse.h postgresql-6.5.2-patched/src/backend/parser/parse.h\n> --- postgresql-6.5.2/src/backend/parser/parse.h\tThu Sep 16 02:23:39 1999\n> +++ postgresql-6.5.2-patched/src/backend/parser/parse.h\tWed Mar 1 18:34:46 2000\n> @@ -29,236 +29,236 @@\n> \tRuleStmt\t\t\t*rstmt;\n> \tInsertStmt\t\t\t*astmt;\n> } YYSTYPE;\n> -#define\tABSOLUTE\t257\n> -#define\tACTION\t258\n> -#define\tADD\t259\n> -#define\tALL\t260\n> -#define\tALTER\t261\n> -#define\tAND\t262\n> -#define\tANY\t263\n> -#define\tAS\t264\n> -#define\tASC\t265\n> -#define\tBEGIN_TRANS\t266\n> -#define\tBETWEEN\t267\n> -#define\tBOTH\t268\n> -#define\tBY\t269\n> -#define\tCASCADE\t270\n> -#define\tCASE\t271\n> -#define\tCAST\t272\n> -#define\tCHAR\t273\n> -#define\tCHARACTER\t274\n> -#define\tCHECK\t275\n> -#define\tCLOSE\t276\n> -#define\tCOALESCE\t277\n> -#define\tCOLLATE\t278\n> -#define\tCOLUMN\t279\n> -#define\tCOMMIT\t280\n> -#define\tCONSTRAINT\t281\n> -#define\tCREATE\t282\n> -#define\tCROSS\t283\n> -#define\tCURRENT\t284\n> -#define\tCURRENT_DATE\t285\n> -#define\tCURRENT_TIME\t286\n> -#define\tCURRENT_TIMESTAMP\t287\n> -#define\tCURRENT_USER\t288\n> -#define\tCURSOR\t289\n> -#define\tDAY_P\t290\n> -#define\tDECIMAL\t291\n> -#define\tDECLARE\t292\n> -#define\tDEFAULT\t293\n> -#define\tDELETE\t294\n> -#define\tDESC\t295\n> -#define\tDISTINCT\t296\n> -#define\tDOUBLE\t297\n> -#define\tDROP\t298\n> -#define\tELSE\t299\n> -#define\tEND_TRANS\t300\n> -#define\tEXCEPT\t301\n> -#define\tEXECUTE\t302\n> -#define\tEXISTS\t303\n> -#define\tEXTRACT\t304\n> -#define\tFALSE_P\t305\n> -#define\tFETCH\t306\n> -#define\tFLOAT\t307\n> -#define\tFOR\t308\n> -#define\tFOREIGN\t309\n> -#define\tFROM\t310\n> -#define\tFULL\t311\n> -#define\tGLOBAL\t312\n> -#define\tGRANT\t313\n> -#define\tGROUP\t314\n> -#define\tHAVING\t315\n> -#define\tHOUR_P\t316\n> -#define\tIN\t317\n> -#define\tINNER_P\t318\n> -#define\tINSENSITIVE\t319\n> -#define\tINSERT\t320\n> -#define\tINTERSECT\t321\n> -#define\tINTERVAL\t322\n> -#define\tINTO\t323\n> -#define\tIS\t324\n> -#define\tISOLATION\t325\n> -#define\tJOIN\t326\n> -#define\tKEY\t327\n> -#define\tLANGUAGE\t328\n> -#define\tLEADING\t329\n> -#define\tLEFT\t330\n> -#define\tLEVEL\t331\n> -#define\tLIKE\t332\n> -#define\tLOCAL\t333\n> -#define\tMATCH\t334\n> -#define\tMINUTE_P\t335\n> -#define\tMONTH_P\t336\n> -#define\tNAMES\t337\n> -#define\tNATIONAL\t338\n> -#define\tNATURAL\t339\n> -#define\tNCHAR\t340\n> -#define\tNEXT\t341\n> -#define\tNO\t342\n> -#define\tNOT\t343\n> -#define\tNULLIF\t344\n> -#define\tNULL_P\t345\n> -#define\tNUMERIC\t346\n> -#define\tOF\t347\n> -#define\tON\t348\n> -#define\tONLY\t349\n> -#define\tOPTION\t350\n> -#define\tOR\t351\n> -#define\tORDER\t352\n> -#define\tOUTER_P\t353\n> -#define\tPARTIAL\t354\n> -#define\tPOSITION\t355\n> -#define\tPRECISION\t356\n> -#define\tPRIMARY\t357\n> -#define\tPRIOR\t358\n> -#define\tPRIVILEGES\t359\n> -#define\tPROCEDURE\t360\n> -#define\tPUBLIC\t361\n> -#define\tREAD\t362\n> -#define\tREFERENCES\t363\n> -#define\tRELATIVE\t364\n> -#define\tREVOKE\t365\n> -#define\tRIGHT\t366\n> -#define\tROLLBACK\t367\n> -#define\tSCROLL\t368\n> -#define\tSECOND_P\t369\n> -#define\tSELECT\t370\n> -#define\tSET\t371\n> -#define\tSUBSTRING\t372\n> -#define\tTABLE\t373\n> -#define\tTEMP\t374\n> -#define\tTEMPORARY\t375\n> -#define\tTHEN\t376\n> -#define\tTIME\t377\n> -#define\tTIMESTAMP\t378\n> -#define\tTIMEZONE_HOUR\t379\n> -#define\tTIMEZONE_MINUTE\t380\n> -#define\tTO\t381\n> -#define\tTRAILING\t382\n> -#define\tTRANSACTION\t383\n> -#define\tTRIM\t384\n> -#define\tTRUE_P\t385\n> -#define\tUNION\t386\n> -#define\tUNIQUE\t387\n> -#define\tUPDATE\t388\n> -#define\tUSER\t389\n> -#define\tUSING\t390\n> -#define\tVALUES\t391\n> -#define\tVARCHAR\t392\n> -#define\tVARYING\t393\n> -#define\tVIEW\t394\n> -#define\tWHEN\t395\n> -#define\tWHERE\t396\n> -#define\tWITH\t397\n> -#define\tWORK\t398\n> -#define\tYEAR_P\t399\n> -#define\tZONE\t400\n> -#define\tTRIGGER\t401\n> -#define\tCOMMITTED\t402\n> -#define\tSERIALIZABLE\t403\n> -#define\tTYPE_P\t404\n> -#define\tABORT_TRANS\t405\n> -#define\tACCESS\t406\n> -#define\tAFTER\t407\n> -#define\tAGGREGATE\t408\n> -#define\tANALYZE\t409\n> -#define\tBACKWARD\t410\n> -#define\tBEFORE\t411\n> -#define\tBINARY\t412\n> -#define\tCACHE\t413\n> -#define\tCLUSTER\t414\n> -#define\tCOPY\t415\n> -#define\tCREATEDB\t416\n> -#define\tCREATEUSER\t417\n> -#define\tCYCLE\t418\n> -#define\tDATABASE\t419\n> -#define\tDELIMITERS\t420\n> -#define\tDO\t421\n> -#define\tEACH\t422\n> -#define\tENCODING\t423\n> -#define\tEXCLUSIVE\t424\n> -#define\tEXPLAIN\t425\n> -#define\tEXTEND\t426\n> -#define\tFORWARD\t427\n> -#define\tFUNCTION\t428\n> -#define\tHANDLER\t429\n> -#define\tINCREMENT\t430\n> -#define\tINDEX\t431\n> -#define\tINHERITS\t432\n> -#define\tINSTEAD\t433\n> -#define\tISNULL\t434\n> -#define\tLANCOMPILER\t435\n> -#define\tLIMIT\t436\n> -#define\tLISTEN\t437\n> -#define\tLOAD\t438\n> -#define\tLOCATION\t439\n> -#define\tLOCK_P\t440\n> -#define\tMAXVALUE\t441\n> -#define\tMINVALUE\t442\n> -#define\tMODE\t443\n> -#define\tMOVE\t444\n> -#define\tNEW\t445\n> -#define\tNOCREATEDB\t446\n> -#define\tNOCREATEUSER\t447\n> -#define\tNONE\t448\n> -#define\tNOTHING\t449\n> -#define\tNOTIFY\t450\n> -#define\tNOTNULL\t451\n> -#define\tOFFSET\t452\n> -#define\tOIDS\t453\n> -#define\tOPERATOR\t454\n> -#define\tPASSWORD\t455\n> -#define\tPROCEDURAL\t456\n> -#define\tRENAME\t457\n> -#define\tRESET\t458\n> -#define\tRETURNS\t459\n> -#define\tROW\t460\n> -#define\tRULE\t461\n> -#define\tSEQUENCE\t462\n> -#define\tSERIAL\t463\n> -#define\tSETOF\t464\n> -#define\tSHARE\t465\n> -#define\tSHOW\t466\n> -#define\tSTART\t467\n> -#define\tSTATEMENT\t468\n> -#define\tSTDIN\t469\n> -#define\tSTDOUT\t470\n> -#define\tTRUSTED\t471\n> -#define\tUNLISTEN\t472\n> -#define\tUNTIL\t473\n> -#define\tVACUUM\t474\n> -#define\tVALID\t475\n> -#define\tVERBOSE\t476\n> -#define\tVERSION\t477\n> -#define\tIDENT\t478\n> -#define\tSCONST\t479\n> -#define\tOp\t480\n> -#define\tICONST\t481\n> -#define\tPARAM\t482\n> -#define\tFCONST\t483\n> -#define\tOP\t484\n> -#define\tUMINUS\t485\n> -#define\tTYPECAST\t486\n> +#define\tABSOLUTE\t258\n> +#define\tACTION\t259\n> +#define\tADD\t260\n> +#define\tALL\t261\n> +#define\tALTER\t262\n> +#define\tAND\t263\n> +#define\tANY\t264\n> +#define\tAS\t265\n> +#define\tASC\t266\n> +#define\tBEGIN_TRANS\t267\n> +#define\tBETWEEN\t268\n> +#define\tBOTH\t269\n> +#define\tBY\t270\n> +#define\tCASCADE\t271\n> +#define\tCASE\t272\n> +#define\tCAST\t273\n> +#define\tCHAR\t274\n> +#define\tCHARACTER\t275\n> +#define\tCHECK\t276\n> +#define\tCLOSE\t277\n> +#define\tCOALESCE\t278\n> +#define\tCOLLATE\t279\n> +#define\tCOLUMN\t280\n> +#define\tCOMMIT\t281\n> +#define\tCONSTRAINT\t282\n> +#define\tCREATE\t283\n> +#define\tCROSS\t284\n> +#define\tCURRENT\t285\n> +#define\tCURRENT_DATE\t286\n> +#define\tCURRENT_TIME\t287\n> +#define\tCURRENT_TIMESTAMP\t288\n> +#define\tCURRENT_USER\t289\n> +#define\tCURSOR\t290\n> +#define\tDAY_P\t291\n> +#define\tDECIMAL\t292\n> +#define\tDECLARE\t293\n> +#define\tDEFAULT\t294\n> +#define\tDELETE\t295\n> +#define\tDESC\t296\n> +#define\tDISTINCT\t297\n> +#define\tDOUBLE\t298\n> +#define\tDROP\t299\n> +#define\tELSE\t300\n> +#define\tEND_TRANS\t301\n> +#define\tEXCEPT\t302\n> +#define\tEXECUTE\t303\n> +#define\tEXISTS\t304\n> +#define\tEXTRACT\t305\n> +#define\tFALSE_P\t306\n> +#define\tFETCH\t307\n> +#define\tFLOAT\t308\n> +#define\tFOR\t309\n> +#define\tFOREIGN\t310\n> +#define\tFROM\t311\n> +#define\tFULL\t312\n> +#define\tGLOBAL\t313\n> +#define\tGRANT\t314\n> +#define\tGROUP\t315\n> +#define\tHAVING\t316\n> +#define\tHOUR_P\t317\n> +#define\tIN\t318\n> +#define\tINNER_P\t319\n> +#define\tINSENSITIVE\t320\n> +#define\tINSERT\t321\n> +#define\tINTERSECT\t322\n> +#define\tINTERVAL\t323\n> +#define\tINTO\t324\n> +#define\tIS\t325\n> +#define\tISOLATION\t326\n> +#define\tJOIN\t327\n> +#define\tKEY\t328\n> +#define\tLANGUAGE\t329\n> +#define\tLEADING\t330\n> +#define\tLEFT\t331\n> +#define\tLEVEL\t332\n> +#define\tLIKE\t333\n> +#define\tLOCAL\t334\n> +#define\tMATCH\t335\n> +#define\tMINUTE_P\t336\n> +#define\tMONTH_P\t337\n> +#define\tNAMES\t338\n> +#define\tNATIONAL\t339\n> +#define\tNATURAL\t340\n> +#define\tNCHAR\t341\n> +#define\tNEXT\t342\n> +#define\tNO\t343\n> +#define\tNOT\t344\n> +#define\tNULLIF\t345\n> +#define\tNULL_P\t346\n> +#define\tNUMERIC\t347\n> +#define\tOF\t348\n> +#define\tON\t349\n> +#define\tONLY\t350\n> +#define\tOPTION\t351\n> +#define\tOR\t352\n> +#define\tORDER\t353\n> +#define\tOUTER_P\t354\n> +#define\tPARTIAL\t355\n> +#define\tPOSITION\t356\n> +#define\tPRECISION\t357\n> +#define\tPRIMARY\t358\n> +#define\tPRIOR\t359\n> +#define\tPRIVILEGES\t360\n> +#define\tPROCEDURE\t361\n> +#define\tPUBLIC\t362\n> +#define\tREAD\t363\n> +#define\tREFERENCES\t364\n> +#define\tRELATIVE\t365\n> +#define\tREVOKE\t366\n> +#define\tRIGHT\t367\n> +#define\tROLLBACK\t368\n> +#define\tSCROLL\t369\n> +#define\tSECOND_P\t370\n> +#define\tSELECT\t371\n> +#define\tSET\t372\n> +#define\tSUBSTRING\t373\n> +#define\tTABLE\t374\n> +#define\tTEMP\t375\n> +#define\tTEMPORARY\t376\n> +#define\tTHEN\t377\n> +#define\tTIME\t378\n> +#define\tTIMESTAMP\t379\n> +#define\tTIMEZONE_HOUR\t380\n> +#define\tTIMEZONE_MINUTE\t381\n> +#define\tTO\t382\n> +#define\tTRAILING\t383\n> +#define\tTRANSACTION\t384\n> +#define\tTRIM\t385\n> +#define\tTRUE_P\t386\n> +#define\tUNION\t387\n> +#define\tUNIQUE\t388\n> +#define\tUPDATE\t389\n> +#define\tUSER\t390\n> +#define\tUSING\t391\n> +#define\tVALUES\t392\n> +#define\tVARCHAR\t393\n> +#define\tVARYING\t394\n> +#define\tVIEW\t395\n> +#define\tWHEN\t396\n> +#define\tWHERE\t397\n> +#define\tWITH\t398\n> +#define\tWORK\t399\n> +#define\tYEAR_P\t400\n> +#define\tZONE\t401\n> +#define\tTRIGGER\t402\n> +#define\tCOMMITTED\t403\n> +#define\tSERIALIZABLE\t404\n> +#define\tTYPE_P\t405\n> +#define\tABORT_TRANS\t406\n> +#define\tACCESS\t407\n> +#define\tAFTER\t408\n> +#define\tAGGREGATE\t409\n> +#define\tANALYZE\t410\n> +#define\tBACKWARD\t411\n> +#define\tBEFORE\t412\n> +#define\tBINARY\t413\n> +#define\tCACHE\t414\n> +#define\tCLUSTER\t415\n> +#define\tCOPY\t416\n> +#define\tCREATEDB\t417\n> +#define\tCREATEUSER\t418\n> +#define\tCYCLE\t419\n> +#define\tDATABASE\t420\n> +#define\tDELIMITERS\t421\n> +#define\tDO\t422\n> +#define\tEACH\t423\n> +#define\tENCODING\t424\n> +#define\tEXCLUSIVE\t425\n> +#define\tEXPLAIN\t426\n> +#define\tEXTEND\t427\n> +#define\tFORWARD\t428\n> +#define\tFUNCTION\t429\n> +#define\tHANDLER\t430\n> +#define\tINCREMENT\t431\n> +#define\tINDEX\t432\n> +#define\tINHERITS\t433\n> +#define\tINSTEAD\t434\n> +#define\tISNULL\t435\n> +#define\tLANCOMPILER\t436\n> +#define\tLIMIT\t437\n> +#define\tLISTEN\t438\n> +#define\tLOAD\t439\n> +#define\tLOCATION\t440\n> +#define\tLOCK_P\t441\n> +#define\tMAXVALUE\t442\n> +#define\tMINVALUE\t443\n> +#define\tMODE\t444\n> +#define\tMOVE\t445\n> +#define\tNEW\t446\n> +#define\tNOCREATEDB\t447\n> +#define\tNOCREATEUSER\t448\n> +#define\tNONE\t449\n> +#define\tNOTHING\t450\n> +#define\tNOTIFY\t451\n> +#define\tNOTNULL\t452\n> +#define\tOFFSET\t453\n> +#define\tOIDS\t454\n> +#define\tOPERATOR\t455\n> +#define\tPASSWORD\t456\n> +#define\tPROCEDURAL\t457\n> +#define\tRENAME\t458\n> +#define\tRESET\t459\n> +#define\tRETURNS\t460\n> +#define\tROW\t461\n> +#define\tRULE\t462\n> +#define\tSEQUENCE\t463\n> +#define\tSERIAL\t464\n> +#define\tSETOF\t465\n> +#define\tSHARE\t466\n> +#define\tSHOW\t467\n> +#define\tSTART\t468\n> +#define\tSTATEMENT\t469\n> +#define\tSTDIN\t470\n> +#define\tSTDOUT\t471\n> +#define\tTRUSTED\t472\n> +#define\tUNLISTEN\t473\n> +#define\tUNTIL\t474\n> +#define\tVACUUM\t475\n> +#define\tVALID\t476\n> +#define\tVERBOSE\t477\n> +#define\tVERSION\t478\n> +#define\tIDENT\t479\n> +#define\tSCONST\t480\n> +#define\tOp\t481\n> +#define\tICONST\t482\n> +#define\tPARAM\t483\n> +#define\tFCONST\t484\n> +#define\tOP\t485\n> +#define\tUMINUS\t486\n> +#define\tTYPECAST\t487\n> \n> \n> extern YYSTYPE yylval;\n> diff -urbw postgresql-6.5.2/src/backend/parser/parse_func.c postgresql-6.5.2-patched/src/backend/parser/parse_func.c\n> --- postgresql-6.5.2/src/backend/parser/parse_func.c\tFri Jun 18 00:21:40 1999\n> +++ postgresql-6.5.2-patched/src/backend/parser/parse_func.c\tWed Mar 1 16:33:53 2000\n> @@ -601,7 +601,8 @@\n> \n> \t\tif ((aclcheck_result = pg_aclcheck(seqrel, GetPgUserName(),\n> \t\t\t\t\t (((funcid == F_NEXTVAL) || (funcid == F_SETVAL)) ?\n> -\t\t\t\t\t\tACL_WR : ACL_RD)))\n> +\t\t\t\t\t\t/* if nextval and setval are atomic, which I don't know, update should be enough */\n> +\t\t\t\t\t\tACL_UP : ACL_RD)))\n> \t\t\t!= ACLCHECK_OK)\n> \t\t\telog(ERROR, \"%s.%s: %s\",\n> \t\t\t seqrel, funcname, aclcheck_error_strings[aclcheck_result]);\n> diff -urbw postgresql-6.5.2/src/backend/rewrite/locks.c postgresql-6.5.2-patched/src/backend/rewrite/locks.c\n> --- postgresql-6.5.2/src/backend/rewrite/locks.c\tSun Feb 14 00:17:44 1999\n> +++ postgresql-6.5.2-patched/src/backend/rewrite/locks.c\tWed Mar 1 16:34:20 2000\n> @@ -228,8 +228,15 @@\n> \t\t\t\t\t\tcase CMD_INSERT:\n> \t\t\t\t\t\t\treqperm = ACL_AP;\n> \t\t\t\t\t\t\tbreak;\n> +\t\t\t\t\t\tcase CMD_DELETE:\n> +\t\t\t\t\t\t\treqperm = ACL_DE;\n> +\t\t\t\t\t\t\tbreak;\n> +\t\t\t\t\t\tcase CMD_UPDATE:\n> +\t\t\t\t\t\t\treqperm = ACL_UP;\n> +\t\t\t\t\t\t\tbreak;\n> \t\t\t\t\t\tdefault:\n> -\t\t\t\t\t\t\treqperm = ACL_WR;\n> +\t\t\t\t\t\t\t/* is it The Right Thing To Do (tm) ? */\n> +\t\t\t\t\t\t\treqperm = ACL_AP | ACL_DE | ACL_UP;\n> \t\t\t\t\t\t\tbreak;\n> \t\t\t\t\t}\n> \t\t\t\telse\n> diff -urbw postgresql-6.5.2/src/backend/rewrite/rewriteHandler.c postgresql-6.5.2-patched/src/backend/rewrite/rewriteHandler.c\n> --- postgresql-6.5.2/src/backend/rewrite/rewriteHandler.c\tSun Jul 11 19:54:30 1999\n> +++ postgresql-6.5.2-patched/src/backend/rewrite/rewriteHandler.c\tWed Mar 1 16:35:01 2000\n> @@ -2282,8 +2282,15 @@\n> \t\t\t\tcase CMD_INSERT:\n> \t\t\t\t\treqperm = ACL_AP;\n> \t\t\t\t\tbreak;\n> +\t\t\t\tcase CMD_DELETE:\n> +\t\t\t\t\treqperm = ACL_DE;\n> +\t\t\t\t\tbreak;\n> +\t\t\t\tcase CMD_UPDATE:\n> +\t\t\t\t\treqperm = ACL_UP;\n> +\t\t\t\t\tbreak;\n> \t\t\t\tdefault:\n> -\t\t\t\t\treqperm = ACL_WR;\n> +\t\t\t\t\t/* is it The Right Thing To Do (tm) ? */\n> +\t\t\t\t\treqperm = ACL_AP | ACL_DE | ACL_UP;\n> \t\t\t\t\tbreak;\n> \t\t\t}\n> \n> diff -urbw postgresql-6.5.2/src/backend/storage/file/fd.c postgresql-6.5.2-patched/src/backend/storage/file/fd.c\n> diff -urbw postgresql-6.5.2/src/backend/utils/adt/acl.c postgresql-6.5.2-patched/src/backend/utils/adt/acl.c\n> --- postgresql-6.5.2/src/backend/utils/adt/acl.c\tMon Aug 2 07:24:49 1999\n> +++ postgresql-6.5.2-patched/src/backend/utils/adt/acl.c\tWed Mar 1 16:35:53 2000\n> @@ -154,8 +154,11 @@\n> \t\t\tcase ACL_MODE_RD_CHR:\n> \t\t\t\taip->ai_mode |= ACL_RD;\n> \t\t\t\tbreak;\n> -\t\t\tcase ACL_MODE_WR_CHR:\n> -\t\t\t\taip->ai_mode |= ACL_WR;\n> +\t\t\tcase ACL_MODE_DE_CHR:\n> +\t\t\t\taip->ai_mode |= ACL_DE;\n> +\t\t\t\tbreak;\n> +\t\t\tcase ACL_MODE_UP_CHR:\n> +\t\t\t\taip->ai_mode |= ACL_UP;\n> \t\t\t\tbreak;\n> \t\t\tcase ACL_MODE_RU_CHR:\n> \t\t\t\taip->ai_mode |= ACL_RU;\n> @@ -272,7 +275,7 @@\n> \tif (!aip)\n> \t\taip = &default_aclitem;\n> \n> -\tp = out = palloc(strlen(\"group =arwR \") + 1 + NAMEDATALEN);\n> +\tp = out = palloc(strlen(\"group =arRdu \") + 1 + NAMEDATALEN);\n> \tif (!out)\n> \t\telog(ERROR, \"aclitemout: palloc failed\");\n> \t*p = '\\0';\n> @@ -605,9 +608,8 @@\n> \tint\t\t\ti;\n> \tint\t\t\tl;\n> \n> -\tAssert(strlen(old_privlist) < 5);\n> -\tpriv = palloc(5); /* at most \"rwaR\" */ ;\n> -\n> +\tAssert(strlen(old_privlist) < 6);\n> +\tpriv = palloc(6); /* at most \"arduR\" */ ;\n> \tif (old_privlist == NULL || old_privlist[0] == '\\0')\n> \t{\n> \t\tpriv[0] = new_priv;\n> @@ -619,7 +621,7 @@\n> \n> \tl = strlen(old_privlist);\n> \n> -\tif (l == 4)\n> +\tif (l == 5)\n> \t{\t\t\t\t\t\t\t/* can't add any more privileges */\n> \t\treturn priv;\n> \t}\n> diff -urbw postgresql-6.5.2/src/include/utils/acl.h postgresql-6.5.2-patched/src/include/utils/acl.h\n> --- postgresql-6.5.2/src/include/utils/acl.h\tFri Jul 30 19:07:22 1999\n> +++ postgresql-6.5.2-patched/src/include/utils/acl.h\tWed Mar 1 16:40:50 2000\n> @@ -54,9 +54,10 @@\n> #define ACL_NO\t\t\t0\t\t/* no permissions */\n> #define ACL_AP\t\t\t(1<<0)\t/* append */\n> #define ACL_RD\t\t\t(1<<1)\t/* read */\n> -#define ACL_WR\t\t\t(1<<2)\t/* write (append/delete/replace) */\n> -#define ACL_RU\t\t\t(1<<3)\t/* place rules */\n> -#define N_ACL_MODES\t\t4\n> +#define ACL_DE\t\t\t(1<<2)\t/* delete */\n> +#define ACL_UP\t\t\t(1<<3)\t/* update/replace */\n> +#define ACL_RU\t\t\t(1<<4)\t/* place rules */\n> +#define N_ACL_MODES\t\t5\n> \n> #define ACL_MODECHG_ADD\t\t\t1\n> #define ACL_MODECHG_DEL\t\t\t2\n> @@ -65,7 +66,8 @@\n> /* change this line if you want to set the default acl permission */\n> #define ACL_WORLD_DEFAULT\t\t(ACL_NO)\n> /* #define\t\tACL_WORLD_DEFAULT\t\t(ACL_RD|ACL_WR|ACL_AP|ACL_RU) */\n> -#define ACL_OWNER_DEFAULT\t\t(ACL_RD|ACL_WR|ACL_AP|ACL_RU)\n> +\n> +#define ACL_OWNER_DEFAULT\t\t(ACL_AP|ACL_RD|ACL_RU|ACL_DE|ACL_UP)\n> \n> /*\n> * AclItem\n> @@ -118,10 +120,12 @@\n> #define ACL_MODECHG_ADD_CHR\t\t'+'\n> #define ACL_MODECHG_DEL_CHR\t\t'-'\n> #define ACL_MODECHG_EQL_CHR\t\t'='\n> -#define ACL_MODE_STR\t\t\t\"arwR\"\t/* list of valid characters */\n> +\n> +#define ACL_MODE_STR\t\t\t\"arduR\"\t /* list of valid characters */\n> #define ACL_MODE_AP_CHR\t\t\t'a'\n> #define ACL_MODE_RD_CHR\t\t\t'r'\n> -#define ACL_MODE_WR_CHR\t\t\t'w'\n> +#define ACL_MODE_DE_CHR\t\t\t'd'\n> +#define ACL_MODE_UP_CHR\t\t\t'u'\n> #define ACL_MODE_RU_CHR\t\t\t'R'\n> \n> /* result codes for pg_aclcheck */\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 13:32:54 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: grant/revoke bug with delete/update" }, { "msg_contents": "On Mon, 2 Oct 2000, Bruce Momjian wrote:\n\n> I tried to apply this patch to the current tree, but unfortunately,\n> changes made in permission handling prevent it from being applied.\n> \n> Seems we were too far into testing to apply this long ago, and now we\n> are too far away from the original patch to apply it now. If you are\n> still intersted, we would like to get this patch against the current\n> source tree. \n\nHi,\n\nof course I'm still interested.\n\nhowever, as you've already been warned months ago, I don't have any time\nto do it again for 7.x, I'm sorry. Maybe next year or around December, but\nnow it's impossible. \n\nsorry, but not my fault.\n\nbye,\n\nJerome Alet\n\n", "msg_date": "Tue, 3 Oct 2000 09:22:39 +0200 (MET DST)", "msg_from": "Jerome Alet <[email protected]>", "msg_from_op": false, "msg_subject": "Re: grant/revoke bug with delete/update" }, { "msg_contents": "\nThis has been fixed in 7.2beta:\n\n\t* -Permission to DELETE table also allows UPDATE (Peter E)\n\n---------------------------------------------------------------------------\n\n> Hi,\n> \n> first I'm sorry to not fill the form, I'm too lazy, and it's not platform\n> nor version dependent AFAIK.\n> \n> I recently posted a question (on Feb 23rd) to pgsql-sql concerning the\n> fact that update and insert are considered the same thing when you modify\n> permissions with grant and revoke. (Maybe it was the wrong place to post\n> it.)\n> \n> for example a \"grant delete\" also grants \"update\" which is completely\n> wrong. More importantly the user is not informed, and this could lead to\n> VERY IMPORTANT SECURITY PROBLEMS, like someone who should only be able to\n> update existing records, have the permission to delete all records... \n> \n> I've read postgresql documentation, especially the grant and revoke\n> manpages, and I've found no mention of this bug, which is IMHO a Big\n> Mistake (tm).\n> \n> attached to this message you'll find a patch for version 6.5.2 wich\n> differentiate delete and update, because before they were considered as\n> \"write\". The patch only modifies .c .y and .h files, but no documentation.\n> \n> the new acl rights look like: arRdu \n> a for append\n> r for read\n> R for rules\n> d for delete\n> u for update\n> \n> instead of: arwR\n> a for append\n> r for read\n> w for update AND delete\n> R for rules\n> \n> This patch seems to work at least with what I've tested, you'll find a\n> test session at the end of this message.\n> \n> I hope this patch will help and that it will be easy to incorporate it in\n> 7.0, which I haven't the time to do for now. \n> \n> And for the bug report I posted on Feb 23rd on \"drop user\" which keeps the\n> user's acl in the database, and the deleted user id being reused, I've not\n> done anything, but I consider this a major problem. Please consider it for\n> a next version.\n> \n> Because I'm not an expert, I suggest you remove gram.c before applying the\n> patch, in order for this file to be generated again from gram.y, but maybe\n> this is not necessary.\n> \n> I'd be very pleased if some people could test this more than I can,\n> because I don't use postgresql intensively with special permissions.\n> \n> I'm not sure for some parts of the patch, especially in execMain.c\n> so if a postgresql hacker could examine it, this would be fine.\n> \n> dump of test session:\n> ---------------------\n> \n> ------- CUT -------\n> \n> template1=> create database db;\n> CREATEDB\n> template1=> create user john;\n> CREATE USER\n> template1=> \\connect db\n> connecting to new database: db\n> db=> create table t (id INT4, name TEXT);\n> CREATE\n> db=> \\z\n> Database = db\n> +----------+--------------------------+\n> | Relation | Grant/Revoke Permissions |\n> +----------+--------------------------+\n> | t | |\n> +----------+--------------------------+\n> db=> grant all on t to john;\n> CHANGE\n> db=> \\z\n> Database = db\n> +----------+--------------------------+\n> | Relation | Grant/Revoke Permissions |\n> +----------+--------------------------+\n> | t | {\"=\",\"john=arduR\"} |\n> +----------+--------------------------+\n> db=> \\connect db john\n> connecting to new database: db as user: john\n> db=> insert into t (id, name) values (1, 'xxx');\n> INSERT 18560 1\n> db=> update t set name = 'yyy' where id=1;\n> UPDATE 1\n> db=> select * from t;\n> id|name\n> --+----\n> 1|yyy\n> (1 row)\n> \n> db=> delete from t;\n> DELETE 1\n> db=> select * from t;\n> id|name\n> --+----\n> (0 rows)\n> \n> db=> insert into t (id, name) values (1, 'xxx');\n> INSERT 18561 1\n> db=> \\connect db postgres\n> connecting to new database: db as user: postgres\n> db=> revoke update on t from john;\n> CHANGE\n> db=> \\z\n> Database = db\n> +----------+--------------------------+\n> | Relation | Grant/Revoke Permissions |\n> +----------+--------------------------+\n> | t | {\"=\",\"john=ardR\"} |\n> +----------+--------------------------+\n> db=> \\connect db john;\n> connecting to new database: db as user: john\n> db=> insert into t (id, name) values (2, 'yyy');\n> INSERT 18592 1\n> db=> update t set name='modified by john' where id=2;\n> ERROR: t: Permission denied.\n> db=> delete from t where id=2;\n> DELETE 1\n> db=> select * from t;\n> id|name\n> --+----\n> 1|xxx\n> (1 row)\n> \n> db=> \\connect db postgres\n> connecting to new database: db as user: postgres\n> db=> revoke insert on t from john;\n> CHANGE\n> db=> \\connect db john;\n> connecting to new database: db as user: john\n> db=> \\z\n> Database = db\n> +----------+--------------------------+\n> | Relation | Grant/Revoke Permissions |\n> +----------+--------------------------+\n> | t | {\"=\",\"john=rdR\"} |\n> +----------+--------------------------+\n> db=> insert into t (id, name) values (3, 'I try to insert something');\n> ERROR: t: Permission denied.\n> db=> delete from t;\n> DELETE 1\n> db=> select * from t;\n> id|name\n> --+----\n> (0 rows)\n> \n> db=> \\connect db postgres\n> connecting to new database: db as user: postgres\n> db=> insert into t (id, name) values (1, 'xxx');\n> INSERT 18624 1\n> db=> \\connect db john;\n> connecting to new database: db as user: john\n> db=> update t set name='john' where id =1;\n> ERROR: t: Permission denied.\n> db=> \\connect db postgres\n> connecting to new database: db as user: postgres\n> db=> revoke delete on t from john;\n> CHANGE\n> db=> grant update on t to john;\n> CHANGE\n> db=> \\connect db john;\n> connecting to new database: db as user: john\n> db=> delete from t;\n> ERROR: t: Permission denied.\n> db=> update t set name='john' where id=1;\n> UPDATE 1\n> db=> select * from t;\n> id|name\n> --+----\n> 1|john\n> (1 row)\n> \n> ------- CUT -------\n> \n> Thank you for reading.\n> \n> bye,\n> \n> Jerome ALET - [email protected] - http://cortex.unice.fr/~jerome\n> Faculte de Medecine de Nice - http://noe.unice.fr - Tel: 04 93 37 76 30 \n> 28 Avenue de Valombrose - 06107 NICE Cedex 2 - FRANCE\n\nContent-Description: the 6.5.2 patch\n\n> diff -urbw postgresql-6.5.2/src/backend/catalog/aclchk.c postgresql-6.5.2-patched/src/backend/catalog/aclchk.c\n> --- postgresql-6.5.2/src/backend/catalog/aclchk.c\tMon Aug 2 07:56:53 1999\n> +++ postgresql-6.5.2-patched/src/backend/catalog/aclchk.c\tWed Mar 1 16:39:44 2000\n> @@ -381,7 +381,7 @@\n> \t\t * pg_database table, there is still additional permissions\n> \t\t * checking in dbcommands.c\n> \t\t */\n> -\t\tif ((mode & ACL_WR) || (mode & ACL_AP))\n> +\t\tif (mode & ACL_AP)\n> \t\t\treturn ACLCHECK_OK;\n> \t}\n> \n> @@ -390,7 +390,7 @@\n> \t * pg_shadow.usecatupd is set.\t(This is to let superusers protect\n> \t * themselves from themselves.)\n> \t */\n> -\tif (((mode & ACL_WR) || (mode & ACL_AP)) &&\n> +\tif ((mode & ACL_AP) &&\n> \t\t!allowSystemTableMods && IsSystemRelationName(relname) &&\n> \t\t!((Form_pg_shadow) GETSTRUCT(tuple))->usecatupd)\n> \t{\n> diff -urbw postgresql-6.5.2/src/backend/commands/command.c postgresql-6.5.2-patched/src/backend/commands/command.c\n> --- postgresql-6.5.2/src/backend/commands/command.c\tMon Aug 2 07:56:57 1999\n> +++ postgresql-6.5.2-patched/src/backend/commands/command.c\tWed Mar 1 16:30:23 2000\n> @@ -524,7 +524,9 @@\n> \tif (lockstmt->mode == AccessShareLock)\n> \t\taclresult = pg_aclcheck(lockstmt->relname, GetPgUserName(), ACL_RD);\n> \telse\n> -\t\taclresult = pg_aclcheck(lockstmt->relname, GetPgUserName(), ACL_WR);\n> +\t\t/* do we really need to have all these permissions at the same time ? */\n> +\t\t/* shouldn't we test lockstmt->mode first ? */\n> +\t\taclresult = pg_aclcheck(lockstmt->relname, GetPgUserName(), (ACL_AP | ACL_DE | ACL_UP));\n> \n> \tif (aclresult != ACLCHECK_OK)\n> \t\telog(ERROR, \"LOCK TABLE: permission denied\");\n> diff -urbw postgresql-6.5.2/src/backend/commands/copy.c postgresql-6.5.2-patched/src/backend/commands/copy.c\n> --- postgresql-6.5.2/src/backend/commands/copy.c\tSat Jul 3 02:32:39 1999\n> +++ postgresql-6.5.2-patched/src/backend/commands/copy.c\tWed Mar 1 16:30:35 2000\n> @@ -242,7 +242,8 @@\n> \tFILE\t *fp;\n> \tRelation\trel;\n> \textern char *UserName;\t\t/* defined in global.c */\n> -\tconst AclMode required_access = from ? ACL_WR : ACL_RD;\n> +\t/* why should we need other permissions than APPEND ? */\n> +\tconst AclMode required_access = from ? ACL_AP : ACL_RD;\n> \tint\t\t\tresult;\n> \n> \trel = heap_openr(relname);\n> diff -urbw postgresql-6.5.2/src/backend/commands/sequence.c postgresql-6.5.2-patched/src/backend/commands/sequence.c\n> --- postgresql-6.5.2/src/backend/commands/sequence.c\tMon Aug 2 07:56:59 1999\n> +++ postgresql-6.5.2-patched/src/backend/commands/sequence.c\tWed Mar 1 16:31:05 2000\n> @@ -314,7 +314,8 @@\n> \tForm_pg_sequence seq;\n> \n> #ifndef NO_SECURITY\n> -\tif (pg_aclcheck(seqname, getpgusername(), ACL_WR) != ACLCHECK_OK)\n> +\t/* why should we need more than UPDATE permission ? */\n> +\tif (pg_aclcheck(seqname, getpgusername(), ACL_UP) != ACLCHECK_OK)\n> \t\telog(ERROR, \"%s.setval: you don't have permissions to set sequence %s\",\n> \t\t\t seqname, seqname);\n> #endif\n> diff -urbw postgresql-6.5.2/src/backend/commands/user.c postgresql-6.5.2-patched/src/backend/commands/user.c\n> --- postgresql-6.5.2/src/backend/commands/user.c\tMon Aug 2 07:56:59 1999\n> +++ postgresql-6.5.2-patched/src/backend/commands/user.c\tWed Mar 1 16:31:38 2000\n> @@ -115,7 +115,7 @@\n> \t * pg_shadow relation.\n> \t */\n> \tpg_shadow = GetPgUserName();\n> -\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_WR | ACL_AP) != ACLCHECK_OK)\n> +\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_AP | ACL_DE | ACL_UP) != ACLCHECK_OK)\n> \t{\n> \t\tUserAbortTransactionBlock();\n> \t\telog(ERROR, \"defineUser: user \\\"%s\\\" does not have SELECT and INSERT privilege for \\\"%s\\\"\",\n> @@ -227,7 +227,8 @@\n> \t * pg_shadow relation.\n> \t */\n> \tpg_shadow = GetPgUserName();\n> -\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_WR) != ACLCHECK_OK)\n> +\t/* why should we need more than UPDATE ? */\n> +\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_UP) != ACLCHECK_OK)\n> \t{\n> \t\tUserAbortTransactionBlock();\n> \t\telog(ERROR, \"alterUser: user \\\"%s\\\" does not have SELECT and UPDATE privilege for \\\"%s\\\"\",\n> @@ -329,11 +330,12 @@\n> \t\tBeginTransactionBlock();\n> \n> \t/*\n> -\t * Make sure the user attempting to create a user can delete from the\n> +\t * Make sure the user attempting to delete a user can delete from the\n> \t * pg_shadow relation.\n> \t */\n> \tpg_shadow = GetPgUserName();\n> -\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_WR) != ACLCHECK_OK)\n> +\t/* why should we need more than DELETE ? */\n> +\tif (pg_aclcheck(ShadowRelationName, pg_shadow, ACL_RD | ACL_DE) != ACLCHECK_OK)\n> \t{\n> \t\tUserAbortTransactionBlock();\n> \t\telog(ERROR, \"removeUser: user \\\"%s\\\" does not have SELECT and DELETE privilege for \\\"%s\\\"\",\n> diff -urbw postgresql-6.5.2/src/backend/executor/execMain.c postgresql-6.5.2-patched/src/backend/executor/execMain.c\n> --- postgresql-6.5.2/src/backend/executor/execMain.c\tThu Jun 17 17:15:49 1999\n> +++ postgresql-6.5.2-patched/src/backend/executor/execMain.c\tWed Mar 1 18:31:31 2000\n> @@ -464,14 +464,16 @@\n> \t\t\tswitch (operation)\n> \t\t\t{\n> \t\t\t\tcase CMD_INSERT:\n> -\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_AP)) == ACLCHECK_OK) ||\n> -\t\t\t\t\t\t((aclcheck_result = CHECK(ACL_WR)) == ACLCHECK_OK);\n> +\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_AP)) == ACLCHECK_OK);\n> \t\t\t\t\topstr = \"append\";\n> \t\t\t\t\tbreak;\n> \t\t\t\tcase CMD_DELETE:\n> +\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_DE)) == ACLCHECK_OK);\n> +\t\t\t\t\topstr = \"delete\";\n> +\t\t\t\t\tbreak;\n> \t\t\t\tcase CMD_UPDATE:\n> -\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_WR)) == ACLCHECK_OK);\n> -\t\t\t\t\topstr = \"write\";\n> +\t\t\t\t\tok = ((aclcheck_result = CHECK(ACL_UP)) == ACLCHECK_OK);\n> +\t\t\t\t\topstr = \"update\";\n> \t\t\t\t\tbreak;\n> \t\t\t\tdefault:\n> \t\t\t\t\telog(ERROR, \"ExecCheckPerms: bogus operation %d\",\n> @@ -508,8 +510,9 @@\n> \t\t\tStrNCpy(rname.data,\n> \t\t\t\t\t((Form_pg_class) GETSTRUCT(htup))->relname.data,\n> \t\t\t\t\tNAMEDATALEN);\n> -\t\t\tok = ((aclcheck_result = CHECK(ACL_WR)) == ACLCHECK_OK);\n> -\t\t\topstr = \"write\";\n> +\t\t\t/* is it the right thing to do ? */\n> +\t\t\tok = ((aclcheck_result = CHECK((ACL_AP | ACL_DE | ACL_UP))) == ACLCHECK_OK);\n> +\t\t\topstr = \"write\";\t/* unused ? */\n> \t\t\tif (!ok)\n> \t\t\t\telog(ERROR, \"%s: %s\", rname.data, aclcheck_error_strings[aclcheck_result]);\n> \t\t}\n> diff -urbw postgresql-6.5.2/src/backend/parser/gram.y postgresql-6.5.2-patched/src/backend/parser/gram.y\n> --- postgresql-6.5.2/src/backend/parser/gram.y\tTue Sep 14 08:07:35 1999\n> +++ postgresql-6.5.2-patched/src/backend/parser/gram.y\tWed Mar 1 16:33:34 2000\n> @@ -1694,11 +1694,11 @@\n> \n> privileges: ALL PRIVILEGES\n> \t\t\t\t{\n> -\t\t\t\t $$ = aclmakepriv(\"rwaR\",0);\n> +\t\t\t\t $$ = aclmakepriv(\"raduR\",0);\n> \t\t\t\t}\n> \t\t| ALL\n> \t\t\t\t{\n> -\t\t\t\t $$ = aclmakepriv(\"rwaR\",0);\n> +\t\t\t\t $$ = aclmakepriv(\"raduR\",0);\n> \t\t\t\t}\n> \t\t| operation_commalist\n> \t\t\t\t{\n> @@ -1726,11 +1726,11 @@\n> \t\t\t\t}\n> \t\t| UPDATE\n> \t\t\t\t{\n> -\t\t\t\t\t\t$$ = ACL_MODE_WR_CHR;\n> +\t\t\t\t\t\t$$ = ACL_MODE_UP_CHR;\n> \t\t\t\t}\n> \t\t| DELETE\n> \t\t\t\t{\n> -\t\t\t\t\t\t$$ = ACL_MODE_WR_CHR;\n> +\t\t\t\t\t\t$$ = ACL_MODE_DE_CHR;\n> \t\t\t\t}\n> \t\t| RULE\n> \t\t\t\t{\n> diff -urbw postgresql-6.5.2/src/backend/parser/parse.h postgresql-6.5.2-patched/src/backend/parser/parse.h\n> --- postgresql-6.5.2/src/backend/parser/parse.h\tThu Sep 16 02:23:39 1999\n> +++ postgresql-6.5.2-patched/src/backend/parser/parse.h\tWed Mar 1 18:34:46 2000\n> @@ -29,236 +29,236 @@\n> \tRuleStmt\t\t\t*rstmt;\n> \tInsertStmt\t\t\t*astmt;\n> } YYSTYPE;\n> -#define\tABSOLUTE\t257\n> -#define\tACTION\t258\n> -#define\tADD\t259\n> -#define\tALL\t260\n> -#define\tALTER\t261\n> -#define\tAND\t262\n> -#define\tANY\t263\n> -#define\tAS\t264\n> -#define\tASC\t265\n> -#define\tBEGIN_TRANS\t266\n> -#define\tBETWEEN\t267\n> -#define\tBOTH\t268\n> -#define\tBY\t269\n> -#define\tCASCADE\t270\n> -#define\tCASE\t271\n> -#define\tCAST\t272\n> -#define\tCHAR\t273\n> -#define\tCHARACTER\t274\n> -#define\tCHECK\t275\n> -#define\tCLOSE\t276\n> -#define\tCOALESCE\t277\n> -#define\tCOLLATE\t278\n> -#define\tCOLUMN\t279\n> -#define\tCOMMIT\t280\n> -#define\tCONSTRAINT\t281\n> -#define\tCREATE\t282\n> -#define\tCROSS\t283\n> -#define\tCURRENT\t284\n> -#define\tCURRENT_DATE\t285\n> -#define\tCURRENT_TIME\t286\n> -#define\tCURRENT_TIMESTAMP\t287\n> -#define\tCURRENT_USER\t288\n> -#define\tCURSOR\t289\n> -#define\tDAY_P\t290\n> -#define\tDECIMAL\t291\n> -#define\tDECLARE\t292\n> -#define\tDEFAULT\t293\n> -#define\tDELETE\t294\n> -#define\tDESC\t295\n> -#define\tDISTINCT\t296\n> -#define\tDOUBLE\t297\n> -#define\tDROP\t298\n> -#define\tELSE\t299\n> -#define\tEND_TRANS\t300\n> -#define\tEXCEPT\t301\n> -#define\tEXECUTE\t302\n> -#define\tEXISTS\t303\n> -#define\tEXTRACT\t304\n> -#define\tFALSE_P\t305\n> -#define\tFETCH\t306\n> -#define\tFLOAT\t307\n> -#define\tFOR\t308\n> -#define\tFOREIGN\t309\n> -#define\tFROM\t310\n> -#define\tFULL\t311\n> -#define\tGLOBAL\t312\n> -#define\tGRANT\t313\n> -#define\tGROUP\t314\n> -#define\tHAVING\t315\n> -#define\tHOUR_P\t316\n> -#define\tIN\t317\n> -#define\tINNER_P\t318\n> -#define\tINSENSITIVE\t319\n> -#define\tINSERT\t320\n> -#define\tINTERSECT\t321\n> -#define\tINTERVAL\t322\n> -#define\tINTO\t323\n> -#define\tIS\t324\n> -#define\tISOLATION\t325\n> -#define\tJOIN\t326\n> -#define\tKEY\t327\n> -#define\tLANGUAGE\t328\n> -#define\tLEADING\t329\n> -#define\tLEFT\t330\n> -#define\tLEVEL\t331\n> -#define\tLIKE\t332\n> -#define\tLOCAL\t333\n> -#define\tMATCH\t334\n> -#define\tMINUTE_P\t335\n> -#define\tMONTH_P\t336\n> -#define\tNAMES\t337\n> -#define\tNATIONAL\t338\n> -#define\tNATURAL\t339\n> -#define\tNCHAR\t340\n> -#define\tNEXT\t341\n> -#define\tNO\t342\n> -#define\tNOT\t343\n> -#define\tNULLIF\t344\n> -#define\tNULL_P\t345\n> -#define\tNUMERIC\t346\n> -#define\tOF\t347\n> -#define\tON\t348\n> -#define\tONLY\t349\n> -#define\tOPTION\t350\n> -#define\tOR\t351\n> -#define\tORDER\t352\n> -#define\tOUTER_P\t353\n> -#define\tPARTIAL\t354\n> -#define\tPOSITION\t355\n> -#define\tPRECISION\t356\n> -#define\tPRIMARY\t357\n> -#define\tPRIOR\t358\n> -#define\tPRIVILEGES\t359\n> -#define\tPROCEDURE\t360\n> -#define\tPUBLIC\t361\n> -#define\tREAD\t362\n> -#define\tREFERENCES\t363\n> -#define\tRELATIVE\t364\n> -#define\tREVOKE\t365\n> -#define\tRIGHT\t366\n> -#define\tROLLBACK\t367\n> -#define\tSCROLL\t368\n> -#define\tSECOND_P\t369\n> -#define\tSELECT\t370\n> -#define\tSET\t371\n> -#define\tSUBSTRING\t372\n> -#define\tTABLE\t373\n> -#define\tTEMP\t374\n> -#define\tTEMPORARY\t375\n> -#define\tTHEN\t376\n> -#define\tTIME\t377\n> -#define\tTIMESTAMP\t378\n> -#define\tTIMEZONE_HOUR\t379\n> -#define\tTIMEZONE_MINUTE\t380\n> -#define\tTO\t381\n> -#define\tTRAILING\t382\n> -#define\tTRANSACTION\t383\n> -#define\tTRIM\t384\n> -#define\tTRUE_P\t385\n> -#define\tUNION\t386\n> -#define\tUNIQUE\t387\n> -#define\tUPDATE\t388\n> -#define\tUSER\t389\n> -#define\tUSING\t390\n> -#define\tVALUES\t391\n> -#define\tVARCHAR\t392\n> -#define\tVARYING\t393\n> -#define\tVIEW\t394\n> -#define\tWHEN\t395\n> -#define\tWHERE\t396\n> -#define\tWITH\t397\n> -#define\tWORK\t398\n> -#define\tYEAR_P\t399\n> -#define\tZONE\t400\n> -#define\tTRIGGER\t401\n> -#define\tCOMMITTED\t402\n> -#define\tSERIALIZABLE\t403\n> -#define\tTYPE_P\t404\n> -#define\tABORT_TRANS\t405\n> -#define\tACCESS\t406\n> -#define\tAFTER\t407\n> -#define\tAGGREGATE\t408\n> -#define\tANALYZE\t409\n> -#define\tBACKWARD\t410\n> -#define\tBEFORE\t411\n> -#define\tBINARY\t412\n> -#define\tCACHE\t413\n> -#define\tCLUSTER\t414\n> -#define\tCOPY\t415\n> -#define\tCREATEDB\t416\n> -#define\tCREATEUSER\t417\n> -#define\tCYCLE\t418\n> -#define\tDATABASE\t419\n> -#define\tDELIMITERS\t420\n> -#define\tDO\t421\n> -#define\tEACH\t422\n> -#define\tENCODING\t423\n> -#define\tEXCLUSIVE\t424\n> -#define\tEXPLAIN\t425\n> -#define\tEXTEND\t426\n> -#define\tFORWARD\t427\n> -#define\tFUNCTION\t428\n> -#define\tHANDLER\t429\n> -#define\tINCREMENT\t430\n> -#define\tINDEX\t431\n> -#define\tINHERITS\t432\n> -#define\tINSTEAD\t433\n> -#define\tISNULL\t434\n> -#define\tLANCOMPILER\t435\n> -#define\tLIMIT\t436\n> -#define\tLISTEN\t437\n> -#define\tLOAD\t438\n> -#define\tLOCATION\t439\n> -#define\tLOCK_P\t440\n> -#define\tMAXVALUE\t441\n> -#define\tMINVALUE\t442\n> -#define\tMODE\t443\n> -#define\tMOVE\t444\n> -#define\tNEW\t445\n> -#define\tNOCREATEDB\t446\n> -#define\tNOCREATEUSER\t447\n> -#define\tNONE\t448\n> -#define\tNOTHING\t449\n> -#define\tNOTIFY\t450\n> -#define\tNOTNULL\t451\n> -#define\tOFFSET\t452\n> -#define\tOIDS\t453\n> -#define\tOPERATOR\t454\n> -#define\tPASSWORD\t455\n> -#define\tPROCEDURAL\t456\n> -#define\tRENAME\t457\n> -#define\tRESET\t458\n> -#define\tRETURNS\t459\n> -#define\tROW\t460\n> -#define\tRULE\t461\n> -#define\tSEQUENCE\t462\n> -#define\tSERIAL\t463\n> -#define\tSETOF\t464\n> -#define\tSHARE\t465\n> -#define\tSHOW\t466\n> -#define\tSTART\t467\n> -#define\tSTATEMENT\t468\n> -#define\tSTDIN\t469\n> -#define\tSTDOUT\t470\n> -#define\tTRUSTED\t471\n> -#define\tUNLISTEN\t472\n> -#define\tUNTIL\t473\n> -#define\tVACUUM\t474\n> -#define\tVALID\t475\n> -#define\tVERBOSE\t476\n> -#define\tVERSION\t477\n> -#define\tIDENT\t478\n> -#define\tSCONST\t479\n> -#define\tOp\t480\n> -#define\tICONST\t481\n> -#define\tPARAM\t482\n> -#define\tFCONST\t483\n> -#define\tOP\t484\n> -#define\tUMINUS\t485\n> -#define\tTYPECAST\t486\n> +#define\tABSOLUTE\t258\n> +#define\tACTION\t259\n> +#define\tADD\t260\n> +#define\tALL\t261\n> +#define\tALTER\t262\n> +#define\tAND\t263\n> +#define\tANY\t264\n> +#define\tAS\t265\n> +#define\tASC\t266\n> +#define\tBEGIN_TRANS\t267\n> +#define\tBETWEEN\t268\n> +#define\tBOTH\t269\n> +#define\tBY\t270\n> +#define\tCASCADE\t271\n> +#define\tCASE\t272\n> +#define\tCAST\t273\n> +#define\tCHAR\t274\n> +#define\tCHARACTER\t275\n> +#define\tCHECK\t276\n> +#define\tCLOSE\t277\n> +#define\tCOALESCE\t278\n> +#define\tCOLLATE\t279\n> +#define\tCOLUMN\t280\n> +#define\tCOMMIT\t281\n> +#define\tCONSTRAINT\t282\n> +#define\tCREATE\t283\n> +#define\tCROSS\t284\n> +#define\tCURRENT\t285\n> +#define\tCURRENT_DATE\t286\n> +#define\tCURRENT_TIME\t287\n> +#define\tCURRENT_TIMESTAMP\t288\n> +#define\tCURRENT_USER\t289\n> +#define\tCURSOR\t290\n> +#define\tDAY_P\t291\n> +#define\tDECIMAL\t292\n> +#define\tDECLARE\t293\n> +#define\tDEFAULT\t294\n> +#define\tDELETE\t295\n> +#define\tDESC\t296\n> +#define\tDISTINCT\t297\n> +#define\tDOUBLE\t298\n> +#define\tDROP\t299\n> +#define\tELSE\t300\n> +#define\tEND_TRANS\t301\n> +#define\tEXCEPT\t302\n> +#define\tEXECUTE\t303\n> +#define\tEXISTS\t304\n> +#define\tEXTRACT\t305\n> +#define\tFALSE_P\t306\n> +#define\tFETCH\t307\n> +#define\tFLOAT\t308\n> +#define\tFOR\t309\n> +#define\tFOREIGN\t310\n> +#define\tFROM\t311\n> +#define\tFULL\t312\n> +#define\tGLOBAL\t313\n> +#define\tGRANT\t314\n> +#define\tGROUP\t315\n> +#define\tHAVING\t316\n> +#define\tHOUR_P\t317\n> +#define\tIN\t318\n> +#define\tINNER_P\t319\n> +#define\tINSENSITIVE\t320\n> +#define\tINSERT\t321\n> +#define\tINTERSECT\t322\n> +#define\tINTERVAL\t323\n> +#define\tINTO\t324\n> +#define\tIS\t325\n> +#define\tISOLATION\t326\n> +#define\tJOIN\t327\n> +#define\tKEY\t328\n> +#define\tLANGUAGE\t329\n> +#define\tLEADING\t330\n> +#define\tLEFT\t331\n> +#define\tLEVEL\t332\n> +#define\tLIKE\t333\n> +#define\tLOCAL\t334\n> +#define\tMATCH\t335\n> +#define\tMINUTE_P\t336\n> +#define\tMONTH_P\t337\n> +#define\tNAMES\t338\n> +#define\tNATIONAL\t339\n> +#define\tNATURAL\t340\n> +#define\tNCHAR\t341\n> +#define\tNEXT\t342\n> +#define\tNO\t343\n> +#define\tNOT\t344\n> +#define\tNULLIF\t345\n> +#define\tNULL_P\t346\n> +#define\tNUMERIC\t347\n> +#define\tOF\t348\n> +#define\tON\t349\n> +#define\tONLY\t350\n> +#define\tOPTION\t351\n> +#define\tOR\t352\n> +#define\tORDER\t353\n> +#define\tOUTER_P\t354\n> +#define\tPARTIAL\t355\n> +#define\tPOSITION\t356\n> +#define\tPRECISION\t357\n> +#define\tPRIMARY\t358\n> +#define\tPRIOR\t359\n> +#define\tPRIVILEGES\t360\n> +#define\tPROCEDURE\t361\n> +#define\tPUBLIC\t362\n> +#define\tREAD\t363\n> +#define\tREFERENCES\t364\n> +#define\tRELATIVE\t365\n> +#define\tREVOKE\t366\n> +#define\tRIGHT\t367\n> +#define\tROLLBACK\t368\n> +#define\tSCROLL\t369\n> +#define\tSECOND_P\t370\n> +#define\tSELECT\t371\n> +#define\tSET\t372\n> +#define\tSUBSTRING\t373\n> +#define\tTABLE\t374\n> +#define\tTEMP\t375\n> +#define\tTEMPORARY\t376\n> +#define\tTHEN\t377\n> +#define\tTIME\t378\n> +#define\tTIMESTAMP\t379\n> +#define\tTIMEZONE_HOUR\t380\n> +#define\tTIMEZONE_MINUTE\t381\n> +#define\tTO\t382\n> +#define\tTRAILING\t383\n> +#define\tTRANSACTION\t384\n> +#define\tTRIM\t385\n> +#define\tTRUE_P\t386\n> +#define\tUNION\t387\n> +#define\tUNIQUE\t388\n> +#define\tUPDATE\t389\n> +#define\tUSER\t390\n> +#define\tUSING\t391\n> +#define\tVALUES\t392\n> +#define\tVARCHAR\t393\n> +#define\tVARYING\t394\n> +#define\tVIEW\t395\n> +#define\tWHEN\t396\n> +#define\tWHERE\t397\n> +#define\tWITH\t398\n> +#define\tWORK\t399\n> +#define\tYEAR_P\t400\n> +#define\tZONE\t401\n> +#define\tTRIGGER\t402\n> +#define\tCOMMITTED\t403\n> +#define\tSERIALIZABLE\t404\n> +#define\tTYPE_P\t405\n> +#define\tABORT_TRANS\t406\n> +#define\tACCESS\t407\n> +#define\tAFTER\t408\n> +#define\tAGGREGATE\t409\n> +#define\tANALYZE\t410\n> +#define\tBACKWARD\t411\n> +#define\tBEFORE\t412\n> +#define\tBINARY\t413\n> +#define\tCACHE\t414\n> +#define\tCLUSTER\t415\n> +#define\tCOPY\t416\n> +#define\tCREATEDB\t417\n> +#define\tCREATEUSER\t418\n> +#define\tCYCLE\t419\n> +#define\tDATABASE\t420\n> +#define\tDELIMITERS\t421\n> +#define\tDO\t422\n> +#define\tEACH\t423\n> +#define\tENCODING\t424\n> +#define\tEXCLUSIVE\t425\n> +#define\tEXPLAIN\t426\n> +#define\tEXTEND\t427\n> +#define\tFORWARD\t428\n> +#define\tFUNCTION\t429\n> +#define\tHANDLER\t430\n> +#define\tINCREMENT\t431\n> +#define\tINDEX\t432\n> +#define\tINHERITS\t433\n> +#define\tINSTEAD\t434\n> +#define\tISNULL\t435\n> +#define\tLANCOMPILER\t436\n> +#define\tLIMIT\t437\n> +#define\tLISTEN\t438\n> +#define\tLOAD\t439\n> +#define\tLOCATION\t440\n> +#define\tLOCK_P\t441\n> +#define\tMAXVALUE\t442\n> +#define\tMINVALUE\t443\n> +#define\tMODE\t444\n> +#define\tMOVE\t445\n> +#define\tNEW\t446\n> +#define\tNOCREATEDB\t447\n> +#define\tNOCREATEUSER\t448\n> +#define\tNONE\t449\n> +#define\tNOTHING\t450\n> +#define\tNOTIFY\t451\n> +#define\tNOTNULL\t452\n> +#define\tOFFSET\t453\n> +#define\tOIDS\t454\n> +#define\tOPERATOR\t455\n> +#define\tPASSWORD\t456\n> +#define\tPROCEDURAL\t457\n> +#define\tRENAME\t458\n> +#define\tRESET\t459\n> +#define\tRETURNS\t460\n> +#define\tROW\t461\n> +#define\tRULE\t462\n> +#define\tSEQUENCE\t463\n> +#define\tSERIAL\t464\n> +#define\tSETOF\t465\n> +#define\tSHARE\t466\n> +#define\tSHOW\t467\n> +#define\tSTART\t468\n> +#define\tSTATEMENT\t469\n> +#define\tSTDIN\t470\n> +#define\tSTDOUT\t471\n> +#define\tTRUSTED\t472\n> +#define\tUNLISTEN\t473\n> +#define\tUNTIL\t474\n> +#define\tVACUUM\t475\n> +#define\tVALID\t476\n> +#define\tVERBOSE\t477\n> +#define\tVERSION\t478\n> +#define\tIDENT\t479\n> +#define\tSCONST\t480\n> +#define\tOp\t481\n> +#define\tICONST\t482\n> +#define\tPARAM\t483\n> +#define\tFCONST\t484\n> +#define\tOP\t485\n> +#define\tUMINUS\t486\n> +#define\tTYPECAST\t487\n> \n> \n> extern YYSTYPE yylval;\n> diff -urbw postgresql-6.5.2/src/backend/parser/parse_func.c postgresql-6.5.2-patched/src/backend/parser/parse_func.c\n> --- postgresql-6.5.2/src/backend/parser/parse_func.c\tFri Jun 18 00:21:40 1999\n> +++ postgresql-6.5.2-patched/src/backend/parser/parse_func.c\tWed Mar 1 16:33:53 2000\n> @@ -601,7 +601,8 @@\n> \n> \t\tif ((aclcheck_result = pg_aclcheck(seqrel, GetPgUserName(),\n> \t\t\t\t\t (((funcid == F_NEXTVAL) || (funcid == F_SETVAL)) ?\n> -\t\t\t\t\t\tACL_WR : ACL_RD)))\n> +\t\t\t\t\t\t/* if nextval and setval are atomic, which I don't know, update should be enough */\n> +\t\t\t\t\t\tACL_UP : ACL_RD)))\n> \t\t\t!= ACLCHECK_OK)\n> \t\t\telog(ERROR, \"%s.%s: %s\",\n> \t\t\t seqrel, funcname, aclcheck_error_strings[aclcheck_result]);\n> diff -urbw postgresql-6.5.2/src/backend/rewrite/locks.c postgresql-6.5.2-patched/src/backend/rewrite/locks.c\n> --- postgresql-6.5.2/src/backend/rewrite/locks.c\tSun Feb 14 00:17:44 1999\n> +++ postgresql-6.5.2-patched/src/backend/rewrite/locks.c\tWed Mar 1 16:34:20 2000\n> @@ -228,8 +228,15 @@\n> \t\t\t\t\t\tcase CMD_INSERT:\n> \t\t\t\t\t\t\treqperm = ACL_AP;\n> \t\t\t\t\t\t\tbreak;\n> +\t\t\t\t\t\tcase CMD_DELETE:\n> +\t\t\t\t\t\t\treqperm = ACL_DE;\n> +\t\t\t\t\t\t\tbreak;\n> +\t\t\t\t\t\tcase CMD_UPDATE:\n> +\t\t\t\t\t\t\treqperm = ACL_UP;\n> +\t\t\t\t\t\t\tbreak;\n> \t\t\t\t\t\tdefault:\n> -\t\t\t\t\t\t\treqperm = ACL_WR;\n> +\t\t\t\t\t\t\t/* is it The Right Thing To Do (tm) ? */\n> +\t\t\t\t\t\t\treqperm = ACL_AP | ACL_DE | ACL_UP;\n> \t\t\t\t\t\t\tbreak;\n> \t\t\t\t\t}\n> \t\t\t\telse\n> diff -urbw postgresql-6.5.2/src/backend/rewrite/rewriteHandler.c postgresql-6.5.2-patched/src/backend/rewrite/rewriteHandler.c\n> --- postgresql-6.5.2/src/backend/rewrite/rewriteHandler.c\tSun Jul 11 19:54:30 1999\n> +++ postgresql-6.5.2-patched/src/backend/rewrite/rewriteHandler.c\tWed Mar 1 16:35:01 2000\n> @@ -2282,8 +2282,15 @@\n> \t\t\t\tcase CMD_INSERT:\n> \t\t\t\t\treqperm = ACL_AP;\n> \t\t\t\t\tbreak;\n> +\t\t\t\tcase CMD_DELETE:\n> +\t\t\t\t\treqperm = ACL_DE;\n> +\t\t\t\t\tbreak;\n> +\t\t\t\tcase CMD_UPDATE:\n> +\t\t\t\t\treqperm = ACL_UP;\n> +\t\t\t\t\tbreak;\n> \t\t\t\tdefault:\n> -\t\t\t\t\treqperm = ACL_WR;\n> +\t\t\t\t\t/* is it The Right Thing To Do (tm) ? */\n> +\t\t\t\t\treqperm = ACL_AP | ACL_DE | ACL_UP;\n> \t\t\t\t\tbreak;\n> \t\t\t}\n> \n> diff -urbw postgresql-6.5.2/src/backend/storage/file/fd.c postgresql-6.5.2-patched/src/backend/storage/file/fd.c\n> diff -urbw postgresql-6.5.2/src/backend/utils/adt/acl.c postgresql-6.5.2-patched/src/backend/utils/adt/acl.c\n> --- postgresql-6.5.2/src/backend/utils/adt/acl.c\tMon Aug 2 07:24:49 1999\n> +++ postgresql-6.5.2-patched/src/backend/utils/adt/acl.c\tWed Mar 1 16:35:53 2000\n> @@ -154,8 +154,11 @@\n> \t\t\tcase ACL_MODE_RD_CHR:\n> \t\t\t\taip->ai_mode |= ACL_RD;\n> \t\t\t\tbreak;\n> -\t\t\tcase ACL_MODE_WR_CHR:\n> -\t\t\t\taip->ai_mode |= ACL_WR;\n> +\t\t\tcase ACL_MODE_DE_CHR:\n> +\t\t\t\taip->ai_mode |= ACL_DE;\n> +\t\t\t\tbreak;\n> +\t\t\tcase ACL_MODE_UP_CHR:\n> +\t\t\t\taip->ai_mode |= ACL_UP;\n> \t\t\t\tbreak;\n> \t\t\tcase ACL_MODE_RU_CHR:\n> \t\t\t\taip->ai_mode |= ACL_RU;\n> @@ -272,7 +275,7 @@\n> \tif (!aip)\n> \t\taip = &default_aclitem;\n> \n> -\tp = out = palloc(strlen(\"group =arwR \") + 1 + NAMEDATALEN);\n> +\tp = out = palloc(strlen(\"group =arRdu \") + 1 + NAMEDATALEN);\n> \tif (!out)\n> \t\telog(ERROR, \"aclitemout: palloc failed\");\n> \t*p = '\\0';\n> @@ -605,9 +608,8 @@\n> \tint\t\t\ti;\n> \tint\t\t\tl;\n> \n> -\tAssert(strlen(old_privlist) < 5);\n> -\tpriv = palloc(5); /* at most \"rwaR\" */ ;\n> -\n> +\tAssert(strlen(old_privlist) < 6);\n> +\tpriv = palloc(6); /* at most \"arduR\" */ ;\n> \tif (old_privlist == NULL || old_privlist[0] == '\\0')\n> \t{\n> \t\tpriv[0] = new_priv;\n> @@ -619,7 +621,7 @@\n> \n> \tl = strlen(old_privlist);\n> \n> -\tif (l == 4)\n> +\tif (l == 5)\n> \t{\t\t\t\t\t\t\t/* can't add any more privileges */\n> \t\treturn priv;\n> \t}\n> diff -urbw postgresql-6.5.2/src/include/utils/acl.h postgresql-6.5.2-patched/src/include/utils/acl.h\n> --- postgresql-6.5.2/src/include/utils/acl.h\tFri Jul 30 19:07:22 1999\n> +++ postgresql-6.5.2-patched/src/include/utils/acl.h\tWed Mar 1 16:40:50 2000\n> @@ -54,9 +54,10 @@\n> #define ACL_NO\t\t\t0\t\t/* no permissions */\n> #define ACL_AP\t\t\t(1<<0)\t/* append */\n> #define ACL_RD\t\t\t(1<<1)\t/* read */\n> -#define ACL_WR\t\t\t(1<<2)\t/* write (append/delete/replace) */\n> -#define ACL_RU\t\t\t(1<<3)\t/* place rules */\n> -#define N_ACL_MODES\t\t4\n> +#define ACL_DE\t\t\t(1<<2)\t/* delete */\n> +#define ACL_UP\t\t\t(1<<3)\t/* update/replace */\n> +#define ACL_RU\t\t\t(1<<4)\t/* place rules */\n> +#define N_ACL_MODES\t\t5\n> \n> #define ACL_MODECHG_ADD\t\t\t1\n> #define ACL_MODECHG_DEL\t\t\t2\n> @@ -65,7 +66,8 @@\n> /* change this line if you want to set the default acl permission */\n> #define ACL_WORLD_DEFAULT\t\t(ACL_NO)\n> /* #define\t\tACL_WORLD_DEFAULT\t\t(ACL_RD|ACL_WR|ACL_AP|ACL_RU) */\n> -#define ACL_OWNER_DEFAULT\t\t(ACL_RD|ACL_WR|ACL_AP|ACL_RU)\n> +\n> +#define ACL_OWNER_DEFAULT\t\t(ACL_AP|ACL_RD|ACL_RU|ACL_DE|ACL_UP)\n> \n> /*\n> * AclItem\n> @@ -118,10 +120,12 @@\n> #define ACL_MODECHG_ADD_CHR\t\t'+'\n> #define ACL_MODECHG_DEL_CHR\t\t'-'\n> #define ACL_MODECHG_EQL_CHR\t\t'='\n> -#define ACL_MODE_STR\t\t\t\"arwR\"\t/* list of valid characters */\n> +\n> +#define ACL_MODE_STR\t\t\t\"arduR\"\t /* list of valid characters */\n> #define ACL_MODE_AP_CHR\t\t\t'a'\n> #define ACL_MODE_RD_CHR\t\t\t'r'\n> -#define ACL_MODE_WR_CHR\t\t\t'w'\n> +#define ACL_MODE_DE_CHR\t\t\t'd'\n> +#define ACL_MODE_UP_CHR\t\t\t'u'\n> #define ACL_MODE_RU_CHR\t\t\t'R'\n> \n> /* result codes for pg_aclcheck */\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, 26 Nov 2001 15:04:12 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: grant/revoke bug with delete/update" } ]
[ { "msg_contents": "\n\n Hi,\n\n query cache hacking continue ...\n\n I just implement my (context-per-plan) query cache (qCache) to SPI. \n\n Changed:\n\n SPI_saveplan() - save plan to qcache instead to never\n\tunallocated TopMemoryContext.\n\n New:\n\n SPI_saveplan_by_key() - save plan to qcache under specifited hash \n\tkey. This is needful if user define key oneself or if key must be \n\tbinary (non-string) - example Jan use any struct as hash key in RI's \n\ttriggers.) \n\n SPI_execp_by_key() - same as SPI_execp(), but as arg is hash key\n\tonly, (again, it is needful for (example) RI).\n\t- you not need pointer to plan, you can use key only\n\n SPI_freeplan() - remove plan from qcache and destroy all\n\tmemory associate with plan. It is end of the TopMemoryContext\n\tfeeding :-)\n\n Comments?\n\n A question: I look at the current PG's SPI and (IMHO) is here a little\n performance bug. Very often is used SPI_prepare() and SPI_saveplan()\n together and without any relevant code between these routines. But see:\n\t\n\tSPI_prepare() - call 2x copyObject() and copy data to procedure \n\t\t\tcontext\n\n\t- well, if you need pquery plans in this context it is OK, but\n \n\tSPI_saveplan() - call 2x copyObject() and copy (same) data to\n\t\t\tTopMemoryContext (or in future to qCache)\n\n\tSPI_execp() - call 2x copyObject() and copy data back to current \n\t\t\tcontext\n\n\t- hmm, it copy twice all data, but without any efect.\n\n IMHO is solution any SPI_prepare_and_save() and copy data only to\n TopMemoryContext (or to qCache), we not need data in procedure context \n (as it copy SPI_prepare), because SPI_execp() copy it to wanted context\n itself. \n\n The SPI performance will interesting if RI will in real life...\n \t \n\n\t\t\t\t\t\tKarel\n\n\n \n\n\n\n\n", "msg_date": "Thu, 2 Mar 2000 17:32:51 +0100 (CET)", "msg_from": "Karel Zak - Zakkr <[email protected]>", "msg_from_op": true, "msg_subject": "SPI and qCache and bug?" }, { "msg_contents": "\n\n Still quiet for this question? Hmm.. (not interesting?)\n \n\nOn Thu, 2 Mar 2000, Karel Zak - Zakkr wrote:\n> \n> \n> Hi,\n> \n> query cache hacking continue ...\n> \n> I just implement my (context-per-plan) query cache (qCache) to SPI. \n> \n> Changed:\n> \n> SPI_saveplan() - save plan to qcache instead to never\n> \tunallocated TopMemoryContext.\n> \n> New:\n> \n> SPI_saveplan_by_key() - save plan to qcache under specifited hash \n> \tkey. This is needful if user define key oneself or if key must be \n> \tbinary (non-string) - example Jan use any struct as hash key in RI's \n> \ttriggers.) \n> \n> SPI_execp_by_key() - same as SPI_execp(), but as arg is hash key\n> \tonly, (again, it is needful for (example) RI).\n> \t- you not need pointer to plan, you can use key only\n> \n> SPI_freeplan() - remove plan from qcache and destroy all\n> \tmemory associate with plan. It is end of the TopMemoryContext\n> \tfeeding :-)\n> \n> Comments?\n> \n> A question: I look at the current PG's SPI and (IMHO) is here a little\n> performance bug. Very often is used SPI_prepare() and SPI_saveplan()\n> together and without any relevant code between these routines. But see:\n> \t\n> \tSPI_prepare() - call 2x copyObject() and copy data to procedure \n> \t\t\tcontext\n> \n> \t- well, if you need pquery plans in this context it is OK, but\n> \n> \tSPI_saveplan() - call 2x copyObject() and copy (same) data to\n> \t\t\tTopMemoryContext (or in future to qCache)\n> \n> \tSPI_execp() - call 2x copyObject() and copy data back to current \n> \t\t\tcontext\n> \n> \t- hmm, it copy twice all data, but without any efect.\n> \n> IMHO is solution any SPI_prepare_and_save() and copy data only to\n> TopMemoryContext (or to qCache), we not need data in procedure context \n> (as it copy SPI_prepare), because SPI_execp() copy it to wanted context\n> itself. \n> \n> The SPI performance will interesting if RI will in real life...\n> \t \n> \n> \t\t\t\t\t\tKarel\n\n", "msg_date": "Wed, 8 Mar 2000 17:33:39 +0100 (CET)", "msg_from": "Karel Zak - Zakkr <[email protected]>", "msg_from_op": true, "msg_subject": "[HACKERS] SPI and qCache and bug?" } ]
[ { "msg_contents": "This function would load OK in 6.5 but doesn't work in 7.0beta1:\n\nThe problem is in the very last function definition where date_week is\ndefined with a date argument. It simply calls the date_week function\nthat has a text argument, but apparently, the parser does not recognize\nthe fact that a cast is present and tries to look for an existing\nfunction date_week(date) instead of date_week(text).\n\nIt looks like either there is a problem in the parser with casting, or\nthere is a new way of doing things I should adapt to. Anyone know which\nit is?\n\nHere is the error message:\nERROR: No such function 'date_week' with the specified attributes\n\n\nHere is the SQL to recreate the problem:\n\n-- Define PLPSQL Language ********************************\ndrop function plpgsql_call_handler ();\nCREATE FUNCTION plpgsql_call_handler () RETURNS OPAQUE AS\n '/usr/local/pgsql/lib/plpgsql.so' LANGUAGE 'C';\n\n-- This creates the plpgsql language\ndrop PROCEDURAL LANGUAGE 'plpgsql';\nCREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql'\n HANDLER plpgsql_call_handler\n LANCOMPILER 'PL/pgSQL';\n\n-- Define PLTCL Language *********************************\ndrop function pltcl_call_handler ();\nCREATE FUNCTION pltcl_call_handler () RETURNS OPAQUE AS\n '/usr/local/pgsql/lib/pltcl.so' LANGUAGE 'C';\n\n-- This creates the plpgsql language\ndrop PROCEDURAL LANGUAGE 'pltcl';\nCREATE TRUSTED PROCEDURAL LANGUAGE 'pltcl'\n HANDLER pltcl_call_handler\n LANCOMPILER 'PL/TCL';\n\n-- Convert date in 1999-01-15 format to the month of the year (1999,35)\n-- calling sequence: date_week(ISO_date)\ndrop function date_week(text);\ncreate function date_week(text) returns text as '\n set spl [split $1 {-/. }]\n set year [lindex $spl 0]\n set month [string trimleft [lindex $spl 1] 0]\n set day [lindex $spl 2]\n if {$month > 0 && $month <= 31} {\n set secs [clock scan \"$month/$day/$year\"]\n } else {\n set secs [clock scan \"$month $day, $year\"]\n }\n set week [clock format $secs -format \"%U\"]\n if {$week == 0} {\n return \"[expr $year - 1]-52\"\n }\n return \"$year-$week\"\n ' LANGUAGE 'pltcl';\n\ndrop function date_week(date);\ncreate function date_week(date) returns text as '\n select date_week($1::text);\n ' LANGUAGE 'sql';", "msg_date": "Fri, 03 Mar 2000 11:19:25 -0700", "msg_from": "Kyle Bateman <[email protected]>", "msg_from_op": true, "msg_subject": "7.0beta bug (or feature)?" }, { "msg_contents": "Kyle Bateman <[email protected]> writes:\n> This function would load OK in 6.5 but doesn't work in 7.0beta1:\n\n> create function date_week(date) returns text as '\n> select date_week($1::text);\n> ' LANGUAGE 'sql';\n\n> ERROR: No such function 'date_week' with the specified attributes\n\n> ... apparently, the parser does not recognize\n> the fact that a cast is present and tries to look for an existing\n> function date_week(date) instead of date_week(text).\n\nYup, 7.0beta1 is missing a couple of lines of code needed to handle\ncasts applied to function parameters. Thanks for catching that.\nI have patched current CVS sources; tonight's snapshot should have\nthe fix.\n\n> It looks like either there is a problem in the parser with casting, or\n> there is a new way of doing things I should adapt to.\n\n7.0 currently is a little snippier about casts than prior releases were;\nit wants the cast to equate directly to an available conversion.\nSo what I'm getting from your example now is\n\nregression=# create function date_week(date) returns text as '\nregression'# select date_week($1::text);\nregression'# ' LANGUAGE 'sql';\nERROR: Cannot cast type 'date' to 'text'\n\nbecause there isn't a text(date) function. But there is a\ntext(timestamp) function, and a timestamp(date) function,\nso this works:\n\nregression=# create function date_week(date) returns text as '\nregression'# select date_week($1::timestamp::text);\nregression'# ' LANGUAGE 'sql';\nCREATE\n\n6.5 would do the intermediate conversion to timestamp (then called\ndatetime) silently, but 7.0 won't. Note that both versions will\nhappily take\n\t\tselect date_week(text($1));\nand interpolate the intermediate conversion step as part of resolving\nthe overloaded function name text(). 7.0 is only picky about\nconversions written as casts.\n\nI am not sure whether this should be regarded as a bug or a feature.\nOn the one hand you could argue that ambiguous casts are a bad thing,\nbut on the other hand, if text(foo) works, why shouldn't foo::text work?\n\nOne thing to realize while considering whether to change this is that if\nwe generalize the behavior of casts, we may also affect the behavior of\nimplicit casts, such as the one applied to convert supplied data in an\nINSERT or UPDATE to the target column type. This could result in loss\nof error detection capability. Currently, both 6.5 and 7.0 do this:\n\nregression=# create table foo(f1 text);\nCREATE\nregression=# insert into foo values('now'::date);\nERROR: Attribute 'f1' is of type 'text' but expression is of type 'date'\n You will need to rewrite or cast the expression\n\nbut if we allow datevalue::text to work, then (barring still more\npushups in the code) the above will be accepted. Should it be?\n\nComments anyone?\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 07 Mar 2000 18:59:53 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Casts in 7.0 vs 6.5 (was Re: [SQL] 7.0beta bug (or feature)?)" }, { "msg_contents": "Tom Lane wrote:\n\n>\n> I am not sure whether this should be regarded as a bug or a feature.\n> On the one hand you could argue that ambiguous casts are a bad thing,\n> but on the other hand, if text(foo) works, why shouldn't foo::text work?\n>\n> One thing to realize while considering whether to change this is that if\n> we generalize the behavior of casts, we may also affect the behavior of\n> implicit casts, such as the one applied to convert supplied data in an\n> INSERT or UPDATE to the target column type. This could result in loss\n> of error detection capability. Currently, both 6.5 and 7.0 do this:\n>\n> regression=# create table foo(f1 text);\n> CREATE\n> regression=# insert into foo values('now'::date);\n> ERROR: Attribute 'f1' is of type 'text' but expression is of type 'date'\n> You will need to rewrite or cast the expression\n>\n> but if we allow datevalue::text to work, then (barring still more\n> pushups in the code) the above will be accepted. Should it be?\n>\n> Comments anyone?\n>\n\nWhat if you could to a \"set AutoCasting=yes\" just as you might set the\ndatestyle variable. Then the DBA could decide whether type mismatches\nshould be quitely translated or reported?", "msg_date": "Wed, 08 Mar 2000 09:22:17 -0700", "msg_from": "Kyle Bateman <[email protected]>", "msg_from_op": true, "msg_subject": "Re: Casts in 7.0 vs 6.5 (was Re: [SQL] 7.0beta bug (or feature)?)" } ]
[ { "msg_contents": "Mark Jewiss writes:\n\n> 04:25pm mark@mark:~/src/pgsql/src/bin/psql $ sudo gmake\n[snip]\n> gcc -I../../interfaces/libpq -I../../include -I../../backend -O2 -pipe -Wall -Wmissing-prototypes -Wmissing-declarations -c mainloop.c -o mainloop.o\n> mainloop.c: In function `MainLoop':\n> mainloop.c:43: warning: variable `successResult' might be clobbered by `longjmp' or `vfork'\n> mainloop.c:44: warning: variable `slashCmdStatus' might be clobbered by `longjmp' or `vfork'\n> mainloop.c:47: warning: variable `in_quote' might be clobbered by `longjmp' or `vfork'\n[etc]\n\nI thought I had shut up those warnings by making the variables in question\nvolatile. There's no need to worry about them since they're re-initialized\nright after the longjmp, but does anyone know how to shut up the compiler?\n\n> gcc -I../../interfaces/libpq -I../../include -I../../backend -O2 -pipe\n> -Wall -\n> Wmissing-prototypes -Wmissing-declarations -c tab-complete.c -o\n> tab-complete.o\n> tab-complete.c: In function `psql_completion':\n> tab-complete.c:535: `filename_completion_function' undeclared (first use\n> in this\n> function)\n> tab-complete.c:535: (Each undeclared identifier is reported only once\n> tab-complete.c:535: for each function it appears in.)\n> gmake: *** [tab-complete.o] Error 1\n> 04:25pm mark@mark:~/src/pgsql/src/bin/psql $ \n\nAye, there's the rub. One more of these and I'm yanking every trace of\nreadline out of psql. ;) Another configure test, another subtle functional\ndifference as the consequence ...\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Sat, 4 Mar 2000 18:06:11 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [GENERAL] Version 7.0 beta problem" }, { "msg_contents": "Peter Eisentraut <[email protected]> writes:\n> Mark Jewiss writes:\n>> mainloop.c:43: warning: variable `successResult' might be clobbered by `longjmp' or `vfork'\n\n> I thought I had shut up those warnings by making the variables in question\n> volatile. There's no need to worry about them since they're re-initialized\n> right after the longjmp, but does anyone know how to shut up the compiler?\n\nThat *should* shut up these warnings. Maybe Mark is trying a slightly\nback-dated beta version? I know you didn't have the \"volatile\"s in\nthere a few days ago.\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 07 Mar 2000 01:55:21 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Re: [GENERAL] Version 7.0 beta problem " } ]
[ { "msg_contents": "Hi, I'm wondering why the transaction star time in\nTransactionStateData is Absolutetime. From nabstime.h:\n\n * Although time_t generally is a long int on 64 bit systems, these two\n * types must be 4 bytes, because that's what the system assumes. They\n * should be yanked (long) before 2038 and be replaced by timestamp and\n * interval.\n */\ntypedef int32 AbsoluteTime;\ntypedef int32 RelativeTime;\n\nShouldn't we use timestamp instead of AbsoluteTime in\nTransactionStateData? It also gives more precision.\n--\nTatsuo Ishii\n", "msg_date": "Sun, 05 Mar 2000 10:54:56 +0900", "msg_from": "Tatsuo Ishii <[email protected]>", "msg_from_op": true, "msg_subject": "TransactionStateData and AbsoluteTime" }, { "msg_contents": "Tatsuo Ishii writes:\n\n> Shouldn't we use timestamp instead of AbsoluteTime in\n> TransactionStateData? It also gives more precision.\n\nThomas was hesitant to using 8 byte types internally across the board. He\nmust have his reasons.\n\nI think that eventually *all* time'ish stuff should be moved to the new\nstuff but perhaps we should wait until the current datetime-related panic\nhas died down. :)\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Sun, 5 Mar 2000 14:39:37 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] TransactionStateData and AbsoluteTime" }, { "msg_contents": "> > Shouldn't we use timestamp instead of AbsoluteTime in\n> > TransactionStateData? It also gives more precision.\n> Thomas was hesitant to using 8 byte types internally across the board. He\n> must have his reasons.\n\nYes, I believe that I discussed it at that time, though not perhaps\nall of these points:\n\nI was hesitant to suggest a change which would increase the minimum\nsize of a tuple.\n\nI was hesitant to tie the fundamental internal operation to modern\nfloating point performance on machines (it is only recently that float\ncalculations are comparable to ints).\n\nOn 64 bit machines especially, it may be interesting to do a 64 bit\nint for the date/time types, which would give greater precision away\nfrom Y2K, but a more limited total range.\n\nTo get a precision greater than 1 second, we would have to use a\ndifferent time call from the OS. I assume that one would be fairly\nportable, but would then require a conversion of int8 to float, with\nsome runtime expense.\n\nAnd I haven't seen a great demand for greater precision in the table\nstructures, though istm that it might be of interest.\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Mon, 06 Mar 2000 23:12:39 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] TransactionStateData and AbsoluteTime" }, { "msg_contents": "> > > Shouldn't we use timestamp instead of AbsoluteTime in\n> > > TransactionStateData? It also gives more precision.\n> > Thomas was hesitant to using 8 byte types internally across the board. He\n> > must have his reasons.\n> \n> Yes, I believe that I discussed it at that time, though not perhaps\n> all of these points:\n> \n> I was hesitant to suggest a change which would increase the minimum\n> size of a tuple.\n\nCan you tell me where the data/time info exists in HeapTupleData?\nI could not find it.\n\n> I was hesitant to tie the fundamental internal operation to modern\n> floating point performance on machines (it is only recently that float\n> calculations are comparable to ints).\n> \n> On 64 bit machines especially, it may be interesting to do a 64 bit\n> int for the date/time types, which would give greater precision away\n> from Y2K, but a more limited total range.\n> \n> To get a precision greater than 1 second, we would have to use a\n> different time call from the OS. I assume that one would be fairly\n> portable, but would then require a conversion of int8 to float, with\n> some runtime expense.\n\nOk. currently we call GetCurrentAbsoluteTime() to get the transaction\nstart time. If we use timestamp instead of Abstime, we would call\ntimeofday() defined in nabstime.c or something like that. So it might\nbe interesting to see how the speed is different between these two\ncalls. If I have a spare time, I'll try it.\n\n> And I haven't seen a great demand for greater precision in the table\n> structures, though istm that it might be of interest.\n\nAnyway, I think we don't want to see those none trivial changes to\nappear in 7.0.\n--\nTatsuo Ishii\n\n", "msg_date": "Tue, 07 Mar 2000 10:34:56 +0900", "msg_from": "Tatsuo Ishii <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] TransactionStateData and AbsoluteTime" } ]
[ { "msg_contents": "I see following in HISTORY:\n\n\tDisallow DROP TABLE/DROP INDEX inside a transaction block\n\nHowever, it seems that this is not done with current?\n\ntest=# create table t1(i int);\nCREATE\ntest=# begin;\nBEGIN\ntest=# drop table t1;\nNOTICE: Caution: DROP TABLE cannot be rolled back, so don't abort now\nDROP\ntest=# end;\nCOMMIT\ntest=# \\d\nNo relations found.\n--\nTatsuo Ishii\n", "msg_date": "Sun, 05 Mar 2000 18:09:51 +0900", "msg_from": "Tatsuo Ishii <[email protected]>", "msg_from_op": true, "msg_subject": "DROP TABLE inside a transaction block" }, { "msg_contents": "Tatsuo Ishii writes:\n\n> I see following in HISTORY:\n> \n> \tDisallow DROP TABLE/DROP INDEX inside a transaction block\n> \n> However, it seems that this is not done with current?\n> \n> test=# create table t1(i int);\n> CREATE\n> test=# begin;\n> BEGIN\n> test=# drop table t1;\n> NOTICE: Caution: DROP TABLE cannot be rolled back, so don't abort now\n\nWow, with all due respect, that's pretty sh^H^Hpoor. That's like saying\n\"Haha, either you commit your transaction or your database is fried.\" Any\nreason that's not an ERROR before anything destructive is done?\n\n> DROP\n> test=# end;\n> COMMIT\n> test=# \\d\n> No relations found.\n> --\n> Tatsuo Ishii\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", "msg_date": "Sun, 5 Mar 2000 14:36:22 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "Peter Eisentraut wrote:\n> \n> Tatsuo Ishii writes:\n> \n> > I see following in HISTORY:\n> >\n> > Disallow DROP TABLE/DROP INDEX inside a transaction block\n> >\n> > However, it seems that this is not done with current?\n> >\n> > test=# create table t1(i int);\n> > CREATE\n> > test=# begin;\n> > BEGIN\n> > test=# drop table t1;\n> > NOTICE: Caution: DROP TABLE cannot be rolled back, so don't abort now\n> \n> Wow, with all due respect, that's pretty sh^H^Hpoor. That's like saying\n> \"Haha, either you commit your transaction or your database is fried.\" Any\n> reason that's not an ERROR before anything destructive is done?\n> \n> > DROP\n> > test=# end;\n> > COMMIT\n> > test=# \\d\n> > No relations found.\n\nWe had an elaborate discussion on this very topic several months\nago. What it comes down to is three possible options:\n\n1) Allow DDL statements in transactions. If the transaction\naborts, currently, corruption can result. Some DDL statements\n(such as TRUNCATE) make no sense with respect to ROLLBACK. So, I\nguess, the idea is that SOME DDL statements will be ROLLBACK-able\nand some won't - yuck.\n\n2) Disallow DDL statement in transactions. This would break code\nfor people which is working now, only because their transactions\nare being committed between the time they issue the DDL statement\nand the COMMIT (or END), instead of aborting and causing their\ndatabase to become corrupt, or require manual removal of files\nwhen the catalogue gets out-of-sync with the filesystem.\n\n3) Implicitly commit the running transaction and begin a new one.\nOnly Vadim and I support this notion, although this is precisely\nwhat Oracle does (not that that should define PostgreSQL's\nbehavior, of course). Everyone else, it seems wants to try to\nimplement #1 successfully...(I don't see it happening any time\nsoon).\n\nSo, as some sort of compromise, a NOTICE was issued.\n\nMike Mascari\n", "msg_date": "Sun, 05 Mar 2000 20:31:25 -0500", "msg_from": "Mike Mascari <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "Philip Warner wrote:\n> \n> At 07:59 6/03/00 +0100, Peter Eisentraut wrote:\n> >> (such as TRUNCATE) make no sense with respect to ROLLBACK. So, I\n> >> guess, the idea is that SOME DDL statements will be ROLLBACK-able\n> >> and some won't - yuck.\n> >\n> >I don't see a problem with disallowing some DDL commands in a transaction\n> >as long as they throw an error and the transaction aborts.\n> \n> Is it really necessary to abort the TX? Seems a little antisocial - can't\n> you just return an error, and let the user/application decide if it needs\n> to abort?\n> \n> >> 3) Implicitly commit the running transaction and begin a new one.\n> >> Only Vadim and I support this notion, although this is precisely\n> >> what Oracle does (not that that should define PostgreSQL's\n> >> behavior, of course). Everyone else, it seems wants to try to\n> >> implement #1 successfully...(I don't see it happening any time\n> >> soon).\n> >\n> >I support that too since it also happens to be SQL's idea more or less.\n> >One of these days we'll have to offer this as an option. At least for\n> >commands for which #1 doesn't work yet.\n> \n> Do you really mean it when ou say 'Implicitly commit the running\n> transaction'. I would be deeply opposed to this philosophically, if so. No\n> TX should ever be commited unless the user requests it.\n> \n> Just my 0.02c\n\nPhilosophically, I agree with you 100%. And apparently, from the\nprevious discussion on this issue, databases like Informix are\ncompletely capable of rolling back DDL statements like DROP\nTABLE, ALTER TABLE RENAME, etc. However, the complexity involved\napparently was too much for Oracle:\n\n\"ORACLE implicitly commits the current transaction before and\nafter every Data Definition Language statement.\"\n\nIts just my feeling that robustness is the number one priority\nand that the current state is kind of \"riding the fence\" between\nORACLE and Informix. On either side of the fence, it is safe, but\nin the middle, you risk corruption.\n\nNaturally, I'd like to see PostgreSQL on the Informix side of the\nfence, but I don't see it happening any time soon. And the ORACLE\nside of the fence is far easier to implement. Or, of course, you\ncould choose Peter's suggestion, and disallow the DDL statement\nentirely. But as soon as that happened, all those people that\nbegin their .cgi programs with BEGIN and end it with END will\nsay, \"Hey, if we can't use DDL statements in transactions, can't\nwe at least do what Oracle does so we don't have to change our\ncode?\"\n\nMike Mascari\n", "msg_date": "Sun, 05 Mar 2000 22:03:28 -0500", "msg_from": "Mike Mascari <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "On Sun, 5 Mar 2000, Mike Mascari wrote:\n\n> 1) Allow DDL statements in transactions. If the transaction\n> aborts, currently, corruption can result. Some DDL statements\n ^^^^^^^^^^^^^^^^^^^^^\nI think those are the key words.\n\n> (such as TRUNCATE) make no sense with respect to ROLLBACK. So, I\n> guess, the idea is that SOME DDL statements will be ROLLBACK-able\n> and some won't - yuck.\n\nI don't see a problem with disallowing some DDL commands in a transaction\nas long as they throw an error and the transaction aborts. Users see this\nand don't do it next time. Sure it's inconsistent but the current state is\nplain bad, sorry.\n\n> 3) Implicitly commit the running transaction and begin a new one.\n> Only Vadim and I support this notion, although this is precisely\n> what Oracle does (not that that should define PostgreSQL's\n> behavior, of course). Everyone else, it seems wants to try to\n> implement #1 successfully...(I don't see it happening any time\n> soon).\n\nI support that too since it also happens to be SQL's idea more or less.\nOne of these days we'll have to offer this as an option. At least for\ncommands for which #1 doesn't work yet.\n\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Mon, 6 Mar 2000 07:59:00 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "At 07:59 6/03/00 +0100, Peter Eisentraut wrote:\n>> (such as TRUNCATE) make no sense with respect to ROLLBACK. So, I\n>> guess, the idea is that SOME DDL statements will be ROLLBACK-able\n>> and some won't - yuck.\n>\n>I don't see a problem with disallowing some DDL commands in a transaction\n>as long as they throw an error and the transaction aborts. \n\nIs it really necessary to abort the TX? Seems a little antisocial - can't\nyou just return an error, and let the user/application decide if it needs\nto abort?\n\n\n>> 3) Implicitly commit the running transaction and begin a new one.\n>> Only Vadim and I support this notion, although this is precisely\n>> what Oracle does (not that that should define PostgreSQL's\n>> behavior, of course). Everyone else, it seems wants to try to\n>> implement #1 successfully...(I don't see it happening any time\n>> soon).\n>\n>I support that too since it also happens to be SQL's idea more or less.\n>One of these days we'll have to offer this as an option. At least for\n>commands for which #1 doesn't work yet.\n\nDo you really mean it when ou say 'Implicitly commit the running\ntransaction'. I would be deeply opposed to this philosophically, if so. No\nTX should ever be commited unless the user requests it.\n\nJust my 0.02c\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": "Mon, 06 Mar 2000 18:27:34 +1100", "msg_from": "Philip Warner <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "On Mon, 6 Mar 2000, Philip Warner wrote:\n\n> >I don't see a problem with disallowing some DDL commands in a transaction\n> >as long as they throw an error and the transaction aborts. \n> \n> Is it really necessary to abort the TX? Seems a little antisocial - can't\n> you just return an error, and let the user/application decide if it needs\n> to abort?\n\nI'm afraid yes, it is necessary. Either the whole transaction or none of\nit. Anything else is opening a can of worms that you can't control unless\nyou have a Ph.D. in fancy databases or something. (Incidentally, I know\nthat a non-zero amount of people around here have one of those, but that\nwon't help the rest of us much. :{ )\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Mon, 6 Mar 2000 11:10:54 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "Mike Mascari <[email protected]> writes:\n> So, as some sort of compromise, a NOTICE was issued.\n\nIt seems everybody but Mike has forgotten the previous go-round on\nthis issue. I had in fact put in an ERROR for DROP TABLE inside a\ntransaction block, and was beat up for it --- on the very reasonable\ngrounds that it's useful to be able to drop a table and do some other\nthings inside a transaction. Although we can't support rollback-ability\nfor such a transaction right now, we *do* support the atomic nature of\nsuch a transaction. It's not reasonable to take away a capability that\nwas available in prior releases just because it's got deficiencies.\nSo the compromise was to issue a NOTICE instead of an ERROR.\n\nBTW, we are not *that* far from being able to roll back a DROP TABLE.\nThe only thing that's really needed is for everyone to take a deep\nbreath and let go of the notion that table files ought to be named\nafter the tables. If we named table files after the OIDs of their\ntables, then rollback-able DROP or RENAME TABLE would be pretty\nstraightforward. If you don't recall why this is, consult the\npghackers archives...\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 07 Mar 2000 02:53:49 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block " }, { "msg_contents": "> It seems everybody but Mike has forgotten the previous go-round on\n> this issue. I had in fact put in an ERROR for DROP TABLE inside a\n> transaction block, and was beat up for it --- on the very reasonable\n> grounds that it's useful to be able to drop a table and do some other\n> things inside a transaction. Although we can't support rollback-ability\n> for such a transaction right now, we *do* support the atomic nature of\n> such a transaction. It's not reasonable to take away a capability that\n> was available in prior releases just because it's got deficiencies.\n> So the compromise was to issue a NOTICE instead of an ERROR.\n> \n> BTW, we are not *that* far from being able to roll back a DROP TABLE.\n> The only thing that's really needed is for everyone to take a deep\n> breath and let go of the notion that table files ought to be named\n> after the tables. If we named table files after the OIDs of their\n> tables, then rollback-able DROP or RENAME TABLE would be pretty\n> straightforward. If you don't recall why this is, consult the\n> pghackers archives...\n\nSo what was the conclusion for 7.0?\n\n>\tDisallow DROP TABLE/DROP INDEX inside a transaction block\n\nWe should remove above from HISTORY, no?\n--\nTatsuo Ishii\n", "msg_date": "Tue, 07 Mar 2000 17:06:43 +0900", "msg_from": "Tatsuo Ishii <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block " }, { "msg_contents": "Tatsuo Ishii <[email protected]> writes:\n>> BTW, we are not *that* far from being able to roll back a DROP TABLE.\n>> The only thing that's really needed is for everyone to take a deep\n>> breath and let go of the notion that table files ought to be named\n>> after the tables. If we named table files after the OIDs of their\n>> tables, then rollback-able DROP or RENAME TABLE would be pretty\n>> straightforward. If you don't recall why this is, consult the\n>> pghackers archives...\n\n> So what was the conclusion for 7.0?\n\nToo late to consider it for 7.0, I think. I'd like to see it happen in\n7.1 or 7.2 or so.\n\n>> Disallow DROP TABLE/DROP INDEX inside a transaction block\n\n> We should remove above from HISTORY, no?\n\nYes, it's not correct.\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 07 Mar 2000 11:47:15 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block " }, { "msg_contents": "On Tue, Mar 07, 2000 at 02:53:49AM -0500, Tom Lane wrote:\n> Mike Mascari <[email protected]> writes:\n> > So, as some sort of compromise, a NOTICE was issued.\n> \n> \n> BTW, we are not *that* far from being able to roll back a DROP TABLE.\n> The only thing that's really needed is for everyone to take a deep\n> breath and let go of the notion that table files ought to be named\n> after the tables. If we named table files after the OIDs of their\n> tables, then rollback-able DROP or RENAME TABLE would be pretty\n> straightforward. If you don't recall why this is, consult the\n> pghackers archives...\n\nAnother data point regarding table filenames: I've been looking into\nwhat's needed to support SQL92 schemas.\n\nThe standard defines a hierarchy of what are essentially scopes for\ndatabase objects. They are (in order from high to low):\n\nCluster of catalogs -> catalog -> schema -> (DB objects)\n\n\"Cluster of catalogs\" is defined as (section 4.13):\n\n Exactly one cluster is associated with an SQL-session and it defines\n the totality of the SQL-data that is available to that SQL-session.\n\nA catalog is (section 4.12):\n\n Catalogs are named collections of schemas in an SQL-environment. An\n SQL-environment contains zero or more catalogs. A catalog con-\n tains one or more schemas, but always contains a schema named\n INFORMATION_SCHEMA that contains the views and domains of the\n Information Schema.\n\n\ncatalog and schema names show up in the syntax, e.g. the BNF for table\nnames (section 5.4):\n\n <table name> ::=\n <qualified name>\n <qualified name> ::=\n [ <schema name> <period> ] <qualified identifier>\n\n <qualified identifier> ::= <identifier> <schema name> ::=\n [ <catalog name> <period> ] <unqualified schema name>\n\nWhich collapses to (using unique names for the various identifiers):\n\n<table name> ::= [ <catalog indentifier> <period> ] [ <schema indentifier>\n<period> ]\n <table identifier>\n\nand make a fully qualified column name BNF:\n\n[ <catalog identifier> <period> ] [ <schema identifier> <period> ]\n [ <table identifier> <period> ] <column identifier>\n\nso:\n foo.bar.baz.bongo\n\nis a well formed column identifier for column bongo of table baz in\nschema bar in catalog foo.\n\n\nWhat's all this mean for pgsql? Well, SCHEMA are an Entry SQL\nrequirement. So, the syntax: schema.table needs to be supported. Both\nschema and catalog define persistent visibilty scopes, and we need to\nsupport identical table names in multiple schema.\n\nI see two possiblities:\n\n1) Map a pgsql database to a SQL schema.\n\nSince we need to support identical table names in multiple schema,\nit might be tempting to map a pgsql database to a schema. In fact,\nsince Entry SQL requires the syntax:\n\nCREATE SCHEMA <schema authorization identifier>\n\nAnd, in practice, the SCHEMA name seems to be equal to the database user\nname, the pgsql default of creating (and accessing) a DB matching the\nusername implies this mapping.\n\nHowever, that means we need to solve the one backend accessing multiple\nDBs problem. I have a feeling that there may be 'gotchas' in the current\nbackend code that presume that all the tuples are coming from one DB.\n\n2) Map pgsql DB -> SQL catalog\n\nIf we do this, the multiDB access problem can be pushed down the road,\nsince cross catalog access (<catalog name> in identifiers) is not\neven required by Intermediate SQL, only Full SQL. In addition, almost\neverything about catalogs is 'implemetation defined' so we get to claim\nthem as done. ;-)\n\n2a) However, if a single pgsql database is a catalog, then each DB needs\nto be able to contain tables in multiple schema, potentially with the\nidentical table names. One solution would be to do what we do for DBs:\ncreate seperate subdirs for each schema, and put the table files in there.\nChanges are probably isolated to the storage manager code, but I haven't\nlooked in detail.\n\n2b) Another possiblity is what Tom has suggested, to solve the DDL\nstatements in a transaction problem: use some other unique identifier\nfor table filenames, perhaps based on OID. Then, supporting schemas\nmeans supporting the syntax in the parser, and that's it, I think. This\nwould seem to minimize the changes needed to implement this Entry SQL92\nrequirement.\n\nSo, what do y'all think?\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\n", "msg_date": "Tue, 7 Mar 2000 13:25:23 -0600", "msg_from": "\"Ross J. Reedstrom\" <[email protected]>", "msg_from_op": false, "msg_subject": "SCHEMA support (was Re: DROP TABLE inside a transaction block)" }, { "msg_contents": "> I see following in HISTORY:\n> \n> \tDisallow DROP TABLE/DROP INDEX inside a transaction block\n> \n> However, it seems that this is not done with current?\n> \n> test=# create table t1(i int);\n> CREATE\n> test=# begin;\n> BEGIN\n> test=# drop table t1;\n> NOTICE: Caution: DROP TABLE cannot be rolled back, so don't abort now\n> DROP\n> test=# end;\n> COMMIT\n> test=# \\d\n> No relations found.\n> --\n> Tatsuo Ishii\n\nOK, seems it is fixed. I will remove the item.\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": "Tue, 7 Mar 2000 18:35:35 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "[Charset ISO-8859-1 unsupported, filtering to ASCII...]\n> Tatsuo Ishii writes:\n> \n> > I see following in HISTORY:\n> > \n> > \tDisallow DROP TABLE/DROP INDEX inside a transaction block\n> > \n> > However, it seems that this is not done with current?\n> > \n> > test=# create table t1(i int);\n> > CREATE\n> > test=# begin;\n> > BEGIN\n> > test=# drop table t1;\n> > NOTICE: Caution: DROP TABLE cannot be rolled back, so don't abort now\n> \n> Wow, with all due respect, that's pretty sh^H^Hpoor. That's like saying\n> \"Haha, either you commit your transaction or your database is fried.\" Any\n> reason that's not an ERROR before anything destructive is done?\n\nI tried it and the ABORT worked, so I have no idea now what is happening\nhere.\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": "Tue, 7 Mar 2000 18:40:23 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "> BTW, we are not *that* far from being able to roll back a DROP TABLE.\n> The only thing that's really needed is for everyone to take a deep\n> breath and let go of the notion that table files ought to be named\n> after the tables. If we named table files after the OIDs of their\n> tables, then rollback-able DROP or RENAME TABLE would be pretty\n> straightforward. If you don't recall why this is, consult the\n> pghackers archives...\n\nThe oid will be appended to the base file name.\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, 7 Mar 2000 19:17:33 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "> So what was the conclusion for 7.0?\n> \n> >\tDisallow DROP TABLE/DROP INDEX inside a transaction block\n> \n> We should remove above from HISTORY, no?\n\nYes removed.\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": "Tue, 7 Mar 2000 19:17:51 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "Bruce Momjian <[email protected]> writes:\n> I tried it and the ABORT worked, so I have no idea now what is happening\n> here.\n\nIs the table file still there after the ABORT? If not, it won't work\nfor long...\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 07 Mar 2000 19:55:17 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block " }, { "msg_contents": "Bruce Momjian <[email protected]> writes:\n>> BTW, we are not *that* far from being able to roll back a DROP TABLE.\n>> The only thing that's really needed is for everyone to take a deep\n>> breath and let go of the notion that table files ought to be named\n>> after the tables. If we named table files after the OIDs of their\n>> tables, then rollback-able DROP or RENAME TABLE would be pretty\n>> straightforward. If you don't recall why this is, consult the\n>> pghackers archives...\n\n> The oid will be appended to the base file name.\n\nIf we do it that way, then RENAME TABLE will be kinda complicated...\nnot impossible, but is it worth it?\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 07 Mar 2000 20:13:53 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block " }, { "msg_contents": "> Bruce Momjian <[email protected]> writes:\n> > I tried it and the ABORT worked, so I have no idea now what is happening\n> > here.\n> \n> Is the table file still there after the ABORT? If not, it won't work\n> for long...\n\nOh, well.\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, 7 Mar 2000 20:48:51 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "> Bruce Momjian <[email protected]> writes:\n> >> BTW, we are not *that* far from being able to roll back a DROP TABLE.\n> >> The only thing that's really needed is for everyone to take a deep\n> >> breath and let go of the notion that table files ought to be named\n> >> after the tables. If we named table files after the OIDs of their\n> >> tables, then rollback-able DROP or RENAME TABLE would be pretty\n> >> straightforward. If you don't recall why this is, consult the\n> >> pghackers archives...\n> \n> > The oid will be appended to the base file name.\n> \n> If we do it that way, then RENAME TABLE will be kinda complicated...\n> not impossible, but is it worth it?\n\n100% worth it. Ingres doesn't use table names in the file name, and\nadministration is a mess.\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, 7 Mar 2000 20:51:34 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "On Tue, 07 Mar 2000, Tom Lane wrote:\n> Bruce Momjian <[email protected]> writes:\n> >> BTW, we are not *that* far from being able to roll back a DROP TABLE.\n> >> The only thing that's really needed is for everyone to take a deep\n> >> breath and let go of the notion that table files ought to be named\n> >> after the tables. If we named table files after the OIDs of their\n> >> tables, then rollback-able DROP or RENAME TABLE would be pretty\n> >> straightforward. If you don't recall why this is, consult the\n> >> pghackers archives...\n \n> > The oid will be appended to the base file name.\n \n> If we do it that way, then RENAME TABLE will be kinda complicated...\n> not impossible, but is it worth it?\n\nYou know, I really hate to disagree with Bruce, but, Tom, you have a point.\nIMHO, the benefits of having tables named by OID are going to be numerous --\nthe schema idea included. Of course, Bruce's concerns are good concerns as\nwell. What to do......\n\nWhy not do this:\n\nLet the tables be named by OID, and only OID. Then, for admins' convenience,\nput in a flat file that is updated periodically, similarly to pg_pwd being a\nflat text dump of pg_shadow. Since there's going to have to be a system\ntable mapping table names to OID's anyway, a flat dump of said system table\nshould be similarly done as pg_pwd. Call it pg_realnames or something. Have\nit have two columns: OID, and pathname (relative to PGDATA) of table.\n\nThis would help admins who might want to restore single tables -- as long as\nthey have a snapshot of pg_realnames at the same time each table is dumped,\nthen a restore of pg_realnames into a temp dir, then the actual table can be\nrestored in by its OID (of course, its OID might have changed in the interim,\nbut you would simply restore it on top of the OID that that table now maps to).\n\nBesides, the OID for the table itself is not likely to change often.\n\nBruce, would this allay some of your (entirely valid) concerns? (I read the\nthread about this the first time around, when Vadim said the tbale names\n_would_ go to OID's.)\n\nJust my two cents.\n\n--\nLamar Owen\nWGCR Internet Radio\n1 Peter 4:11\n", "msg_date": "Tue, 7 Mar 2000 21:57:36 -0500", "msg_from": "Lamar Owen <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "> > If we do it that way, then RENAME TABLE will be kinda complicated...\n> > not impossible, but is it worth it?\n> \n> You know, I really hate to disagree with Bruce, but, Tom, you have a point.\n> IMHO, the benefits of having tables named by OID are going to be numerous --\n> the schema idea included. Of course, Bruce's concerns are good concerns as\n> well. What to do......\n> \n> Why not do this:\n> \n> Let the tables be named by OID, and only OID. Then, for admins' convenience,\n> put in a flat file that is updated periodically, similarly to pg_pwd being a\n> flat text dump of pg_shadow. Since there's going to have to be a system\n> table mapping table names to OID's anyway, a flat dump of said system table\n> should be similarly done as pg_pwd. Call it pg_realnames or something. Have\n> it have two columns: OID, and pathname (relative to PGDATA) of table.\n> \n> This would help admins who might want to restore single tables -- as long as\n> they have a snapshot of pg_realnames at the same time each table is dumped,\n> then a restore of pg_realnames into a temp dir, then the actual table can be\n> restored in by its OID (of course, its OID might have changed in the interim,\n> but you would simply restore it on top of the OID that that table now maps to).\n> \n> Besides, the OID for the table itself is not likely to change often.\n> \n> Bruce, would this allay some of your (entirely valid) concerns? (I read the\n> thread about this the first time around, when Vadim said the tbale names\n> _would_ go to OID's.)\n\nI will fight this to my death. :-)\n\nI have cursed Ingres every time I needed to look at the Ingres data\ndirectory to find out which tables match which files. Even a lookup\nfile is a pain. Right now, I can do ls -l to see which tables are\ntaking disk space. \n\nConsidering the number of times administrators have to do this, it is a\npain. It is only lazy database internals programmers that would advance\nan oid-only file name concept. FYI, Informix SE uses this the\ntablename_oid concept in their implementation.\n\nKeeping that flat file in sync with the database will be a royal pain. \nImagine the concurrency problems keeping it up to date.\n\nGuess everyone knows where I stand on this 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, 7 Mar 2000 23:53:53 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "On Tue, 7 Mar 2000, Lamar Owen wrote:\n\n> Let the tables be named by OID, and only OID. Then, for admins' convenience,\n> put in a flat file that is updated periodically, similarly to pg_pwd being a\n> flat text dump of pg_shadow. Since there's going to have to be a system\n> table mapping table names to OID's anyway, a flat dump of said system table\n> should be similarly done as pg_pwd. Call it pg_realnames or something. Have\n> it have two columns: OID, and pathname (relative to PGDATA) of table.\n\nThis I would be against ... I personally hate the whole pg_hba.conf,\npg_pwd, etc 'flatfiles' ...\n\nBut, could there not be some way of 'extracting extended data' from the\nbackend? ie. some sort of \\d command that would provide you with\ntablename+path+disk size+??\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, 8 Mar 2000 01:49:58 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "> > I will fight this to my death. :-)\n> > I have cursed Ingres every time I needed to look at the Ingres data\n> > directory to find out which tables match which files. Even a lookup\n> > file is a pain. Right now, I can do ls -l to see which tables are\n> > taking disk space.\n> \n> I had Ingres also, and found their scheme to be a royal pain. But that\n> was really only because they had such a *bad* schema that I'd have to\n> poke around forever to reconstruct a query which would give me file\n> names and table names. And then I'd have to print that and compare\n> that to the directories which were buried way down in a directory\n> tree.\n> \n> But with Postgres, we can write a utility to do this for us, so I\n> think that it isn't so much of an issue. In fact, perhaps we could\n> have a backend function which could do this, so we could query the\n> sizes directly.\n\nDoes not work if the table was accidentally deleted. Also requires the\nbackend to be running.\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, 8 Mar 2000 00:54:37 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "> I will fight this to my death. :-)\n> I have cursed Ingres every time I needed to look at the Ingres data\n> directory to find out which tables match which files. Even a lookup\n> file is a pain. Right now, I can do ls -l to see which tables are\n> taking disk space.\n\nI had Ingres also, and found their scheme to be a royal pain. But that\nwas really only because they had such a *bad* schema that I'd have to\npoke around forever to reconstruct a query which would give me file\nnames and table names. And then I'd have to print that and compare\nthat to the directories which were buried way down in a directory\ntree.\n\nBut with Postgres, we can write a utility to do this for us, so I\nthink that it isn't so much of an issue. In fact, perhaps we could\nhave a backend function which could do this, so we could query the\nsizes directly.\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Wed, 08 Mar 2000 05:55:43 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "At 21:57 7/03/00 -0500, Lamar Owen wrote:\n>Let the tables be named by OID, and only OID. Then, for admins' convenience,\n>put in a flat file that is updated periodically, similarly to pg_pwd being a\n>flat text dump of pg_shadow. Since there's going to have to be a system\n>table mapping table names to OID's anyway, a flat dump of said system table\n>should be similarly done as pg_pwd. Call it pg_realnames or something. Have\n>it have two columns: OID, and pathname (relative to PGDATA) of table.\n\nFor the ignorant, are you able to explain why naming files\n'<table_name>_<IOD>' is not acceptable? This seems to satisfy both\nrequirements (and seemed to be the conclusion of the previous discussion).\n\nI presume I have missed something, and assume there is a good reason for\nthe '<IOD>' naming convention, so if that is the final choice, would it be\nhard to have a file header containing details about the table/index/thing\nthe the file contains and it's OID. In this way, a future pd_dumpfile\ncommand can tell us what our backed up file '1FA12347.dat' is supposed to\ncontain?\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, 08 Mar 2000 17:05:05 +1100", "msg_from": "Philip Warner <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "Bruce Momjian wrote:\n\n> I will fight this to my death. :-)\n> \n> I have cursed Ingres every time I needed to look at the Ingres data\n> directory to find out which tables match which files. Even a lookup\n> file is a pain. Right now, I can do ls -l to see which tables are\n> taking disk space.\n\nAssuming a script \"tableoid\", is..\n\nls -l `tableoid foobar`\n\nor\n\ntableoid | xargs ls -l\n\nso bad?\n", "msg_date": "Wed, 08 Mar 2000 17:24:30 +1100", "msg_from": "Chris Bitmead <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "> Bruce Momjian wrote:\n> \n> > I will fight this to my death. :-)\n> > \n> > I have cursed Ingres every time I needed to look at the Ingres data\n> > directory to find out which tables match which files. Even a lookup\n> > file is a pain. Right now, I can do ls -l to see which tables are\n> > taking disk space.\n> \n> Assuming a script \"tableoid\", is..\n> \n> ls -l `tableoid foobar`\n> \n> or\n> \n> tableoid | xargs ls -l\n\nGive me a reason we don't put the table name in the file name?\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, 8 Mar 2000 01:41:15 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "Philip Warner <[email protected]> writes:\n> For the ignorant, are you able to explain why naming files\n> '<table_name>_<IOD>' is not acceptable? This seems to satisfy both\n> requirements (and seemed to be the conclusion of the previous discussion).\n\nWell, it's pretty simple: consider what has to happen to make RENAME\nTABLE be rollback-able.\n\nYou clearly have to update the pg_class tuple whose relname field\ncontains the table name. That's no problem, because the normal\ntuple commit mechanics will take care of making that tuple update\nvisible or not.\n\nBut, in the current implementation, renaming a table also requires\nrenaming the physical files that hold the table's data --- and last\nI checked, Unix filesystems don't know anything about Postgres\ntransactions. Our current code renames the files instantly when\nthe table rename command is done, and there isn't any code for\nundoing that rename. Thus, aborting the xact afterwards fails, because\nthe pg_class entries revert to their pre-xact values, but the physical\nfiles don't revert to their prior names.\n\nIf we change the implementation so that the files are named after\nthe (fixed, never-changed-after-creation) table OID, then RENAME\nTABLE is no problem: it affects *nothing* except the relname field\nof the table's pg_class row, and either that row update is committed\nor it ain't.\n\nBut if the physical file names contain the logical table name, we\nhave to be prepared to rename those files in sync with the transaction\ncommit that makes the pg_class update valid. Quite aside from any\nimplementation effort involved, the critical point is this: it is\n*not possible* to ensure that that collection of changes is atomic.\nAt best, we can make the window for failure small.\n\nBruce seems to be willing to accept a window of failure for RENAME\nTABLE in order to make database admin easier. That is very possibly\nthe right tradeoff --- but it is *not* an open-and-shut decision.\nWe need to talk about it.\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 08 Mar 2000 01:54:52 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block " }, { "msg_contents": "> If we change the implementation so that the files are named after\n> the (fixed, never-changed-after-creation) table OID, then RENAME\n> TABLE is no problem: it affects *nothing* except the relname field\n> of the table's pg_class row, and either that row update is committed\n> or it ain't.\n> \n> But if the physical file names contain the logical table name, we\n> have to be prepared to rename those files in sync with the transaction\n> commit that makes the pg_class update valid. Quite aside from any\n> implementation effort involved, the critical point is this: it is\n> *not possible* to ensure that that collection of changes is atomic.\n> At best, we can make the window for failure small.\n> \n> Bruce seems to be willing to accept a window of failure for RENAME\n> TABLE in order to make database admin easier. That is very possibly\n> the right tradeoff --- but it is *not* an open-and-shut decision.\n> We need to talk about it.\n\nHow about creating a hard link during RENAME, and you can just remove\nthe old link on commit or remove the new link on transaction rollback?\n\nWe can register this in the at_exit processing too if you think it is\nnecessary to clean it up on a backend crash that never gets to an abort,\nthough I think abort is always called.\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, 8 Mar 2000 02:06:00 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "At 01:54 8/03/00 -0500, Tom Lane wrote:\n>Philip Warner <[email protected]> writes:\n>> For the ignorant, are you able to explain why naming files\n>> '<table_name>_<IOD>' is not acceptable? This seems to satisfy both\n>> requirements (and seemed to be the conclusion of the previous discussion).\n>\n>Well, it's pretty simple: consider what has to happen to make RENAME\n>TABLE be rollback-able.\n...etc\n\nSorry for the stupid question. I was confusing the previous discussions\nover 'DROP COLUMN' with this one, without actually engaging my brain. \n\nYour response was admirably patient.\n\nFWIW, without a 'storage area' or 'table space' concept, I agree that table\nnames based on OID's are TWTG.\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, 08 Mar 2000 18:10:04 +1100", "msg_from": "Philip Warner <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block " }, { "msg_contents": "Can I throw one more question out there on this subject?\n\nThere's something that I view as inconsistent behavior with\nrespect to DDL statements and MVCC and was wondering if this\nwould have any impact on the discussion (the following is with\n6.5.3):\n\nSession #1:\n\nemptoris=> begin;\nBEGIN\nemptoris=> select * from test;\nvalue\n-----\n 1\n(1 row)\n\nSession #2:\n\nemptoris=> begin;\nBEGIN\nemptoris=> select * from test;\nvalue\n-----\n 1\n(1 row)\n\nSession #1:\n\nemptoris=> drop table test;\nDROP\n\nSession #2:\n\nemptoris=> select * from test;\nERROR: mdopen: couldn't open test: No such file or directory\n\nNow it would seem to me that if DROP TABLE is going to be\nROLLBACK-able, then Session #2, in a MVCC environment should\nnever see:\n\nERROR: mdopen: couldn't open test: No such file or directory\n\nbut it does, because the \"effect\" of the drop table is an action\nthat is seen by all sessions, as though it were \"committed\". So I\nam now wondering, are there any\nMulti-Versioning/Multi-Generational RDBMS that support\nROLLBACK-able DDL statements in transactions...\n\nJust curious,\n\nMike Mascari\n", "msg_date": "Wed, 08 Mar 2000 03:07:45 -0500", "msg_from": "Mike Mascari <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": ">but it does, because the \"effect\" of the drop table is an action\n>that is seen by all sessions, as though it were \"committed\". So I\n>am now wondering, are there any\n>Multi-Versioning/Multi-Generational RDBMS that support\n>ROLLBACK-able DDL statements in transactions...\n>\n\nDec/Rdb for one. They do, however, make their lives easier by 'locking the\nmetadata' when a user does a select. This means the 'drop table' would hang\nuntil the first user commits. I think it even hangs until the first user\nexits - basically if they have referenced tha table, you can't touch it\nuntil they exit. But they do allow rollback on all DDL statements.\n\nThey do not allow rollback on 'managment' functions like moving storage\nareas (where one or more tables are stored) across disks, doing vacuum-like\nfunctions etc.\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, 08 Mar 2000 19:26:19 +1100", "msg_from": "Philip Warner <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "Mike Mascari <[email protected]> writes:\n> Now it would seem to me that if DROP TABLE is going to be\n> ROLLBACK-able, then Session #2, in a MVCC environment should\n> never see:\n\n> ERROR: mdopen: couldn't open test: No such file or directory\n\nCheck. We didn't say this worked yet ;-)\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 08 Mar 2000 03:31:40 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block " }, { "msg_contents": "Bruce Momjian <[email protected]> writes:\n>> Bruce seems to be willing to accept a window of failure for RENAME\n>> TABLE in order to make database admin easier. That is very possibly\n>> the right tradeoff --- but it is *not* an open-and-shut decision.\n>> We need to talk about it.\n\n> How about creating a hard link during RENAME, and you can just remove\n> the old link on commit or remove the new link on transaction rollback?\n\nStill non-atomic as far as I can see...\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 08 Mar 2000 03:41:17 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block " }, { "msg_contents": "> -----Original Message-----\n> From: [email protected]\n> [mailto:[email protected]]On Behalf Of Mike Mascari\n> \n> Can I throw one more question out there on this subject?\n> \n> There's something that I view as inconsistent behavior with\n> respect to DDL statements and MVCC and was wondering if this\n> would have any impact on the discussion (the following is with\n> 6.5.3):\n> \n> Session #1:\n> \n> emptoris=> begin;\n> BEGIN\n> emptoris=> select * from test;\n> value\n> -----\n> 1\n> (1 row)\n> \n> Session #2:\n> \n> emptoris=> begin;\n> BEGIN\n> emptoris=> select * from test;\n> value\n> -----\n> 1\n> (1 row)\n> \n> Session #1:\n> \n> emptoris=> drop table test;\n> DROP\n> \n> Session #2:\n> \n> emptoris=> select * from test;\n> ERROR: mdopen: couldn't open test: No such file or directory\n> \n> Now it would seem to me that if DROP TABLE is going to be\n> ROLLBACK-able, then Session #2, in a MVCC environment should\n> never see:\n> \n> ERROR: mdopen: couldn't open test: No such file or directory\n> \n> but it does, because the \"effect\" of the drop table is an action\n> that is seen by all sessions, as though it were \"committed\".\n\nThe inconsistency is due the current implementation of DROP\nTABLE which immediately unlinks the base relation file phisically.\nThough the definition(i.e pg_class tuple) of test relation still exits\n(logically),the base relation file doesn't exist.\n \nPostgreSQL has a standard mechanism of transaction control\nfor tuples but there's no such mechanism for relation files.\nCurrently even a single DDL command outside transaction\ndoesn't have atomicity. I have really disliked this feature(? bug)\nfor a long time.\nFlexible mapping from a relation to the relation file name is\nneeded in order to enable transaction control for relation files. \n\nRegards.\n\nHiroshi Inoue\[email protected]\n", "msg_date": "Wed, 8 Mar 2000 18:40:20 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "> -----Original Message-----\n> From: [email protected]\n> [mailto:[email protected]]On Behalf Of Tom Lane\n>\n> Philip Warner <[email protected]> writes:\n> > For the ignorant, are you able to explain why naming files\n> > '<table_name>_<IOD>' is not acceptable? This seems to satisfy both\n> > requirements (and seemed to be the conclusion of the previous\n> discussion).\n>\n> Well, it's pretty simple: consider what has to happen to make RENAME\n> TABLE be rollback-able.\n>\n\nIs it necessary to get the relation path name from the relation name/oid etc\neach time ?\nIs it bad to keep the relation path name in pg_class(or another relation) ?\nIf a new vessel is needed for copy(etc)ing existent tuples we have to\nallocate\nanother unique path name otherwise we can use already allocated file name.\nAnd is it good to dicide the unique path name from oid/relname etc ?\n\nRegards.\n\nHiroshi Inoue\[email protected]\n\n", "msg_date": "Wed, 8 Mar 2000 19:12:43 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] DROP TABLE inside a transaction block " }, { "msg_contents": "Tom Lane wrote:\n> \n> \n> If we change the implementation so that the files are named after\n> the (fixed, never-changed-after-creation) table OID, then RENAME\n> TABLE is no problem: it affects *nothing* except the relname field\n> of the table's pg_class row, and either that row update is committed\n> or it ain't.\n> \n> But if the physical file names contain the logical table name, we\n> have to be prepared to rename those files in sync with the transaction\n> commit that makes the pg_class update valid. Quite aside from any\n> implementation effort involved, the critical point is this: it is\n> *not possible* to ensure that that collection of changes is atomic.\n> At best, we can make the window for failure small.\n>\n\nHow about using hard-links? The transaction that created the change\nwould see the new link along with the new tuple. other transactions\nwould see the old directory and the old tuple. rollback drops the new\ntuple and the new directory entry. Commit does the obvious.\n\nDoes WinNT have something similar to a hard link?\n-- \n\nMark Hollomon\[email protected]\nESN 451-9008 (302)454-9008\n", "msg_date": "Wed, 08 Mar 2000 08:05:20 -0500", "msg_from": "\"Mark Hollomon\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "[email protected] (Bruce Momjian) writes:\n> I have cursed Ingres every time I needed to look at the Ingres data\n> directory to find out which tables match which files. Even a lookup\n> file is a pain. Right now, I can do ls -l to see which tables are\n> taking disk space. \n> \n> Considering the number of times administrators have to do this, it is a\n> pain. It is only lazy database internals programmers that would advance\n> an oid-only file name concept. FYI, Informix SE uses this the\n> tablename_oid concept in their implementation.\n> \n> Keeping that flat file in sync with the database will be a royal pain. \n> Imagine the concurrency problems keeping it up to date.\n\nI'm just a lurker here, and not familiar with postgres internals, so\nthis suggestion could easily be so ignorant that it's simply not worth\nit to even respond.\n\nCaveats aside, it occurs to me that a possible compromise might be to\nname tables files by OID, but put them in directories that are named\nfor the tables themselves.\n\nBruce has to use du -s rather than ls -l, but he can still achieve the\nsame end (measuring space used by particular tables), while allowing\nthe tables to be named by OID, which means that we could get the\nbenefits that accrue from that.\n\nThis actually occured to me when the whole \"tablespace\" discussion\ncame up a couple of months ago---by using a different directory for\neach table, it would suddenly become very easy to split up a database\nacross spindles with what would seem to be at least adequate control.\n\nAgain, I am sufficiently ignorant of postgres internals---I just read\nthe list, I haven't really looked at the code---that this is probably\nutterly untenable.\n\nMike.\n", "msg_date": "08 Mar 2000 09:04:27 -0500", "msg_from": "Michael Alan Dorman <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "\"Hiroshi Inoue\" <[email protected]> writes:\n> Is it necessary to get the relation path name from the relation name/oid etc\n> each time ?\n> Is it bad to keep the relation path name in pg_class(or another relation) ?\n\nHmm, we could maybe do that for user relations, but it obviously would\nnot work for pg_class itself. I'm a little worried about trying to do\nit for the other critical system relations, too. We'd want to keep the\nrelation's pathname in its relcache entry, so any system relation that\nis read while setting up a relcache entry has to have a fixed path that\ncan be determined without a relcache entry.\n\nPerhaps it would be good enough to say that all system relations live in\nthe database's primary directory, and only user relations have pathnames\nspecified in their pg_class entries. Renaming a system table would be\na Really Bad Idea anyway ;-)\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 08 Mar 2000 11:15:56 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block " }, { "msg_contents": "On Wed, 8 Mar 2000, Bruce Momjian wrote:\n\n> > But with Postgres, we can write a utility to do this for us, so I\n> > think that it isn't so much of an issue. In fact, perhaps we could\n> > have a backend function which could do this, so we could query the\n> > sizes directly.\n> \n> Does not work if the table was accidentally deleted. Also requires the\n> backend to be running.\n\nFor ppl that aim ourselves at providing for data integrity, we sure have a\nlot of \"if the table was accidentally deleted\" problems with poor\nsolutions, no? :) \n\nIMHO, we are basically supporting ppl *not* doing regular backups of their\ndata ... most, if not all, of the problems that ppl feel exist that\nrequires the use of 'flat files', IMHO, aren't big problems if properly\nbackup procedures are followed ...\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, 8 Mar 2000 16:12:38 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "The Hermit Hacker wrote:\n> IMHO, we are basically supporting ppl *not* doing regular backups of their\n> data ... most, if not all, of the problems that ppl feel exist that\n> requires the use of 'flat files', IMHO, aren't big problems if properly\n> backup procedures are followed ...\n\nI suggested the 'flat-file' more as a compromise than anything else.\n(Although it kindof backfired :-(). Technically speaking, my\n'flat-file' is trading the flat-file in the OS's filesystem (the\ndirectory) with a separate flat-file. Little to no admin difference\nfrom my point of view.\n\nThe problem that Bruce is talking about occurs when you try to restore\n(from a properly built off-line binary backup) a single table or small\nset of tables. It doesn't have anything to do with supporting people\nwho won't do proper backups, IMO.\n\nOf course, I personally use on-line pg_dump backups and feed into psql\nfor on-line restore -- which doesn't require knowing anything about the\nunderlying filesystem structures.\n\nSo, the dichotomy is between those who want to admin at the OS file\nlevel versus those who feel the backend should hide all those details\nfrom the admin. At least that's how istm.\n\n--\nLamar Owen\nWGCR Internet Radio\n1 Peter 4:11\n", "msg_date": "Wed, 08 Mar 2000 16:15:40 -0500", "msg_from": "Lamar Owen <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "On Wed, Mar 08, 2000 at 03:41:17AM -0500, Tom Lane wrote:\n> Bruce Momjian <[email protected]> writes:\n> >> Bruce seems to be willing to accept a window of failure for RENAME\n> >> TABLE in order to make database admin easier. That is very possibly\n> >> the right tradeoff --- but it is *not* an open-and-shut decision.\n> >> We need to talk about it.\n> \n> > How about creating a hard link during RENAME, and you can just remove\n> > the old link on commit or remove the new link on transaction rollback?\n> \n> Still non-atomic as far as I can see...\n> \n\nAnd there doesn't seem to be an obvious way to extend it to the DROP\nTABLE case. Hmm, on second thought, to rollback DROP TABLE we'll need to\n'hide' the table from the current transaction: one way would be to rename\nit, then do the drop at commit time.\n\nRegardless, since I think there are other, SQL92 standard driven reasons to\nbreak the relname == filename link, I decided to go ahead and see how hard\ncoding it would be, and how much code might be depending on that behavior.\n\nLooked like it was going to be very simple: the RelationGetRelationName\nand RelationGetPhysicalRelationName macros encapsulate access to the\n(relation)->rd_rel->relname structure member pretty effectively (thanks\nto Bruce's temp. relation work, I presume)\n\nAs a first crack, I decided to use the oid for the filename, just because\nit simplified the chamges to the Macro, and there was already an oidout()\nbuiltin that'd do the palloc for me ;-)\n\n<some time latter...>\n\nWell, ... it is, as they say, a Small Matter of Programming. I now know\na lot more about the bootstrap process, and the relcache, I can tell you!\n\nMost problems where code that used RelationGetPhysicalRelationName\nwhen they it should use RelationGetRelationName. In several cases,\nthe code assumed RelationGetPhysicalRelationName handed them a\npointer to rd_rel->relname, which they copy into! I substituted\nRelationGetRelationName for all these cases.\n\nThere's some uglyness with SharedSystemRelations, as well. I just hacked\nin hard coded numbers where ever I found hardcoded relation names, for\nan inital test of principle.\n\nI've got a version running, and I can type at a standalone backend:\nstill some problems with initdb: the pg_log, pg_shadow and pg_user\nrelations don't get created: I cheated and copied the first two from my\n'current' install. That got the backend up, either standalone, or as\npostmaster. It'll even accept connections from pgsql: just errors a lot,\nsince pg_user isn't there!\n\nHowever, typing at the backend, I can create tables, insert, delete,\nstart transactions, rollback, etc. Basically, everything works.\n\nSuffice to say, altering the physical storage name is not too difficult,\nif _I_ can get this far in just a few hours. Whatever we decide for\n'policy' on the name issue (and now that I've generated it, I can tell\nyou that a directory full of numbers is _really_ ugly) implementation\nshould go easily.\n\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": "Wed, 8 Mar 2000 15:19:43 -0600", "msg_from": "\"Ross J. Reedstrom\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "> Looked like it was going to be very simple: the RelationGetRelationName\n> and RelationGetPhysicalRelationName macros encapsulate access to the\n> (relation)->rd_rel->relname structure member pretty effectively (thanks\n> to Bruce's temp. relation work, I presume)\n\nYes.\n\n> As a first crack, I decided to use the oid for the filename, just because\n> it simplified the chamges to the Macro, and there was already an oidout()\n> builtin that'd do the palloc for me ;-)\n> \n> <some time latter...>\n> \n> Well, ... it is, as they say, a Small Matter of Programming. I now know\n> a lot more about the bootstrap process, and the relcache, I can tell you!\n> \n> Most problems where code that used RelationGetPhysicalRelationName\n> when they it should use RelationGetRelationName. In several cases,\n> the code assumed RelationGetPhysicalRelationName handed them a\n> pointer to rd_rel->relname, which they copy into! I substituted\n> RelationGetRelationName for all these cases.\n\nPlease send in a patch on those if they need to be corrected, 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": "Wed, 8 Mar 2000 18:24:35 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "On Wed, Mar 08, 2000 at 06:24:35PM -0500, Bruce Momjian wrote:\n> > Looked like it was going to be very simple: the RelationGetRelationName\n> > and RelationGetPhysicalRelationName macros encapsulate access to the\n> > (relation)->rd_rel->relname structure member pretty effectively (thanks\n> > to Bruce's temp. relation work, I presume)\n> \n> Yes.\n\nWell, thank you, then ;-)\n> \n> > \n> > Most problems where code that used RelationGetPhysicalRelationName\n> > when they it should use RelationGetRelationName. In several cases,\n> > the code assumed RelationGetPhysicalRelationName handed them a\n> > pointer to rd_rel->relname, which they copy into! I substituted\n> > RelationGetRelationName for all these cases.\n> \n> Please send in a patch on those if they need to be corrected, OK?\n> \n\nOnce I'm sure it's the Right Thing To Do, I will. That's probably\nthe only clean part of the ugly hack I've done so far.\n\nI've got a complete system up, now. For some reason, the bootstrapping\nin initdb doesn't create the pg_log (or pg_shadow!) relations, even\nthough the same step on a clean CVS tree does. Can't quite find why. So,\nthe non-bootstrap connections in initdb (creating all the system views)\nthen fail. If I manually copy the pg_log and pg_shadow files over from\n'current' to 'hacked', I can then run the code from initdb by hand,\nand get a fully functional system.\n\nI went ahead and ifdefed out the rename() in renamerel(). Low and behold,\nI can rollback an ALTER TABLE RENAME, and have a concurrent session\nsee the right thing. The conncurent session hangs, though, because of\nthe exclusive lock. Based on comments in that function, I think the\nlock is still needed to handle the buffer cache, which is indexed by\nrelname. Should probably make that indexed by PhysicalName, since they're\ndisk buffers, after all. Haven't touched DROP TABLE, yet though.\n\nMy real goal with all this is to now look at the parser, and see how\nhard it will be to do something with schema. I think that's going to\nrequire an other field in the relation structure, to indicate which\nschema a relation belongs to, then control access based on what the\ncurrent default schema is. All the relname stuff was just so different\nschema can have different tables with the same name. ;-)\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": "Wed, 8 Mar 2000 18:22:20 -0600", "msg_from": "\"Ross J. Reedstrom\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "> -----Original Message-----\n> From: [email protected]\n> [mailto:[email protected]]On Behalf Of Bruce Momjian\n> \n> > Looked like it was going to be very simple: the RelationGetRelationName\n> > and RelationGetPhysicalRelationName macros encapsulate access to the\n> > (relation)->rd_rel->relname structure member pretty effectively (thanks\n> > to Bruce's temp. relation work, I presume)\n> \n> Yes.\n> \n> > As a first crack, I decided to use the oid for the filename, \n> just because\n> > it simplified the chamges to the Macro, and there was already \n> an oidout()\n> > builtin that'd do the palloc for me ;-)\n> >\n\nI object to this proposal.\n\nI have been suspicious why mapping algorithm from relations\nto the relation file names is needed for existent relations.\nThis should be changed first.\n\nAnd pluaral relation file names are needed for a relation oid/relname.\nWhy do you prefer fixed mapping oid/relname --> relation file name ?\n\nRegards.\n\nHiroshi Inoue\[email protected]\n\n\n", "msg_date": "Thu, 9 Mar 2000 09:43:35 +0900", "msg_from": "\"Hiroshi Inoue\" <[email protected]>", "msg_from_op": false, "msg_subject": "RE: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "> > > Most problems where code that used RelationGetPhysicalRelationName\n> > > when they it should use RelationGetRelationName. In several cases,\n> > > the code assumed RelationGetPhysicalRelationName handed them a\n> > > pointer to rd_rel->relname, which they copy into! I substituted\n> > > RelationGetRelationName for all these cases.\n> > \n> > Please send in a patch on those if they need to be corrected, OK?\n> > \n> \n> Once I'm sure it's the Right Thing To Do, I will. That's probably\n> the only clean part of the ugly hack I've done so far.\n\nI was just really interested in places where\nRelationGetPhysicalRelationName() and RelationGetRelationName() where\ncalled incorrectly. That can go into 7.0.\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, 8 Mar 2000 21:00:56 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] DROP TABLE inside a transaction block" } ]
[ { "msg_contents": "Hello,\n\nI just downloaded the 7.0 beta to test it with my database to make sure\nthere will be no unexpected problems when I upgrade my production site.\nI've run into a problem that I hope you can help me with. I dumped my \n6.5.2 database and loaded it into 7.0. Lot's of queries are now taking \nmuch much longer. I have included the plans from one of the queries. \nIn 7.0, the query takes 94 seconds compared to less than a second for\nit to run on 6.5.2. All of the data is exactly the same, the indexes are the \nsame. I thought maybe the indexes had bad statistics, so I \"vaccum analyze\" \nboth the 6.5.2 database and the 7.0 database and ran again on both just to \nbe on the safe side. Still, same problem. I know that there were problems \nwith IN clauses optimizing and the preferred method is to use an exists \nstatement. However, I wouldn't expect this kind of change in performance. \nIt does appear that 7.0 is trying to be smarter by using an index in the \nSubPlan, but for some reason it's being a hog.\n\nSome more information that may be useful, the table 'game' has about 1000\nrows and the table game_developer has about 15000 rows. There is an\nindex on game_developer(developer_id) \n\nOther than these types of queries, everything else seems to be working \nokay. I logged about 500 different queries that run against my database,\nremoved the ones that exhibit the behaviour above and ran a little\nbenchmark. The run times between 6.5.2 and 7.0.0, for the types of\nqueries I'm running, are almost identical. I was hoping that the new\nimproved optimizer would bring a great speed improvement, but I'm not\nseeing it. My guess is that most of the queries that I'm running are\nsmall and there's a fixed cost associated with running each one -- the\nactual work they perform is pretty small. Possibly more time is being\nspent optimizing the plan and is offsetting the improved execution time\non smaller queries.\n\n-brian\n\n\n-- PG 7.0 --\nNOTICE: QUERY PLAN:\n\nSort (cost=383940.72..383940.72 rows=905 width=59)\n -> Seq Scan on game (cost=0.00..383896.28 rows=905 width=59)\n SubPlan\n -> Unique (cost=0.00..808.88 rows=0 width=4)\n -> Index Scan using game_developer_game_index on game_developer (cost=0.00..808.87 rows=4 width=4)\n\nEXPLAIN\n\n-- PG 6.5.2 --\nNOTICE: QUERY PLAN:\n\nSort (cost=99.32 rows=872 width=59)\n -> Seq Scan on game (cost=99.32 rows=872 width=59)\n SubPlan\n -> Unique (cost=578.53 rows=2 width=4)\n -> Sort (cost=578.53 rows=2 width=4)\n -> Seq Scan on game_developer (cost=578.53 rows=2 width=4)\n\nEXPLAIN\n\nQuery:\n\nselect \n\tcreation_timestamp,\n\tapproved,\n\tmoby_user_id,\n\tcopyright_year,\n\tgame_title,\n\tgame_url,\n\tcompany_line,\n\tcredits_complete,\n\tgame_id \nfrom \n\tgame \nwhere \n\tapproved = 1 \nand \n\tgame_id in (\n\t\tselect \n\t\t\tdistinct game_id\n\t\tfrom \n\t\t\tgame_developer\n\t\twhere \n\t\t\tdeveloper_id = 3) \norder by \n\tcopyright_year desc,\n\tgame_title;\n-- \nThe world's most ambitious and comprehensive PC game database project.\n\n http://www.mobygames.com\n", "msg_date": "Sun, 5 Mar 2000 03:26:55 -0600", "msg_from": "Brian Hirt <[email protected]>", "msg_from_op": true, "msg_subject": "Optimizer badness in 7.0 beta" }, { "msg_contents": "This query can be rewritten as\n\nSELECT creation_timestamp, etc. \nFROM game, game_developer\nWHERE game.game_id = game_developer.game_id\n AND approved = 1 AND developer_id = 3\nORDER BY copyright_year desc, game_title\n\nThe way you're writing it you're almost asking it to be slow. :)\n\nOf course that still doesn't explain why it's now 94sec versus formerly 1\nbut I'm sure Tom Lane will enlighten us all very soon. :)\n\n\nBrian Hirt writes:\n\n> select \n> \tcreation_timestamp,\n[snip]\n> from \n> \tgame \n> where \n> \tapproved = 1 \n> and \n> \tgame_id in (\n> \t\tselect \n> \t\t\tdistinct game_id\n> \t\tfrom \n> \t\t\tgame_developer\n> \t\twhere \n> \t\t\tdeveloper_id = 3) \n> order by \n> \tcopyright_year desc,\n> \tgame_title;\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": "Sun, 5 Mar 2000 15:15:45 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Optimizer badness in 7.0 beta" }, { "msg_contents": "Peter,\n\nActually, the query you supply will not work, I'll get duplicate \nrows because the relationship between game and game_developer is \na one to many. Of course you had no way of knowing that from the \ninformation I supplied. I could throw a distinct in there to get \nthe results, but that really feels like bad form because of the large\namount of duplicate rows. In any case, the original query I supplied \nis generated SQL, created by a Database to Object persistance layer \nand cannot by design have multiple tables in the from clause, so \nrestrictions to the table seleted from must be in the form of a \nqualifier. \n\nI realize that the query in question could be written better. My \nconcern was the huge difference in performance between 6.5 and 7.0 on\nthis type of query. Other people may be bitten by this one, so I wanted\nto bring it up. I've been able to easily to work around this problem, \nit just seems wrong that the difference in execution time is so far \noff from the previous release. \n\nI dont know too much about the PG internals, but when I used sybase, \nit would usually execute the sub-select independently and stuff the \nresults into a temp table and then do another query, joining to the \nresults of the sub-select. In a situation like this one, worst case \nwithout indexes you would get a table scan for the sub-select \nand then a merge join with a sequential scan on the temp table and a \nsequential scan on the other table (example below). Using that\napproach, with no indexes, the query still executes in a fraction of a \nsecond. It just seems that a query on tables as small as I'm describing\nshould never take as long as it did. It seems like a problem with\nthe optimizer, but if people are happy with currenty functionality that's \nfine with me also.\n\n-brian\n\nFor Example:\n\nSELECT DISTINCT game_id INTO temp tmp_res\nFROM game_developer\nWHERE developer_id = 3\n\nSELECT *\nFROM game, tmp_res\nWHERE game.game_id = tmp_res.game_id\n AND game.approved = 1\nORDER BY copyright_year desc, game_title\n\nOn Sun, Mar 05, 2000 at 03:15:45PM +0100, Peter Eisentraut wrote:\n> This query can be rewritten as\n> \n> SELECT creation_timestamp, etc. \n> FROM game, game_developer\n> WHERE game.game_id = game_developer.game_id\n> AND approved = 1 AND developer_id = 3\n> ORDER BY copyright_year desc, game_title\n> \n> The way you're writing it you're almost asking it to be slow. :)\n> \n> Of course that still doesn't explain why it's now 94sec versus formerly 1\n> but I'm sure Tom Lane will enlighten us all very soon. :)\n> \n> \n> Brian Hirt writes:\n> \n> > select \n> > \tcreation_timestamp,\n> [snip]\n> > from \n> > \tgame \n> > where \n> > \tapproved = 1 \n> > and \n> > \tgame_id in (\n> > \t\tselect \n> > \t\t\tdistinct game_id\n> > \t\tfrom \n> > \t\t\tgame_developer\n> > \t\twhere \n> > \t\t\tdeveloper_id = 3) \n> > order by \n> > \tcopyright_year desc,\n> > \tgame_title;\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-- \nThe world's most ambitious and comprehensive PC game database project.\n\n http://www.mobygames.com\n", "msg_date": "Sun, 5 Mar 2000 15:01:32 -0600", "msg_from": "Brian Hirt <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Optimizer badness in 7.0 beta" }, { "msg_contents": "On Sun, 5 Mar 2000, Brian Hirt wrote:\n\n> Actually, the query you supply will not work, I'll get duplicate \n> rows because the relationship between game and game_developer is \n> a one to many.\n\nGot me. I tried to read into it a little like 'one developer develops many\ngames' but apparently it's the other way around. In that case you could\nuse DISTINCT or maybe DISTINCT ON depending on the details.\n\n> I dont know too much about the PG internals, but when I used sybase, \n> it would usually execute the sub-select independently and stuff the \n> results into a temp table and then do another query, joining to the \n> results of the sub-select.\n\nLast time I checked PostgreSQL executes the subquery for each row.\nApparently it must still be doing that and I do suspect that it is right\nin the overall sense because the subquery may have side effects. Consider\n\nSELECT * FROM t1 WHERE id IN (select nextval('my_sequence'))\n\nOf course this query makes absolutely no sense whatsoever but perhaps\nthere are similar ones where it does.\n\nBut I didn't mean to bash your query style, just pointing out a\nwork-around that's commonly suggested. (People have been caught by this\nbefore.)\n\n> > SELECT creation_timestamp, etc. \n ^^ insert DISTINCT\n> > FROM game, game_developer\n> > WHERE game.game_id = game_developer.game_id\n> > AND approved = 1 AND developer_id = 3\n> > ORDER BY copyright_year desc, game_title\n\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Mon, 6 Mar 2000 08:05:52 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Optimizer badness in 7.0 beta" }, { "msg_contents": "Peter Eisentraut <[email protected]> writes:\n>> I dont know too much about the PG internals, but when I used sybase, \n>> it would usually execute the sub-select independently and stuff the \n>> results into a temp table and then do another query, joining to the \n>> results of the sub-select.\n\n> Last time I checked PostgreSQL executes the subquery for each row.\n> Apparently it must still be doing that\n\nIt did up until last Wednesday. If Brian retries his example with\ncurrent sources I think he'll see better performance. But I still\nwant to poke into exactly why the indexscan implementation seems so\nmuch slower than the prior seqscan+sort implementation; that doesn't\nseem right. (And if it is right, why doesn't the optimizer realize it?)\nI'll get back to Brian on that.\n\n> and I do suspect that it is right\n> in the overall sense because the subquery may have side effects. Consider\n\n> SELECT * FROM t1 WHERE id IN (select nextval('my_sequence'))\n\n> Of course this query makes absolutely no sense whatsoever but perhaps\n> there are similar ones where it does.\n\nInteresting example. But since the tuples in t1 are not guaranteed to\nbe scanned in any particular order, it seems to me that a query that\nhas side-effects in WHERE inherently has undefined results. If we could\ndetect side-effect-producing expressions (which we cannot, currently,\nand in general I suspect that problem is undecidable) I would argue that\nwe ought to reject this query. I certainly don't want to constrain the\noptimizer by assuming that repeated executions of subqueries can't be\noptimized away.\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 07 Mar 2000 03:08:35 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Optimizer badness in 7.0 beta " }, { "msg_contents": "Brian Hirt <[email protected]> writes:\n> -- PG 7.0 --\n> NOTICE: QUERY PLAN:\n\n> Sort (cost=383940.72..383940.72 rows=905 width=59)\n> -> Seq Scan on game (cost=0.00..383896.28 rows=905 width=59)\n> SubPlan\n> -> Unique (cost=0.00..808.88 rows=0 width=4)\n> -> Index Scan using game_developer_game_index on game_developer (cost=0.00..808.87 rows=4 width=4)\n\nThere's something very strange about this query plan --- why is the\nestimated cost of the indexscan so high? If I do, say,\n\nregression=# explain select distinct * from tenk1 where unique1 < 3;\nNOTICE: QUERY PLAN:\n\nUnique (cost=3.22..3.34 rows=0 width=148)\n -> Sort (cost=3.22..3.22 rows=3 width=148)\n -> Index Scan using tenk1_unique1 on tenk1 (cost=0.00..3.19 rows=3 width=148)\n\nThe tenk1 table from the regression database is only 10K rows, versus\n15K in your table, but still I'd expect costs not a heck of a lot higher\nthan one page fetch per tuple retrieved. How is it coming up with a\ncost of 800 to retrieve 4 tuples?\n\nCould I trouble you for the exact declarations of the tables and indices\ninvolved here? Also, what plan do you get from 7.0 if you do\n\n\tset enable_indexscan = 'off';\n\nbefore the EXPLAIN?\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 07 Mar 2000 19:15:10 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Optimizer badness in 7.0 beta " } ]
[ { "msg_contents": "Because of the problems that were pointed out, I'm inclined to remove the\npg_pwd updating trigger again. I can offer you the non-initdb requiring\nvariant (just remove the trigger definition in initdb) or the\nclean-sweeping one (remove the trigger function from the backend). Okay,\nthe first one will require some sort of intervention as well, eventually,\nbut you see the difference.\n\nMy new take on the situation is actually that there shouldn't be a reason\nto tinker with the systems catalogs period. In the case of pg_shadow\nthat's not entirely possible (catupd and trace can't be adjusted\notherwise), but that can be fixed (not now). After all they're called\n*system* catalogs. If someone thinks they can rename a table by updating\npg_class.relname -- good night!\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Sun, 5 Mar 2000 14:29:50 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": true, "msg_subject": "pg_pwd trigger to be removed" }, { "msg_contents": "[Charset ISO-8859-1 unsupported, filtering to ASCII...]\n> Because of the problems that were pointed out, I'm inclined to remove the\n> pg_pwd updating trigger again. I can offer you the non-initdb requiring\n> variant (just remove the trigger definition in initdb) or the\n> clean-sweeping one (remove the trigger function from the backend). Okay,\n> the first one will require some sort of intervention as well, eventually,\n> but you see the difference.\n\nI think we liked the trigger, but wanted it to activate only on\ntransaction commit. I think Tom Lane had some ideas on 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": "Tue, 7 Mar 2000 18:39:24 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] pg_pwd trigger to be removed" }, { "msg_contents": "Peter Eisentraut <[email protected]> writes:\n> Because of the problems that were pointed out, I'm inclined to remove the\n> pg_pwd updating trigger again.\n\nActually, what I'd like to see is a fix that makes the trigger robust.\nMaybe that's too much work for 7.0.\n\nIf we had a robust solution for this problem, then we could apply the\nsame method to export a flat-file equivalent of pg_database, which could\nbe read during backend startup. That would allow us to get rid of some\nincredibly grotty (and not 100% reliable) code that tries to read\npg_database before the transaction management code has been fired up :-(\n\n> My new take on the situation is actually that there shouldn't be a reason\n> to tinker with the systems catalogs period.\n\nMaybe so, but we still could make good use of an end-of-transaction\ntrigger to update pg_pwd from pg_shadow. Right now, rollback of a\npg_shadow update doesn't really work right even if you did it via\nCREATE/ALTER USER.\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 07 Mar 2000 19:22:14 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] pg_pwd trigger to be removed " } ]
[ { "msg_contents": "Peter Eisentraut wrote:\n> \n> On Mon, 6 Mar 2000, Zeugswetter Andreas SB wrote:\n> \n> > Yes, that was also the general consensus on the list. No statement is\n> > ever going to do an implicit commit of previous statements.\n> \n> I can understand that, but one of these days I hope we can offer the SQL\n> semantics of transactions where you don't require a BEGIN. (*Optional*,\n> people.) \n\nI often think that the current behavior with respect to BEGIN\noften hurts PostgreSQL's reputation with respect to speed. If the\ndefault behavior was to begin a transaction at the first\nnon-SELECT DML statement, PostgreSQL wouldn't fare so poorly in\ntests of:\n\nINSERT INTO testspeed(1);\nINSERT INTO testspeed(2);\nINSERT INTO testspeed(3);\n...\nINSERT INTO testspeed(100000);\n\nwhere, the same .sql script submitted against other databases is\nrunning in a transaction, and, as such, is not being committed\nimmediately to disk. Fortunately, the Ziff-Davis reviewer ran his\ntests with fsync() off. But your run-of-the-mill enterprise\napplication developer is probably going to just install the\nsoftware via rpms and run their sql scripts against it.\n\n> In that case you have to do *something* about non-rollbackable\n> DDL (face it, there's always going to be one). Doing what Oracle does is\n> certainly not the *worst* one could do. Again, optional.\n> \n> That still doesn't excuse the current behavior though.\n\nI can certainly understand Andreas' viewpoint. If no DDL,\nhowever, was allowed inside a transaction -or- you could\noptionally turn on implicit commit, imagine how much easier life\nbecomes in implementing ALTER TABLE DROP COLUMN, DROP TABLE, DROP\nINDEX, etc, not having to worry about restoring filesystem files,\nor deleting them in aborted CREATE TABLE/CREATE INDEX statements,\netc. A far-reaching idea would be to make use of foreign keys in\nthe system catalogue, with triggers used to add/rename/remove\nrelation files. That could be done if DDL statements could not be\nexecuted in transactions. With AccessExclusive locks on the\nappropriate relations, a host of race-condition related bugs\nwould disappear. And the complexity involved with dropping (or\nperhaps disallowing the dropping of) related objects, such as\ntriggers, indexes, etc. would be automatic.\n\nMike Mascari\n", "msg_date": "Mon, 06 Mar 2000 00:44:39 -0500", "msg_from": "Mike Mascari <[email protected]>", "msg_from_op": true, "msg_subject": "Re: AW: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "\n> >> 3) Implicitly commit the running transaction and begin a new one.\n> >> Only Vadim and I support this notion, although this is precisely\n> >> what Oracle does (not that that should define PostgreSQL's\n> >> behavior, of course). Everyone else, it seems wants to try to\n> >> implement #1 successfully...(I don't see it happening any time\n> >> soon).\n> >\n> >I support that too since it also happens to be SQL's idea more or less.\n> >One of these days we'll have to offer this as an option. At least for\n> >commands for which #1 doesn't work yet.\n> \n> Do you really mean it when ou say 'Implicitly commit the running\n> transaction'. I would be deeply opposed to this philosophically, if so. No\n> TX should ever be commited unless the user requests it.\n\nYes, that was also the general consensus on the list.\nNo statement is ever going to do an implicit commit of\nprevious statements.\n\nAndreas\n", "msg_date": "Mon, 6 Mar 2000 09:31:30 +0100 ", "msg_from": "Zeugswetter Andreas SB <[email protected]>", "msg_from_op": false, "msg_subject": "AW: [HACKERS] DROP TABLE inside a transaction block" }, { "msg_contents": "On Mon, 6 Mar 2000, Zeugswetter Andreas SB wrote:\n\n> Yes, that was also the general consensus on the list. No statement is\n> ever going to do an implicit commit of previous statements.\n\nI can understand that, but one of these days I hope we can offer the SQL\nsemantics of transactions where you don't require a BEGIN. (*Optional*,\npeople.) In that case you have to do *something* about non-rollbackable\nDDL (face it, there's always going to be one). Doing what Oracle does is\ncertainly not the *worst* one could do. Again, optional.\n\nThat still doesn't excuse the current behavior though.\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Mon, 6 Mar 2000 11:08:04 +0100 (MET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": false, "msg_subject": "Re: AW: [HACKERS] DROP TABLE inside a transaction block" } ]
[ { "msg_contents": "Hello,\n\nI've recently written to pgsql-ports about a problem with PG7.0 on NT (Subj: [PORTS] initdb problem on NT with 7.0). Since nobody helped me, I had to find out the reson. The difference between NT and Linux (for instance) is that \"open( path, O_RDWR );\" opens a file in text mode. So sometime less block can be read than required.\n\nI suggest a following patch. BTW the situation appeared before, see hba.c, pqcomm.c and others.", "msg_date": "Mon, 6 Mar 2000 12:06:27 +0600", "msg_from": "\"Alexei Zakharov\" <[email protected]>", "msg_from_op": true, "msg_subject": "xlog.c.patch for cygwin port." }, { "msg_contents": "Hi,\n\nOn Mon, 6 Mar 2000 12:06:27 +0600\n\"Alexei Zakharov\" <[email protected]> wrote:\n\n> I suggest a following patch. BTW the situation appeared before, \n> see hba.c, pqcomm.c and others.\n\nI propose another patch, against src/include/port/win.h.\nIf this patch is applied, #ifdef with open() such as following is no\nmore needed.\n\n--\n#ifndef __CYGWIN__\n fd=open(path,flags,mode);\n#else\n fd=open(path,flags | O_BINARY,mode);\n#endif\n--\n\nComments?\n\n--\nYutaka tanida / S34 Co., Ltd.\[email protected] (Office)\[email protected](Private, or if you *HATE* Microsoft Outlook)\n\n\n\n*** win.h.orig\tThu Feb 10 17:00:14 2000\n--- win.h\tTue Mar 07 14:07:21 2000\n***************\n*** 10,15 ****\n--- 10,35 ----\n #define USE_POSIX_TIME\n #define HAVE_INT_TIMEZONE\t\t/* has int _timezone */\n \n+ /* open() must use with O_BINARY flag */\n+ \n+ #include<stdarg.h>\n+ #include<sys/fcntl.h>\n+ \n+ static __inline int pg_cygwin_open(const char *pathname,int flags,...) {\n+ va_list va;\n+ \tmode_t mode;\n+ \tif(flags | O_CREAT) {\n+ va_start(va,flags);\n+ mode=va_arg(va,int);\n+ va_end(va);\n+ \treturn open(pathname,flags | O_BINARY,mode);\n+ \t}else{\n+ \treturn open(pathname,flags | O_BINARY);\n+ \t}\n+ }\n+ \n+ #define open pg_cygwin_open\n+ \n #include <cygwin/version.h>\n #if (CYGWIN_VERSION_API_MAJOR >= 0) && (CYGWIN_VERSION_API_MINOR >= 8)\n #define sys_nerr _sys_nerr\n\n", "msg_date": "Tue, 07 Mar 2000 14:25:22 +0900", "msg_from": "yutaka tanida <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] xlog.c.patch for cygwin port." }, { "msg_contents": "Applied.\n\n[Charset Windows-1252 unsupported, skipping...]\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": "Tue, 7 Mar 2000 18:48:55 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] xlog.c.patch for cygwin port." }, { "msg_contents": "This looks interesting. We could remove some of our ifwin cruft.\n\n---------------------------------------------------------------------------\n\n\nOn Mon, 6 Mar 2000 12:06:27 +0600\n\"Alexei Zakharov\" <[email protected]> wrote:\n\n> I suggest a following patch. BTW the situation appeared before, \n> see hba.c, pqcomm.c and others.\n\nI propose another patch, against src/include/port/win.h.\nIf this patch is applied, #ifdef with open() such as following is no\nmore needed.\n\n--\n#ifndef __CYGWIN__\n fd=open(path,flags,mode);\n#else\n fd=open(path,flags | O_BINARY,mode);\n#endif\n--\n\nComments?\n\n--\nYutaka tanida / S34 Co., Ltd.\[email protected] (Office)\[email protected](Private, or if you *HATE* Microsoft Outlook)\n\n\n\n*** win.h.orig\tThu Feb 10 17:00:14 2000\n--- win.h\tTue Mar 07 14:07:21 2000\n***************\n*** 10,15 ****\n--- 10,35 ----\n #define USE_POSIX_TIME\n #define HAVE_INT_TIMEZONE\t\t/* has int _timezone */\n \n+ /* open() must use with O_BINARY flag */\n+ \n+ #include<stdarg.h>\n+ #include<sys/fcntl.h>\n+ \n+ static __inline int pg_cygwin_open(const char *pathname,int flags,...) {\n+ va_list va;\n+ \tmode_t mode;\n+ \tif(flags | O_CREAT) {\n+ va_start(va,flags);\n+ mode=va_arg(va,int);\n+ va_end(va);\n+ \treturn open(pathname,flags | O_BINARY,mode);\n+ \t}else{\n+ \treturn open(pathname,flags | O_BINARY);\n+ \t}\n+ }\n+ \n+ #define open pg_cygwin_open\n+ \n #include <cygwin/version.h>\n #if (CYGWIN_VERSION_API_MAJOR >= 0) && (CYGWIN_VERSION_API_MINOR >= 8)\n #define sys_nerr _sys_nerr\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": "Tue, 7 Mar 2000 19:13:06 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] xlog.c.patch for cygwin port." }, { "msg_contents": "Bruce Momjian <[email protected]> writes:\n> This looks interesting. We could remove some of our ifwin cruft.\n\nI have been thinking for quite some time that most of the CYGWIN32\nifdefs represent very poor programming. Instead of zillions of\n\n#ifndef __CYGWIN32__\n\tfd = open(filename, O_RDONLY, 0666);\n#else\n\tfd = open(filename, O_RDONLY | O_BINARY, 0666);\n#endif\n\nwe should have in one include file something like\n\n#ifndef __CYGWIN32__\n#define OPEN_FLAGS_READ O_RDONLY\n#define OPEN_FLAGS_WRITE O_WRONLY\n// etc for the combinations we need\n#else\n#define OPEN_FLAGS_READ (O_RDONLY | O_BINARY)\n#define OPEN_FLAGS_WRITE (O_WRONLY | O_BINARY)\n// etc\n#endif\n\nand then the body of the code would have\n\n\tfd = open(filename, OPEN_FLAGS_READ, 0666);\n\nand no ifdef. This would also provide a single place to tweak open()\nflags for other platforms, whereas the existing method is exactly zero\nhelp for any non-CYGWIN platform that wants to add O_BINARY ...\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 07 Mar 2000 20:01:16 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] xlog.c.patch for cygwin port. " }, { "msg_contents": "\nSounds like a *great* bug fix to me ... if you \"have better things to do\",\nI can tackle it ...\n\nOn Tue, 7 Mar 2000, Tom Lane wrote:\n\n> Bruce Momjian <[email protected]> writes:\n> > This looks interesting. We could remove some of our ifwin cruft.\n> \n> I have been thinking for quite some time that most of the CYGWIN32\n> ifdefs represent very poor programming. Instead of zillions of\n> \n> #ifndef __CYGWIN32__\n> \tfd = open(filename, O_RDONLY, 0666);\n> #else\n> \tfd = open(filename, O_RDONLY | O_BINARY, 0666);\n> #endif\n> \n> we should have in one include file something like\n> \n> #ifndef __CYGWIN32__\n> #define OPEN_FLAGS_READ O_RDONLY\n> #define OPEN_FLAGS_WRITE O_WRONLY\n> // etc for the combinations we need\n> #else\n> #define OPEN_FLAGS_READ (O_RDONLY | O_BINARY)\n> #define OPEN_FLAGS_WRITE (O_WRONLY | O_BINARY)\n> // etc\n> #endif\n> \n> and then the body of the code would have\n> \n> \tfd = open(filename, OPEN_FLAGS_READ, 0666);\n> \n> and no ifdef. This would also provide a single place to tweak open()\n> flags for other platforms, whereas the existing method is exactly zero\n> help for any non-CYGWIN platform that wants to add O_BINARY ...\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": "Tue, 7 Mar 2000 21:19:09 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] xlog.c.patch for cygwin port. " }, { "msg_contents": "> Bruce Momjian <[email protected]> writes:\n> > This looks interesting. We could remove some of our ifwin cruft.\n> \n> I have been thinking for quite some time that most of the CYGWIN32\n> ifdefs represent very poor programming. Instead of zillions of\n> \n> #ifndef __CYGWIN32__\n> \tfd = open(filename, O_RDONLY, 0666);\n> #else\n> \tfd = open(filename, O_RDONLY | O_BINARY, 0666);\n> #endif\n> \n> we should have in one include file something like\n\nDo we ever assign a function pointer for open() anywhere. If so, the\ndefine will not work without some kind of wrapper, right?\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, 7 Mar 2000 20:50:07 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] xlog.c.patch for cygwin port." }, { "msg_contents": ">> Bruce Momjian <[email protected]> writes:\n>> > This looks interesting. We could remove some of our ifwin cruft.\n>> \n>> I have been thinking for quite some time that most of the CYGWIN32\n>> ifdefs represent very poor programming. Instead of zillions of\n>> \n>> #ifndef __CYGWIN32__\n>> \tfd = open(filename, O_RDONLY, 0666);\n>> #else\n>> \tfd = open(filename, O_RDONLY | O_BINARY, 0666);\n>> #endif\n>> \n>> we should have in one include file something like\n>\n>Do we ever assign a function pointer for open() anywhere. If so, the\n>define will not work without some kind of wrapper, right?\n\nSince the only difference seems to be \"O_RDONLY\" vs \"O_RDONLY | O_BINARY\",\nwhy not do the #define on that?\n\nAt least in this case it works.\n-- \nD. Jay Newman ! For the pleasure and the profit it derives\[email protected] ! I arrange things, like furniture, and\nhttp://www.sprucegrove.com/~jay/ ! daffodils, and ...lives. -- Hello Dolly\n", "msg_date": "Tue, 7 Mar 2000 21:48:28 -0500 (EST)", "msg_from": "\"D. Jay Newman\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] xlog.c.patch for cygwin port." }, { "msg_contents": "> >> Bruce Momjian <[email protected]> writes:\n> >> > This looks interesting. We could remove some of our ifwin cruft.\n> >> \n> >> I have been thinking for quite some time that most of the CYGWIN32\n> >> ifdefs represent very poor programming. Instead of zillions of\n> >> \n> >> #ifndef __CYGWIN32__\n> >> \tfd = open(filename, O_RDONLY, 0666);\n> >> #else\n> >> \tfd = open(filename, O_RDONLY | O_BINARY, 0666);\n> >> #endif\n> >> \n> >> we should have in one include file something like\n> >\n> >Do we ever assign a function pointer for open() anywhere. If so, the\n> >define will not work without some kind of wrapper, right?\n> \n> Since the only difference seems to be \"O_RDONLY\" vs \"O_RDONLY | O_BINARY\",\n> why not do the #define on that?\n> \n> At least in this case it works.\n\nBTW, why do we call open() directory here? Why not VFD interface?\n--\nTatsuo Ishii\n", "msg_date": "Wed, 08 Mar 2000 12:03:11 +0900", "msg_from": "Tatsuo Ishii <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] xlog.c.patch for cygwin port." }, { "msg_contents": "On Tue, 7 Mar 2000, Bruce Momjian wrote:\n\n> > Bruce Momjian <[email protected]> writes:\n> > > This looks interesting. We could remove some of our ifwin cruft.\n> > \n> > I have been thinking for quite some time that most of the CYGWIN32\n> > ifdefs represent very poor programming. Instead of zillions of\n> > \n> > #ifndef __CYGWIN32__\n> > \tfd = open(filename, O_RDONLY, 0666);\n> > #else\n> > \tfd = open(filename, O_RDONLY | O_BINARY, 0666);\n> > #endif\n> > \n> > we should have in one include file something like\n> \n> Do we ever assign a function pointer for open() anywhere. If so, the\n> define will not work without some kind of wrapper, right?\n\nOkay, I'm lost ... if we \"#define OPEN_FLAGS ..\" and not the open itself,\nwhy would we need some kind of wrapper?\n\n\n", "msg_date": "Wed, 8 Mar 2000 01:42:06 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] xlog.c.patch for cygwin port." }, { "msg_contents": "> On Tue, 7 Mar 2000, Bruce Momjian wrote:\n> \n> > > Bruce Momjian <[email protected]> writes:\n> > > > This looks interesting. We could remove some of our ifwin cruft.\n> > > \n> > > I have been thinking for quite some time that most of the CYGWIN32\n> > > ifdefs represent very poor programming. Instead of zillions of\n> > > \n> > > #ifndef __CYGWIN32__\n> > > \tfd = open(filename, O_RDONLY, 0666);\n> > > #else\n> > > \tfd = open(filename, O_RDONLY | O_BINARY, 0666);\n> > > #endif\n> > > \n> > > we should have in one include file something like\n> > \n> > Do we ever assign a function pointer for open() anywhere. If so, the\n> > define will not work without some kind of wrapper, right?\n> \n> Okay, I'm lost ... if we \"#define OPEN_FLAGS ..\" and not the open itself,\n> why would we need some kind of wrapper?\n\nNo, the original person was refining open(). I�think defining the flags\nis much 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, 8 Mar 2000 00:50:15 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] xlog.c.patch for cygwin port." }, { "msg_contents": "On Wed, 8 Mar 2000, Bruce Momjian wrote:\n\n> > On Tue, 7 Mar 2000, Bruce Momjian wrote:\n> > \n> > > > Bruce Momjian <[email protected]> writes:\n> > > > > This looks interesting. We could remove some of our ifwin cruft.\n> > > > \n> > > > I have been thinking for quite some time that most of the CYGWIN32\n> > > > ifdefs represent very poor programming. Instead of zillions of\n> > > > \n> > > > #ifndef __CYGWIN32__\n> > > > \tfd = open(filename, O_RDONLY, 0666);\n> > > > #else\n> > > > \tfd = open(filename, O_RDONLY | O_BINARY, 0666);\n> > > > #endif\n> > > > \n> > > > we should have in one include file something like\n> > > \n> > > Do we ever assign a function pointer for open() anywhere. If so, the\n> > > define will not work without some kind of wrapper, right?\n> > \n> > Okay, I'm lost ... if we \"#define OPEN_FLAGS ..\" and not the open itself,\n> > why would we need some kind of wrapper?\n> \n> No, the original person was refining open(). I�think defining the flags\n> is much better.\n\n\tAh, okay, knew I was missing something :) \n\n\n", "msg_date": "Wed, 8 Mar 2000 02:07:28 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] xlog.c.patch for cygwin port." }, { "msg_contents": "We have resolved all the open()/binary flag calls.\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 12:03:17 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: xlog.c.patch for cygwin port." }, { "msg_contents": "We have resolved all the O_BINARY calls for 7.1. Thanks.\n\n\n> On Mon, 6 Mar 2000 12:06:27 +0600\n> \"Alexei Zakharov\" <[email protected]> wrote:\n> \n> > I suggest a following patch. BTW the situation appeared before, \n> > see hba.c, pqcomm.c and others.\n> \n> I propose another patch, against src/include/port/win.h.\n> If this patch is applied, #ifdef with open() such as following is no\n> more needed.\n> \n> --\n> #ifndef __CYGWIN__\n> fd=open(path,flags,mode);\n> #else\n> fd=open(path,flags | O_BINARY,mode);\n> #endif\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:04:10 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: xlog.c.patch for cygwin port." } ]
[ { "msg_contents": "\n> > Yes, that was also the general consensus on the list. No statement is\n> > ever going to do an implicit commit of previous statements.\n> \n> I can understand that, but one of these days I hope we can offer the SQL\n> semantics of transactions where you don't require a BEGIN. \n> (*Optional*,people.) In that case you have to do *something* about \n> non-rollbackable DDL (face it, there's always going to be one). Doing what\n\n> Oracle does is certainly not the *worst* one could do. Again, optional.\n\nImho it *is* the worst one can do.\nThe only also bad, but acceptable solutions to me would be:\n\n1. disallow this DDL if there is any open DML in this tx,\n\t( allow it, if only select or DDL statements since tx open, and do\nthe implicit commit)\n2. handle this DDL outside any transaction scope even if a tx is open\n\nImplicitly committing previous DML with a DDL statement is imho out of\ndiscussion.\n\nNot in the scope of this discussion is imho the \"truncate\" command,\nsince it is 1. not SQL92, 2. per definition a non rollbackable statement\nand 3. probably rather a DML statement.\n\n> That still doesn't excuse the current behavior though.\n\nAgreed\n\nAndreas\n", "msg_date": "Mon, 6 Mar 2000 11:27:43 +0100 ", "msg_from": "Zeugswetter Andreas SB <[email protected]>", "msg_from_op": true, "msg_subject": "AW: AW: [HACKERS] DROP TABLE inside a transaction block" } ]
[ { "msg_contents": "I have (almost) nothing to do for about 3 weeks, so I thought I'd get\nstarted on some stuff for next time around.\n\nThe idea here is to unify all the various configuration settings into one\ncoherent scheme. This would include:\n\n* pg_options\n* pg_geqo\n* postmaster.opts\n* Most of the postgres and postmaster command line options\n* (almost?) everything you can use SET on\n* All the temporary solutions via server side environment variables\n\nThe idea would be an obvious (IMO) extension of what's done in\ncommands/variable.c: Every conceivable option is assigned a name similar\nto an SQL identifier. With that name you could (under this proposal):\n\n1) Do SET \"foo\" TO 'bar' as usual\n\n2) Pass a default value to the backend via some generic option, say\n\t-@ foo=bar\n\n3) Do the same via the PGOPTIONS variant from the client side\n\n4) Provide a global default via an entry in a configuration file, say\npg_config, of the form foo=bar.\n\nOf course the current and in general the popular options will also retain\ntheir one letter switch in the backend.\n\nIn addition it would be nice to include some (better all) of the static\npostmaster options (of the -p and -N variety) in the scheme. In that case\nonly (4) above will apply, of course.\n\nWhat does this all accomplish you ask? Well, first of all it provides a\nframework for making configuration options available via a variety of\nchannels in a consistent fashion. Secondly, it provides a framework for\neasily adding options in the first place. No more, \"should this be a\nconfigure option?\" (because it most likely should not be a configure\noption :). Finally, it gives people something to do when they should be\n\"administering\" their database server. ;)\n\nLet me know what you think. Don't be rushed if you have other things to do\nright now.\n\n\nA somewhat related but more difficult and controversial project would be\nto unify the options between postmaster and postgres and revise some of\nthe old mechanisms from the time when they were separate executables. For\nexample it would be nice if I could start the postmaster with the -F\noption and it would look that up in the grand unified options table (see\nabove) and say \"ah, that's a per-backend option\" and pass it on to the\nbackend. In the above framework this wouldn't be too difficult to do, but\nthere are conflicting option letters between the two. Of course what\n*really* ought to happen is to give up that postgres/postmaster naming\ndichotomy as such, but that's another day ...\n\n-- \nPeter Eisentraut Sernanders v�g 10:115\[email protected] 75262 Uppsala\nhttp://yi.org/peter-e/ Sweden\n\n", "msg_date": "Mon, 6 Mar 2000 16:59:57 +0100 (CET)", "msg_from": "Peter Eisentraut <[email protected]>", "msg_from_op": true, "msg_subject": "Proposal for Grand Unified Configuration scheme" }, { "msg_contents": "Peter Eisentraut wrote:\n\n> I have (almost) nothing to do for about 3 weeks, so I thought I'd get\n> started on some stuff for next time around.\n\n Lucky you\n\n> The idea here is to unify all the various configuration settings into one\n> coherent scheme. This would include:\n>\n> [...]\n> \n> Let me know what you think. Don't be rushed if you have other things to do\n> right now.\n\n Sounds good to me.\n\n\nJan from Philly\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, 6 Mar 2000 22:31:56 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Proposal for Grand Unified Configuration scheme" }, { "msg_contents": "Peter Eisentraut <[email protected]> writes:\n> The idea here is to unify all the various configuration settings into one\n> coherent scheme.\n\nA good goal. Your sketch seems reasonable, but one comment:\n\n> ... For\n> example it would be nice if I could start the postmaster with the -F\n> option and it would look that up in the grand unified options table (see\n> above) and say \"ah, that's a per-backend option\" and pass it on to the\n> backend.\n\nIn fact -F is *not* a per-backend option, and certainly we dare not\nchange it on-the-fly via SET. The setting is useless and even dangerous\nunless all backends are behaving the same way (see pghackers archives if\nyou've forgotten why). More generally, some options are reasonable to\nset at any time and some aren't; your mechanism needs to deal with that.\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 07 Mar 2000 03:15:31 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Proposal for Grand Unified Configuration scheme " }, { "msg_contents": "[Charset ISO-8859-1 unsupported, filtering to ASCII...]\n> I have (almost) nothing to do for about 3 weeks, so I thought I'd get\n> started on some stuff for next time around.\n> \n> The idea here is to unify all the various configuration settings into one\n> coherent scheme. This would include:\n> \n> * pg_options\n> * pg_geqo\n> * postmaster.opts\n> * Most of the postgres and postmaster command line options\n> * (almost?) everything you can use SET on\n> * All the temporary solutions via server side environment variables\n\nClearly has to be done.\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, 7 Mar 2000 19:00:16 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Proposal for Grand Unified Configuration scheme" } ]
[ { "msg_contents": "Sorry about the length of this one, but I wanted to include backtrace\ninfo. I've been getting a segfault when I try to setup a test version\nof the current CVS tree, to run along beside a 'production' 6.5.X server.\n\nThis is how I've configured it:\n\nwallace$./configure --prefix=/usr/local/pgsql7.0/ --with-pgport=6666 --enable-debug\n\nAfter which make; make install works fine.\n\nOn my machine at home, where I can let pgsql take the default location\nand port, I've had no trouble. With this one, at work, I get a segfault\nwhen initdb tries to execute postgres in bootstrap mode. I've managed\nto run postgres under gdb and capture a backtrace:\n\nwallace$ which initdb\n/usr/local/pgsql7.0/bin/initdb\nwallace$ export | grep -i PG\ndeclare -x LD_LIBRARY_PATH=\"/usr/local/pgsql7.0/lib\"\ndeclare -x PGDATA=\"/usr/local/pgsql7.0/data\"\ndeclare -x PGLIB=\"/usr/local/pgsql7.0/lib\"\ndeclare -x PWD=\"/extra/src/pgsql-current/src\"\n{PATH deleted}\n\n{already ran initdb -d -n, then, after it failed, deleted\n${PGDATA}/pg_control, and created an already sed processed version of\nthe template (just subs for PGUID) }\n\nwallace$ gdb postgres \nGNU gdb 19990928\n<deleted banner>\nThis GDB was configured as \"i686-pc-linux-gnu\"...\n(gdb) set args -boot -x -C -F -D/usr/local/pgsql7.0/data -d template1 </home/reedstrm/template1.sql\n(gdb) run\nStarting program: /usr/local/pgsql7.0/bin/postgres -boot -x -C -F -D/usr/local/pgsql7.0/data -d template1 </home/reedstrm/template1.sql\n<proname name> \n<proowner int4> \n<prolang oid> \n<proisinh bool> \n<proistrusted bool> \n<proiscachable bool> \n<pronargs int2> \n<proretset bool> \n<prorettype oid> \n<proargtypes oidvector> \n<probyte_pct int4> \n<properbyte_cpu int4> \n<propercall_cpu int4> \n<prooutin_ratio int4> \n<prosrc text> \n<probin bytea> \n\n> creating bootstrap relation\n\nProgram received signal SIGSEGV, Segmentation fault.\n0x80eb266 in filepath (filename=0x81b2260 \"pg_proc\") at fd.c:529\n\n529 len = strlen(DatabasePath) + strlen(filename) + 2;\n(gdb) bt\n#0 0x80eb26\n#1 0x80eb456 in FileNameOpenFile (fileName=0x81b2260 \"pg_proc\", fileFlags=194, fileMode=384)\n at fd.c:657\n#2 0x80f1d44 in mdcreate (reln=0x81b18b0) at md.c:128\n#3 0x80f2da7 in smgrcreate (which=0, reln=0x81b18b0) at smgr.c:134\n#4 0x8081a9d in heap_storage_create (rel=0x81b18b0) at heap.c:352\n#5 0x8081a4c in heap_create (relname=0x81b8d48 \"pg_proc\", tupDesc=0x81bdd28, isnoname=0 '\\000', \n istemp=0, storage_create=1 '\\001') at heap.c:329\n#6 0x807e95c in Int_yyparse () at bootparse.y:168\n#7 0x8080557 in BootstrapMain (argc=7, argv=0xbffffc38) at bootstrap.c:395\n#8 0x80afcee in main (argc=8, argv=0xbffffc34) at main.c:100\n\n{grovel around in fd.c: looks like DatabasePath should be set by\nSetDatabasePath, which uses ExpandDatabasePath to the value of DataDir +\ndbName (template1) but somehow we missed it}\n\n(gdb) print DatabasePath\n$1 = 0x0\n(gdb) print DataDir \n$2 = 0xbffffd97 \"/usr/local/pgsql7.0/data\"\n(gdb) exit\n\nAnyone have any ideas? I can recreate at will.\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": "Mon, 6 Mar 2000 18:37:22 -0600", "msg_from": "\"Ross J. Reedstrom\" <[email protected]>", "msg_from_op": true, "msg_subject": "sqgfault on initdb with current CVS" }, { "msg_contents": "> Sorry about the length of this one, but I wanted to include backtrace\n> info. I've been getting a segfault when I try to setup a test version\n> of the current CVS tree, to run along beside a 'production' 6.5.X server.\n> \n> This is how I've configured it:\n> \n> wallace$./configure --prefix=/usr/local/pgsql7.0/ --with-pgport=6666 --enable-debug\n\nFor some reason, current does not seem to allow \".\" in the\n$PGDATA. I'm no sure why this happens at all. I guess it intends to\ninhibit \"./\" or \"../\" for a security reason? If so, that would be\napparently an overkill.\n--\nTatsuo Ishii\n", "msg_date": "Tue, 07 Mar 2000 10:07:16 +0900", "msg_from": "Tatsuo Ishii <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] sqgfault on initdb with current CVS" }, { "msg_contents": "On Tue, Mar 07, 2000 at 10:07:16AM +0900, Tatsuo Ishii wrote:\n> > Sorry about the length of this one, but I wanted to include backtrace\n> > info. I've been getting a segfault when I try to setup a test version\n> > of the current CVS tree, to run along beside a 'production' 6.5.X server.\n> > \n> > This is how I've configured it:\n> > \n> > wallace$./configure --prefix=/usr/local/pgsql7.0/ --with-pgport=6666 --enable-debug\n> \n> For some reason, current does not seem to allow \".\" in the\n> $PGDATA. I'm no sure why this happens at all. I guess it intends to\n> inhibit \"./\" or \"../\" for a security reason? If so, that would be\n> apparently an overkill.\n\nThank you very much, Ishii-san, changing it to pgsql70 worked! If your ever in Houston,\nI owe you a beer!\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": "Mon, 6 Mar 2000 23:04:43 -0600", "msg_from": "\"Ross J. Reedstrom\" <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] sqgfault on initdb with current CVS" }, { "msg_contents": "> > wallace$./configure --prefix=/usr/local/pgsql7.0/ --with-pgport=6666 --enable-debug\n> For some reason, current does not seem to allow \".\" in the\n> $PGDATA. I'm no sure why this happens at all. I guess it intends to\n> inhibit \"./\" or \"../\" for a security reason? If so, that would be\n> apparently an overkill.\n\nBruce, can you add this item to the \"must fix\" list for the 7.0\nrelease (hint hint - is it time to start that list?? ;)\n\nAlso, please add to the same list:\n\no implement the OVERLAPS date/time operator from SQL92 (Thomas)\no support TIME WITH TIME ZONE timezones in literals (Thomas)\no add support for full POSIX time zone specification (Thomas)\n\nThe POSIX time zone stuff is already in there, new for this release,\nbut needs to be polished to work with TZs away from GMT. The OVERLAPS\nstuff is coded and being tested now; it just adds a few functions and\na bit of gram.y syntax.\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Tue, 07 Mar 2000 05:16:07 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] sqgfault on initdb with current CVS" }, { "msg_contents": "> > > wallace$./configure --prefix=/usr/local/pgsql7.0/ --with-pgport=6666 --enable-debug\n> > For some reason, current does not seem to allow \".\" in the\n> > $PGDATA. I'm no sure why this happens at all. I guess it intends to\n> > inhibit \"./\" or \"../\" for a security reason? If so, that would be\n> > apparently an overkill.\n> \n> Bruce, can you add this item to the \"must fix\" list for the 7.0\n> release (hint hint - is it time to start that list?? ;)\n\n> \n> Also, please add to the same list:\n> \n> o implement the OVERLAPS date/time operator from SQL92 (Thomas)\n> o support TIME WITH TIME ZONE timezones in literals (Thomas)\n> o add support for full POSIX time zone specification (Thomas)\n> \n\n\nWe don't have any must fixes for 7.0 yet. Why are these worthy?\n\n> The POSIX time zone stuff is already in there, new for this release,\n> but needs to be polished to work with TZs away from GMT. The OVERLAPS\n> stuff is coded and being tested now; it just adds a few functions and\n> a bit of gram.y syntax.\n\nInitdb required. You better get an OK from Marc.\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": "Tue, 7 Mar 2000 19:09:21 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] sqgfault on initdb with current CVS" }, { "msg_contents": "On Tue, 7 Mar 2000, Bruce Momjian wrote:\n\n> > > > wallace$./configure --prefix=/usr/local/pgsql7.0/ --with-pgport=6666 --enable-debug\n> > > For some reason, current does not seem to allow \".\" in the\n> > > $PGDATA. I'm no sure why this happens at all. I guess it intends to\n> > > inhibit \"./\" or \"../\" for a security reason? If so, that would be\n> > > apparently an overkill.\n> > \n> > Bruce, can you add this item to the \"must fix\" list for the 7.0\n> > release (hint hint - is it time to start that list?? ;)\n> \n> > \n> > Also, please add to the same list:\n> > \n> > o implement the OVERLAPS date/time operator from SQL92 (Thomas)\n> > o support TIME WITH TIME ZONE timezones in literals (Thomas)\n> > o add support for full POSIX time zone specification (Thomas)\n> > \n> \n> \n> We don't have any must fixes for 7.0 yet. Why are these worthy?\n> \n> > The POSIX time zone stuff is already in there, new for this release,\n> > but needs to be polished to work with TZs away from GMT. The OVERLAPS\n> > stuff is coded and being tested now; it just adds a few functions and\n> > a bit of gram.y syntax.\n> \n> Initdb required. You better get an OK from Marc.\n\nGo for it ... no INITDBs after our first release candidate, but if these\nare must-have's, we've only done one Beta1, so get it into Beta2...\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": "Tue, 7 Mar 2000 21:08:27 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] sqgfault on initdb with current CVS" } ]
[ { "msg_contents": "Hello.\n\nI noticed you are the maintainer of the TODO list for PostgreSQL.\n\nI am an enthusiastic user of PostgreSQL, and I feel that with little effort\nwe could add pam authentication functionality. What do you think?\n\"Pluggable Authentication Modules\" are well supported on many architectures,\neg. Linux or BSD or Solaris, users could authenticate in tens of ways.\nThe db administrator's will have choice of thousands of authentication\nmethods, e.g. Kerberos, standard Unix UID (/etc/passwd), SMB, NT Domain,\netc. etc.\nI am looking forward for a NT Domain authentication for PostgreSQL, but\nothers could use one the thousands pam provide.\n\nAnd also you will not have to mantain any more an \"authentication tree\" on\nthe PostgreSQL source code. You just delegate to pam libraries.\n\nThanks for evaluating my proposal,\nJacopo Silva\n\n\n\n\n\n\n\n", "msg_date": "Tue, 7 Mar 2000 09:45:44 +0100", "msg_from": "\"Jacopo Silva\" <[email protected]>", "msg_from_op": true, "msg_subject": "pSQL auth" }, { "msg_contents": "On Tue, Mar 07, 2000 at 09:45:44AM +0100, Jacopo Silva wrote:\n> I am an enthusiastic user of PostgreSQL, and I feel that with little effort\n> we could add pam authentication functionality. What do you think?\n> \"Pluggable Authentication Modules\" are well supported on many architectures,\n> eg. Linux or BSD or Solaris, users could authenticate in tens of ways.\n> The db administrator's will have choice of thousands of authentication\n> methods, e.g. Kerberos, standard Unix UID (/etc/passwd), SMB, NT Domain,\n> etc. etc.\n\nThis sounds very interesting IMO. \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, 8 Mar 2000 08:21:12 +0100", "msg_from": "Michael Meskes <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] pSQL auth" } ]
[ { "msg_contents": "In the alter table regression test, alter_table.sql, it says:\n\n-- 20 values, sorted\nSELECT unique1 FROM ten_k WHERE unique1 < 20;\n\n-- 20 values, sorted\nSELECT unique2 FROM ten_k WHERE unique2 < 20;\n\nWhy sorted? Shouldn't it be\n\nSELECT unique1 FROM ten_k WHERE unique1 < 20 ORDER BY unique1;\n\nif we really expect the output to be sorted?\n\nCheers,\n\nPatrick\n", "msg_date": "Tue, 7 Mar 2000 14:52:27 +0000", "msg_from": "Patrick Welche <[email protected]>", "msg_from_op": true, "msg_subject": "alter_table.sql" }, { "msg_contents": "Patrick Welche <[email protected]> writes:\n> In the alter table regression test, alter_table.sql, it says:\n> -- 20 values, sorted\n> SELECT unique1 FROM ten_k WHERE unique1 < 20;\n> Why sorted? Shouldn't it be\n> SELECT unique1 FROM ten_k WHERE unique1 < 20 ORDER BY unique1;\n> if we really expect the output to be sorted?\n\nThe regression test author evidently expected the optimizer to choose an\nindexscan, which will produce the values in sorted order as a byproduct.\nI agree this code is bogus in a theoretical sense, but I don't think\nit's worth worrying about until we alter the optimizer so far that it\ndoesn't choose an indexscan for this query. (Indeed, that might be a\nsign of an optimizer bug --- so I'd look into why the behavior changed\nbefore changing the regress test.)\n\nSince our regress tests are checked on the basis of exact equality of\noutput, in theory every single regress test SELECT that doesn't specify\n\"ORDER BY\" is broken, because in theory the system could choose to put\nout the tuples in some other order than what's in the regress test\nreference outputs. But in practice, the implementation-dependent\nordering you get is reproducible across platforms, so the tests\naccomplish what they're supposed to. Every so often we have to throw in\nan ORDER BY when we find that one of the test cases isn't so\nreproducible.\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 07 Mar 2000 11:19:08 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] alter_table.sql " }, { "msg_contents": "OK - got it! It is because vacuum analyze <tablename> doesn't work for me,\ntherefore the select doesn't use indices, so uses a sequential rather than\nindex scan => my rows are returned out of order.\n\nThanks for the pointer.\n\nCheers,\n\nPatrick\n\nOn Tue, Mar 07, 2000 at 11:19:08AM -0500, Tom Lane wrote:\n> Patrick Welche <[email protected]> writes:\n> > In the alter table regression test, alter_table.sql, it says:\n> > -- 20 values, sorted\n> > SELECT unique1 FROM ten_k WHERE unique1 < 20;\n> > Why sorted? Shouldn't it be\n> > SELECT unique1 FROM ten_k WHERE unique1 < 20 ORDER BY unique1;\n> > if we really expect the output to be sorted?\n> \n> The regression test author evidently expected the optimizer to choose an\n> indexscan, which will produce the values in sorted order as a byproduct.\n> I agree this code is bogus in a theoretical sense, but I don't think\n> it's worth worrying about until we alter the optimizer so far that it\n> doesn't choose an indexscan for this query. (Indeed, that might be a\n> sign of an optimizer bug --- so I'd look into why the behavior changed\n> before changing the regress test.)\n> \n> Since our regress tests are checked on the basis of exact equality of\n> output, in theory every single regress test SELECT that doesn't specify\n> \"ORDER BY\" is broken, because in theory the system could choose to put\n> out the tuples in some other order than what's in the regress test\n> reference outputs. But in practice, the implementation-dependent\n> ordering you get is reproducible across platforms, so the tests\n> accomplish what they're supposed to. Every so often we have to throw in\n> an ORDER BY when we find that one of the test cases isn't so\n> reproducible.\n> \n> \t\t\tregards, tom lane\n", "msg_date": "Tue, 7 Mar 2000 16:40:31 +0000", "msg_from": "Patrick Welche <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] alter_table.sql" }, { "msg_contents": "Patrick Welche <[email protected]> writes:\n> OK - got it! It is because vacuum analyze <tablename> doesn't work for me,\n> therefore the select doesn't use indices, so uses a sequential rather than\n> index scan => my rows are returned out of order.\n\nAh so. I think you mentioned before that you were seeing trouble with\nVACUUM ANALYZE --- we need to find out what the problem is. What\nplatform are you on, and what are you seeing exactly?\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 07 Mar 2000 12:01:29 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] alter_table.sql " }, { "msg_contents": "On Tue, Mar 07, 2000 at 12:01:29PM -0500, Tom Lane wrote:\n> Ah so. I think you mentioned before that you were seeing trouble with\n> VACUUM ANALYZE --- we need to find out what the problem is. What\n> platform are you on, and what are you seeing exactly?\n\nWhen I mentioned it Bruce said \"works for me\" => I assume it is netbsd\nspecific => I should fix it! The symptom is, if I say\nvacuum analyze <tablename>, I get\n\nNOTICE: Vacuum: table not found\nVACUUM\n\nIf I omit the tablename, vacuum analyze works. I have been rather pressed\nfor time, so all I can say is the notice comes from line 360 of\nsrc/backend/commands/vacuum.c...\n\nCheers,\n\nPatrick\n", "msg_date": "Tue, 7 Mar 2000 17:22:15 +0000", "msg_from": "Patrick Welche <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] alter_table.sql" }, { "msg_contents": "Patrick Welche <[email protected]> writes:\n> On Tue, Mar 07, 2000 at 12:01:29PM -0500, Tom Lane wrote:\n>> Ah so. I think you mentioned before that you were seeing trouble with\n>> VACUUM ANALYZE --- we need to find out what the problem is. What\n>> platform are you on, and what are you seeing exactly?\n\n> When I mentioned it Bruce said \"works for me\" => I assume it is netbsd\n> specific => I should fix it! The symptom is, if I say\n> vacuum analyze <tablename>, I get\n\n> NOTICE: Vacuum: table not found\n> VACUUM\n\n> If I omit the tablename, vacuum analyze works.\n\nHmm. Since there have been examples of vacuum analyze <tablename> in\nthe numeric regress test since 6.5, I'd think we'd have heard about it\nif there were any widespread problem ;-). Perhaps it is a platform\nissue, but I suspect you will find there are additional constraints that\nexplain why no one but you is seeing it. Please do dig into it ... or,\nif you do not have time, you could consider giving one of the other\ndevelopers a login on your machine and that person could check it out.\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 07 Mar 2000 14:29:32 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] alter_table.sql " }, { "msg_contents": "On Tue, Mar 07, 2000 at 02:29:32PM -0500, Tom Lane wrote:\n> \n> Hmm. Since there have been examples of vacuum analyze <tablename> in\n> the numeric regress test since 6.5, I'd think we'd have heard about it\n> if there were any widespread problem ;-). Perhaps it is a platform\n> issue, but I suspect you will find there are additional constraints that\n> explain why no one but you is seeing it. Please do dig into it ... or,\n> if you do not have time, you could consider giving one of the other\n> developers a login on your machine and that person could check it out.\n\nStory so far: I have a table called \"found\". vacuum() in src/backend/commands/vacuum.c\ngets called with vacrel=\"found\". During vc_init() at line 177, vacrel is cleared (=\"\").\n\nMore tomorrow...\n\nCheers,\n\nPatrick\n", "msg_date": "Wed, 8 Mar 2000 18:58:28 +0000", "msg_from": "Patrick Welche <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] alter_table.sql" }, { "msg_contents": "Patrick Welche <[email protected]> writes:\n> Story so far: I have a table called \"found\". vacuum() in\n> src/backend/commands/vacuum.c gets called with vacrel=\"found\". During\n> vc_init() at line 177, vacrel is cleared (=\"\").\n\nWhat the ???\n\nSomebody broke this code badly since I last looked at it. The vacuum\ninitialization sequence has been rearranged so that it does not work:\nthere is a CommitTransactionCommand call that occurs before the vacuum\nparameters have been copied into safe-across-transactions storage.\nWe are reading already-freed memory at line 186.\n\nWill fix ASAP.\n\nBTW, this also demonstrates that the CLOBBER_FREED_MEMORY testing hack\nI put into aset.c needs more work; it ought to clobber implicitly-freed\nmemory as well as explicitly pfree'd blocks. Had I done that I would\nprobably have seen a regression test failure from this bug. Will add\nsome more clobbering code and see what else breaks ;-)\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 08 Mar 2000 14:29:36 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] alter_table.sql " }, { "msg_contents": ">> Story so far: I have a table called \"found\". vacuum() in\n>> src/backend/commands/vacuum.c gets called with vacrel=\"found\". During\n>> vc_init() at line 177, vacrel is cleared (=\"\").\n\n> Somebody broke this code badly since I last looked at it.\n\nFix committed to CVS.\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 08 Mar 2000 18:51:37 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] alter_table.sql " } ]
[ { "msg_contents": "What exactly is our policy towards global variables in libraries? I take is\nthese variables are harmless in multi tasking operation as each process has\nits seperate data space. But they may do harm in multi threading. But then\nlibpq are is not suitable for multi threading, is it?\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, 7 Mar 2000 15:57:45 +0100", "msg_from": "Michael Meskes <[email protected]>", "msg_from_op": true, "msg_subject": "library policy question" }, { "msg_contents": "Michael Meskes <[email protected]> writes:\n> What exactly is our policy towards global variables in libraries?\n\nAvoid them.\n\n> But then libpq are is not suitable for multi threading, is it?\n\nAFAIK, libpq's only use of non-constant globals is the ill-designed\nPQconninfoOption array. I'd get rid of that if it didn't mean breaking\nthe library API. But as things stand, you can't safely use concurrent\ncalls to PQconnectdb or PQconndefaults. Everything else should be OK,\nunless someone has broken it recently.\n\n(idly examines code...)\n\nHmm, we do have a bit of a problem here. While PQconnectdb can be\nreplaced by PQsetdb to avoid the concurrency issue, there is no\nthread-safe equivalent for the new routines\nPQconnectStart/PQconnectPoll. That may not matter much, because\nprobably you would only need those in a single-threaded environment,\nbut it's still kinda ugly. In any case it'd be a lot nicer to be\nable to say \"libpq is thread safe\" rather than \"almost thread safe\".\n\nAt one point we had discussed going ahead and breaking compatibility\nin order to get rid of the static PQconninfoOption array. It wouldn't\nbe a big change in the API: we'd only need to make PQconndefaults return\na malloc'd array instead of a static. That probably wouldn't really\nbreak any existing code, just create a small memory leak in applications\nthat didn't know to free the result when they were done with it. My bet\nis that very few apps use PQconndefaults anyway.\n\n7.0 would be a good time to do that if we were gonna do it. Comments?\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 07 Mar 2000 11:34:04 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] library policy question " }, { "msg_contents": "> 7.0 would be a good time to do that if we were gonna do it. Comments?\n\nYup.\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Tue, 07 Mar 2000 16:57:45 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] library policy question" }, { "msg_contents": "Tom Lane wrote:\n> but it's still kinda ugly. In any case it'd be a lot nicer to be\n> able to say \"libpq is thread safe\" rather than \"almost thread safe\".\n \n> 7.0 would be a good time to do that if we were gonna do it. Comments?\n\nIf time is available to do that, I agree that now is an great time to do\nso. As a user of a multithreaded web front end to PostgreSQL\n(AOLserver), I personally am affected by the result. The AOLserver\nPostgreSQL driver avoids the PQconnectdb() issue by using\nPQsetdbLogin().\n\nHOWEVER, it was a hunt to find that information -- it would have been\nnice for the docs to say 'libpq {is|is not} threadsafe' -- even 'libpq\nis threadsafe if and only if the following API calls are used:' would be\nnice.\nIn fact, even if libpq is not touched, a documentation note to libpq's\nthreadsafeness would be nice.\n\n--\nLamar Owen\nWGCR Internet Radio\n1 Peter 4:11\n", "msg_date": "Tue, 07 Mar 2000 11:57:50 -0500", "msg_from": "Lamar Owen <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] library policy question" }, { "msg_contents": "On Tue, Mar 07, 2000 at 11:34:04AM -0500, Tom Lane wrote:\n> > What exactly is our policy towards global variables in libraries?\n> \n> Avoid them.\n\nAnd what shall I do with sqlca? Make every program define it in its own space?\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, 7 Mar 2000 20:25:10 +0100", "msg_from": "Michael Meskes <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] library policy question" }, { "msg_contents": "On Tue, 7 Mar 2000, Thomas Lockhart wrote:\n\n> > 7.0 would be a good time to do that if we were gonna do it. Comments?\n> \n> Yup.\n\nDitto ... \n\n\n", "msg_date": "Tue, 7 Mar 2000 19:06:24 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] library policy question" }, { "msg_contents": "The Hermit Hacker <[email protected]> writes:\n> On Tue, 7 Mar 2000, Thomas Lockhart wrote:\n>>>> 7.0 would be a good time to do that if we were gonna do it. Comments?\n>> \n>> Yup.\n\n> Ditto ... \n\nOK, I'll take a look at doing it later this week.\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 07 Mar 2000 20:28:02 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] library policy question " }, { "msg_contents": "> Hmm, we do have a bit of a problem here. While PQconnectdb can be\n> replaced by PQsetdb to avoid the concurrency issue, there is no\n> thread-safe equivalent for the new routines\n> PQconnectStart/PQconnectPoll. That may not matter much, because\n> probably you would only need those in a single-threaded environment,\n> but it's still kinda ugly. In any case it'd be a lot nicer to be\n> able to say \"libpq is thread safe\" rather than \"almost thread safe\".\n> \n> At one point we had discussed going ahead and breaking compatibility\n> in order to get rid of the static PQconninfoOption array. It wouldn't\n> be a big change in the API: we'd only need to make PQconndefaults return\n> a malloc'd array instead of a static. That probably wouldn't really\n> break any existing code, just create a small memory leak in applications\n> that didn't know to free the result when they were done with it. My bet\n> is that very few apps use PQconndefaults anyway.\n> \n> 7.0 would be a good time to do that if we were gonna do it. Comments?\n> \n\nSeems like a good time to do 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": "Tue, 7 Mar 2000 20:35:01 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] library policy question" }, { "msg_contents": "> And what shall I do with sqlca? Make every program define it in its own \n> space?\n\nMy vague recollection is that embedded SQL doesn't multithread very\nwell for exactly this reason. You may be stuck with a global variable\nfor that case...\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Wed, 08 Mar 2000 14:06:35 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] library policy question" }, { "msg_contents": "On Tue, Mar 07, 2000 at 11:34:04AM -0500, Tom Lane wrote:\n> > What exactly is our policy towards global variables in libraries?\n> \n> Avoid them.\n\nMaybe I've got a brain lock for the moment but what do I do to the list of\nconnections I have to handle? Since it is used in several functions I cannot\nsee how to program this without a global variable albeit a static one. What\nI need is a mapping of the SQL conenction name to the PGconn structure.\n\nI also wonder if multiple threads should be allowed access to the same\nstructure, i.e. if one thread opens a new connection should the other one be\nallowed to access this too?\n\nBTW libpgeasy does not seem to be able to be used in multi-threading\nenvironments either. Is this library still supported?\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, 8 Mar 2000 16:30:10 +0100", "msg_from": "Michael Meskes <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] library policy question" }, { "msg_contents": "On Wed, Mar 08, 2000 at 02:06:35PM +0000, Thomas Lockhart wrote:\n> My vague recollection is that embedded SQL doesn't multithread very\n> well for exactly this reason. You may be stuck with a global variable\n> for that case...\n\nI was afraid you'd say that. So I can use lots of global vars since libecpg\ndoes not multithread anyway. :-)\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, 8 Mar 2000 17:40:34 +0100", "msg_from": "Michael Meskes <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] library policy question" }, { "msg_contents": "Thomas Lockhart <[email protected]> writes:\n>> And what shall I do with sqlca? Make every program define it in its own \n>> space?\n\n> My vague recollection is that embedded SQL doesn't multithread very\n> well for exactly this reason. You may be stuck with a global variable\n> for that case...\n\nAside from the unthreadable API, ecpg has another potential threading\nproblem: it depends on a lexer and parser that might or might not be\nthread-safe, depending on what they were generated with.\n\nI'd advise just labeling ecpg \"not threadable\" :-(. Not much point in\nbreaking existing apps by changing the API, when you still won't be able\nto guarantee thread safeness...\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 08 Mar 2000 14:49:32 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] library policy question " } ]
[ { "msg_contents": "I had to change quite a lot of files to make libepcg easier to handle. It\nmay be I accidently deleted too many include file. It does compile on my\nlinux machine though. So if it does not compile on any other system please\ntell me.\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, 7 Mar 2000 16:09:39 +0100", "msg_from": "Michael Meskes <[email protected]>", "msg_from_op": true, "msg_subject": "ECPG restructuring" } ]
[ { "msg_contents": "Thanks,\nRegards,\nAndrzej Mazurkiewicz\n", "msg_date": "Tue, 7 Mar 2000 17:14:30 +0100 ", "msg_from": "Andrzej Mazurkiewicz <[email protected]>", "msg_from_op": true, "msg_subject": "How can I create trigger on system table, for on example pg_class ???" } ]
[ { "msg_contents": "I've got patches to fix the CREATE VIEW command to support SQL92\nsyntax for result column names, a la\n\n CREATE VIEW (a, b, c) AS SELECT ...\n\nIt is an almost trivial fix, requiring the addition of a single field\nin the View structure and a few lines of code in analyze.c.\n\nI'll commit this at the same time I commit support for the SQL92\nOVERLAPS operator, which will need an initdb anyway since there are a\nfew new functions in pg_proc. I believe that we have at least one\nother patch coming which will force an initdb anyway, and I'll\ncoordinate with that.\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Tue, 07 Mar 2000 16:14:35 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": true, "msg_subject": "CREATE VIEW fix" }, { "msg_contents": "On Tue, Mar 07, 2000 at 04:14:35PM +0000, Thomas Lockhart wrote:\n> I've got patches to fix the CREATE VIEW command to support SQL92\n> syntax for result column names, a la\n> \n> CREATE VIEW (a, b, c) AS SELECT ...\n> \n> It is an almost trivial fix, requiring the addition of a single field\n> in the View structure and a few lines of code in analyze.c.\n> \n\nHmm, couldn't you just rewrite the SELECT d, e, f ... part to use the \nAS syntax? I was thinking that both:\n\n CREATE VIEW (a, b, c) AS SELECT d, e, f ...\n CREATE VIEW AS SELECT d AS a, e AS b, f AS c ...\n\nshould result in the same VIEW being created. But, hey, don't let me\nknock already written code! \n\n> I'll commit this at the same time I commit support for the SQL92\n> OVERLAPS operator, which will need an initdb anyway since there are a\n> few new functions in pg_proc. I believe that we have at least one\n> other patch coming which will force an initdb anyway, and I'll\n> coordinate with that.\n> \n> - Thomas\n\nExcellent: Both changes will help with the NIST test suite I'm (trying)\nto run.\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, 7 Mar 2000 13:41:54 -0600", "msg_from": "\"Ross J. Reedstrom\" <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] CREATE VIEW fix" }, { "msg_contents": "> I've got patches to fix the CREATE VIEW command to support SQL92\n> syntax for result column names, a la\n> \n> CREATE VIEW (a, b, c) AS SELECT ...\n> \n> It is an almost trivial fix, requiring the addition of a single field\n> in the View structure and a few lines of code in analyze.c.\n> \n> I'll commit this at the same time I commit support for the SQL92\n> OVERLAPS operator, which will need an initdb anyway since there are a\n> few new functions in pg_proc. I believe that we have at least one\n> other patch coming which will force an initdb anyway, and I'll\n> coordinate with that.\n\nSounds good. We may have some people running production on 7.0 beta. \nThey will need to use pg_upgrade.\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, 7 Mar 2000 20:31:46 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] CREATE VIEW fix" }, { "msg_contents": "> > CREATE VIEW (a, b, c) AS SELECT ...\n> Hmm, couldn't you just rewrite the SELECT d, e, f ... part to use the\n> AS syntax? I was thinking that both:\n> CREATE VIEW (a, b, c) AS SELECT d, e, f ...\n> CREATE VIEW AS SELECT d AS a, e AS b, f AS c ...\n> should result in the same VIEW being created. But, hey, don't let me\n> knock already written code!\n\nNot at all. Next time I'll let you write it, since this is how I\nimplemented it :)\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Wed, 08 Mar 2000 05:29:33 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] CREATE VIEW fix" } ]
[ { "msg_contents": "\nHi all. I'm not subscribed to the list but I thought I'd drop this in\nhere as a suggestion. There is a thread in GENERAL called '50MB Table'\nfor those interested. The summary is, I have a 50MB +- table with about\n70,000 records which on wich I was doing LIKE selects. It was taking\napprox 20 secs to complete the search. The table is something like...\n\nCREATE TABLE info (\n lastname char(50),\n street_name char(50),\n ...(etc omitted)\n);\n\nCREATE INDEX nx_info1 ON info (lastname);\nCREATE INDEX nx_info2 ON info (street_name);\n\non which I was doing...\n\nSELECT * FROM info WHERE street_name LIKE 'MAIN%';\n\n...this would take about 20 secs to complete. Because the wildness only\nhappens at the end of the search string, I changed the query to...\n\nSELECT * FROM info WHERE substring( street_name from 1 to 4 ) = 'MAIN';\n\n...this takes under 2 secs. I wrote a piece of code in python to do this\nautomatically for me but it seems to me that the parser/optimizer could\ntake a look at this case and re-write the query with the '=' instead of\nthe 'LIKE'. I've looked through the 'C' code to see where this could\nhappen but it is too thick for me to sort out with my schedule, so I\nthought I'd make the suggestion here.\n\ncheers\njim\n\n-- \nIf everything is coming your way then you're in the wrong lane.\n", "msg_date": "Tue, 07 Mar 2000 18:53:06 -0500", "msg_from": "JB <[email protected]>", "msg_from_op": true, "msg_subject": "'LIKE' enhancement" } ]
[ { "msg_contents": "I have a 50MB +- table with about 70,000 records which on which I was\ndoing LIKE selects. It was taking approx 20 secs to complete the search.\nThe table is something like...\n\nCREATE TABLE info (\n lastname char(50),\n street_name char(50),\n ...(etc omitted)\n);\n\nCREATE INDEX nx_info1 ON info (lastname);\nCREATE INDEX nx_info2 ON info (street_name);\n\non which I was doing...\n\nSELECT * FROM info WHERE street_name LIKE 'MAIN%';\n\n...this would take about 20 secs to complete. Because the wildness only\nhappens at the end of the search string, I changed the query to...\n\nSELECT * FROM info WHERE substring( street_name from 1 to 4 ) = 'MAIN';\n\n...this takes under 2 secs. I wrote a piece of code in python to do this\nautomatically for me but it seems to me that the parser/optimizer could\ntake a look at this case and re-write the query with the '=' instead of\nthe 'LIKE'. I've looked through the 'C' code to see where this could\nhappen but it is too thick for me to sort out with my schedule, so I\nthought I'd make the suggestion here.\n\ncheers\njim\n-- \nIf everything is coming your way then you're in the wrong lane.\n", "msg_date": "Tue, 07 Mar 2000 19:04:16 -0500", "msg_from": "JB <[email protected]>", "msg_from_op": true, "msg_subject": "'LIKE' enhancement suggestion" }, { "msg_contents": "JB <[email protected]> writes:\n> SELECT * FROM info WHERE street_name LIKE 'MAIN%';\n\n> ...this would take about 20 secs to complete. Because the wildness only\n> happens at the end of the search string, I changed the query to...\n\n> SELECT * FROM info WHERE substring( street_name from 1 to 4 ) = 'MAIN';\n\n> ...this takes under 2 secs.\n\nThis makes no sense to me at all. The latter query should be far\nslower, because AFAIK there is no optimization for it, whereas there is\nan optimization for \"foo LIKE 'bar%'\".\n\nWhat version are you running, and what plan does EXPLAIN show for\neach of these queries?\n\n\t\t\tregards, tom lane\n", "msg_date": "Tue, 07 Mar 2000 19:32:10 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] 'LIKE' enhancement suggestion " }, { "msg_contents": "I'm running 6.5.2 on RH6.1, 128mb ram, 27gb, P350. I don't understand\nthis either so please excuse my ignorance. I looked up EXPLAIN and\nhere's what came out...\n\n---[snip]---\n#!/bin/sh\npsql -c \"EXPLAIN SELECT * FROM info WHERE substring(stname from 1 for 4)\n= 'MAIN';\"\ntime psql -c \"SELECT * FROM info WHERE substring(stname from 1 for 4) =\n'MAIN';\"\n\npsql -c \"EXPLAIN SELECT * FROM info WHERE stname LIKE 'MAIN%';\"\ntime psql -c \"SELECT * FROM info WHERE stname LIKE 'MAIN%';\"\n---[snip]---\n\noutputs...\n\n\nSeq Scan on info (cost=3829.93 rows=15454 width=420)\n\n0.01user 0.01system 0:00.72elapsed 2%CPU (0avgtext+0avgdata\n0maxresident)k\n0inputs+0outputs (198major+25minor)pagefaults 0swaps\n\n\nIndex Scan using nx_info1 on info (cost=1531.12 rows=30 width=420)\n\n0.01user 0.01system 0:00.64elapsed 3%CPU (0avgtext+0avgdata\n0maxresident)k\n0inputs+0outputs (198major+25minor)pagefaults 0swaps\n\n\nObviously the numbers don't support me. I'm quite confused. I was told\nthat the engine didn't use indexes with 'LIKE' by someone equally\ninformed as I, and thus the 'substring' change. This worked remarkably\nfaster so I assumed it to be true. Apparently it is not. There must be\nsomething with the bigger system that I need to look into (mem usage,\netc). My apologies for chewing up bandwidth. \n\njb\n\n\nTom Lane wrote:\n> \n> JB <[email protected]> writes:\n> > SELECT * FROM info WHERE street_name LIKE 'MAIN%';\n> \n> > ...this would take about 20 secs to complete. Because the wildness only\n> > happens at the end of the search string, I changed the query to...\n> \n> > SELECT * FROM info WHERE substring( street_name from 1 to 4 ) = 'MAIN';\n> \n> > ...this takes under 2 secs.\n> \n> This makes no sense to me at all. The latter query should be far\n> slower, because AFAIK there is no optimization for it, whereas there is\n> an optimization for \"foo LIKE 'bar%'\".\n> \n> What version are you running, and what plan does EXPLAIN show for\n> each of these queries?\n> \n> regards, tom lane\n> \n> ************\n\n-- \nIf everything is coming your way then you're in the wrong lane.\n", "msg_date": "Tue, 07 Mar 2000 20:24:03 -0500", "msg_from": "JB <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] 'LIKE' enhancement suggestion" }, { "msg_contents": "JB <[email protected]> writes:\n> My apologies for chewing up bandwidth. \n\nNot at all! Just because I don't understand it does not mean\nyou haven't found an effect worth looking into ;-)\n\n> I'm running 6.5.2 on RH6.1, 128mb ram, 27gb, P350.\n\nOK, cool. We've had a couple of weird-looking questions that turned\nout to be from people running ancient releases, so \"what version\" is\nsomething we all routinely ask now.\n\n> ---[snip]---\n> #!/bin/sh\n> psql -c \"EXPLAIN SELECT * FROM info WHERE substring(stname from 1 for 4)\n> = 'MAIN';\"\n> time psql -c \"SELECT * FROM info WHERE substring(stname from 1 for 4) =\n> 'MAIN';\"\n\n> psql -c \"EXPLAIN SELECT * FROM info WHERE stname LIKE 'MAIN%';\"\n> time psql -c \"SELECT * FROM info WHERE stname LIKE 'MAIN%';\"\n> ---[snip]---\n\n> outputs...\n\n> Seq Scan on info (cost=3829.93 rows=15454 width=420)\n\n> 0.01user 0.01system 0:00.72elapsed 2%CPU (0avgtext+0avgdata\n> 0maxresident)k\n> 0inputs+0outputs (198major+25minor)pagefaults 0swaps\n\n> Index Scan using nx_info1 on info (cost=1531.12 rows=30 width=420)\n\n> 0.01user 0.01system 0:00.64elapsed 3%CPU (0avgtext+0avgdata\n> 0maxresident)k\n> 0inputs+0outputs (198major+25minor)pagefaults 0swaps\n\n\n> Obviously the numbers don't support me. I'm quite confused.\n\n\"time psql\" doesn't really tell you anything much, since the CPU\nnumbers it cites only cover the psql front end, not the backend\ndatabase server. You can put some faith in the \"elapsed time\"\nvalues, but only if your machine is otherwise idle. In this case\nyou have readings 0.72 and 0.64, which are IMHO too close to call;\nyou'd need to make a longer-running test case to have much confidence\nin the results.\n\nBut you said before that you saw 20 sec vs. 2 sec, which is surely\na significant difference (barring major load variations from other\nprograms on your machine); can you duplicate that?\n\n> I was told that the engine didn't use indexes with 'LIKE' by someone\n> equally informed as I, and thus the 'substring' change.\n\nPostgres does use an index for \"foo LIKE 'bar%'\" if it can. 6.5\nis not very bright about this when you have USE_LOCALE enabled,\nbut 7.0 is smarter.\n\n> There must be something with the bigger system that I need to\n> look into (mem usage, etc).\n\nIt's worth looking into. Feel free to contact me off-list if you\nwant to probe further.\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 08 Mar 2000 00:07:30 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] 'LIKE' enhancement suggestion " }, { "msg_contents": "On Tue, 7 Mar 2000, JB wrote:\n\n> Obviously the numbers don't support me. I'm quite confused. I was told\n> that the engine didn't use indexes with 'LIKE' by someone equally\n> informed as I\n\n\tBruce made mods at least a release, if not more, back that allowed\na LIKE to use an index *if and only if* the only \"varying\" part was the\ntail end ...\n\n\n", "msg_date": "Wed, 8 Mar 2000 01:19:24 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] 'LIKE' enhancement suggestion" } ]
[ { "msg_contents": "\n\n In the PostgreSQL TODO is \"Get faster regex() code from Henry Spencer..\".\n\n I look at current available regex used (a example) in apache, php, .etc. But\nif I look at changes (via diff) between PostgreSQL's regex and more new\nregex in PHP4 it is very same. A differentions are that in new regex code\nare all values marks as 'register' and this new regex not support MULTIBYTE.\nIt is without any relevant changes (or 'register' is really fastly?).\n\n What means TODO? \n\n The PG's regex use malloc -- why not MemoryContext?\n\n\t\t\t\t\t\t\tKarel\n\n", "msg_date": "Wed, 8 Mar 2000 17:26:14 +0100 (CET)", "msg_from": "Karel Zak - Zakkr <[email protected]>", "msg_from_op": true, "msg_subject": "regex (from TODO)" }, { "msg_contents": "> \n> \n> In the PostgreSQL TODO is \"Get faster regex() code from Henry Spencer..\".\n> \n> I look at current available regex used (a example) in apache, php, .etc. But\n> if I look at changes (via diff) between PostgreSQL's regex and more new\n> regex in PHP4 it is very same. A differentions are that in new regex code\n> are all values marks as 'register' and this new regex not support MULTIBYTE.\n> It is without any relevant changes (or 'register' is really fastly?).\n> \n> What means TODO? \n> \n> The PG's regex use malloc -- why not MemoryContext?\n\nHenry has new code that is faster, and he has put it only in TCL so far.\nI am waiting for a library version of it that we can include.\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, 8 Mar 2000 14:33:44 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] regex (from TODO)" }, { "msg_contents": "> In the PostgreSQL TODO is \"Get faster regex() code from Henry Spencer..\".\n> \n> I look at current available regex used (a example) in apache, php, .etc. But\n> if I look at changes (via diff) between PostgreSQL's regex and more new\n> regex in PHP4 it is very same. A differentions are that in new regex code\n> are all values marks as 'register' and this new regex not support MULTIBYTE.\n\nActually Henry has never supported MULTIBYTE:-) We modified his code\nso that we could support it.\n\n> It is without any relevant changes (or 'register' is really fastly?).\n\nI vaguely recall that we decided that 'register' did nothing good with\nmodern compilers, and it'd be better to let the optimizer determine\nwhat variables should be assigned to registers.\n\n> What means TODO? \n\nThat means \"get faster code from Henry and modify it if it does not\nsupport MULTIBYTE\" -- I guess.\n\n> The PG's regex use malloc -- why not MemoryContext?\n\nProbably because the regex caches the results of regcomp in a static\narea which points to a malloced memory allocated while compiling a\nregular expression. However, for the regexec stage we might be able to\nuse palloc instead of malloc. I'm not sure if this would result in a\nany better performance, though.\n--\nTatsuo Ishii\n", "msg_date": "Thu, 09 Mar 2000 10:10:11 +0900", "msg_from": "Tatsuo Ishii <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] regex (from TODO)" } ]
[ { "msg_contents": "Hi,\n\nThe regression test script runcheck.sh doesn't seem able to\nhandle the blank line on the end of the resultmap file.\n\nHere's a patch to remove it!!\n\nKeith.\n\n*** src/test/regress/resultmap.orig Wed Mar 8 16:48:28 2000\n--- src/test/regress/resultmap Wed Mar 8 16:48:38 2000\n***************\n*** 25,28 ****\n horology/sparc-sun-solaris=horology-solaris-1947\n abstime/sparc-sun-solaris=abstime-solaris-1947\n tinterval/sparc-sun-solaris=tinterval-solaris-1947\n- \n--- 25,27 ----\n\n", "msg_date": "Wed, 8 Mar 2000 16:52:25 +0000 (GMT)", "msg_from": "Keith Parks <[email protected]>", "msg_from_op": true, "msg_subject": "Regression test failure (runcheck)" }, { "msg_contents": "Applied.\n\n> Hi,\n> \n> The regression test script runcheck.sh doesn't seem able to\n> handle the blank line on the end of the resultmap file.\n> \n> Here's a patch to remove it!!\n> \n> Keith.\n> \n> *** src/test/regress/resultmap.orig Wed Mar 8 16:48:28 2000\n> --- src/test/regress/resultmap Wed Mar 8 16:48:38 2000\n> ***************\n> *** 25,28 ****\n> horology/sparc-sun-solaris=horology-solaris-1947\n> abstime/sparc-sun-solaris=abstime-solaris-1947\n> tinterval/sparc-sun-solaris=tinterval-solaris-1947\n> - \n> --- 25,27 ----\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": "Wed, 8 Mar 2000 14:35:01 -0500 (EST)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Regression test failure (runcheck)" } ]
[ { "msg_contents": "Using perl DBI, I would like to catch a backend error and, if the\npgsql error string matches a particular regex (/ExecInitIndexScan:\nboth left and right op's are rel-vars/), vacuum on the fly and\nimmediately resubmit the query within the same transaction. \n[Vacuuming has sometimes worked as a temporary fix to the problem.]\n\nThe immediate problem seems to be that once the backend fails on a\nquery within a transaction, the client is not permitted to do any more\nqueries within that transaction, giving this msg:\n\n\tNOTICE: (transaction aborted): queries ignored until END\n\nAny suggestions on how I might handle this? \n\nRegards,\nEd Loehr\n", "msg_date": "Wed, 08 Mar 2000 11:19:18 -0600", "msg_from": "Ed Loehr <[email protected]>", "msg_from_op": true, "msg_subject": "[HACKERS] Transaction abortions & recovery handling" }, { "msg_contents": "Ed Loehr <[email protected]> writes:\n> Any suggestions on how I might handle this? \n\nEr ... run 7.0beta ? Probably a cleaner answer than hacking up your\napp to implement an incomplete workaround for that 6.5 bug.\n\nYear before last, I moved my company's production applications onto\na pre-alpha 6.4 snapshot, because we were getting killed by a bad bug\nin 6.3.*. It made me pretty nervous, but guess what: we didn't have\nany problems.\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 08 Mar 2000 14:54:23 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Transaction abortions & recovery handling " }, { "msg_contents": "Tom Lane wrote:\n> \n> Ed Loehr <[email protected]> writes:\n> > Any suggestions on how I might handle this?\n> \n> Er ... run 7.0beta ? Probably a cleaner answer than hacking up your\n> app to implement an incomplete workaround for that 6.5 bug.\n> \n> Year before last, I moved my company's production applications onto\n> a pre-alpha 6.4 snapshot, because we were getting killed by a bad bug\n> in 6.3.*. It made me pretty nervous, but guess what: we didn't have\n> any problems.\n\nI was sure that would be someone's first response. I'd like to\nexpress my perspective and\nsee if you still stick with your advice...\n\n[flame suit on]\n\nMy system is live. As such, I really don't want to trade this known\nproblem for (unknown) additional adjustments to 7.0beta right now\n(pg_dump & views, not null unique, etc), also due to my own time\nconstraints. Based on recent threads on this list, I have the\nimpression that 7.0beta is not quite ready for production. The recent\nflaming of one fellow for, among other things, using it in his\nnear-production system reinforced my impression. Before I get derided\nand flamed, let me admit I haven't tracked all these issues to their\nconclusion, nor am I watching cvs for fixes.\n\n[flame suit off]\n\nAdditionally, I already have the app code in place to catch the error \n& vacuum, and I think it has even worked in the past, though something\nhas apparently changed on my end to make that cease.\n\nHaving said all that, do you still advise 7.0beta for production? Or\nmight there be a simple workaround to my original question?\n\nOK, flame away...\n\nRegards,\nEd Loehr\n", "msg_date": "Wed, 08 Mar 2000 18:13:25 -0600", "msg_from": "Ed Loehr <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Transaction abortions & recovery handling" }, { "msg_contents": "Ed Loehr <[email protected]> writes:\n>>>> Any suggestions on how I might handle this?\n>> \n>> Er ... run 7.0beta ?\n\n> Based on recent threads on this list, I have the\n> impression that 7.0beta is not quite ready for production.\n\nA fair objection, since in fact it isn't. Moving to 7 now will probably\ncost you at least one extra dump/initdb/reload cycle, since we are\nlikely to force another initdb before final release. However, if the\nalternative is continuing to get bit by a 6.5 bug, it seems to me that\nbeing an early adopter of 7.0 is not such a bad choice.\n\nI wouldn't actually suggest picking up 7.0beta1 at this point, since\nwe've fixed a number of flaws since then; the latest nightly snapshot\nwould be better. Or you might want to wait for 7.0beta2, which should\nbe out in a day or two.\n\n\t\t\tregards, tom lane\n", "msg_date": "Wed, 08 Mar 2000 20:04:48 -0500", "msg_from": "Tom Lane <[email protected]>", "msg_from_op": false, "msg_subject": "Re: [HACKERS] Transaction abortions & recovery handling " }, { "msg_contents": "Tom Lane wrote:\n> \n> Ed Loehr <[email protected]> writes:\n> >>>> Any suggestions on how I might handle this?\n> >>\n> >> Er ... run 7.0beta ?\n> \n> > Based on recent threads on this list, I have the\n> > impression that 7.0beta is not quite ready for production.\n> \n> A fair objection, since in fact it isn't. [snip] However, if the\n> alternative is continuing to get bit by a 6.5 bug, it seems to me that\n> being an early adopter of 7.0 is not such a bad choice.\n\nAgreed, if that is in fact my only alternative. Fortunately, this\nshowstopper bug shows up infrequently (it's been a month or two since\nthe last bite). I'm still hoping to avoid the bleeding edge on this\nproduction system.\n\nIs there any reasonably straight-forward means to allowing additional\nqueries within the same transaction after I get an ERROR?\n\nRegards,\nEd Loehr\n", "msg_date": "Wed, 08 Mar 2000 22:24:24 -0600", "msg_from": "Ed Loehr <[email protected]>", "msg_from_op": true, "msg_subject": "Re: [HACKERS] Transaction abortions & recovery handling" } ]
[ { "msg_contents": "Hi,\n\n The configuration script does not recognise 'alphaev6-dec-osf4.0f' as\na valid machine/OS combination. I've\nhacked config.sub a but can't get it to recognise anything, so it won't\nconfigure. I'd appreciate any help on this one.\n\nAdriaan\n", "msg_date": "Thu, 09 Mar 2000 07:31:01 +0200", "msg_from": "Adriaan Joubert <[email protected]>", "msg_from_op": true, "msg_subject": "Unrecognised machine in 7.0beta1" } ]
[ { "msg_contents": "\nignore, we had some problems today with the mailing lists as a result of a\nremoving some old software, and believe its all in order again *sigh*\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, 9 Mar 2000 01:50:11 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "test ..." } ]
[ { "msg_contents": "\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, 9 Mar 2000 02:03:37 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "ignore" } ]
[ { "msg_contents": "\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, 9 Mar 2000 02:11:33 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "Ack ..." } ]
[ { "msg_contents": "\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, 9 Mar 2000 02:17:41 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "work ..." } ]
[ { "msg_contents": "\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, 9 Mar 2000 02:21:04 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "something just isn't right ..." } ]
[ { "msg_contents": "\ntry this ..\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, 9 Mar 2000 02:25:50 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "arg .." } ]
[ { "msg_contents": "On Thu, Mar 30, 2000 at 05:18:57PM +0300, Adriaan Joubert wrote:\n> We missed the deadline for this release. It will be in 7.1. I've written the C\n> routines to do the internal work, but didn't know where to start with the\n> integration, so it all got delayed a bit.\n\nBelieve it or not, this is good news for me as it reduces my work for 7.0 to\none bug report. :-)\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, 30 Mar 2000 20:17:50 +0200", "msg_from": "Michael Meskes <[email protected]>", "msg_from_op": true, "msg_subject": "Re: BIT datatype" }, { "msg_contents": "> > We missed the deadline for this release. It will be in 7.1. I've written the C\n> > routines to do the internal work, but didn't know where to start with the\n> > integration, so it all got delayed a bit.\n> Believe it or not, this is good news for me as it reduces my work for 7.0 to\n> one bug report. :-)\n\nbtw, I've just finished taking the old ecpg man page and putting it\ninto the ecpg-ref.sgml reference page (it had been placed in that file\nbut was mostly commented out).\n\nI'm committing this right now, and if anyone who has expressed\ninterest in ecpg docos wants to help augment it, we probably have a\nfew days left to do so.\n\nIf someone is interested but does not have access to the source tree,\nlet me know and I can mail the files ;)\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Fri, 31 Mar 2000 06:24:20 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: BIT datatype" }, { "msg_contents": "On Fri, Mar 31, 2000 at 06:24:20AM +0000, Thomas Lockhart wrote:\n> btw, I've just finished taking the old ecpg man page and putting it\n> into the ecpg-ref.sgml reference page (it had been placed in that file\n> but was mostly commented out).\n\nThanks.\n> \n> I'm committing this right now, and if anyone who has expressed\n> interest in ecpg docos wants to help augment it, we probably have a\n> few days left to do so.\n\nI surely won't. I'm expecting 12 working hour days for every single day\nuntil I go on vacation. \n\nThere is one open problem with ecpg. But I do not understand it completely\nso far. Maybe I'm a bit brain locked but I'm clueless right now.\n\nI attach a small test program m.pgc. This program dumps core in libecpg\nbecause the char array is not correctly accessed.\n\nThen I rewrote it in that I moved the test() function into main (attached as\nn.pgc) et voila all is well. \n\nThe call to ECPGdo however is identical. If anyone has an idea what's going\non PLEASE tell me.\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": "Fri, 31 Mar 2000 12:02:45 +0200", "msg_from": "Michael Meskes <[email protected]>", "msg_from_op": true, "msg_subject": "Re: BIT datatype" }, { "msg_contents": "Hi,\n\n here is an updated version of the bit type with a bugfix and all the necessary\nSQL functions defined. This should replace what is currently in contrib. I'd\nappreciate any comments on what is there.\n\nKind regards,\n\nAdriaan", "msg_date": "Mon, 03 Apr 2000 20:36:48 +0300", "msg_from": "Adriaan Joubert <[email protected]>", "msg_from_op": false, "msg_subject": "Re: BIT datatype (Fixed)" }, { "msg_contents": "Applied.\n\n> Hi,\n> \n> here is an updated version of the bit type with a bugfix and all the necessary\n> SQL functions defined. This should replace what is currently in contrib. I'd\n> appreciate any comments on what is there.\n> \n> Kind regards,\n> \n> Adriaan\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, 3 Apr 2000 16:49:11 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: BIT datatype (Fixed)" }, { "msg_contents": "> > here is an updated version of the bit type with a bugfix and all the necessary\n> > SQL functions defined. This should replace what is currently in contrib. I'd\n> > appreciate any comments on what is there.\n> \n> I'm hoping to get a chance to look at it fairly soon. It's already\n> been committed to the tree...\n\nThe bits never even got cold before it was 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": "Tue, 4 Apr 2000 10:44:20 -0400 (EDT)", "msg_from": "Bruce Momjian <[email protected]>", "msg_from_op": false, "msg_subject": "Re: BIT datatype (Fixed)" }, { "msg_contents": "> here is an updated version of the bit type with a bugfix and all the necessary\n> SQL functions defined. This should replace what is currently in contrib. I'd\n> appreciate any comments on what is there.\n\nI'm hoping to get a chance to look at it fairly soon. It's already\nbeen committed to the tree...\n\n - Thomas\n\n-- \nThomas Lockhart\t\t\t\[email protected]\nSouth Pasadena, California\n", "msg_date": "Tue, 04 Apr 2000 14:46:29 +0000", "msg_from": "Thomas Lockhart <[email protected]>", "msg_from_op": false, "msg_subject": "Re: BIT datatype (Fixed)" }, { "msg_contents": "Bruce Momjian wrote:\n\n> > > here is an updated version of the bit type with a bugfix and all the necessary\n> > > SQL functions defined. This should replace what is currently in contrib. I'd\n> > > appreciate any comments on what is there.\n> >\n> > I'm hoping to get a chance to look at it fairly soon. It's already\n> > been committed to the tree...\n>\n> The bits never even got cold before it was applied. :-)\n\nThanks! I spent a day with a debugger to find a silly error, but it all does seem to\nbehave now. I could not use the name BIT for the example type, as it is reserved. I also\nnoticed that I could not use BITS(6) for a user-defined type to specify a length. A last\nproblem is that there are two types of output routines, one returning a bit string in hex\nformat, and another returning it in binary format. I seem to recall that there once was a\ndiscussion on adding a C-string type for situations like this, so that one output-type\nwould be the default, but the second could be made available through a function. I also\ndidn't do anything to make these indexable.\n\nAny suggestions or complaints, please let me know.\n\nAdriaan\n\n", "msg_date": "Wed, 05 Apr 2000 08:37:43 +0300", "msg_from": "Adriaan Joubert <[email protected]>", "msg_from_op": false, "msg_subject": "Re: BIT datatype (Fixed)" } ]
[ { "msg_contents": "\nTesting the archive \"redirect\" feature of Majordomo2 ... there will be a\ntemporary gap until I merge the two back together again ...\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, 30 Mar 2000 16:06:04 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "Archivses ..." } ]
[ { "msg_contents": "On Thu, 30 Mar 2000, Ann Harrison wrote:\n\n> \n> >\n> >InterBase has MVCC, just as Oracle and PostgreSQL.\n> >So, that grey dot should be cleared -:)\n> \n> Just right. Excellent!\n> \n> Ann\n> \n\nchange made!\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": "Thu, 30 Mar 2000 15:15:02 -0500 (EST)", "msg_from": "Vince Vielhaber <[email protected]>", "msg_from_op": true, "msg_subject": "RE: row level locking vs concurrency ?" } ]
[ { "msg_contents": "\nJust want to make sure it works for all the lists ... if someone notices I\nhappened to have missed one, please let me know ...\n\nThere is currently a gap between the 9th and 30th, that I will be fillig\nin tonight ... but at least ro now forward the archives should be working\nas they used to ...\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, 30 Mar 2000 16:16:41 -0400 (AST)", "msg_from": "The Hermit Hacker <[email protected]>", "msg_from_op": true, "msg_subject": "[TEST] Archives should now work again ..." } ]