Re: diference between calling a function in select clause and from clause - Mailing list pgsql-novice

From Tom Lane
Subject Re: diference between calling a function in select clause and from clause
Date
Msg-id 12293.1300285347@sss.pgh.pa.us
Whole thread Raw
In response to diference between calling a function in select clause and from clause  (siva kiran balijepalli <b.sivakiran@gmail.com>)
List pgsql-novice
siva kiran balijepalli <b.sivakiran@gmail.com> writes:
>                What i sthe difference between these two sql statements?

> select * from function-name();
> select function-name();

> The outputs of these will be same but when should we use particular one.

If the function returns a set (multiple rows) then the first is
considered better practice.  If not, take your pick.

            regards, tom lane

pgsql-novice by date:

Previous
From: "Haris"
Date:
Subject: foreign key
Next
From: Robert Poor
Date:
Subject: what is the PostgreSQL idiom for "insert or update"?