Re: [GENERAL] how do functional indices work?

2001-09-04 Thread John Clark Naldoza y Lopez
hubert depesz lubaczewski wrote:
 
 hi
 i  have a question.
 let's assume i have table users which is (id int4, person_id int4) - pkey'ed
 on id with index on person_id.
 next i have table people (id int4, fullname text) with pkey on id.
 there is a foreign key between the two tables on users.person_id = people.id.
 now i wrote a function, which given user id returns it's person's name. quite
 simple function.
 not i want to make a index:
 create index test on users (myMagicalFunction(id));
 this of course works, but the question is:
 how this index will work if i'll modify the fullname in people table? would it
 be automatically updated? if yes then how pgsql knows where to update this
 index? if no - is there any possible workaround that can be done?
 

I believe what you are looking for is some triggers for your foreign
keys..

Perhaps you should re-visit the docs and try to find the CREATE TABLE
section =]

In it you'll find 

REFERENCES Constraint 

[ CONSTRAINT name ] REFERENCES reftable [ ( refcolumn ) ] 
[ MATCH matchtype ]
[ ON DELETE action ] 
[ ON UPDATE action ]
[ [ NOT ] DEFERRABLE ] 
[ INITIALLY checktime ]

=]

So perhaps you could try:

CREATE TABLE people
(
id INT4 PRIMARY KEY,
fullname TEXT
);

CREATE TABLE USERS
(
id INT4, 
person_id INT4 REFERENCES people(id) ON DELETE CASCADE ON UPDATE
CASCADE
);


I think =[ I hope that works =]


Cheers,


John Clark
-- 
 /) John Clark Naldoza y Lopez   (\
/ )Software Design Engineer III  ( \
  _( (__  Web-Application Development_) )_
 (((\ \  /_Cable Modem Network Management System _\  / /)))
 ( \_/ / NEC Telecom Software Phils., Inc.  \ \_/ )
  \   /  \   /
   \_/  phone: (+63 32) 233-9142 loc. 3113\_/
   /   /  cellphone: (+63 919) 399-4742 \   \
  /   / email: [EMAIL PROTECTED]\   \


"Intelligence is the ability to avoid doing work, yet getting the work
done"
--Linus Torvalds

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


Re: [GENERAL] SHOW

2001-09-04 Thread Joe Conway

   What is the equivalent to the mysql's:
   SHOW COLUMNS FROM [TABLENAME];
 
  in psql,  \d will show you all tables and \d TABLE will show you the
  columns in the table.  If you need it as a sql command,  you can check
the
  system tables.

 OK. That works for ./bin/psql, but NOT on the libpq's PQexec.
 What do I have to type here?

 Thanx again and lots of greetings from cool Spain
 Steve

Start up psql with the -E on the command line. Then do \d TABLE. This will
show you the actual SQL commands used by psql.

See the psql man page for more details.

HTH,

-- Joe


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



[GENERAL] (no subject)

2001-09-04 Thread Giorgio Volpe

remove


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



Re: [GENERAL] SHOW

2001-09-04 Thread Stephan Bergmann

Hi Joe.

 
 Start up psql with the -E on the command line. Then do \d TABLE. This will
 show you the actual SQL commands used by psql.

Doesn't change nothing.

 See the psql man page for more details.

No hints to find there respective to the libpq's PQexec.

Greetings
Steve


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

http://www.postgresql.org/users-lounge/docs/faq.html



Re: [GENERAL] PL/java?

2001-09-04 Thread Gilles DAROLD

Hi Alex,

Saying that mod_perl is slower than any java apps is purely marketing
for java. An other guy told me that one day, I just bench it to show him
how java developper just talk marketing. So the result was that with small
users the performance was the same and with many user mod_perl is
really speediest. Secondly mod_perl doesn't crash the system, under Linux
using Java is a waste of time and a leak of memory ! Marketing is probably
why daniel talk about Win$

When first Java was out it was called the Perl killer, so after many years
Perl is most uses than Java, ask you why ???

For your other words what you do in Java can be done in perl more quickly
more efficiently and with writing many less lines !

An other example is the Oracle XML/SQL Servlet that it was plan to use
in my company. After hearing too many marketing words I write the same
in perl in 3 days and extend the possibility with no limits. Now they're using
Perl, ask you why ? This is use in the entreprise commercial application that
I think you call entreprise level !

At this time Perl is the only really portable language over any OS.

In my opinion PL/Java is purely a waste of time but some have time so why not !

Sorry but I can not let you say words like that, we are not newbe :-(

In your way I can tell you that before using Perl I also preach for Java :-)
But
after rewritten many time the same apps with the differents versions of Java
and the OS where it should work it ended to decide me: no more Java !

Regards

Gilles Darold

Alex Knight wrote:

 Daniel, thank you kindly for your input.

 However, mod_perl is absolutely slower than most any j2ee application.
 If all you are doing is keeping a session variable to count number of hits
 on a web page, then sure, perl is more than sufficient, possibly faster.
 But when you start doing anything of importance, enterprise level stuff,
 you need something scalable in ways java can go, but perl just doesn't
 seem to have _easy_ or sometimes _existant_ ways to implement.

 How would you go about synchronizing session data on 10 application servers
 running mod_perl _without_ using the database to mirror that data in
 memory? It's not very difficult to do it in Java. (Ofcourse, any smart
 architect would use content switches generally to keep a remote user
 associated with the initial app server to reduce the necessity of such
 replication technologies).

 Not sure how you are associating me with windows, but no, all my server
 stuff is always *nix. My answer on awt and swing was in reference to
 someone else who was basing their opinion of java on awt/swing's
 capabilities. Regardless, applets using awt/swing can be easily run
 under Linux Mozilla or Netscape, or HotJava, etc. So you can't really
 say that's enough to assume we're talking about windows.

 -Knight


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



