473,770 Members | 5,842 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DBs and Schemas

I'm looking for some input on a configuration I'm implementing. The long
term goal is to providing hosting for companies and organizations with a
basic/generic set of applications that use PostgreSQL.

Most of these applications want to be installed in their own database.
Given I'm looking at 6 or so already this would be 6+ databases per
company. Not my idea of an easy to admin situation.

My plan is to make one database (per company/organization) and modify the
installation scripts and the applications so they end up in and using
different schemas (probably named the same as the database would have been
named.)

I currently see see several issues.

1. Modifying the applications to use schemas instead of connecting to
specific databases. Getting the authors to use schemas so I do it
once.

2. PostgreSQL usernames are global to the instance (?) not specific to the
database which means each username has to/should include a grouping
type of prefix/postfix identifier. I think this is so. Please tell me
I'm wrong!

3. Isolation of users in a database from other users of another database.
(Grants, groups, etc.) Just making sure I do it and not cutting them
off from system stuff they need.

And several more, I'm sure.

Most of the reading I've done so far hasn't got into this very deep. (What
did I miss in this arena?) I have done this type of setup before many
years (10+) ago using Oracle but think there are significant differences
in their way and the PostgreSQL way.
TIA,
Rod
--
"Open Source Software - You usually get more than you pay for..."
"Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL"

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 12 '05 #1
7 1607
> 1. Modifying the applications to use schemas instead of connecting to
specific databases. Getting the authors to use schemas so I do it
once.
One thing I'd suggest would be to modify the application to issue a
"set search_path = yourschema;" at the beginning, then the rest of the
application wouldn't need to change. That's what I did when I did
something similar.

Adam Ruth

On Jan 6, 2004, at 12:39 PM, Roderick A. Anderson wrote:
I'm looking for some input on a configuration I'm implementing. The
long
term goal is to providing hosting for companies and organizations with
a
basic/generic set of applications that use PostgreSQL.

Most of these applications want to be installed in their own database.
Given I'm looking at 6 or so already this would be 6+ databases per
company. Not my idea of an easy to admin situation.

My plan is to make one database (per company/organization) and modify
the
installation scripts and the applications so they end up in and using
different schemas (probably named the same as the database would have
been
named.)

I currently see see several issues.

1. Modifying the applications to use schemas instead of connecting to
specific databases. Getting the authors to use schemas so I do it
once.

2. PostgreSQL usernames are global to the instance (?) not specific to
the
database which means each username has to/should include a grouping
type of prefix/postfix identifier. I think this is so. Please
tell me
I'm wrong!

3. Isolation of users in a database from other users of another
database.
(Grants, groups, etc.) Just making sure I do it and not cutting
them
off from system stuff they need.

And several more, I'm sure.

Most of the reading I've done so far hasn't got into this very deep.
(What
did I miss in this arena?) I have done this type of setup before many
years (10+) ago using Oracle but think there are significant
differences
in their way and the PostgreSQL way.
TIA,
Rod
--
"Open Source Software - You usually get more than you pay for..."
"Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL"

---------------------------(end of
broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddres sHere" to
ma*******@postg resql.org)

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 12 '05 #2
On Tue, 2004-01-06 at 22:06, Adam Ruth wrote:
1. Modifying the applications to use schemas instead of connecting to
specific databases. Getting the authors to use schemas so I do it
once.


One thing I'd suggest would be to modify the application to issue a
"set search_path = yourschema;" at the beginning, then the rest of the
application wouldn't need to change. That's what I did when I did
something similar.


You can use ALTER DATABASE to set that up permanently, without touching
the application.

--
Oliver Elphick Ol************@ lfix.co.uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
=============== =============== ==========
"Thou shalt not avenge, nor bear any grudge against the
children of thy people, but thou shalt love thy
neighbour as thyself. I am the LORD."
Leviticus 19:18
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postg resql.org

Nov 12 '05 #3
On Tue, 6 Jan 2004, Adam Ruth wrote:
One thing I'd suggest would be to modify the application to issue a
"set search_path = yourschema;" at the beginning, then the rest of the
application wouldn't need to change. That's what I did when I did
something similar.


Neat idea. I was thinking that most of the applications use a specific id
to access their database so I was going to do this at the user level
(alter user). I think it will depend on the specific application as to
how I'd do this.
Rod
--
"Open Source Software - You usually get more than you pay for..."
"Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL"

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #4
On Tue, 6 Jan 2004, Oliver Elphick wrote:
You can use ALTER DATABASE to set that up permanently, without touching
the application.


I'd thought of this but since there will be several applications installed
and some, I am sure, will have same-named tables this could back-fire.
Rod
--
"Open Source Software - You usually get more than you pay for..."
"Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL"

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 12 '05 #5
On Tue, Jan 06, 2004 at 03:34:21PM -0800, Roderick A. Anderson wrote:
On Tue, 6 Jan 2004, Oliver Elphick wrote:
You can use ALTER DATABASE to set that up permanently, without touching
the application.
I'd thought of this but since there will be several applications installed
and some, I am sure, will have same-named tables this could back-fire.


