Re: [Plperlng-devel] Re: [HACKERS] Concern about new PL/Perl

2004-11-19 Thread Andrew Dunstan
Tom Lane said:
 Josh Berkus [EMAIL PROTECTED] writes:
 I would agree that seems a little odd ;). Would this be something we
 want done for 8.0?

 I think we'd better.   Otherwise, people will get used to the broken
 syntax.

 Agreed.  Someone's going to step up and patch this, no?

 (Not me --- I've already wasted more hours than I could afford this
 week on plperl.)


I knew I should have looked at this closer when Peter made his complaint -
it sounded familiar. IIRC it was actually a point I raised about the
original code, and it was fixed. At any rate, last night Abhijit Menon-Sen
and I looked at the code and got confused becuse it appears to have been
fixed ;-). rows only contains data and only exists if the result is from a
successful select. processed is the row count, and is always present.

So it's a case of bad documentation, which we will fix very shortly. Sorry
for the noise.

cheers

andrew



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

   http://www.postgresql.org/docs/faqs/FAQ.html


Re: [Plperlng-devel] Re: [HACKERS] Concern about new PL/Perl

2004-11-19 Thread Joshua D. Drake

Humor the Canadian ... when is Thanksgiving? :)
Next week.. :) Thursday.


Marc G. Fournier   Hub.Org Networking Services 
(http://www.hub.org)
Email: [EMAIL PROTECTED]   Yahoo!: yscrappy  ICQ: 
7615664

--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - [EMAIL PROTECTED] - http://www.commandprompt.com
PostgreSQL Replicator -- production quality replication for PostgreSQL
begin:vcard
fn:Joshua Drake
n:Drake;Joshua
org:Command Prompt, Inc.
adr:;;PO Box 215 ;Cascade Locks;OR;97014;US
email;internet:[EMAIL PROTECTED]
title:Consultant
tel;work:503-667-4564
tel;fax:503-210-0334
x-mozilla-html:FALSE
url:http://www.commandprompt.com
version:2.1
end:vcard


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


Re: [Plperlng-devel] Re: [HACKERS] Concern about new PL/Perl

2004-11-19 Thread Marc G. Fournier
On Fri, 19 Nov 2004, Joshua D. Drake wrote:

Humor the Canadian ... when is Thanksgiving? :)
Next week.. :) Thursday.
Thank you ... I knew you guys celebrated later then us, just didn't know 
why ... do you guys celebrate Remembrance Day same as us, or different 
too?  Ours is Nov 11 ...


Marc G. Fournier   Hub.Org Networking Services (http://www.hub.org)
Email: [EMAIL PROTECTED]   Yahoo!: yscrappy  ICQ: 7615664
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
  http://www.postgresql.org/docs/faqs/FAQ.html


Re: [Plperlng-devel] Re: [HACKERS] Concern about new PL/Perl

2004-11-19 Thread Joshua D. Drake

Thank you ... I knew you guys celebrated later then us, just didn't know 
why ... do you guys celebrate Remembrance Day same as us, or different 
too?  Ours is Nov 11 ...
I don't even know what Rememberance Day is ;)
Sincerely,
Joshua D. Drake


Marc G. Fournier   Hub.Org Networking Services (http://www.hub.org)
Email: [EMAIL PROTECTED]   Yahoo!: yscrappy  ICQ: 7615664
---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
  http://www.postgresql.org/docs/faqs/FAQ.html

--
Command Prompt, Inc., home of PostgreSQL Replication, and plPHP.
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - [EMAIL PROTECTED] - http://www.commandprompt.com
Mammoth PostgreSQL Replicator. Integrated Replication for PostgreSQL
begin:vcard
fn:Joshua D. Drake
n:Drake;Joshua D.
org:Command Prompt, Inc.
adr:;;PO Box 215;Cascade Locks;Oregon;97014;USA
email;internet:[EMAIL PROTECTED]
title:Consultant
tel;work:503-667-4564
tel;fax:503-210-0334
note:Command Prompt, Inc. is the largest and oldest US based commercial PostgreSQL support provider. We  provide the only commercially viable integrated PostgreSQL replication solution, but also custom programming, and support. We authored  the book Practical PostgreSQL, the procedural language plPHP, and adding trigger capability to plPerl.
x-mozilla-html:FALSE
url:http://www.commandprompt.com/
version:2.1
end:vcard


---(end of broadcast)---
TIP 3: 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: [Plperlng-devel] Re: [HACKERS] Concern about new PL/Perl

2004-11-19 Thread Doug McNaught
Joshua D. Drake [EMAIL PROTECTED] writes:

 Thank you ... I knew you guys celebrated later then us, just didn't
 know why ... do you guys celebrate Remembrance Day same as us, or
 different too?  Ours is Nov 11 ...

 I don't even know what Rememberance Day is ;)

WWI ended on November 11, 1918.  The British and their (ex-) colonies
take the holiday more seriously than we do, possibly because they lost
a million dead in that war...  We have it too, but we call it
Veterans' Day.

-Doug

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [Plperlng-devel] Re: [HACKERS] Concern about new PL/Perl

2004-11-19 Thread David Fetter
On Fri, Nov 19, 2004 at 05:29:20AM -0600, Andrew Dunstan wrote:
 Tom Lane said:
  Josh Berkus [EMAIL PROTECTED] writes:
  I would agree that seems a little odd ;). Would this be something we
  want done for 8.0?
 
  I think we'd better.   Otherwise, people will get used to the broken
  syntax.
 
  Agreed.  Someone's going to step up and patch this, no?
 
  (Not me --- I've already wasted more hours than I could afford this
  week on plperl.)
 
 
 I knew I should have looked at this closer when Peter made his complaint -
 it sounded familiar. IIRC it was actually a point I raised about the
 original code, and it was fixed. At any rate, last night Abhijit Menon-Sen
 and I looked at the code and got confused becuse it appears to have been
 fixed ;-). rows only contains data and only exists if the result is from a
 successful select. processed is the row count, and is always present.
 
 So it's a case of bad documentation, which we will fix very shortly. Sorry
 for the noise.

