Re: [GENERAL] [PL/pgSQL] function call

2011-10-31 Thread Tarlika Elisabeth Schmitz
On Mon, 31 Oct 2011 09:41:40 -0500 Merlin Moncure wrote: >On Mon, Oct 31, 2011 at 8:31 AM, Tarlika Elisabeth Schmitz > wrote: >> I have created a function log_insert(), which is simply a shorthand >> for an INSERT table and which I want to call from various trigger >> functions. >> >> CREATE OR R

Re: [GENERAL] [PL/pgSQL] function call

2011-10-31 Thread Pavel Stehule
2011/10/31 Merlin Moncure : > On Mon, Oct 31, 2011 at 8:31 AM, Tarlika Elisabeth Schmitz > wrote: >> I have created a function log_insert(), which is simply a shorthand for >> an INSERT table and which I want to call from various trigger functions. >> >> CREATE OR REPLACE FUNCTION log_insert(vseve

Re: [GENERAL] [PL/pgSQL] function call

2011-10-31 Thread Merlin Moncure
On Mon, Oct 31, 2011 at 8:31 AM, Tarlika Elisabeth Schmitz wrote: > I have created a function log_insert(), which is simply a shorthand for > an INSERT table and which I want to call from various trigger functions. > > CREATE OR REPLACE FUNCTION log_insert(vseverity text, vtrigger text, > vtrigger

[GENERAL] [PL/pgSQL] function call

2011-10-31 Thread Tarlika Elisabeth Schmitz
I have created a function log_insert(), which is simply a shorthand for an INSERT table and which I want to call from various trigger functions. CREATE OR REPLACE FUNCTION log_insert(vseverity text, vtrigger text, vtriggertable text, vtriggerid text, vmessage text) RETURNS boolean AS $BODY$ BEGIN

Re: [GENERAL] Pl/pgsql function

2011-06-04 Thread David Johnston
>>From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Nick Raj >>Sent: Saturday, June 04, 2011 10:04 AM >>To: pgsql-general@postgresql.org >>Subject: [GENERAL] Pl/pgsql function >> >>Second thing, >>Suppos

Re: [GENERAL] Pl/pgsql function

2011-06-04 Thread Rob Sargent
Nick Raj wrote: I am implementing some pl/pgsql functions. Is there any way to change the input for example- I got some value by $1. I want to modify this value (means split that value), Can we do this and how? Second thing, Suppose i defined a function test as select test('geom',the_geom,

[GENERAL] Pl/pgsql function

2011-06-04 Thread Nick Raj
I am implementing some pl/pgsql functions. Is there any way to change the input for example- I got some value by $1. I want to modify this value (means split that value), Can we do this and how? Second thing, Suppose i defined a function test as select test('geom',the_geom,time) from tablename .

Re: [GENERAL] pl/pgsql function with argument of type DATE

2008-06-12 Thread Pavel Stehule
2008/6/10 Bojan <[EMAIL PROTECTED]>: > How to invoke function which has arguments declared as type "date"? > > > > I want to make function which will return a list of all dates between > starting and ending > > date which are two arguments of that function. I tried with: > > > > select * from foo(

Re: [GENERAL] pl/pgsql function with argument of type DATE

2008-06-12 Thread A. Kretschmer
am Tue, dem 10.06.2008, um 18:02:01 +0100 mailte Bojan folgendes: > How to invoke function which has arguments declared as type ?date?? > > > > I want to make function which will return a list of all dates between starting > and ending > > date which are two arguments of that function. I tri

[GENERAL] pl/pgsql function with argument of type DATE

2008-06-12 Thread Bojan
How to invoke function which has arguments declared as type “date”? I want to make function which will return a list of all dates between starting and ending date which are two arguments of that function. I tried with: select * from foo(2008-06-01, 2008-06-09) select * from foo(‘2008-06-

[GENERAL] PL/PGSql function within a view definition

2008-02-15 Thread Keith Haugh
Due to limitations (perceived or real) within my client application I am trying to return a complex dataset which I am assembling using an expensive PL/PGSql function which I would like to wrap in a writeable view. I have written the function as both a row-level function which returns a RO

Re: [GENERAL] PL/pgsql function handle CUBE values

2008-01-16 Thread Rajarshi Guha
On Jan 16, 2008, at 3:41 PM, Colin Wetherbee wrote: Rajarshi Guha wrote: Hi, I am trying to write a PL/pgsql function that will take a CUBE variable (which will be a 1D point) and a double precision variable. If the input CUBE is defined as '(x,y,z)'::cube the function would then return a CU

Re: [GENERAL] PL/pgsql function handle CUBE values

2008-01-16 Thread Colin Wetherbee
Rajarshi Guha wrote: Hi, I am trying to write a PL/pgsql function that will take a CUBE variable (which will be a 1D point) and a double precision variable. If the input CUBE is defined as '(x,y,z)'::cube the function would then return a CUBE value of the form '(x+R,y+R,z+R),(x-R,y-R,z-R)'::

[GENERAL] PL/pgsql function handle CUBE values

2008-01-16 Thread Rajarshi Guha
Hi, I am trying to write a PL/pgsql function that will take a CUBE variable (which will be a 1D point) and a double precision variable. If the input CUBE is defined as '(x,y,z)'::cube the function would then return a CUBE value of the form '(x+R,y+R,z+R),(x-R,y-R,z-R)'::cube where R is the

FW: [GENERAL] PL/pgSQL Function Help

2005-12-16 Thread Niblett, David A
w) Thanks Tom! -- David -Original Message- From: Tom Lane [mailto:[EMAIL PROTECTED] Sent: Friday, December 16, 2005 3:30 PM To: Niblett, David A Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] PL/pgSQL Function Help "Niblett, David A" <[EMAIL PROTECTED]&g

Re: [GENERAL] PL/pgSQL Function Help

2005-12-16 Thread Michael Fuhr
On Fri, Dec 16, 2005 at 03:30:01PM -0500, Tom Lane wrote: > "Niblett, David A" <[EMAIL PROTECTED]> writes: > > Is there no way in Postgres that I can simply not return > > anything so I show zero rows? > > Make the function return SETOF myrec not just myrec. Then you > can return zero or one (or

Re: [GENERAL] PL/pgSQL Function Help

2005-12-16 Thread Tom Lane
"Niblett, David A" <[EMAIL PROTECTED]> writes: > Is there no way in Postgres that I can simply not return > anything so I show zero rows? Make the function return SETOF myrec not just myrec. Then you can return zero or one (or more) myrec's. regards, tom lane ---

[GENERAL] PL/pgSQL Function Help

2005-12-16 Thread Niblett, David A
I've got an issue with a plpgsql function and I have not been able to find any reference to this situation in searching. I hope that someone can point me in the correct direction. I'm running v8.0.3 and assuming a test set up of: - CREATE TYPE myrec AS ( id int );

Re: [GENERAL] pl/pgsql function debugging

2005-09-29 Thread A. Kretschmer
am 29.09.2005, um 20:08:17 +0200 mailte Craig folgendes: > Hi > > What is the best tool for debugging pl/pgsql functions? > Any suggestions would be appreciated RAISE NOTICE 'foo %', bar; Read: http://www.postgresql.org/docs/8.0/static/plpgsql-structure.html Regards, Andreas -- Andreas Kretsc

Re: [GENERAL] pl/pgsql function debugging

2005-09-29 Thread David Fetter
On Thu, Sep 29, 2005 at 08:08:17PM +0200, Craig wrote: > Hi > > What is the best tool for debugging pl/pgsql functions? Any > suggestions would be appreciated For now, it's RAISE NOTICE aka "debugging by printf", and I'm checking out EMS HiTech's debugger, which is part of their toolset.

[GENERAL] pl/pgsql function debugging

2005-09-29 Thread Craig
Hi   What is the best tool for debugging pl/pgsql functions? Any suggestions would be appreciated   Thanks Craig

Re: [GENERAL] PL/pgSQL function to validate UPC and EAN barcodes

2005-06-25 Thread Frank van Vugt
> > I've made a PL/pgSQL function to validate UPC and EAN barcodes. > > It works correctly, but is a little ugly. > > Wondering if any PL/pgSQL experts can offer some suggestions. (I'm > > new to PL/pgSQL.) For what it's worth, here's a function I'm using to calculate the checksum of an EAN barc

Re: [GENERAL] PL/pgSQL function to validate UPC and EAN barcodes

2005-06-25 Thread Sven Willenberger
Miles Keaton presumably uttered the following on 06/25/05 01:44: I've made a PL/pgSQL function to validate UPC and EAN barcodes. It works correctly, but is a little ugly. Wondering if any PL/pgSQL experts can offer some suggestions. (I'm new to PL/pgSQL.) Main questions: #1 - I wanted to ad

[GENERAL] PL/pgSQL function to validate UPC and EAN barcodes - works! Improvements?

2005-06-24 Thread Miles Keaton
I've made a PL/pgSQL function to validate UPC and EAN barcodes. It works correctly, but is a little ugly. Wondering if any PL/pgSQL experts can offer some suggestions. (I'm new to PL/pgSQL.) Main questions: #1 - I wanted to add a "0" to the front of the barcode if it was only 12 characters long

Re: [GENERAL] PL/pgSQL Function Problem

2004-09-10 Thread Tom Lane
the inquirer <[EMAIL PROTECTED]> writes: > I am trying to create a function that creates a user > and adds a row to a table. It produces no warnings or > errors when I create the function but when I attempt > to execute it I get a syntax error. I do not > understand why this is happening. > CREA

[GENERAL] PL/pgSQL Function Problem

2004-09-10 Thread the inquirer
I am trying to create a function that creates a user and adds a row to a table. It produces no warnings or errors when I create the function but when I attempt to execute it I get a syntax error. I do not understand why this is happening. Any help would be greatly appreciated. SELECT create_aut

[GENERAL] pl/pgsql function out parameters

2000-07-06 Thread Richard Nfor
Hi there, Does anyone know if out parameters are supported in pl/pgsql functions? What I mean is something like this: create function f(out int4) returns text as ' select $1 = 3 return "" ' language 'plpgsql'; db ==> declare i int4; db ==> select f(i); db ==> select i; i == 3