Are you actually going to be doing joins between these applications? If not,
why not setup multiple databases, then you can be sure they won't conflict.
--
Martijn van Oosterhout <kl*****@svana. org> http://svana.org/kleptog/ (... have gone from d-i being barely usable even by its developers
anywhere, to being about 20% done. Sweet. And the last 80% usually takes
20% of the time, too, right?) -- Anthony Towns, debian-devel-announce


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE/+0h2Y5Twig3Ge+Y RAgp2AJ9+Q/gyWsYXUvVaGk9YB 3dO6ccQxQCdErYb
PJiqSulNY6zprf+ nnMx3Fzc=
=EIyG
-----END PGP SIGNATURE-----

Nov 12 '05 #6

On Jan 6, 2004, at 3:27 PM, Oliver Elphick wrote:
On Tue, 2004-01-06 at 22:06, Adam Ruth wrote:
1. Modifying the applications to use schemas instead of connecting to
specific databases. Getting the authors to use schemas so I do it
once.


One thing I'd suggest would be to modify the application to issue a
"set search_path = yourschema;" at the beginning, then the rest of the
application wouldn't need to change. That's what I did when I did
something similar.


You can use ALTER DATABASE to set that up permanently, without touching
the application.


If you were combining several databases into one database with several
schemas, each application will use a different schema. Thus each
application would need to specify which schema it's using when starting
up.
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 12 '05 #7
On Wed, 7 Jan 2004, Martijn van Oosterhout wrote:
Are you actually going to be doing joins between these applications?
If not, why not setup multiple databases, then you can be sure they
won't conflict.


Well in at least one situation I can think of there will be joins. And
with a minimum of six applications for a company/organization that adds up
to quite a bit of admin work when there are several company/organizations.
Rod
--
"Open Source Software - You usually get more than you pay for..."
"Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL"

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postg resql.org

Nov 12 '05 #8

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

Similar topics

0
1426
by: kyancy | last post by:
Hello All. We have several XML schemas to describe common component document parts. We then create new XML schemas as necessary that use "xsd:import schemaLocation=whateverLocation.." to include the common type definitions from 1 or more of the component XML schemas rather than just explicitly adding the common definitions in every XML schema we create. This works great from a definition and validation point of view, but I
30
9853
by: btober | last post by:
Whenever I create a temporary table, with something like CREATE TEMPORARY TABLE temptable1 AS SELECT * FROM paid.ad_hoc_query; New schemas appear, with names like "pg_temp_1". I guess the appearance of these schemas with "temp" in the name indicates that they are "temporary" schemas and related to the temporary table creation, but the schemas persist even after the end of the session in which the temporary table was created.
4
1693
by: anonymous | last post by:
When I use the schema collection to apply many schemas to one XML instance document, I get an error if I do not qualify every element with the appropriate namespace. Both the W3C site and this article (http://www.xfront.com/ZeroOneOrManyNamespaces.html) imply that I can submit an XML instance without having to qualify each element. How do I accomplish this while still using .Net & the
2
1285
by: John Jenkins | last post by:
Hi, I have a lot of schemas to load into a schema collection. I load them in by reading each one into a XMLTextReader from disk and add them into a schema collection. I have a couple of issues to contend with. 1. The targetnamespace on all the schemas (except ones which define generic types) are the same. 2. The DefaultNamespace is the same as the Targetnamespace (I think this should be ok) 3. Some of the schemas import other sschemas...
1
1585
by: CSN | last post by:
I have two machines between which I exchange dumps a lot. On the first (Windows/cygwin), pgsql was set up with "Administrator" as the main superuser - who owns all schemas in template0 and template1. On the second machine (Linux), "postgres" is pgsql's main superuser. On whatever machines I do "createdb", the owner of the schemas in template0/1 is copied over to the schemas in the new database, even when specifying the owner parameter...
6
3536
by: Dennis Gearon | last post by:
This post is as much about getting some questions answered as leaving the following definitions in the archives for the next person. After a quick perview of the web, I came up with the following: tablespaces are a hardware issue, and totally transparent to SQL execution. It is for optimization for IO, recovery, and separating user and application usage amongst disks even in the same databases. schemas are a logical issue, and NOT...
0
1905
by: Net Virtual Mailing Lists | last post by:
I've been spending the last few days converting many databases into a single schema and have completed the process, but now I'm at somewhat of an impasse as to the best way to proceed forward.... It is important for me to explain that each of these databases has a rather different structure, going forward I'm using more of an inheritance model for each new schema, but that was simply was not possible back in the day and I hope one day to...
3
4630
by: Sami Marzouki | last post by:
Hi, What I'm trying to do is: - To write a Web.config with custom sections. (Done) - To write a xsd schema for this custom sections.(Done) - Tell the Web.config to take the two schemas. When i specify the two schemas in the schemas property of the web.config, it seems that only one is token.
0
1838
by: vihrao | last post by:
I am designing wsdl that uses multiple schemas. I can do this in two ways: 1) use multiple schema imports in one wsdl or 2) use multiple schema imports in to one common schema and then import a single common schema in the wsdl. The issue is complicated because I have several wsdls with several common and unique schemas. As an example serviceA_Ports.wsdl imports a commonServiceTypes.Xml, commonFaultTypes.xml, and serviceA.xml ...
0
10225
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10053
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8880
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7415
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5312
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3969
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3573
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.