Skip site navigation (1) Skip section navigation (2)

Re: need help to write a function in postgresql

From: Laszlo Nagy <gandalf(at)shopzeus(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: need help to write a function in postgresql
Date: 2012-08-03 08:37:11
Message-ID: 501B8DB7.5050700@shopzeus.com (view raw or flat)
Thread:
Lists: pgsql-admin
> 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.)

In response to

Responses

pgsql-admin by date

Next:From: Craig RingerDate: 2012-08-03 08:48:30
Subject: Re: need help to write a function in postgresql
Previous:From: Laszlo NagyDate: 2012-08-03 08:31:43
Subject: Messed up time zones

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group