pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laszlo Nagy <gandalf@shopzeus.com>
To: pgsql-admin@postgresql.org
Subject: Re: need help to write a function in postgresql
Date: Fri, 03 Aug 2012 10:37:11 +0200
Message-ID: <501B8DB7.5050700@shopzeus.com> (raw)
In-Reply-To: <ju8nfr$aco$1@dough.gmane.org>
References: <000b01cd658e$e66ae920$b340bb60$@avineonindia.com>
	<ju8nfr$aco$1@dough.gmane.org>


> Then you can do:
>         select *
>     from retrieve_user('foo', 'bar');
>
> Personally I'd prefer to create view that wraps that select statement 
> and then simply do a
>
>    select *
>    from user_view
>    where name = 'foo'
>    and password = 'bar'
It is also better because with a view, you can also do " name is null ". 
But you cannot do that with a function (unless you write unnecessary 
circumstancial code.)



view thread (5+ messages)  latest in thread

Message-ID: <501B8DB7.5050700@shopzeus.com>
Permalink:  ../501B8DB7.5050700@shopzeus.com/
Also on:    postgresql.org/message-id/501B8DB7.5050700@shopzeus.com

 · 

reply

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-admin@postgresql.org
  Cc: gandalf@shopzeus.com
  Subject: Re: need help to write a function in postgresql
  In-Reply-To: <501B8DB7.5050700@shopzeus.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