pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: tom.kemp@philips.com
To: pgsql-php@postgresql.org
Subject: apache-php-postgresql connection question
Date: Thu, 31 Jan 2002 12:11:24 -0700
Message-ID: <OFF4D46284.400DEEEC-ON86256B52.005FF5D3@diamond.philips.com> (raw)

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





view thread (5+ messages)  latest in thread

Message-ID: <OFF4D46284.400DEEEC-ON86256B52.005FF5D3@diamond.philips.com>
Permalink:  ../OFF4D46284.400DEEEC-ON86256B52.005FF5D3@diamond.philips.com/
Also on:    postgresql.org/message-id/OFF4D46284.400DEEEC-ON86256B52.005FF5D3@diamond.philips.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: tom.kemp@philips.com
  Subject: Re: apache-php-postgresql connection question
  In-Reply-To: <OFF4D46284.400DEEEC-ON86256B52.005FF5D3@diamond.philips.com>
  References: <OFF4D46284.400DEEEC-ON86256B52.005FF5D3@diamond.philips.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox