Re: Simple stored procedure examples? - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Simple stored procedure examples?
Date
Msg-id 20061105101236.GC3979@svana.org
Whole thread Raw
In response to Re: Simple stored procedure examples?  (novnov <novnovice@gmail.com>)
Responses Re: Simple stored procedure examples?
List pgsql-general
On Sat, Nov 04, 2006 at 08:35:28AM -0800, novnov wrote:
> So pgSQL is case sensitive and that include keywords like UPDATE and SET.

No it's not. Only identifiers in double quotes (") are case-sensetive.

So, in your example below, because the function was created with double
quotes, you now have to use double quotes and the same case every time
you want to use it. If you create a function/table/column without
double quotes, you never need quotes and it is case-insensetive.

In your case it's possible that pgAdmin is adding the quotes for you,
maybe?

> There what worked, for the record:
>
> -- Function: "proc_UpdateItemName"()
>
> -- DROP FUNCTION "proc_UpdateItemName"();
>
> CREATE OR REPLACE FUNCTION "proc_UpdateItemName"()
>   RETURNS void AS
> $BODY$UPDATE "Item" SET "ItemName" = 'fox';$BODY$
>   LANGUAGE 'sql' VOLATILE;
> ALTER FUNCTION "proc_UpdateItemName"() OWNER TO postgres;
>

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: dividing integers not producing decimal fractions
Next
From: Andreas Kretschmer
Date:
Subject: Re: Converting a timestamp to a time