Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] Connecting to dB's: default dB names and schema use

hey all,

two questions about connecting to databases:

1) Do all DBMS's have some default dB (aka Cluster/ Catalog) readable by
all users?

The uDig postgis connection system needs the name of a database to make
an initial connection from which it gets a list of databases to offer
the user. Hence, it currently connects to the default "template1" and
then executes the sql query 
  "SELECT datname from pg_database ORDER BY datname"
to get the list of databases.

Does an equivalent strategy work with every database system we will
access through JDBC? That is, can every user always connect to some
default database and then get a list of database names from there?

I need to understand this to see how to design the event system for the
GenericWizardPage that gets reused by both PostgisPage and
AbstractPageForNonFreeDatabases.


2) What's with schema?

Currently the uDig postgis connection dialog goes through great lengths
to present the user with a name of schema and then decides not to use
any of it in the connection system. I can't tell from the code what is
supposed to happen when we will support schema.

Specifically, I don't understand the relation between dB and schema. A
user connecting to a DBMS has to connect to a particular dB. Does schema
work only to constrain the connection beyond this dB? Can I assume that
every schema is a 'child' of some dB and that each dB has one or more
schema? This seems to be what is going on so a connection to a dB can
specify a schema which will restrict the way of looking at the tables.

Does each dB always have a default schema equivalent to the 'public'
schema on Postgresql that uDig current shows? 

As I understand things (badly) schema can be umbrellas over several
tables, stored procedures, etc. What's the relation between the list of
schema and the list of dB's (clusters/catalogs)? One source seemed to
suggest that schema can integrate data from several dB's. I presume, if
this is true, that the user can still connect to a single dB, using that
particular schema and execute all the queries against that original dB.

Thanks for any explanations or pointers to documents.
--adrian



Back to the top