Re: [GENERAL] installing DBD::Pg without installing postgres

2001-04-24 Thread Jeff Duffy


On Mon, 23 Apr 2001 16:30:43 -0400, Fran Fabrizio alluded:

 
  Hello,
  
  It seems that there should be a way to install the DBD Pg module without
  having to install postgres on the local machine.  I tried installing
  just the libs rpm, but that didn't seem to do the trick.  I've done some
  usenet and mailing list archive searches, but all the info I'm turning
  up appears geared towards the assumption that you also want postgres
  installed locally.  Am I looking in the wrong places?

 There really isn't any reason to do so. If you're looking to have many
machines connect to a single PostgreSQL database, take a look at DBI::Proxy.
It is designed to allow you to connect to databases that have libraries
linked into the DBD::* executables without needing the libraries on the local
box (this is very nice for avoiding the Oracle client library installs as
well).

Jeff

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



Re: [GENERAL] Var substitution in SELECT statements

2001-04-24 Thread will trillich

On Mon, Apr 23, 2001 at 09:41:51PM -0400, Randall Perry wrote:
 on 4/23/01 9:20 PM, Randall Perry at [EMAIL PROTECTED] wrote:
 
  This works:
  $res  = $conn-exec(select cust, contact, user_name, email from $t where
  user_name = a1a);
  
  This doesn't:
  $c = a1a;
  $res  = $conn-exec(select cust, contact, user_name, email from $t where
  user_name = $c);
  
  and returns the error:
  Attribute 'a1a' not found
  
  
  How do you do var substitution with the Pg module in Perl?
 
 Whoops! Needed to quote the var as so (for $c above):
 
 $c = \'$c\';
 
 Works now.

also try

$sth = $dbh-prepare(select fields from tbl where f1 = ? and f2 = ?)
$sth-execute($val1,$val2);
while ($ref = $sth-fetchrow_hashref()) {
...
}
$sth-finish();

-- 
don't visit this page. it's bad for you. take my expert word for it.
http://www.salon.com/people/col/pagl/2001/03/21/spring/index1.html

[EMAIL PROTECTED]
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

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

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



Re: [GENERAL] Re: BETWEEN clause

2001-04-24 Thread will trillich

On Tue, Apr 24, 2001 at 12:07:41AM -0400, Joel Burton wrote:
 On Mon, 23 Apr 2001, Paul Tomblin wrote:
 
  Is the BETWEEN clause inclusive or exclusive?  ie if I say WHERE
  latitude BETWEEN 45 and 55, will I get examples where the latitude equals
  45 or not?  Also, is latitude BETWEEN 45 and 55 any more efficient than
  latitude = 45 AND latitude = 55, or is it just a stylistic thing?
 
 yes, yes, and no:
 
 
 select 'exclusive' where 2 between 1 and 3;
  ?column?
 --
  inclusive
 
 test=# select 'inclusive' where 1 between 1 and 3;
  ?column?
 --
  inclusive
 
 test=# create view its_really_the_same_thing as select true where 1
 between 1 and 3;
 
 test=# \d its_really_the_same_thing
 ...
 View definition: SELECT 't'::bool WHERE ((1 = 1) AND (1 = 3));
 
 
 HTH,
 -- 
 Joel Burton   [EMAIL PROTECTED]
 Director of Information Systems, Support Center of Washington

just wanted to say -- BEAUTIFULLY executed reply. 
not only did you answer the query succinctly and completely,
you showed, quite clearly, how to find out such answers.

teach a man to fish...

delightful!

-- 
don't visit this page. it's bad for you. take my expert word for it.
http://www.salon.com/people/col/pagl/2001/03/21/spring/index1.html

[EMAIL PROTECTED]
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

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



Re: [GENERAL] Re: BETWEEN clause

2001-04-24 Thread Paul Tomblin

Quoting will trillich ([EMAIL PROTECTED]):
  test=# create view its_really_the_same_thing as select true where 1
  between 1 and 3;
  
  test=# \d its_really_the_same_thing
  ...
  View definition: SELECT 't'::bool WHERE ((1 = 1) AND (1 = 3));
  
  
  HTH,
  -- 
  Joel Burton   [EMAIL PROTECTED]
  Director of Information Systems, Support Center of Washington
 
 just wanted to say -- BEAUTIFULLY executed reply. 
 not only did you answer the query succinctly and completely,
 you showed, quite clearly, how to find out such answers.

