From: Kev <kevinjamesfield@gmail.com>
To: pgsql-general@postgresql.org
Subject: Re: Using function like where clause
Date: Tue, 07 Aug 2007 12:18:02 -0700
Message-ID: <1186514282.434942.45940@m37g2000prh.googlegroups.com> (raw)
In-Reply-To: <46B77A1D.4050908@wgsystems.com.br>
References: <46B77A1D.4050908@wgsystems.com.br>
On Aug 6, 3:44 pm, rmaz...@wgsystems.com.br (Ranieri Mazili) wrote:
> 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
Look up the quote_ident() function in the docs, you'll likely need
that for both cases.
Kev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: kevinjamesfield@gmail.com, pgsql-general@postgresql.org
Subject: Re: Using function like where clause
In-Reply-To: <1186514282.434942.45940@m37g2000prh.googlegroups.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox