473,396 Members | 1,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Best PostgreSQL Install Practices

The PHP web app that I'm building uses PostgreSQL. Of course it won't
work right off the bat, so my web app is going to have to detect that
it has never been configured with a database and have to instruct the
sysop on what to do. What are developers in the PHP industry doing with
their installers to ensure everything with PostgreSQL is going to work
out right?

In particular I'm going to want the web app to have a local database
(by default), although a remote one is an option. The web app will
require a username and password to reach the database. What pg_hba.conf
configuration would you recommend most highly for new installations?

Jan 6 '07 #1
4 1956
Alfred wrote:
The PHP web app that I'm building uses PostgreSQL. Of course it won't
work right off the bat, so my web app is going to have to detect that
it has never been configured with a database and have to instruct the
sysop on what to do. What are developers in the PHP industry doing with
their installers to ensure everything with PostgreSQL is going to work
out right?
Just describe clearly what users on the database are made and what their
rights should be.
Maybe add some tutorial with commands for GRANT or something.
Then let the guy that installs the database read that document.

Also add a SQL-script that creates the tables/relations/etc.
Do not make a binary dump, but the text-SQL variant, so people can actually
read what tables are created.

You do not want to make a seperate installer for Postgresql, are you?

>
In particular I'm going to want the web app to have a local database
(by default), although a remote one is an option. The web app will
require a username and password to reach the database. What pg_hba.conf
configuration would you recommend most highly for new installations?
Well, the pg_hba.conf is a file that should be maintained by the sysop.
So just mention WHICH users should be added with what rights.
Maybe suggest the lines to add to pg_hba.conf.

For security, do not allow others on the same machine (trust-setting) to
connect to your database. The 'fallthrough' approach is used in
postgresql's pg_hba.conf, so you must explicity say that other cannot
connect if you have a few users in the environment.
To make this sure, add a 'reject' as last line for your listed allowed
connections to your database.

Good luck, and wise choice (Postgres). :-)

Regards,
Erwin Moller
Jan 8 '07 #2
Erwin Moller, thanks for your opinion. That's pretty much how I was
going to do it:

1. Provide DB's CREATEDB and GRANT statements for the user account used
by the web app.

2. Suggest the pg_hba.conf changes for the sysop, and try to prohibit
anything connecting to my web app except the ID specified, and only
from the IP address of where the web app is hosted.

3. Generate a SQL script to load the default database tables.
I was going to have the web app detect it's not installed by default
and start to display a wizard-like set of screens that describe the
process of setting the application up in really user-friendly terms.

Jan 8 '07 #3
Alfred wrote:
Erwin Moller, thanks for your opinion. That's pretty much how I was
going to do it:

1. Provide DB's CREATEDB and GRANT statements for the user account used
by the web app.

2. Suggest the pg_hba.conf changes for the sysop, and try to prohibit
anything connecting to my web app except the ID specified, and only
from the IP address of where the web app is hosted.

3. Generate a SQL script to load the default database tables.
I was going to have the web app detect it's not installed by default
and start to display a wizard-like set of screens that describe the
process of setting the application up in really user-friendly terms.
Sounds good. :-)

Good luck!

Regards,
Erwin Moller
Jan 9 '07 #4
BTW, Erwin Moller (and others), a friend sent me these links on how to
optimize postgresql.conf for more speed. By default this is usually
tuned way back on most Linux distros. These hyperlinks should be good
information for PHP programmers who use PostgreSQL.

http://www.varlena.com/varlena/Gener...bits/perf.html

http://www.powerpostgresql.com/Downl...d_conf_80.html

Jan 10 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: great_googley_moogley | last post by:
Greetings, I am in the process of installing a SQL database at a customer location. I have determined that there are 3 ways to do this, and I wanted to know which is the best of the 3. 1...
11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
2
by: Krish | last post by:
hi all, i'm wondering if there are any best practices for distributing apps which require the .net framework to run. i've read about using the .net bootstrapper which will install the .net...
0
by: David Helgason | last post by:
I think those best practices threads are a treat to follow (might even consider archiving some of them in a sort of best-practices faq), so here's one more. In coding an game asset server I want...
1
by: phil campaigne | last post by:
Tom Lane wrote: > phil campaigne <pcampaigne@charter.net> writes: > > >> when I login to linux and check the env's I see: >>...
4
by: Collin Peters | last post by:
I have searched the Internet... but haven't found much relating to this. I am wondering on what the best practices are for migrating a developmemnt database to a release database. Here is the...
2
by: SmoothJazz | last post by:
Hi All! I am wanting to setup/run PostgreSQL on my server (a SuSE Linux 9.2 distro) but I'm not quite sure which way to go. I have a few books on PostgreSQL but they don't seem to match the...
2
by: sabbadin12 | last post by:
Hi, I'm going to work on an application that uses a postgreSQL database so that it can uses SQLServer 2005. I think I solved most problems on the programming side, but I still have some doubts...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.