apache-php-postgresql connection question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi,

I am new to apache, php, and postgresql.  I had been tasked with creating a database for use in my work environment, accessible via web browsers.  I read up on SQL, postgresql and mysql and chose postgresql.  I  have the database built and rebuildable via
sql script for postgresql implementation.  I am being pushed to rewrite this and use MySQL by my IT department.  I don't want to use MySQL, based on some advantages I have seen during comparison research and the expected future size and complexity 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 user connection
and views become irrelevant in regard to permissions.  My knowledge/expectation based on reading books was that I could use the 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 a php script, and have the connect be based on the security of the database permissions.  Is this not true?  Can I not do this 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 creating a new persistent connection, right?  Well, does it only reuse the already connected persistent if it is the same user?  How does
this work?  Does it check that it is the same user/password (does my script have to supply this in the second persistent connection function) prior to using the preexisting connection? Is it tied to the current browser request?

Thanks in advance for your time and help!

Tom




[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux