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

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, >>Suppose i defined a function test as >> >>select test

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,

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

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)'::

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 ---

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.

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

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