Thread: another stupid question: Database is being accessed by other users
sorry for asking again, because i could solve this problem on my own if i had enough time to check things. i collect all my sql command and do #!/bin/sh dropdb kontaktdaten createdb kontaktdaten cat sql_commands | psql kontaktdaten and often i get ERROR: DROP DATABASE: Database "kontaktdaten" is being accessed by other users if i do a ' ps ax | grep post ' i see some processes which are idle 2572 pts/6 S 0:00 /usr/bin/postgres localhost wwwrun kontaktdaten idle i always call pg_Close in my php scripts. Why are there still some processes and how can i achieve to drop the database?? thanks in advance for any help or suggestions janning
Janning Vygen wrote: > sorry for asking again, because i could solve this problem on my own if i had > enough time to check things. > > i collect all my sql command and do > #!/bin/sh > dropdb kontaktdaten > createdb kontaktdaten > cat sql_commands | psql kontaktdaten > > and often i get > > ERROR: DROP DATABASE: Database "kontaktdaten" is being accessed by other > users > > if i do a ' ps ax | grep post ' i see some processes which are idle > 2572 pts/6 S 0:00 /usr/bin/postgres localhost wwwrun kontaktdaten idle > > i always call pg_Close in my php scripts. Why are there still some processes > and how can i achieve to drop the database?? Maybe, but you're using pg_pconnect() instead of pg_connect(), turning pg_close() effectively into a NOOP. Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com # _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
Am Freitag, 29. Juni 2001 19:15 schrieb Jan Wieck: > Janning Vygen wrote: > > i always call pg_Close in my php scripts. Why are there still some > > processes and how can i achieve to drop the database?? > > Maybe, but you're using pg_pconnect() instead of > pg_connect(), turning pg_close() effectively into a NOOP. i Love you!! Thanks a lot. janning
Janning Vygen wrote: > Am Freitag, 29. Juni 2001 19:15 schrieb Jan Wieck: > > Janning Vygen wrote: > > > > i always call pg_Close in my php scripts. Why are there still some > > > processes and how can i achieve to drop the database?? > > > > Maybe, but you're using pg_pconnect() instead of > > pg_connect(), turning pg_close() effectively into a NOOP. > > > i Love you!! > Thanks a lot. You're welcome. I usually have some error code checking wrappers around all DB access, that spit out some nice error page instead of messing up the regular one. So if possible, all the PHP logic placed before the <html> tag. Doing so has the advantage that it's easy to switch between persistent connections in production/test and one-time connections in development, by just editing one include file. Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com # _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com