I was impressed as well.  I didn't know you could use \d to find the
definition of views like that.

-- 
Paul Tomblin [EMAIL PROTECTED], not speaking for anybody
Nobody can be told what the dominatrix is, they have to see it for themselves

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

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



[GENERAL] Strange locale goings on

2001-04-24 Thread Tony Grant

Hello,

I am querying my French language data via JDBC. Accented caracters do
not get returned.

When I query via Webmin (Perl???) accents are just fine.

Quid???

Cheers

Tony Grant

-- 
RedHat Linux on Sony Vaio C1XD/S
http://www.animaproductions.com/linux2.html


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



[GENERAL] Converting queries to upper case

2001-04-24 Thread Tony Grant

Another question

I am submitting my JDBC queries via HTML form. Is it best to convert the
query to UPPER CASE with java script in the form when submitting it?

Cheers

Tony Grant

-- 
RedHat Linux on Sony Vaio C1XD/S
http://www.animaproductions.com/linux2.html


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

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



[GENERAL] Re: Re: BETWEEN clause

2001-04-24 Thread Joel Burton

On Tue, 24 Apr 2001, Paul Tomblin wrote:

 Quoting will trillich ([EMAIL PROTECTED]):
   test=# create view its_really_the_same_thing as select true where 1
   between 1 and 3;
   
   test=# \d its_really_the_same_thing
   ...
   View definition: SELECT 't'::bool WHERE ((1 = 1) AND (1 = 3));
   
   
   HTH,
   -- 
   Joel Burton   [EMAIL PROTECTED]
   Director of Information Systems, Support Center of Washington
  
  just wanted to say -- BEAUTIFULLY executed reply. 
  not only did you answer the query succinctly and completely,
  you showed, quite clearly, how to find out such answers.
 
 I was impressed as well.  I didn't know you could use \d to find the
 definition of views like that.

Yep.

Now what I'd love is \recreate foobar which would execute

DROP VIEW foobar; CREATE VIEW foobar AS ...

So that I could conveniently up-arrow in psql's readline, and edit and
re-create the view.

Woud save me a hundred vi fumblings or X-mouse cutting and pastings a
week.

... who needs GUIs? ;-)

-- 
Joel Burton   [EMAIL PROTECTED]
Director of Information Systems, Support Center of Washington


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

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



[GENERAL] Performance: sql functions v. plpgsql v. plperl

2001-04-24 Thread Joel Burton


Last night, I was doing some amateurish benchmarking and found that,
contrary to my (admittedly uninformed) expectation, sql functions seem
*slower* than plsql functions. Even for very simple things, like

'SELECT CASE WHEN $1 RETURN $1 ELSE $2 END'

were slower than the plsql

begin
  if $1 then
return $1;
  else
return $2;
  end if;
end;

by about 15%.

However, my benchmarking was the type usually dreaded: a single person,
playing around in a scripting language, running the test one a time
seqeuentially, and just timing the results.

Is there any real data on this?



I also tried plperl v plpgsql, and found that, probably not surprisingly,
there was about a 15% advantage to plpgsql. Of course, many things can be
written much simpler in perl (such as string handling functions). Even so,
though, a find-the-first-letter-of-all-significant-words function written
about 1.5 years ago in plpgsql (a pretty awful, nested, letter-by-letter
parser) was only about twice as slow as the perl
split() replacement. Looks like our little plpgsql is quite a speed demon.

(as always, IANAPB [ I am not a professional benchmarker ], YMMV)


-- 
Joel Burton   [EMAIL PROTECTED]
Director of Information Systems, Support Center of Washington


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

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



[GENERAL] indices are crashed after installation of rpm

2001-04-24 Thread Peter Keller

hello all,
we are running PostgreSQL 7.0.2 on Solaris 2.6,/x86 compiled by gcc 2.8.1.
For installation Postgres on 70 Solaris-2.6 server we built packages 
(SVR4-style).

The first time we installed Postgres everything was ok. But after a new 
installation of the package ( - same Postgres version! - just the starting 
script changed) all indices where damaged (this is reproducible).

In the installation script the postmaster is stopped and started. Is it 
possible the stopping and starting is crashing the indices, 
because sometimes just stopping and starting the postmaster ist crashing the 
indices (not reproducible)?

Has someone any idea what's wrong, do you need more informations?
greetings,
Peter


this ist the starting/stopping script S99postgres:

#!/bin/sh
 
umask 077
 
