Unix Technical Forum

BUG #1553: Function arguments and table fields

This is a discussion on BUG #1553: Function arguments and table fields within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 1553 Logged by: Dan Black Email address: dchernyshov@yandex.ru PostgreSQL version: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 08:40 AM
Dan Black
 
Posts: n/a
Default BUG #1553: Function arguments and table fields


The following bug has been logged online:

Bug reference: 1553
Logged by: Dan Black
Email address: dchernyshov@yandex.ru
PostgreSQL version: 8.0.1
Operating system: MS Windows 2000 sp4
Description: Function arguments and table fields
Details:

1) Here is simple function

CREATE OR REPLACE FUNCTION img_update(img_name int4, img_name "varchar")
RETURNS int4 AS
$BODY$DECLARE
_imgId ALIAS FOR $1;
_imgName ALIAS FOR $2;
BEGIN
UPDATE images SET img_name = _imgName WHERE img_id = _imgId;
RETURN 0;
END$BODY$
LANGUAGE 'plpgsql' VOLATILE SECURITY DEFINER;

2) Here is simple table

CREATE TABLE images
(
img_id int4 NOT NULL DEFAULT nextval('public.images_id_seq'::text),
img_name varchar(34)
)

PROBLEM:
Function does not work

PROBLEM-SOLVING:
Need to rename function parameters, so that their names and table fields
names are unmatched.

It's not probably bug, but it's difficult-to-locate error

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 08:40 AM
Neil Conway
 
Posts: n/a
Default Re: BUG #1553: Function arguments and table fields

Dan Black wrote:
> Need to rename function parameters, so that their names and table fields
> names are unmatched.


I don't really see a way to make the error any more obvious in the
current pl/pgsql implementation, unfortunately.

-Neil

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:40 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com