Re: [GENERAL] Problem with numeric and operators

2001-09-04 Thread Oliver Elphick

DaVinci wrote:
   Hi all.
  
   I have a problem with data type 'numeric'. If I have a field of type
   'numeric' (in this case 'foo') and execute next query:
  
   select * from table_example where foo  2.45
  
   I get error:
  
   ERROR:  Unable to identify an operator '' for types 'numeric' and 'flo
  at8'
   You will have to retype this query using an explicit cast
  
   What is the meaning of this? Is it a bug? What am I doing wrong?...
 
There is not yet an automatic type conversion for such cases.

Add an explicit cast to your query:

  select * from table_example where foo  CAST (2.45 AS NUMERIC(12,2))


-- 
Oliver Elphick[EMAIL PROTECTED]
Isle of Wight  http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
 
 If any of you lack wisdom, let him ask of God, who
  gives to all men generously and without reproach, and 
  it will be given to him.   James 1:5 



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



Re: [GENERAL] Is it possible to default all number data to numeric type?

2001-09-04 Thread Jan Wieck

Pls Help Me wrote:
 My company had a old program with written by Powerbuilder. It work
 fine in MSSQL 6.5.
 Now, my boss required to use another SQL server.  Someone told me
 PostgreSQL is totally free and powerful.  I installed it in a Linux
 machine (RedHat 7 + PostgreSQL 7.1.2), and transfer the old data from
 MSSQL 6.5 server. It work fine.
 However, when I run the old program.  When I try to update some record
 with numeric type field, it show error as below.

 Unable to identify an operator '=' for types 'numeric' and 'float8'...
 You will have to retype this query using an explicit cast.

Looks like the application does some

SELECT ... WHERE some_numeric_attrib = 1234.56 ...

The point here is, that a constant like above (1234.56) get's
parsed into a float8 and there is no = operator  defined  for
numeric  and  float8.   It  is  not  sufficient  to define an
operator, because the conversion of  the  characters  1234.56
into a float8 value looses precision, so the comparision with
a true numeric attribute might result in false,  even  if  it
should've been true.

 The point is the software house closed, I can't find any programmer.
 _
 So, I want to know is it possible to set the numeric type to default??
 Or any easy way to fix it up?

If  the  vendor  doesn't  exist any more, I hope you have the
sources!

If so, you could cast the  constant  values  in  the  queries
explicitly  to  numeric  data  type  by changing 1234.56 into
'1234.56'::numeric.

 P.S. My English is bad, pls. forgive me.

Compared to what some english native speakers scribble,  it's
excellent.And   this  mailing  list  focuses  on  solving
PostgreSQL problems anyway. As long as we can figure out what
someones problem is, noone will complain.


Jan

--

#==#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.  #
#== [EMAIL PROTECTED] #



_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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



Re: [GENERAL] nested SQL with SPI

2001-09-04 Thread Tom Lane

Markus Wagner [EMAIL PROTECTED] writes:
 this would mean that all result tables are kept in memory until the trigger 
 function exits?

