Re: [GENERAL] Any risks in using FUNCTIONs (stored procedures) instead of raw sql queries?

2008-11-19 Thread Craig Ringer
Phoenix Kiula wrote: I have googled but it looks like there's a whole variety of information from 2003 (when PG must have been quite different) until now--some people find stored functions slow for web based apps, others find it is worth the maintenance. If your web servers are very close in

Re: [GENERAL] Any risks in using FUNCTIONs (stored procedures) instead of raw sql queries?

2008-11-19 Thread Sam Mason
On Wed, Nov 19, 2008 at 06:40:04PM +0900, Craig Ringer wrote: What you really want is Ensure that the form info is in the database and up to date, ie an UPSERT / REPLACE. There's a fairly convenient way to do that: -- If the form is already there, update it. -- If it's not there, this is

Re: [GENERAL] Any risks in using FUNCTIONs (stored procedures) instead of raw sql queries?

2008-11-19 Thread Joshua D. Drake
On Wed, 2008-11-19 at 18:40 +0900, Craig Ringer wrote: Phoenix Kiula wrote: I have googled but it looks like there's a whole variety of information from 2003 (when PG must have been quite different) until now--some people find stored functions slow for web based apps, others find it is

Re: [GENERAL] Any risks in using FUNCTIONs (stored procedures) instead of raw sql queries?

2008-11-19 Thread Craig Ringer
Joshua D. Drake wrote: On Wed, 2008-11-19 at 18:40 +0900, Craig Ringer wrote: Phoenix Kiula wrote: I have googled but it looks like there's a whole variety of information from 2003 (when PG must have been quite different) until now--some people find stored functions slow for web based apps,

[GENERAL] Any risks in using FUNCTIONs (stored procedures) instead of raw sql queries?

2008-11-18 Thread Phoenix Kiula
I am looking to convert all my database access code into stored procedures in PL/PGSQL. I have googled but it looks like there's a whole variety of information from 2003 (when PG must have been quite different) until now--some people find stored functions slow for web based apps, others find it

Re: [GENERAL] Any risks in using FUNCTIONs (stored procedures) instead of raw sql queries?

2008-11-18 Thread Joshua D. Drake
On Wed, 2008-11-19 at 02:18 +0800, Phoenix Kiula wrote: I am looking to convert all my database access code into stored procedures in PL/PGSQL. But a DBA told me that it will be much better to do all of these things in a stored procedure as it may bring some performance benefits. He's an