Re: [SQL] Re: PLpgSQL

2001-07-23 Thread Jan Wieck
Josh Berkus wrote: > Dado, > > > But still, the $1 is still plaguing me. > > > > Here's your problem: > > > >>CREATE FUNCTION new_proj_pts_seq(int4) > > >>RETURNS text > > >>AS 'DECLARE > > >>proj_ID alias for $1; > > >>seq_name TEXT; > > >>BEGIN > > >>seq_name := '

Re: [SQL] Re: PLpgSQL

2001-07-21 Thread Josh Berkus
Dado, > But still, the $1 is still plaguing me. > Here's your problem: > >>CREATE FUNCTION new_proj_pts_seq(int4) > >>RETURNS text > >>AS 'DECLARE > >>proj_ID alias for $1; > >>seq_name TEXT; > >>BEGIN > >>seq_name := ''proj_pts_'' || proj_ID; > >>create seq

[SQL] Re: PLpgSQL

2001-07-20 Thread Dado Feigenblatt
Jeff Eckermann wrote: >You will need to use "EXECUTE" to create the sequence. The docs on pl/pgsql >cover it: basically, "EXECUTE string" will cause that string to be executed >as a SQL statement. > Now that I found the documentation, I started to suspect that. Although nowhere it is mentioned t

[SQL] RE: PLpgSQL

2001-07-20 Thread Jeff Eckermann
You will need to use "EXECUTE" to create the sequence. The docs on pl/pgsql cover it: basically, "EXECUTE string" will cause that string to be executed as a SQL statement. > -Original Message- > From: Dado Feigenblatt [SMTP:[EMAIL PROTECTED]] > Sent: Friday, July 20, 2001 2:26 PM > To:

[SQL] Re: plpgsql grief

2001-02-12 Thread Ian Harding
Tcl is my bread and butter but, coincidentally, I have just started considering pl/tcl 2 days ago as the choice for server side pg programming. I do it in microsoft t-sql right now, and plsql is pretty close to that. However, tcl is like English to me, so I think I will go that way unless someon

[SQL] Re: plpgsql grief

2001-02-12 Thread rob
> > I feel your pain;^) > > Here is the text of a post from Tuesday... I think it answers your question > which is that you cannot do variable subsititution for table or field names > inside procedures. This is not a Postgres specific limitation, MS SQL > Server has the same issue. > > >

[SQL] Re: plpgsql grief

2001-02-12 Thread Ian Harding
rob wrote: > Hi, I'm having some real headache problems here. Apologies for the > length, i just want to get it all out now :) > > I figured moving some 'simple' db code from my application to it's more > natural home in the db would work out. Bummer. Not only do i have to run > 7.1 (beta 4) to b

Re: [SQL] RE: plpgsql error: cache lookup from pg_proc failed

2001-02-06 Thread Joseph Shraibman
Michael Davis wrote: > > Setting NEW in an AFTER update or insert trigger is not wise. Try using a before >update trigger instead. > I still get the error message. > -Original Message- > From: Joseph Shraibman [SMTP:[EMAIL PROTECTED]] > Sent: Tuesday, February 06, 2001 6:35 PM >

[SQL] RE: plpgsql error: cache lookup from pg_proc failed

2001-02-06 Thread Michael Davis
Setting NEW in an AFTER update or insert trigger is not wise. Try using a before update trigger instead. -Original Message- From: Joseph Shraibman [SMTP:[EMAIL PROTECTED]] Sent: Tuesday, February 06, 2001 6:35 PM To: [EMAIL PROTECTED] Subject:plpgsql error: cache looku

[SQL] RE: plpgsql language

2001-01-23 Thread Michael Davis
Did you execute the following after you created your database? CREATE FUNCTION plpgsql_call_handler () RETURNS OPAQUE AS '/usr/local/pgsql/lib/plpgsql.so' LANGUAGE 'C'; CREATE TRUSTED PROCEDURAL LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler LANCOMPILER 'PL/pgSQL'; These are