Until you do SPI_freetuptable or SPI_finish, yes, an SPI result sticks
around.

 What do you mean with copy it and associated globals into locals, just the 
 pointers or the data itself?

Just the pointer.  You may or may not need to hang onto SPI_processed, 
SPI_lastoid, or SPI_result; a copy of SPI_tuptable might be enough for
your purposes.

If the docs don't seem clear enough to you, feel free to submit a doc
patch ...

regards, tom lane

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



[GENERAL] upgrade from 7.1.2 to 7.1.3 and uh, where are my databases?

2001-09-04 Thread Jerry Asher

I upgraded from 7.1.2 to 7.1.3.  Upon starting 7.1.3, I tried to use psql 
to access my databases.  But whether I use psql -U foo, or psql -d foo, I 
am told that:

   psql: FATAL 1: Database foo does not exist in the system catalog.

When I examine /usr/local/pgsql/data, it certainly looks as though my 
databases are still on the disk.  How do I get postgresql to recognize them?

More details:

Since I was upgrading from 7.1.2 to 7.1.3, I didn't bother (my mistake) 
backing up the system.  I didn't call initdb explicitly.  I did:

./configure --with-x --with-tcl
make
make check
make install

I am worried that the make check may have done an initdb.

Would initdb wipe out my existing databases?

How do I get my existing databases to be reentered into the system catalog?

Thank you,

Jerry Asher


=
Jerry Asher   [EMAIL PROTECTED]
1678 Shattuck Avenue Suite 161Tel: (510) 549-2980
Berkeley, CA 94709Fax: (877) 311-8688


---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://www.postgresql.org/search.mpl



Re: [GENERAL] Unexpected Behavior Using a Rule With Multiple Actions (Long)

2001-09-04 Thread Tom Lane

James F. Hranicky [EMAIL PROTECTED] writes:
 What I'd really like to do is this:

 create rule homes_update as on update to homes where OLD.fspath != 
   NEW.fspath do instead
 (
 update homes_table set record_expired = now() where fsname 
   = OLD.fsname and record_expired is null;

 insert into homes_table values (NEW.fsname, NEW.fspath);

 );

 However, when I do that, it seems the insert fails to execute, or fails
 silently in some way.

The reason it doesn't work is that the INSERT is done conditionally on
the existence of view rows satisfying the rule's WHERE and the original
query's WHERE.  For example, given

update homes set fspath = 'mach1:/exp/h02' where fsname = 'h02';

the second part of the rule expands to something like

INSERT INTO homes_table
SELECT
'h02',  -- substituted for NEW.fsname
'mach1:/exp/h02'-- substituted for NEW.fspath
FROM homes OLD
WHERE OLD.fspath != 'mach1:/exp/h02'-- rule WHERE
AND OLD.fsname = 'h02'; -- original WHERE

The trouble is that after the UPDATE done by the first part of the
rule, there are no view rows satisfying the WHERE conditions (you've
set record_expired to non-null in all the homes_table rows that might
have matched).

Basically, rules are macros that get substituted into the given query.
If you do anything that's even slightly self-referential then you are
likely to get confused.  It's a lot easier to wrap your mind around a
trigger --- the extra notational complexity of having to write a trigger
function is more than made up for by conceptual simplicity.

My suggestion is to do this with triggers and a separate history table.
Say,

homes (fsname primary key, fspath, record_added default now());

homes_log (fsname, fspath, record_added, record_expired);

and a trigger that does an insert into homes_log on any update or delete
of homes.

regards, tom lane

