Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Lori Corbani
: change name of input parameter On 08/20/2014 08:42 AM, Lori Corbani wrote: > > OK...if I manually run this within psql it is fine. > > But I have a shell script in which I am wrapping a call to 'psql'...and I > guess it does not like how things are being passed in when

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Adrian Klaver
On 08/20/2014 08:42 AM, Lori Corbani wrote: OK...if I manually run this within psql it is fine. But I have a shell script in which I am wrapping a call to 'psql'...and I guess it does not like how things are being passed in when I do it this way. So, yes, it is working correctly when I copy/p

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Lori Corbani
This worked! Many, many, thanks! -Original Message- From: Rob Sargent [mailto:robjsarg...@gmail.com] Sent: Wednesday, August 20, 2014 10:15 AM To: Adrian Klaver Cc: Lori Corbani; Alban Hertroys; pgsql-general@postgresql.org Subject: Re: [GENERAL] create function : change name of input

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Lori Corbani
Will try a different approach to my wrapper. Many thanks! Lori -Original Message- From: Adrian Klaver [mailto:adrian.kla...@aklaver.com] Sent: Wednesday, August 20, 2014 10:11 AM To: Lori Corbani; pgsql-general@postgresql.org Subject: Re: [GENERAL] create function : change name of input

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Tom Lane
Lori Corbani writes: > My example: > DROP FUNCTION ACC_setMax(); > CREATE OR REPLACE FUNCTION ACC_setMax ( > increment int, > prefixPart varchar(30) = 'MGI:' > ) > RETURNS VOID AS > \$\$ This is not the right thing: you need to include the parameters in the drop command. ACC_setMax() is a tota

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Adrian Klaver
On 08/20/2014 07:00 AM, Lori Corbani wrote: My example: DROP FUNCTION ACC_setMax(); CREATE OR REPLACE FUNCTION ACC_setMax ( increment int, prefixPart varchar(30) = 'MGI:' ) RETURNS VOID AS \$\$ BEGIN /* Increment the max MGI Accession Number by @increment */ update ACC_AccessionMax set maxN

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Adrian Klaver
On 08/20/2014 07:00 AM, Lori Corbani wrote: My example: DROP FUNCTION ACC_setMax(); CREATE OR REPLACE FUNCTION ACC_setMax ( increment int, prefixPart varchar(30) = 'MGI:' ) RETURNS VOID AS \$\$ BEGIN /* Increment the max MGI Accession Number by @increment */ update ACC_AccessionMax set maxN

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Rob Sargent
Include the types in the drop Sent from my iPhone > On Aug 20, 2014, at 7:59 AM, Adrian Klaver wrote: > >> On 08/20/2014 06:51 AM, Lori Corbani wrote: >> >> I *am* definitely dropping the function first. I still get the same error. > > Well we need to see the actual sequence to figure this

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Adrian Klaver
On 08/20/2014 06:51 AM, Lori Corbani wrote: I *am* definitely dropping the function first. I still get the same error. Well we need to see the actual sequence to figure this out. Best guess, is you have more than one function with that name. -- Adrian Klaver adrian.kla...@aklaver.com

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Lori Corbani
= prefixPart changed to v_ prefixPart varchar(30) = 'MGI:' where prefixPart = v_prefixPart -Original Message- From: Adrian Klaver [mailto:adrian.kla...@aklaver.com] Sent: Wednesday, August 20, 2014 9:40 AM To: Lori Corbani; pgsql-general@postgresql.org Subject: Re: [GENERAL] cr

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Lori Corbani
I *am* definitely dropping the function first. I still get the same error. -Original Message- From: Alban Hertroys [mailto:haram...@gmail.com] Sent: Wednesday, August 20, 2014 9:44 AM To: Lori Corbani Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] create function : change name

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Lori Corbani
: change name of input parameter On 08/20/2014 06:25 AM, Lori Corbani wrote: > Using Postgres Version 9.0.4: > > We are migrating our Sybase stored procedures to Postgres and need to > be able to drop/replace the SPs, making needed changes to input > parameters to fix issues/diff

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Alban Hertroys
On 20 August 2014 15:25, Lori Corbani wrote: > The ‘create function’ documentation states: > > ‘You cannot change the name already assigned to any input parameter > (although you can add names to parameters that had none before).’ Further on in that same paragraph (although I looked at the 9.3 d

Re: [GENERAL] create function : change name of input parameter

2014-08-20 Thread Adrian Klaver
On 08/20/2014 06:25 AM, Lori Corbani wrote: Using Postgres Version 9.0.4: We are migrating our Sybase stored procedures to Postgres and need to be able to drop/replace the SPs, making needed changes to input parameters to fix issues/differences between Sybase and Postgres. However, we keep gett