Please find attached a patch that fixes this.

Cheers,
D
-- 
David Fetter [EMAIL PROTECTED] http://fetter.org/
phone: +1 510 893 6100   mobile: +1 415 235 3778

Remember to vote!
Index: doc/src/sgml/plperl.sgml
===
RCS file: /projects/cvsroot/pgsql/doc/src/sgml/plperl.sgml,v
retrieving revision 2.30
diff -c -r2.30 plperl.sgml
*** doc/src/sgml/plperl.sgml6 Nov 2004 14:32:10 -   2.30
--- doc/src/sgml/plperl.sgml19 Nov 2004 18:52:34 -
***
*** 174,189 
  programlisting
  $rv = spi_exec_query('SELECT * FROM my_table', 5);
  /programlisting
!This returns up to 5 rows from the table
!literalmy_table/literal.  If literalmy_table/literal
!has a column literalmy_column/literal, it could be accessed
!like this:
  programlisting
  $foo = $rv-{rows}[$i]-{my_column};
  /programlisting
!The total number of rows returned can be accessed like this:
  programlisting
! $nrows = @{$rv-{rows}};
  /programlisting
/para
  
--- 174,190 
  programlisting
  $rv = spi_exec_query('SELECT * FROM my_table', 5);
  /programlisting
! This returns up to 5 rows from the table
! literalmy_table/literal.  If literalmy_table/literal
! has a column literalmy_column/literal, you can get the value that
! value from row literal$i/literal from a
! commandSELECT/command like this:
  programlisting
  $foo = $rv-{rows}[$i]-{my_column};
  /programlisting
!The total number of rows returned from a commandSELECT/command 
query can be accessed like this:
  programlisting
! $nrows = $rv-{processed}
  /programlisting
/para
  
***
*** 200,206 
  /programlisting
 To get the number of rows affected, do:
  programlisting
! $nrows = $rv-{rows};
  /programlisting
/para
   /listitem
--- 201,207 
  /programlisting
 To get the number of rows affected, do:
  programlisting
! $nrows = $rv-{processed};
  /programlisting
/para
   /listitem

---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [Plperlng-devel] Re: [HACKERS] Concern about new PL/Perl

2004-11-19 Thread Tom Lane
David Fetter [EMAIL PROTECTED] writes:
 So it's a case of bad documentation, which we will fix very shortly. Sorry
 for the noise.

 Please find attached a patch that fixes this.

Applied, thanks.

regards, tom lane

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [Plperlng-devel] Re: [HACKERS] Concern about new PL/Perl

2004-11-18 Thread Joshua D. Drake
Andrew Dunstan wrote:

Peter Eisentraut wrote:
It seems that in the new PL/Perl, the result of the spi_exec_query 
function changes in meaning depending on the command.  For a SELECT, 
the value of

