Received: from localhost (uranus.hub.org [200.46.204.60]) by postgresql.org (Postfix) with ESMTP id 1CDA29F9F7E for ; Mon, 13 Nov 2006 09:12:11 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.60]) (amavisd-new, port 10024) with ESMTP id 58899-01 for ; Mon, 13 Nov 2006 09:12:06 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from aa016msg.fastweb.it (aa016msg.fastweb.it [213.140.2.83]) by postgresql.org (Postfix) with ESMTP id 21CDC9F9C52 for ; Mon, 13 Nov 2006 09:12:06 -0400 (AST) Received: from ms008msg.fastweb.it (10.31.40.141) by aa016msg.fastweb.it (7.3.105.6) id 4535D64500BEB9C5 for pgsql-sql@postgresql.org; Mon, 13 Nov 2006 14:10:36 +0100 Received: from [192.168.201.201] (89.97.40.40) by ms008msg.fastweb.it (7.2.070) id 451BC9920120AFC3 for pgsql-sql@postgresql.org; Mon, 13 Nov 2006 14:12:01 +0100 From: Luca Ferrari To: pgsql-sql@postgresql.org Subject: hiding column values for specific rows Date: Mon, 13 Nov 2006 14:11:50 +0100 User-Agent: KMail/1.9.5 MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200611131411.50562.fluca1978@infinito.it> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/124 X-Sequence-Number: 26776 Hi, I don't know if this's possible but I'd like to hide column values for specific rows within a query. Imagine I've got a table with columns username and password: users(username,password). Now I'd like the user registered in the table to see her password, to see who is registered but not to see the other people passwords. For example, if the table contains: username | password --------------+------------- luca | myPaswd roberto | otherPaswd gianna | thirdPaswd I'd like to do a query like: "SELECT * FROM users where username=luca" obtaining something like: username | password --------------+------------- luca | myPaswd roberto | xxxxx gianna | XXXXX Is it possible to specify in the above query that all password columns that do not belong to selected row (username=luca) must be hidden? Anyone has an idea about how to implement this on the database side? Thanks, Luca