Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 008BF47592F for ; Tue, 28 May 2002 01:51:45 -0400 (EDT) Received: from chronozon.artofdns.com (CPE00e0293a847c.cpe.net.cable.rogers.com [24.100.79.179]) by postgresql.org (Postfix) with ESMTP id 073A0475B0B for ; Tue, 28 May 2002 01:51:38 -0400 (EDT) Received: by chronozon.artofdns.com (Postfix, from userid 501) id 169468AEA; Tue, 28 May 2002 01:35:47 -0400 (EDT) To: sszabo@megazone23.bigpanda.com, stef@chronozon.artofdns.com Subject: Re: Triggers and System Tables. Cc: pgsql-sql@postgresql.org Message-Id: <20020528053547.169468AEA@chronozon.artofdns.com> Date: Tue, 28 May 2002 01:35:47 -0400 (EDT) From: stef@chronozon.artofdns.com (Stef Telford) X-Archive-Number: 200205/289 X-Sequence-Number: 7924 > Hello, > this is probably a really silly question, but where can i > control wether or not the superuser/root user can create a trigger > on a system table ? In general this is not something you can safely do. I'm not sure if pg_stat_activity modifications go through something that will fire triggers, but in general you shouldn't expect that they will on system tables. It would make sense to assume that, even though the tables in question are system tables, that triggers can be used in unison with them. I do, of course, understand the inherent dangers with attaching triggers (it could be possible to attach a trigger that would delete user logins) but then, this is what i want them -for- :) The limitation would, to my untrained eye, appear to be completely aberant. The ability to put triggers on system tables would allow me to (using plpgsql) * Limit and/or assign a 'number of logins' * Create and/or use 'connection' or temporary 'global variables' These may end up being 'quick and dirty' and by no means tailored to maximum performance, but it would certainly be a 'start' if nothing else. regards Stef