apache-php-postgresql connection question - Mailing list pgsql-php

From tom.kemp@philips.com
Subject apache-php-postgresql connection question
Date
Msg-id OFF4D46284.400DEEEC-ON86256B52.005FF5D3@diamond.philips.com
Whole thread Raw
List pgsql-php
Hi,

I am new to apache, php, and postgresql.  I had been tasked with creating a database for use in my work environment,
accessiblevia web browsers.  I read up on SQL, postgresql and mysql and chose postgresql.  I  have the database built
andrebuildable via 
sql script for postgresql implementation.  I am being pushed to rewrite this and use MySQL by my IT department.  I
don'twant to use MySQL, based on some advantages I have seen during comparison research and the expected future size
andcomplexity of the 
database.  Some advantages that I am using are views, subqueries, triggers and foreign keys.

I have had to try to justify Postgresql ( IT Department).  One advantage that I planned to make good use of is views.
However,I am being told that if I use web access through apache to PHP to my postgresql server, I am opening a single
userconnection 
and views become irrelevant in regard to permissions.  My knowledge/expectation based on reading books was that I could
usethe database view permissions I set up for in postgresql for a go/no-go on database use of the views via apache
server-> php 
engine -> connection request to postgresql server.

I am a bit confused now.  My understanding was I could use the pg_connect() command, supplying username and password in
aphp script, and have the connect be based on the security of the database permissions.  Is this not true?  Can I not
dothis for each 
browser based request?

Also, if I do a persistent connection, it appears that PHP will try to use this connection if it exists, prior to
creatinga new persistent connection, right?  Well, does it only reuse the already connected persistent if it is the
sameuser?  How does 
this work?  Does it check that it is the same user/password (does my script have to supply this in the second
persistentconnection function) prior to using the preexisting connection? Is it tied to the current browser request? 

Thanks in advance for your time and help!

Tom



pgsql-php by date:

Previous
From: "Josh Berkus"
Date:
Subject: Re: keyword search help
Next
From: Marco Colombo
Date:
Subject: Re: pg_pconnect - ??