Re: [DOCS] Table A-1. PostgreSQL Error Codes (WITH constants)

2005-12-01 Thread philip
> What exactly is the point of the change at all?

Take a typical line in the table:

Error Code | Meaning
23502  | NOT NULL VIOLATION

Now assume I want to catch this exception in a plpgsql function:

CREATE OR REPLACE FUNCTION foo()
/* boilerplate omitted */

EXCEPTION
WHEN NOT_NULL_VIOLATION THEN
   RAISE WARNING 'Crikey!';
WHEN OTHERS THEN
   RAISE NOTICE 'Oh well, [%,%]', SQLSTATE, SQLERRM;

Making the "Meaning" column almost-usable as the exception name is
frustrating. This patch would allow people writing functions to copy and
paste the exception names directly.

It's not a big deal, but it would save some re-typing for people writing a
lot of functions (me, for example).



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


---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [DOCS] Suggested patch to plpgsql docs (7.4beta)

2003-09-03 Thread Philip Yarra
On Thu, 4 Sep 2003 09:11 am, Bruce Momjian wrote:
> Richard Huxton wrote:
> > Addition of one paragraph to the end of section 39.7.3.4 "FOR (integer
> > variant)"
> >
> > Note that this is basically a WHILE loop, so if the lower bound is larger
> > than the upper bound the loop never executes it's contents:
> >   FOR i IN 10..1 LOOP
> > RAISE NOTICE ''I do not raise a notice %'',i;
> >   END LOOP;
> >
> > I wasn't sure and had to check, so I assume others might find this useful
> > too.
>
> I figured everyone would assume that.  I know of no language that will
> execute a loop listed as 10 ... 1.

Basic on my first computer suppported it, though the syntax was 

FOR $i in 10 TO 1 STEP -1
    PRINT $i
NEXT 

I think it is worth stating explicitly. The apostrophe in "it's" is incorrect 
though.

Regards, Philip Yarra.

---(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


[DOCS] Online comments system

2005-10-05 Thread Philip Rodrigues
Hi,
I'm part of the KDE documentation team, and we've recently discussed ways of 
allowing users to more easily contribute to the KDE documentation. We're 
interested in the comment system that you use on the PGSQL website, since it 
provides a way for users to add to the documentation, with the potential to 
merge the additions into the official doc later.

I'd be grateful if you could tell me your experiences with the comment system: 
Do users contribute? Are the contributions useful? Is the system easy to 
administer?

Also, is there some information online about the technical side of the system? 
Is the source code available?

Thanks in advance,
Philip

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [DOCS] Online comments system

2005-10-07 Thread Philip Rodrigues
Thanks for the pointers - I'll talk to pgsql-www if I have any more questions.

Yours,
Philip


pgpq76i1HiYSJ.pgp
Description: PGP signature


[DOCS] pl/pgSQL doco patch

2005-11-15 Thread Philip Yarra
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 -	1.79
--- doc/src/sgml/plpgsql.sgml	28 Oct 2005 05:20:54 -
***
*** 3132,3137 
--- 3132,3144 
 state in temporary tables, instead.

   
+  
+   
+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
+   
+  
  
 
  

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


Re: [DOCS] [PATCHES] pl/pgSQL doco patch

2005-11-16 Thread Philip Yarra
On Thu, 17 Nov 2005 01:40 am, Andrew Dunstan wrote:
> 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.

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.

-- 

"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.


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