Search Postgresql Archives

Re: Stored Procedures and Functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





	MySQL supports procedures and functions.

	Functions can return results but cannot update the database.
	Procedures can update the database but cannot return results.

	However :
	- a function can call a procedure that updates the database !
	- a procedure can return result through OUT parameters !

It's a friggin mess. In pgsql, if you want, a STABLE or IMMUTABLE procedure is a function since it is repeatable : it will always return the same results with the same parameters, and has no side-effects. This is the definition of a function.

It is better not to draw useless lines in the ground with huge "don't walk over this line" stickers. People will always find a way around. Better offer features that users need.


Is it true that postgres doesn't have a notion of Stored Procedures
and functions is what it has instead?
RDBMS like Sql Server supports both stored procedures and functions.
So I was wondering what is the difference between a Stored Procedure
and a function.

Pascal has functions and procedures. C has only functions. That doesn't
say anything about the relative usability of each language. Those are
just names.




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux