Subject: pl/pgSQL doco patch

From: Philip Yarra <[email-masked]>
Date: Wed, 16 Nov 2005 09:59:04 +1100

Hi, I supplied a minor doco patch relating to porting pl/SQL to pl/pgSQL: 
http://archives.postgresql.org/pgsql-hackers/2005-10/msg01295.php. Also 
attached here.

Could someone please review and apply this for me?

Regards, Philip.

-- 

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan

-----------------
Utiba Pty Ltd 
This message has been scanned for viruses and
dangerous content by Utiba mail server and is 
believed to be clean.

Index: doc/src/sgml/plpgsql.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/plpgsql.sgml,v
retrieving revision 1.79
diff -c -r1.79 plpgsql.sgml
*** doc/src/sgml/plpgsql.sgml	21 Oct 2005 05:11:23 -0000	1.79
--- doc/src/sgml/plpgsql.sgml	28 Oct 2005 05:20:54 -0000
***************
*** 3132,3137 ****
--- 3132,3144 ----
         state in temporary tables, instead.
        </para>
       </listitem>
+      <listitem>
+       <para>
+        You cannot use parameter names that are the same as columns 
+        that are referenced in the function. Oracle does allow you to do this
+        if you qualify the parameter name as function_name.paramater_name
+       </para>
+      </listitem>
      </itemizedlist>
     </para>

---

From: Bruce Momjian <[email-masked]>
Date: Tue, 15 Nov 2005 22:52:51 -0500 (EST)

Your patch has been added to the PostgreSQL unapplied patches list at:

	http://momjian.postgresql.org/cgi-bin/pgpatches

It will be applied as soon as one of the PostgreSQL committers reviews
and approves it.

---------------------------------------------------------------------------

> Could someone please review and apply this for me?

[ Attachment, skipping... ]

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
>        subscribe-nomail command to [email-masked] so that your
>        message can get through to the mailing list cleanly

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  [email-masked]               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

---

From: Andrew Dunstan <[email-masked]>
Date: Wed, 16 Nov 2005 09:40:37 -0500

I am wondering we should make this warning more prominent - it would be 
easily missed buried on the Oracle porting section, and I have seen 
people caught by it lots of times.

cheers

andrew

Philip Yarra wrote:

>------------------------------------------------------------------------
>

---

From: Philip Yarra <[email-masked]>
Date: Thu, 17 Nov 2005 09:26:55 +1100

> people caught by it lots of times.

I added it to the Oracle section because I found this syntax while porting an 
Oracle stored proc to a pl/pgSQL function, and assumed it was an Oracle-ism.

Do other RDBMSs also allow you to qualify function_name.param_name to 
distinguish a param from a column of the same name? If so, sure, I'll put it 
somewhere more general (suggestions?), and Tom, I think that would lend 
weight to allowing PostgreSQL to do it too (not because it's The Right Thing, 
but for interoperability and ease of porting). Thoughts?

Regards, Philip.

-- 

-----------------
Utiba Pty Ltd

---

From: Bruce Momjian <[email-masked]>
Date: Thu, 8 Dec 2005 13:01:54 -0500 (EST)

Add documentation about the inability of plpsql to use parameter names
that are the same as column names used in the function.  I moved the
item up on the list of porting issues.

Patch applied to CVS HEAD and 8.1.X.  Thanks.

---

From: Bruce Momjian <[email-masked]>
Date: Thu, 8 Dec 2005 13:03:09 -0500 (EST)

I think the Oracle porting section is the correct place for this item. 
Thanks for the patch.