Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 0B10163336F for ; Fri, 4 Jun 2010 18:04:51 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 00305-10 for ; Fri, 4 Jun 2010 21:04:42 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-iw0-f174.google.com (mail-iw0-f174.google.com [209.85.214.174]) by mail.postgresql.org (Postfix) with ESMTP id 8D509633121 for ; Fri, 4 Jun 2010 18:04:42 -0300 (ADT) Received: by iwn37 with SMTP id 37so1463067iwn.19 for ; Fri, 04 Jun 2010 14:04:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=+rjtGCkMmbo4lGTYBxFDJZIx3Uu1m/zHU5w5ibD0KMQ=; b=uCvQpfH2H+Wkwu7MqunZEsc/DsRQeMj0EB2CkDnS1mOWoOlUugN4zrwz6aD81cde1Y 7DIDRujCLFx+wSY+H/Uq9anOt/R/ffDIHC5zywfmdmVlpOu9YXvEE/y3IzeSDhvXvfHg YfpxHFa341YP7TXZyd+J9sf0VaeUU29lGK6bU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=CcuG2zHFL6O1013cnX4u8YBzVlRhGH3JRlDOpz5VmyFWzeix1PIBOR5QRKYrQ86NYK joV8G+k2ux/Dy83Zy5nG2bnNe7402zMU4793A73RgSJFB7IRCBw/nSv5MMoFiiNMY8tG ItTtyvfvVB9iwt5mEcQx3suW+2CfmJdEOADdo= MIME-Version: 1.0 Received: by 10.231.130.137 with SMTP id t9mr1366554ibs.142.1275685481302; Fri, 04 Jun 2010 14:04:41 -0700 (PDT) Received: by 10.231.12.8 with HTTP; Fri, 4 Jun 2010 14:04:41 -0700 (PDT) In-Reply-To: <23387.1275684816@sss.pgh.pa.us> References: <6649.1275584543@sss.pgh.pa.us> <7060.1275585689@sss.pgh.pa.us> <23387.1275684816@sss.pgh.pa.us> Date: Fri, 4 Jun 2010 17:04:41 -0400 Message-ID: Subject: Re: superuser unable to modify settings of a system table From: Robert Haas To: Tom Lane Cc: Gurjeet Singh , PGSQL Bugs Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201006/69 X-Sequence-Number: 27030 On Fri, Jun 4, 2010 at 4:53 PM, Tom Lane wrote: > Robert Haas writes: >> Personally, I think it would be better to put some work into making >> allow_system_table_mods a little less simple-minded. =A0Right now, >> !allow_system_table_mods prohibits you from doing perfectly sensible >> things (as in the OP's original example) yet still allows you to do >> things that are totally nuts (like DELETE FROM pg_class, which causes >> every subsequent connection attempt for that database to panic). >> Perfection may be too much to ask for but I'd take "modest >> improvement"... > > Nope, that is the wrong viewpoint entirely. =A0allow_system_table_mods > is intended to prevent you from modifying the *structure* of the > system catalogs, which is fairly critical because the backend C code > tends to depend on that. =A0Modifying the *content* of the catalogs > is another matter, and in fact we let any superuser do that without > having set allow_system_table_mods. =A0There is no practical way to > distinguish a benign catalog-content change from a disastrous one, > so we don't try. > > It's possible that reloptions is a special case and we should treat it > as being more nearly in the content than structure category. =A0Not sure. The backend C code also depends on the critical system indexes being present in the system catalogs, yet we still allow them to be deleted. Is there really a use case for users fiddling with pg_proc, pg_class, etc. directly? At any rate, I'd be happy to drop that part of the proposal. It would be a step forward just to permit (even without allow_system_table_mods) those changes which don't alter the structure of the catalog. For ALTER TABLE, the SET STATISTICS, (RE)SET (attribute_option), SET STORAGE, CLUSTER ON, SET WITHOUT CLUSTER, and (RE)SET (reloptions) forms are all things that fall into this category, I believe. --=20 Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise Postgres Company