Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id D5DD59FB1E8; Mon, 6 Aug 2007 16:45:34 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 31262-07; Mon, 6 Aug 2007 16:45:34 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sr01-07.mta.terra.com.br (sr01-07.mta.terra.com.br [200.154.152.26]) by postgresql.org (Postfix) with ESMTP id D666E9FBB97; Mon, 6 Aug 2007 16:45:03 -0300 (ADT) Received: from temora.hst.terra.com.br (temora.hst.terra.com.br [200.176.10.6]) by bulimba.hst.terra.com.br (Postfix) with ESMTP id 5B37E2D4818A; Mon, 6 Aug 2007 16:45:01 -0300 (BRT) X-Terra-Karma: -2% X-Terra-Hash: 55081943d8ef2192e5567fc8b32f91f7 Received-SPF: pass (temora.hst.terra.com.br: domain of terra.com.br designates 200.176.10.6 as permitted sender) client-ip=200.176.10.6; envelope-from=ranieri.oliveira@terra.com.br; helo=[172.16.2.72]; Received: from [172.16.2.72] (200-162-219-207.corp.ajato.com.br [200.162.219.207]) (authenticated user ranieri.oliveira) by temora.hst.terra.com.br (Postfix) with ESMTP id 60CEB8188; Mon, 6 Aug 2007 16:44:58 -0300 (BRT) Message-ID: <46B77A2B.4090804@terra.com.br> Date: Mon, 06 Aug 2007 16:44:43 -0300 From: Ranieri Mazili User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: pgsql-general@postgresql.org, pgsql-sql@postgresql.org Subject: Using function like where clause Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.738 tagged_above=0 required=5 tests=AWL=-0.263, BAYES_60=1 X-Spam-Level: X-Archive-Number: 200708/324 X-Sequence-Number: 118173 Hello, I have 2 questions. 1) Can I use a function that will return a string in a where clause like bellow? select * from table where my_function_making_where() and another_field = 'another_think' 2) Can I use a function that will return a string to return the list of columns that I want to show like below? select my_function_making_list_of_columns() from table where field_test = 'mydatum' Thanks