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

From Mikko Partio
Subject Re: Simple stored procedure examples?
Date
Msg-id 454CBCB3.7000808@paprikalaatikko.be
Whole thread Raw
In response to Re: Simple stored procedure examples?  (novnov <novnovice@gmail.com>)
Responses Re: Simple stored procedure examples?
List pgsql-general
  > novnov wrote:
>> Thanks to both of you for responding. I should have included the code for
>> my own attempt, at #1 which is just as you suggest:
>>
>> update item set itemname = 'fox';
>>
>> I've tried single, and double quoting the table and field names; call caps
>> to the UPDATE etc, exactly matching the capitalization of the table and
>> field names (really Item and ItemName).
>>
>> I wonder if "Item" is a reserved word in pgsql?
>>
>>

I think you haven't quoted the field names correctly.


dun=# CREATE TABLE "Item" (id int4, "ItemName" text);
CREATE TABLE
dun=# INSERT INTO "Item" VALUES(1,'aaa');
INSERT 0 1
dun=# UPDATE "Item" SET "ItemName" = 'fox';
UPDATE 1
dun=# SELECT * FROM "Item";
  id | ItemName
----+----------
   1 | fox
(1 row)


If you want to have case-sensitive names, you have to have double quotes.


MP

pgsql-general by date:

Previous
From: Oisin Glynn
Date:
Subject: Re: Simple stored procedure examples?
Next
From: Martijn van Oosterhout
Date:
Subject: Re: UNICODE and UTF-8