X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id A8A50D1B477 for ; Mon, 22 Dec 2003 10:49:22 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 95373-03 for ; Mon, 22 Dec 2003 06:48:35 -0400 (AST) Received: from anchor-post-35.mail.demon.net (anchor-post-35.mail.demon.net [194.217.242.85]) by svr1.postgresql.org (Postfix) with ESMTP id 4216CD1B4A3 for ; Mon, 22 Dec 2003 06:48:27 -0400 (AST) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-35.mail.demon.net with esmtp (Exim 3.35 #1) id 1AYNbw-00055w-0Z; Mon, 22 Dec 2003 10:48:29 +0000 Received: by mainbox.archonet.com (Postfix, from userid 529) id 8F6D216479; Mon, 22 Dec 2003 10:48:23 +0000 (GMT) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 6D11F16346; Mon, 22 Dec 2003 10:48:21 +0000 (GMT) From: Richard Huxton To: "Denis" , Subject: Re: how to preserve \n in select statement Date: Mon, 22 Dec 2003 10:48:20 +0000 User-Agent: KMail/1.5 References: <200312220904.11730.dev@archonet.com> <004c01c3c86f$389c5380$0f32a8c0@denisnew> In-Reply-To: <004c01c3c86f$389c5380$0f32a8c0@denisnew> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200312221048.20783.dev@archonet.com> X-Bogosity: No, tests=bogofilter, spamicity=0.000000, version=0.15.3 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/142 X-Sequence-Number: 16308 On Monday 22 December 2003 09:37, Denis wrote: > Hi Richard.. > > If your users are required to fire only SELECT and no DML, you can do the > following: > > BEGIN; > execute the statements given by user > ROLLBACK; > > This will not affect your SELECT and also if any malicious user gives > DELETE statement, that will not have any impact too.. An interesting idea, though you'd need to be careful with side-effects (triggers/functions etc). I seem to recall a "read-only" setting being discussed for transactions too (though not as a security measure, I should emphasise). The other thing is to use the database user/group mechanism - something which tends to be neglected with web-based apps (partly because different DBs have different setups here). If only an application super-user can add/delete users make sure the permissions reflect this and connect as a more restricted user for other logins. -- Richard Huxton Archonet Ltd