killdaemon()
{
PIDs=`ps -u postgres | sed '/PID/d;s/ \{1,\}/ /g' | cut -d  -f2 | 
sort -rn`
[ -n $PIDs ]  kill $PIDs
[ -f /tmp/.s.PGSQL.5432 ]  rm -f /tmp/.s.PGSQL.5432
echo postmaster stopped
}
 
startdaemon()
{
su postgres -c /export/home/postgres/start_postgres
echo postmaster started
 
su postgres -c /export/home/postgres/chk_user \
 su postgres -c /export/home/postgres/create_user
}
 
case $1 in
'start')
startdaemon
;;
'stop')
killdaemon
;;
'restart')
killdaemon
startdaemon
;;
*)
echo Usage: $0 { start | stop | restart }
;;
esac
 
exit 0

++
and start_postgres:


PATH=/opt/local/bin:$PATH:/opt/local/DWH/bin:.
LD_LIBRARY_PATH=/usr/openwin/lib:/usr/dt/lib:/opt/local/DWH/lib
export PATH LD_LIBRARY_PATH
 
PGLIB=/DWH/lib
PGDATA=$HOME/data
export PGLIB PGDATA
 
postmaster -i -D /export/home/postgres/data  /tmp/postgres.log

-- 
Bezirksfinanzdirektion Muenchen
  Vermessungsabteilung 
...
 Peter Keller:  Tel: (+49) 089-2190-2594 
 Vermessungsrat  :  Fax: (+49) 089-2190-2459
 Alexandrastr. 3   :  mailto:[EMAIL PROTECTED]
 80538 Muenchen   :  web: http://www.bayern.de/vermessung

Sie finden uns: 
http://www2.stadtplandienst.de/query;ORT=m;LL=11.591107x48.142584;GR=5;PRINTER_FRIENDLY=TRUE

**
Bitte merken Sie sich vor:
Zum 200. Geburtstag der Bayerischen Vermessungsverwaltung
findet am Samstag, den 23. Juni 2001 von 10 bis 17 Uhr
ein Tag der offenen Tür am Staatlichen Vermessungsamt München
und am Bayerischen Landesvermessungsamt statt.
**

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

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



RE: [GENERAL] pg_dump failure: handler procedure for language plpgsql not foun d

2001-04-24 Thread Jeff Eckermann

Tom,
Absolutely right!  I suppose I could have figured that out if I had spent
three days looking at it :-)
I didn't find anything in the docs about assigning a sysid to a new user, so
I just did a createuser and an UPDATE to pg_shadow to reset the sysid.
If that is likely to cause a problem, please let me know.  In any case,
pg_dump is now working for me.
Thank you once again for your valuable help.
Regards

 -Original Message-
 From: Tom Lane [SMTP:[EMAIL PROTECTED]]
 Sent: Monday, April 23, 2001 6:23 PM
 To:   Jeff Eckermann
 Cc:   '[EMAIL PROTECTED]'
 Subject:  Re: [GENERAL] pg_dump failure: handler procedure for
 language plpgsql not foun d 
 
 Jeff Eckermann [EMAIL PROTECTED] writes:
  I am attempting to do a pg_dump, preparing to upgrade to 7.1.
  I have attempted a pg_dumpall, as well as pg_dump for various individual
  databases, and each fails with the message dumpProcLangs(): handler
  procedure for language plpgsql not found
 
 Hmm, does plpgsql_call_handler's proowner appear in pg_shadow?  If not,
 add a user with the correct sysid...
 
   regards, tom lane

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

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



[GENERAL] IBM to buy Informix

2001-04-24 Thread Bruce Momjian

IBM to buy Informix:

   http://news.cnet.com/news/0-1003-200-5705678.html?tag=st.it.9500.lthd

-- 
  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 5: Have you checked our extensive FAQ?

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



[GENERAL] Problem with postgreSQL (number of backends)

2001-04-24 Thread Konstantin Borchert

Hi,

i have problems with PostgreSQL 7.0.3 on a RedHat 6.2 System. Very often 
postgresql post me the following warning and error message.


Warning: Unable to connect to PostgreSQL server: Sorry, too many clients 
already in /home/server/... 
PostgreSQL said: Unable to connect to server


It seems to be a problem with buffers and backends. So i have restart the 
postmaster with the parameters /usr/bin/postmaster -N 256 -B 512  ... (i 
put these parameters in the file postmaster.opts in the postgresql data 
folder).But it seems to have no effect. The problem still exist.

I need help

thx 


Konstantin

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