$res-{rows}
is a reference to an array of the result rows.
For a different command
$res-{rows}
is a scalar containing the number of affected rows.  I think this is 
a poor design.  Couldn't we have a different result field that always 
contains the number of rows?
 

I don't recall seeing any reply to this, but I'm inclined to agree 
with it.

Joshua, any comment from  CP?
I would agree that seems a little odd ;). Would this be something we 
want done for 8.0?

Sincerely,
Joshua D. Drake

cheers
andrew
___
Plperlng-devel mailing list
[EMAIL PROTECTED]
http://pgfoundry.org/mailman/listinfo/plperlng-devel

--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - [EMAIL PROTECTED] - http://www.commandprompt.com
PostgreSQL Replicator -- production quality replication for PostgreSQL
begin:vcard
fn:Joshua Drake
n:Drake;Joshua
org:Command Prompt, Inc.
adr:;;PO Box 215 ;Cascade Locks;OR;97014;US
email;internet:[EMAIL PROTECTED]
title:Consultant
tel;work:503-667-4564
tel;fax:503-210-0334
x-mozilla-html:FALSE
url:http://www.commandprompt.com
version:2.1
end:vcard


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

   http://www.postgresql.org/docs/faqs/FAQ.html


Re: [Plperlng-devel] Re: [HACKERS] Concern about new PL/Perl

2004-11-18 Thread Josh Berkus
Josh,

 I would agree that seems a little odd ;). Would this be something we
 want done for 8.0?

I think we'd better.   Otherwise, people will get used to the broken syntax.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])


Re: [Plperlng-devel] Re: [HACKERS] Concern about new PL/Perl

2004-11-18 Thread Tom Lane
Josh Berkus [EMAIL PROTECTED] writes:
 I would agree that seems a little odd ;). Would this be something we
 want done for 8.0?

 I think we'd better.   Otherwise, people will get used to the broken syntax.

Agreed.  Someone's going to step up and patch this, no?

(Not me --- I've already wasted more hours than I could afford this week
on plperl.)

regards, tom lane

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])


Re: [Plperlng-devel] Re: [HACKERS] Concern about new PL/Perl

2004-11-18 Thread Joshua D. Drake

Agreed.  Someone's going to step up and patch this, no?
(Not me --- I've already wasted more hours than I could afford this week
on plperl.)
 

We can do it, but it will have to be after thanksgiving.
J

			regards, tom lane
 


--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - [EMAIL PROTECTED] - http://www.commandprompt.com
PostgreSQL Replicator -- production quality replication for PostgreSQL
begin:vcard
fn:Joshua Drake
n:Drake;Joshua
org:Command Prompt, Inc.
adr:;;PO Box 215 ;Cascade Locks;OR;97014;US
email;internet:[EMAIL PROTECTED]
title:Consultant
tel;work:503-667-4564
tel;fax:503-210-0334
x-mozilla-html:FALSE
url:http://www.commandprompt.com
version:2.1
end:vcard


---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [Plperlng-devel] Re: [HACKERS] Concern about new PL/Perl

2004-11-18 Thread Marc G. Fournier
On Thu, 18 Nov 2004, Joshua D. Drake wrote:

Agreed.  Someone's going to step up and patch this, no?
(Not me --- I've already wasted more hours than I could afford this week
on plperl.)
We can do it, but it will have to be after thanksgiving.
Humor the Canadian ... when is Thanksgiving? :)

Marc G. Fournier   Hub.Org Networking Services (http://www.hub.org)
Email: [EMAIL PROTECTED]   Yahoo!: yscrappy  ICQ: 7615664
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [Plperlng-devel] Re: [HACKERS] Concern about new PL/Perl

2004-11-16 Thread Josh Berkus
Andrew, Peter,

 It seems that in the new PL/Perl, the result of the spi_exec_query
 function changes in meaning depending on the command.  For a SELECT,
 the value of
 
 $res-{rows}
 
 is a reference to an array of the result rows.
 
 For a different command
 
 $res-{rows}
 
 is a scalar containing the number of affected rows.  I think this is a
 poor design.  Couldn't we have a different result field that always
 contains the number of rows?

Hmmm ... while contextual data changes is perlish, substituting a scalar for 
an arrayref is going a little far.I agree with Peter, if the second # is 
needed, {nrows} makes more sense.   

-- 
Josh Berkus
Aglio Database Solutions
San Francisco

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

   http://www.postgresql.org/docs/faqs/FAQ.html