Re: [GENERAL] connection fails

2001-09-21 Thread Nick Fankhauser

I'm not a PHP-er, but I notice that a difference between the script that
works & the one that doesn't is the "host=... portion. Could it be that
phpPgAdmin & the script that works do *not* use tcpip to connect & while the
failing script does?

If so, the message you got also contains the answer- you need to turn the
tcpip_socket on in the .conf file, or change the first script to not specify
a host.

-Nick

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> [EMAIL PROTECTED]
> Sent: Friday, September 21, 2001 2:25 PM
> To: [EMAIL PROTECTED]
> Subject: [GENERAL] connection fails
>
>
> Hello,
>
> I\'m trying to connect using an extremely simple php script:
>
> $conn = pg_Connect(\"host=localhost dbname=db name user=postgres
> password=postgres\");
>
> if ($conn) { echo \"ok\"; }
> else { echo \"failed\"; }
>
> I get this error message:
>
> Warning: Unable to connect to PostgreSQL server: connectDBStart()
> -- connect() failed: Connection refused Is the postmaster running
> (with -i) at \'localhost\' and accepting connections on TCP/IP
> port 5432? in /var/www/sts.twcable.com/launch_plan/test/c.php on line 3
> failed
>
> I also tried to work from the command line and get similar error messages.
> The weird thing is that phpPgAdmin is working fine and this script works:
>
>  $database = pg_Connect (\"dbname=dbname\");
>  pg_exec ($database, \"begin\");
>  $oid = pg_locreate ($database);
>  echo (\"$oid\\n\");
>  $handle = pg_loopen ($database, $oid, \"w\");
>  echo (\"$handle\\n\");
>  pg_lowrite ($handle, \"gaga\");
>  pg_loclose ($handle);
>  pg_exec ($database, \"commit\");
>
> [script coming from php.net]
>
> Any ideas??
>
> thnx!
> /paula
>
>
> 
> :: www.nervemail.net :: free access to POP3 accounts
>
>
> ---(end of broadcast)---
> TIP 4: Don't 'kill -9' the postmaster
>


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



[GENERAL] connection fails

2001-09-21 Thread paula

Hello,

I\'m trying to connect using an extremely simple php script:

$conn = pg_Connect(\"host=localhost dbname=db name user=postgres password=postgres\");

if ($conn) { echo \"ok\"; }
else { echo \"failed\"; }

I get this error message:

Warning: Unable to connect to PostgreSQL server: connectDBStart() -- connect() failed: 
Connection refused Is the postmaster running (with -i) at \'localhost\' and accepting 
connections on TCP/IP port 5432? in /var/www/sts.twcable.com/launch_plan/test/c.php on 
line 3
failed

I also tried to work from the command line and get similar error messages.
The weird thing is that phpPgAdmin is working fine and this script works:

 $database = pg_Connect (\"dbname=dbname\");
 pg_exec ($database, \"begin\");
 $oid = pg_locreate ($database);
 echo (\"$oid\\n\");
 $handle = pg_loopen ($database, $oid, \"w\");
 echo (\"$handle\\n\");
 pg_lowrite ($handle, \"gaga\");
 pg_loclose ($handle);
 pg_exec ($database, \"commit\");

[script coming from php.net]

Any ideas??

thnx!
/paula



:: www.nervemail.net :: free access to POP3 accounts


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



Re: [GENERAL] Postgres 7.1.3 on OpenBSD 2.9?

2001-09-21 Thread Keary Suska

It looks like there is something amiss with your installed readline
libraries. Are they GNU readline? If not, you may need to install the GNU
version. I don't recall of PG expects it precisely, and I cant say if
installing GNU will break other programs.

Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"

> From: Pete Leonard <[EMAIL PROTECTED]>
> Date: Fri, 21 Sep 2001 09:46:54 -0700 (PDT)
> To: [EMAIL PROTECTED]
> Subject: [GENERAL] Postgres 7.1.3 on OpenBSD 2.9?
> 
> 
> Has anyone out there succeeded in installing Postgres 7.1.3 on an
> x86-based OpenBSD 2.9 install?
> 
> My setup - 
> 
> x86 OpenBSD 2.9, out-of-the-box (no patches).
> 
> Unpacked the Postgres 7.1.3 tarball.  Configure, make, make check all
> pass.  Installed cleanly.  Updated /var/run/ld.so.hints to include
> /usr/local/pgsql/lib.
> 
> initdb -D /usr/local/pgsql/data/ ran fine.
> database started up without complaint.
> createdb test was fine.
> 
> Attempting to log into the database with pgsql died as follows:
> 
> bash-2.05$ /usr/local/pgsql/bin/psql test
> Welcome to psql, the PostgreSQL interactive terminal.
> 
> Type:  \copyright for distribution terms
> \h for help with SQL commands
> \? for help on internal slash commands
> \g or terminate with semicolon to execute query
> \q to quit
> 
> /usr/libexec/ld.so: Undefined symbol "_tgetent" called from
> psql:/usr/lib/libreadline.so.0.0 at 0x40165964
> pq_recvbuf: unexpected EOF on client connection
> 
> 
> Any suggestions?  There's nothing in the documentation that suggests
> special settings for installing on OpenBSD.  If there's any additional
> information I can provide, please let me know.
> 
> thanks,
> 
> --peter
> 
> 
> 
> ---(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
> 


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



Re: [GENERAL] Postgres 7.1.3 on OpenBSD 2.9?

2001-09-21 Thread bpalmer

>
> Has anyone out there succeeded in installing Postgres 7.1.3 on an
> x86-based OpenBSD 2.9 install?

Did ya try the ports tree?  7.1.3 is in it if you are tracking
2.9-current.  Else,  let me know and I can make the the tarball available
for 2.9-release.

- Brandon


 c: 646-456-5455h: 201-798-4983
 b. palmer,  [EMAIL PROTECTED]   pgp:crimelabs.net/bpalmer.pgp5


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

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



[GENERAL] Recursive queries

2001-09-21 Thread Juan Jose Comellas

I have a database with the following fields: 

product_id  INTEGER
parent_id   INTEGER
nameVARCHAR(64) 

The idea is that it will store a tree of products and its subproducts. Any 
row whose parent_id is NULL will be assumed to be a root product (i.e. top 
level). 

This means I will need to process recursively, with some sort of reference to 
parent_id passing through layers of recursion. 

However, I want to save on database queries and do a "SELECT *", then fetch 
each row on the results recursively, to build the tree. The idea is to only 
have to do one db query. 

Does anyone have any idea how this can be done in PostgreSQL? Both Oracle and 
DB2 support this with their own proprietary syntax.

 
-- 
Juan Jose Comellas
([EMAIL PROTECTED])

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



[GENERAL] Postgres 7.1.3 on OpenBSD 2.9?

2001-09-21 Thread Pete Leonard


Has anyone out there succeeded in installing Postgres 7.1.3 on an
x86-based OpenBSD 2.9 install?

My setup - 

x86 OpenBSD 2.9, out-of-the-box (no patches).

Unpacked the Postgres 7.1.3 tarball.  Configure, make, make check all
pass.  Installed cleanly.  Updated /var/run/ld.so.hints to include
/usr/local/pgsql/lib.

initdb -D /usr/local/pgsql/data/ ran fine.
database started up without complaint.
createdb test was fine.

Attempting to log into the database with pgsql died as follows:

bash-2.05$ /usr/local/pgsql/bin/psql test
Welcome to psql, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
   \h for help with SQL commands
   \? for help on internal slash commands
   \g or terminate with semicolon to execute query
   \q to quit

/usr/libexec/ld.so: Undefined symbol "_tgetent" called from
psql:/usr/lib/libreadline.so.0.0 at 0x40165964
pq_recvbuf: unexpected EOF on client connection


Any suggestions?  There's nothing in the documentation that suggests
special settings for installing on OpenBSD.  If there's any additional
information I can provide, please let me know.

thanks,

--peter



---(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] Problem: Failed Make on Linux Pgres v. 7.1.2

2001-09-21 Thread Doug McNaught

R Talbot <[EMAIL PROTECTED]> writes:

> First is there a great need to move to v. 7.1.2?
> What advantages are offred?

7.1.x has a lot of enhancements, including outer joins, write-ahead
logging (WAL) for better performance, enhancements to PL/pgSQL and
much more.

> Below are my results ... PLease advise
> 
> Postgresql 7.1.2 make errors
> 
> /usr/lib/gcc-lib/i386-linux/egcs-2.91.66/crtendS.o: In function
> `init_dummy':
> /usr/lib/gcc-lib/i386-linux/egcs-2.91.66/crtendS.o(.text+0x53):
> undefined reference to
> `___brk_addr'

This looks like your build environmemt is all messed up.  Are you
actually able to compile C programs on this system with this compiler?

-Doug
-- 
In a world of steel-eyed death, and men who are fighting to be warm,
Come in, she said, I'll give you shelter from the storm.-Dylan

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



Re: [GENERAL] [HACKERS] psql and security

2001-09-21 Thread Tom Lane

"Colin 't Hart" <[EMAIL PROTECTED]> writes:
> Does postgres have a concept of a 'root' user? Then the password should
> only be prompted when one isn't root; ie. adopt Unix semantics.

Can't really do that in psql's \c, since it's establishing a whole new
connection; there is no possibility for superuserness on the old
connection to provide any relaxation of the check.

However, see SET SESSION AUTHORIZATION, which does what you're thinking
of within the context of a single connection.

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] [HACKERS] psql and security

2001-09-21 Thread Colin 't Hart

Tatsuo Ishii:

> As you can see, psql reconnect as any user if the password is same as
> foo. Of course this is due to the careless password setting, but I
> think it's better to prompt ANY TIME the user tries to switch to
> another user. Comments?

Does postgres have a concept of a 'root' user? Then the password should
only be prompted when one isn't root; ie. adopt Unix semantics.


Cheers,

Colin



---(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] Hardware tuning (Was: Performance question)

2001-09-21 Thread Tille, Andreas

On Fri, 21 Sep 2001, Justin Clift wrote:

> Hi Andreas,
>
> I'm running PostgreSQL 7.1.3 here on a PC with nearly a gig of ram, and
> running Linux Mandrake 8.0
>
> First thing I did was to increase the amount of shared memory and stuff
> which Linux allows things to use :
>
> echo "kernel.shmall = 134217728" >> /etc/sysctl.conf
> echo "kernel.shmmax = 134217728" >> /etc/sysctl.conf
>
> For my system, that'll raise the shared memory limits to 128MB at system
> boot time.
>
> btw, the "134217728" figure = 128MB  (128 * 1024 * 1024)
>
> Then I changed the limits for the running system (so no reboot is
> necessary) :
>
> echo 134217728 > /proc/sys/kernel/shmall
> echo 134217728 > /proc/sys/kernel/shmmax
>
> Then adjusted the postgresql.conf file with these values :
>
> sort_mem = 32768
> shared_buffers = 220
>
> Now, that's a bunch of shared_buffers, but at the same time I also
> raised the max_connections to 110.
220 is much less than I have set before I posted my stats yesterday.
I have set it to 2048.  But adjusting
   kernel.shmall = 134217728
   kernel.shmmax = 134217728
gave me a speed up by nearly factor 2!  That could be a nice start
for further increasing of memory. (Well, that machine has 2GB ;-) ... )

> This seems to have dropped my execution times, but I haven't seriously
> gotten around to tuning this system.
So yes, it has dropped my execution times from 20 times slower than
MS-SQL to 10 times slower, i.e. I have to continue tuning my setup.

> The key thing I think you've missed is to update the shared memory,
> etc.  More info about it can be found at :
>
> http://www.postgresql.org/idocs/index.php?kernel-resources.html
>
> Bruce Momjian also put together some information about optimising things
> with PostgreSQL at :
>
> http://www.ca.postgresql.org/docs/hw_performance/
I´ve read both documents now and see no other parameter to adjust than
shared_buffers.  I have to admit that I´m not really sure if this
parameter is responsible for the term "cache size" on page
   http://www.ca.postgresql.org/docs/hw_performance/node8.html
(I would consider it to be helpfull if the relevant parameter would
be mentioned in the text, Bruce.)

I just post the parameters I changed on my system and the results I´ve got:

/etc/sysctl.conf
  kernel.shmall = 134217728
  kernel.shmmax = 134217728
  fs.file-max = 16384

/etc/postgresql/postgresql.conf:
  max_connections = 256
  shared_buffers  = 2048
  sort_mem= 32768

This setup gave me a speed increase from 56s to 33s for a certain query
(the one which took the M$-SQL server 2.5s).

Now I tried to increase
  sort_mem= 32768
  shared_buffers  = 4096

and got no real speed difference but I noticed an improved memory usage by
top.  So I continued increasing shared_buffers by doubling the size step
by step.  To enable a certain amount of shared_buffers I also had to adjust
kernel.shmall and kernel.shmmax (I got errors otherwise).

Here I post some parameter settings and corresponding memory usage
measured by top and times for the query:

kernel.shmall = 536870912
kernel.shmmax = 536870912

shared_buffers = 32768

  PID USER PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME COMMAND
  769 postgres  16   0 78372  76M 52916 R99.9  7.6   0:23 postmaster

real0m33.591s
user0m0.190s
sys 0m0.040s


kernel.shmall = 1073741824
kernel.shmmax = 1073741824

shared_buffers = 65536

  PID USER PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME COMMAND
  865 postgres  17   0 80332  78M 54836 R99.9  7.7   0:20 postmaster

real0m32.861s
user0m0.200s
sys 0m0.010s


kernel.shmall = 2147483648
kernel.shmmax = 2147483648

shared_buffers = 131072

  PID USER PRI  NI  SIZE  RSS SHARE STAT %CPU %MEM   TIME COMMAND
 1172 postgres  18   0 86572  84M 60748 R99.9  8.3   0:22 postmaster

7.1.3: (I also tried PostgreSQL 7.1.3 all other values for 7.1.2)
 2644 postgres  17   0 87088  84M 61264 R99.9  8.4   0:29 postmaster

set enable_seqscan = off;  (quite the same speed but other mem-usage)
 1205 postgres  18   0 85500  83M 59676 R99.9  8.2   0:22 postmaster

7.1.3:
 2631 postgres  15   0 81972  79M 56148 R99.9  7.9   0:28 postmaster

real0m32.835s
user0m0.210s
sys 0m0.050s

I noticed no real difference in speed in all this tests but I observed
an increased need of memory usage.  There was no difference in query
speed if I enabled or disabled index scan and between PostgreSQL version
7.1.2 and 7.1.3.

Furthermore I wonder about the following fact:  I see no real difference
in speed if I start the query immediately after restarting postmaster
and redoing the same query.  In my opinion the first query should fill
the relevant tables into memory cache which should take some time but the
second query should be faster because the cache is just filled.

So I wonder if it makes sense if I continue increasing those values
until I observe this difference or if I don´t see any increase in
memory usage by top.  I think I could sp

[GENERAL] Does postgresql use /tmp?

2001-09-21 Thread Lincoln Yeoh

I'm wondering how much space to allocate to my /tmp partition. 

Are the sort files still placed in the database directory? e.g.
/var/pgsql/data/base/123144/

Does postgresql use much space on /tmp? 

Thanks,
Link.


---(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] Problem: Failed Make on Linux Pgres v. 7.1.2

2001-09-21 Thread R Talbot

Help.. I had been running my compiled source v. 7.0.3 this compiled and
runs fine..
First is there a great need to move to v. 7.1.2?
What advantages are offred?
I had one success and two failures on Make .
DUe to either the  libc difference or GNU Make difference
If I am right is it worth the trouble to upgrade the libc..
I haven't done that chore in years and can't remember how???

Below are my results ... PLease advise

 Failed MAKE  Installed
Caldera linux 2.3 kernal 2.2.10  Caldera linux 2.4 kernal 2.2.13
libc-2.1.1.so   ld-2.1.1.so   vs.libc-2.2.2.so ld-2.1.2.so
GNU make 3.77 vs GNU Make   3.78.1

Postgresql 7.1.2 make errors

/usr/lib/gcc-lib/i386-linux/egcs-2.91.66/crtendS.o: In function
`init_dummy':
/usr/lib/gcc-lib/i386-linux/egcs-2.91.66/crtendS.o(.text+0x53):
undefined reference to
`___brk_addr'
make[3]: *** [libpsqlodbc.so.0.26] Error 1
make[3]: Leaving directory
`/usr/src/OpenLinux/SOURCES/postgresql-7.1.2/src/interfaces/odbc'
make[2]: *** [all] Error 2
make[2]: Leaving directory
`/usr/src/OpenLinux/SOURCES/postgresql-7.1.2/src/interfaces'
make[1]: *** [all] Error 2
make[1]: Leaving directory
`/usr/src/OpenLinux/SOURCES/postgresql-7.1.2/src'
make: *** [all] Error 2
[root postgresql-7.1.2]#
libc-2.1.1.so   ld-2.1.1.so   vs. 2.1.2.so
and GNU make 3.77  vs  3.78.1


Bob T


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

http://archives.postgresql.org