Re: [SQL] SQL Functions

2005-10-26 Thread Thomas F. O'Connell
On Oct 21, 2005, at 9:19 AM, [EMAIL PROTECTED] wrote: I have been trying to find a way to return more than one but different types of variables. How do I return more than one but mix types of variables. Any help is appriaciated. Thanks; In PostgreSQL 8.1, you'll have output parameters avail

[SQL] SQL Functions

2005-10-24 Thread gurkan
I have been trying to find a way to return more than one but different types of variables. How do I return more than one but mix types of variables. Any help is appriaciated. Thanks; CREATE FUNCTION allMoney_con(integer,integer,date,date) RETURNS AS ' SELECT DISTINCT(inv_acct

[SQL] SQL Functions

2005-10-24 Thread gurkan
I have been trying to find a way to return more than one but different types of variables. How do I return more than one but mix types of variables. Any help is appriaciated. Thanks; CREATE FUNCTION allMoney_con(integer,integer,date,date) RETURNS AS ' SELECT DISTINCT(inv_acct

Re: [SQL] SQL Functions vs PL/PgSQL

2003-02-13 Thread Tom Lane
Roberto Mello <[EMAIL PROTECTED]> writes: > On Thu, Feb 13, 2003 at 09:02:05AM -0800, Josh Berkus wrote: >> Unless you know something I don't, I do not believe that PL/pgSQL stores >> execution plans for functions. > AFAIK execution plans for PL/pgSQL functions were cached once per backend. > No?

Re: [SQL] SQL Functions vs PL/PgSQL

2003-02-13 Thread Josh Berkus
Johnny, > Does postgres store execution plan's for user-defined SQL functions as the > PL/pgSQL interpreter does. And if so - will this only be prepared after an > initial call to the function? Can't seem to find this information in the > docs!? Thanks, Unless you know something I don't, I do not

Re: [SQL] sql functions and triggers

2001-03-07 Thread Karel Zak
On Wed, Mar 07, 2001 at 03:03:59PM +0100, Andrzej Roszkowski wrote: > Hello! > > It is possible to pass ie. insert fields and values to sql function in > trigger? I want to define a trigger on insert (select delete etc.) and log > some values in different table(s). Sure, see docs about SPI in

[SQL] sql functions and triggers

2001-03-07 Thread Andrzej Roszkowski
Hello! It is possible to pass ie. insert fields and values to sql function in trigger? I want to define a trigger on insert (select delete etc.) and log some values in different table(s). -- "Code reviews are like sex, just anyone can do it, but skill and training can make you a lot better a

Re: [SQL] SQL functions not locking properly?

2000-09-25 Thread Hiroshi Inoue
Forest Wilkinson wrote: > > I'm having a problem with functions written in SQL. Specifically, they > don't seem to be adhering to Postgres locking rules. For the record, I'm > using postgres 7.0.2, installed from RPMs, on Red Hat 6.2. > > Here's what I'm seeing: > (psql input represented by '<<

Re: [SQL] SQL functions not locking properly?

2000-09-25 Thread Tom Lane
Forest Wilkinson <[EMAIL PROTECTED]> writes: > session2<< select nextid('myid'); > (session2 blocks until session1 completes its transaction) > session1<< commit; session1> COMMIT > (session2 resumes) session2> nextid session2> session2> 0 session2> (1 row) > What gives??? I expecte

[SQL] SQL functions not locking properly?

2000-09-25 Thread Forest Wilkinson
I'm having a problem with functions written in SQL. Specifically, they don't seem to be adhering to Postgres locking rules. For the record, I'm using postgres 7.0.2, installed from RPMs, on Red Hat 6.2. Here's what I'm seeing: (psql input represented by '<<'; output represented by '>>'.) sess

Re: [SQL] SQL functions - bug?

2000-06-05 Thread Tom Lane
Kovacs Zoltan Sandor <[EMAIL PROTECTED]> writes: > There is a function "function_y(...)" which returns int4; a table z and > two functions: > CREATE FUNCTION function_x1() RETURNS int4 AS ' > select function_y(any_of_fields_of_table_z) from z; > ' LANGUAGE 'SQL'; > This calls function_y(...) onl

[SQL] SQL functions - bug?

2000-06-05 Thread Kovacs Zoltan Sandor
I realized the following facts using SQL language functions: There is a function "function_y(...)" which returns int4; a table z and two functions: CREATE FUNCTION function_x1() RETURNS int4 AS ' select function_y(any_of_fields_of_table_z) from z; ' LANGUAGE 'SQL'; This calls function_y(...) on