---(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: [GENERAL] how do functional indices work?

2001-09-04 Thread Tom Lane

hubert depesz lubaczewski [EMAIL PROTECTED] writes:
 let's assume i have table users which is (id int4, person_id int4) - pkey'ed
 on id with index on person_id.
 next i have table people (id int4, fullname text) with pkey on id.
 there is a foreign key between the two tables on users.person_id = people.id.
 now i wrote a function, which given user id returns it's person's name. quite
 simple function.
 not i want to make a index:
 create index test on users (myMagicalFunction(id));
 this of course works,

No, it doesn't.  A functional index using a function that depends on any
data other than its explicitly passed parameters is a horribly bad idea.
It WILL fail --- nastily --- as soon as you change the other table.

To help catch this, 7.2 will not allow you to build functional indexes
on functions that are not marked iscachable.

regards, tom lane

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



Re: [GENERAL] upgrade from 7.1.2 to 7.1.3 and uh, where are my

2001-09-04 Thread Jerry Asher

At 07:17 AM 9/4/01, you wrote:
i upgraded from 7.1.2 to 7.1.3.  upon starting 7.1.3, i tried to use psql 
to access my databases.  but whether i use psql -u foo, or psql -d foo, i 
am told that:

   psql: fatal 1: database foo does not exist in the system catalog.

when i examine /usr/local/pgsql/data, it certainly looks as though my 
databases are still on the disk.  how do i get postgresql to recognize them?

Just to clarify (because I am thinking I need to do a

   ./configure --datadir=/usr/local/pgsql/data

The directory /usr/local/pgsql/share contains:

global.bki
global.description
pg_hba.conf.sample
pg_ident.conf.sample
pgaccess/
postgresql.conf.sample
template1.bki
template1.description

While the directory /usr/local/pgsql/data contains:

PG_VERSION
base/
global/
pg_hba.conf
pg_ident.conf
pg_xlog
postgresql.conf
postmaster.opts
postmaster.pid

How do I tell postgres where to find my databases?

Thanks,


Jerry

=
Jerry Asher   [EMAIL PROTECTED]
1678 Shattuck Avenue Suite 161Tel: (510) 549-2980
Berkeley, CA 94709Fax: (877) 311-8688


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



[GENERAL] many junction tables

2001-09-04 Thread Eric Kolve

I was wondering if anyone has a solution to the following problem.  I
have a few tables similar to the following.  


person_table

city_table

company_table

If I want to associate a person with a one or more cities.  I need to
create a city_persons table that contains just the primary keys of both
the city_table and person_table.  If I want to associate a person to
many companies, I have to do a similar thing.  Now, if I wan to
generalize these associaes I can create something like an associate
table which will contain both id's plus two columns which indicate the
source and target tables of the relaionship.  Does anyone have
suggestions along these lines on how to generalize such relationships?

thanks,

--eric

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



[GENERAL] internet week article

2001-09-04 Thread Eric Kolve

  http://www.internetweek.com/reviews01/rev090301.htm

I would be most interested to here this lists response to the following
paragraph.  Though much of the specifics of the benchmark are left out,
so tuning could very much of been an issue.

  Database performance is a key issue for most businesses.
  If the database is slow, the business is too. Our benchmarks
  showed that PostgreSQL is slower than Oracle 8.1.7 in many
  operations. The tests were performed on a 1-GHz Pentium III
  system with 1 GB of RAM running Red Hat 7.1. 

  Oracle performed the count 33 percent faster and the distinct
  count 27 percent faster. The simple query was approximately
  18 percent faster in Oracle, but the most concerning was the
  slowdown of PostgreSQL in the two- and three-table join test.

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

http://www.postgresql.org/users-lounge/docs/faq.html



Re: [GENERAL] upgrade from 7.1.2 to 7.1.3 and uh, where are my databases?

2001-09-04 Thread Tom Lane

Jerry Asher [EMAIL PROTECTED] writes:
 I upgraded from 7.1.2 to 7.1.3.  Upon starting 7.1.3, I tried to use psql 
 to access my databases.  But whether I use psql -U foo, or psql -d foo, I 
 am told that:

psql: FATAL 1: Database foo does not exist in the system catalog.

Hm.  What does psql -l show?  Can you connect to *any* database?  (If
so, try vacuum pg_database and then checkpoint.)

regards, tom lane

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



Re: [GENERAL] upgrade from 7.1.2 to 7.1.3 and uh, where are my

2001-09-04 Thread Tom Lane

Jerry Asher [EMAIL PROTECTED] writes:
 How do I tell postgres where to find my databases?

A -D switch when starting the postmaster is sufficient.  If you are not
using one then the configure-time default is assumed.  Is it possible
that you built 7.1.3 with a different default than 7.1.2 had, and it's
now running in some other data directory than you think it is?

If you are getting as far as Database foo does not exist in the
system catalog then the postmaster is in a valid data directory,
but perhaps it's one that's leftover from a test setup, or some such?

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: [GENERAL] PL/java?

2001-09-04 Thread Alex Knight

Hi Gilles,

You did not read what I wrote very well. First, I said that mod_perl was
slower than most any j2ee application. If you knew what j2ee was,
you'd know that it's generally limited to server-side internet apps
like servlets, jsps, etc... Not to mention, I do try to give perl credit
where due. If java crashes your server, that's because either the vendor
that has the jvm incorporated sucks, or your program was written poorly.
I have _never_ crashed a system or eaten up memory when everything is
properly installed. Java is NOT a cure all language. I honestly feel
that because of the way the interpreter is packaged, it can not be used
for every single situation, like C could for example. But I feel java
would be incredibly appropriate in postgresql.

I see it this way. All the people who really know Java's capabilities,
and know that it can be used without problem, will want Java in the db.
All the others who think java is _always_ slow or java leaks memory
or java is a waste of time won't be using the java extensions ANYWAYS.

As for perl, I probably came off a little wrong. In a reply to Randal,
I did state that I liked perl very much, and I've been developing with
it forever. Perl _is_ amazing, and there is no limit to what you can do
with it. However, in some cases, Java does things better (just like
perl does things faster than Java in certain situations). But perl has
had the most uses for so many years because it is easy to learn,
not truely object oriented (atleast the past few years have been that
way), does not require compiling to simplify the execution process
(i.e. fully interpreted), etc.

Expand on your enterprise application. A true enterprise application
takes more than 3 days time to design and implement. Most real
enterprise applications have multiple layers of logic, etc. I don't
consider a script that queries a database for a password by 100,000
people a day to really be considered as Enterprise either.

If I was new to programming, and I started preaching Java right off
the bat, this conversation wouldn't be warranted. In fact, I run into
these types of Java developers who go around saying they think Java
is the best language ever, etc etc but don't really have the experience
to make that claim.

Anyways, I really didn't want this to get into my language is better
than yours, and let's drop that immediately. My entire purpose here
was to help defend the idea of implementing Java as a PL in PGSQL.

Anyone else have any comments about the java implementation?

-Knight

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Gilles DAROLD
Sent: Tuesday, September 04, 2001 3:22 AM
To: [EMAIL PROTECTED]
Subject: Re: [GENERAL] PL/java?


Hi Alex,

Saying that mod_perl is slower than any java apps is purely marketing
for java. An other guy told me that one day, I just bench it to show him
how java developper just talk marketing. So the result was that with small
users the performance was the same and with many user mod_perl is
really speediest. Secondly mod_perl doesn't crash the system, under Linux
using Java is a waste of time and a leak of memory ! Marketing is probably
why daniel talk about Win$

When first Java was out it was called the Perl killer, so after many years
Perl is most uses than Java, ask you why ???

For your other words what you do in Java can be done in perl more quickly
more efficiently and with writing many less lines !

An other example is the Oracle XML/SQL Servlet that it was plan to use
in my company. After hearing too many marketing words I write the same
in perl in 3 days and extend the possibility with no limits. Now they're
using
Perl, ask you why ? This is use in the entreprise commercial application
that
I think you call entreprise level !

At this time Perl is the only really portable language over any OS.

In my opinion PL/Java is purely a waste of time but some have time so why
not !

Sorry but I can not let you say words like that, we are not newbe :-(

In your way I can tell you that before using Perl I also preach for Java :-)
But
after rewritten many time the same apps with the differents versions of Java
and the OS where it should work it ended to decide me: no more Java !

Regards

Gilles Darold

Alex Knight wrote:

 Daniel, thank you kindly for your input.

 However, mod_perl is absolutely slower than most any j2ee application.
 If all you are doing is keeping a session variable to count number of hits
 on a web page, then sure, perl is more than sufficient, possibly faster.
 But when you start doing anything of importance, enterprise level stuff,
 you need something scalable in ways java can go, but perl just doesn't
 seem to have _easy_ or sometimes _existant_ ways to implement.

 How would you go about synchronizing session data on 10 application
servers
 running mod_perl _without_ using the database to mirror that data in
 memory? It's not very difficult to do it in Java. (Ofcourse, any smart
 architect 

Re: [GENERAL] PL/java?

2001-09-04 Thread Alex Knight

Python is a great language too. For scripts, I tend to write more python
scripts than perl these days, simply because python better suits my needs
and the base class library seems larger than perl's after install,
not that adding libs aren't easy. But I can write compact scripts without
cryptoblinding the user reading the script...

Zope is quite powerful too. But Zope still has a long way to travel until
it can make it to the Enterprise arena. I know a lot of the Zope developers,
and zope.org specifically gets lots of hits, but it's not getting nearly
as many as a Bankofamerica.com would get.

-Knight

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Adam Manock
Sent: Tuesday, September 04, 2001 4:35 AM
To: [EMAIL PROTECTED]
Subject: Re: [GENERAL] PL/java?


After having seen this Perl / Java debate go back and forth...
I can't help myself...

RANT
The answer is Python !!!
For the best middleware you're ever likely to integrate with Postgresql :
http://www.zope.org

To see its enterprise scalability:
http://www.zope.org/About

To see it taking LOTS of hits:
http://ns1.zope.org:82/

To see it NOT using much memory at all:
http://ns1.zope.org:82/cgi-bin/zope-track.pl
(this one loads kinda slow, maybe cause it's done in Perl?)
/RANT

The real point here is that programmers are religious about their choice of
language,
and highly resistant to changing, which is why Postgres supports so many
languages!

I happen to prefer python, but that's just me. http://www.python.org if
you're curious

Adam


At 06:21 AM 9/4/01, you wrote:
Hi Alex,

Saying that mod_perl is slower than any java apps is purely marketing
for java. An other guy told me that one day, I just bench it to show him
how java developper just talk marketing. So the result was that with small
users the performance was the same and with many user mod_perl is
really speediest. Secondly mod_perl doesn't crash the system, under Linux
using Java is a waste of time and a leak of memory ! Marketing is probably
why daniel talk about Win$

When first Java was out it was called the Perl killer, so after many
years
Perl is most uses than Java, ask you why ???

For your other words what you do in Java can be done in perl more quickly
more efficiently and with writing many less lines !

An other example is the Oracle XML/SQL Servlet that it was plan to use
in my company. After hearing too many marketing words I write the same
in perl in 3 days and extend the possibility with no limits. Now they're
using
Perl, ask you why ? This is use in the entreprise commercial application
that
I think you call entreprise level !

At this time Perl is the only really portable language over any OS.

In my opinion PL/Java is purely a waste of time but some have time so why
not !

Sorry but I can not let you say words like that, we are not newbe :-(

In your way I can tell you that before using Perl I also preach for Java
:-)
But
after rewritten many time the same apps with the differents versions of
Java
and the OS where it should work it ended to decide me: no more Java !

Regards

Gilles Darold

Alex Knight wrote:

  Daniel, thank you kindly for your input.
 
  However, mod_perl is absolutely slower than most any j2ee application.
  If all you are doing is keeping a session variable to count number of
hits
  on a web page, then sure, perl is more than sufficient, possibly faster.
  But when you start doing anything of importance, enterprise level stuff,
  you need something scalable in ways java can go, but perl just doesn't
  seem to have _easy_ or sometimes _existant_ ways to implement.
 
  How would you go about synchronizing session data on 10 application
servers
  running mod_perl _without_ using the database to mirror that data in
  memory? It's not very difficult to do it in Java. (Ofcourse, any smart
  architect would use content switches generally to keep a remote user
  associated with the initial app server to reduce the necessity of such
  replication technologies).
 
  Not sure how you are associating me with windows, but no, all my server
  stuff is always *nix. My answer on awt and swing was in reference to
  someone else who was basing their opinion of java on awt/swing's
  capabilities. Regardless, applets using awt/swing can be easily run
  under Linux Mozilla or Netscape, or HotJava, etc. So you can't really
  say that's enough to assume we're talking about windows.
 
  -Knight


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


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


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

http://www.postgresql.org/users-lounge/docs/faq.html



Re: [GENERAL] [WAY OT] Re: PL/java?

2001-09-04 Thread Alex Knight

I'm interested to see the results,

Cheers.

-Original Message-
From: Bruce Momjian [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 04, 2001 9:16 AM
To: Lincoln Yeoh
Cc: Gunnar Ronning; Alex Knight; Alex Pilosov;
[EMAIL PROTECTED]
Subject: Re: [GENERAL] [WAY OT] Re: PL/java?



This is a valid concern for Solaris and I wish we had an answer.  I am
going to contact some Sun people to see if I can figure out a
workaround.


 Just curious about one thing.

 How was the perl app implemented?

 It seems Solaris doesn't do/fork processes very well which is why Sun
 pushes threads.

 Whereas *BSD and Linux do processes about as well as Solaris does threads.

 Postgresql doesn't do so well on our Solaris 2GB box as it does on a 128MB
 Linux x86 box.

 I haven't compared MySQL (threaded) on Solaris vs Linux.

 Cheerio,
 Link.

 At 12:29 PM 9/1/01 +0200, Gunnar R?nning wrote:
 * Alex Knight [EMAIL PROTECTED] wrote:
 |
 | IMHO, scalability is incredibly important, and perl leaves that out
often.
 | Even with Fast-CGI style servers, perl sucks. Perl is great for admin
 | interfaces, or low to medium traffic sites.
 
 We got a contract last december with a customer that were having some
 performance problems with a perl web application. The customer has
 access to the best perl programmers money can buy, but they could not
 fix the performance problem.
 
 We came in to make version 2.0 of the system. In one month we had an
 implementation in Java that outperformed the perl application by a factor
 of 10. The customer could stop the leasing of three of the Sun E450
servers
 they were previously using to run the perl application.
 
 We've had similar experiences in other projects. Every migration
 we've done from Perl-Java has resulted in massive savings.
 
 --
 Gunnar R?nning - [EMAIL PROTECTED]
 Senior Consultant, Polygnosis AS, http://www.polygnosis.com/
 
 ---(end of broadcast)---
 TIP 6: Have you searched our list archives?
 
 http://www.postgresql.org/search.mpl
 
 


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


--
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 853-3000
  +  If your life is a hard drive, |  830 Blythe Avenue
  +  Christ can be your backup.|  Drexel Hill, Pennsylvania 19026


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



Re: [GENERAL] PL/java?

2001-09-04 Thread Randal L. Schwartz

 Alex == Alex Knight [EMAIL PROTECTED] writes:

Alex You did not read what I wrote very well. First, I said that mod_perl was
Alex slower than most any j2ee application. If you knew what j2ee was,
Alex you'd know that it's generally limited to server-side internet apps
Alex like servlets, jsps, etc... 

If you'd just stop saying things that can't be backed up, I wouldn't
have to keep responding.

Where is your proof that mod_perl is slower than most any j2ee
application?

Alex However, in some cases, Java does things better (just like
Alex perl does things faster than Java in certain situations).

I'm still waiting for Java does things better to be demonstrated.

Alex But perl has had the most uses for so many years because it is
Alex easy to learn, not truely object oriented

Perl is a hybrid OO language, just like Java.  Now if you compare both
of them to Smalltalk, I see your point.  But Java has primitive types
that cannot be subclassed or extended, just like Perl.  There's really
no difference.  Perhaps you've not read Object Oriented Perl by
Damian Conway, to see just how rich Perl's object model is, even
compared to Java and others.

Alex  (atleast the past few
Alex years have been that way), does not require compiling to
Alex simplify the execution process (i.e. fully interpreted), etc.

Perl is no more interpreted than Java.  Perl's compiler translates the
entire program down to bytecodes, and the bytecodes are then executed
by the Perl Virtual Machine, just like Java.  (I won't bring up any
benchmarks here... it's unfair to Java. :)

See... it's the nonsense you keep spouting that makes me want to slap
you silly.  Get a clue.  Perl is a serious, mission-critical language,
being actively developed by hundreds of people who depend on it to
remain stable, fast, and useful.

I've seen both.  Java has its place.  Perl has its place.  Stop
dissing Perl, because you are apparently unaware of what is actually
going on.  I guess that would make you a language bigot.

Alex Expand on your enterprise application. A true enterprise application
Alex takes more than 3 days time to design and implement. Most real
Alex enterprise applications have multiple layers of logic, etc. I don't
Alex consider a script that queries a database for a password by 100,000
Alex people a day to really be considered as Enterprise either.

And many enterprise applications are completely in Perl.
cbs.sportsline.com is 90% Perl.  Etoys.com was 100% Perl.  imdb.com is
100% perl.  valueclick.com is 100% Perl.  Amazon.com does all their
backend processing in Perl.  Boeing uses Perl in every step of their
cad/cam process... every number defining the 777 airplane was passed
through Perl.

Alex If I was new to programming, and I started preaching Java
Alex right off the bat, this conversation wouldn't be warranted. In
Alex fact, I run into these types of Java developers who go around
Alex saying they think Java is the best language ever, etc etc but
Alex don't really have the experience to make that claim.

You smell a bit like that now though, mostly through your ignorance of
Perl.  Maybe you're not unfounded pro Java, but you are unfounded
anti Perl.  And I won't allow that here.  I'll certainly permit Perl
to lose on its technical merits, but I won't let Perl lose through
your ignorance of what it actually can be or do.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

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