r4 - 11 Sep 2003 - 21:48:39 - BobKrzaczekYou are here: TWiki >  Help Web  > UsingDatabases
Tags:
create new tag
, view all tags
There are (will be) a number of PostgreSQL database servers running in the Center.

If you want to use one of the servers below, contact that server's admin for access.

Tools

Direct

Direct access to the PostgreSQL servers can be obtained with the PostgreSQL interactive terminal, via the psql command. Typically, you run it, giving the name of the database you want to work on. For example, assuming you had access to a database named obs, you might connect to a machine named SERVER with the following command. If you are logged onto the machine running the database server, you can omit the -h option and its hostname argument.
   psql -h SERVER.cis.rit.edu obs

If you don't want to supply the -h option and a servername every time, you can set the PGHOST environment variable to the name of the server you want to automatically connect to.

Assuming you have access to a given server, you can see what databases currently reside on it with the -l option to psql.

   psql -l -h chapman.cis.rit.edu

            List of databases
      Name    |  Owner   | Encoding  
   -----------+----------+-----------
    scratch   | krz      | SQL_ASCII
    template0 | postgres | SQL_ASCII
    template1 | postgres | SQL_ASCII
   (3 rows)

If you have the privilege to create new databases from your account, you can use the createdb command to do so. For example, to create a new database called obs, you could use the following.

   createdb obs

Direct SQL access is probably only useful to do in database maintenance; you should use one of the method below to actually use your databases. Further documentation on PostgreSQL can be found in the online documentation under /cis/doc/postgresql or on the 'net at http://www.postgresql.org/docs/

ODBC

Microsoft Access and other ODBC clients can be used to connect to the servers listed below.

ODBC support is forthcoming.

Perl

The Perl installation on the (new) Solaris filesystem supports access to PostgreSQL servers via the DBI (1.37) and DBD::Pg (1.21) modules. Currently, only chapman.cis.rit.edu mounts this new filesystem; you'll have to log in there to do your work. Typically, you should use a DSN that includes the server name, so that your scripts can be ported elsewhere in the future. For example, if your perl script accesses a database named obs running on chapman, you might use a DSN such as the following.
   dbi:Pg:dbname=obs;host=chapman.cis.rit.edu

Note: The version of perl referred to above is available as /cis/bin/perl. Do not use the perl installed locally on a workstation, typically /bin/perl or /usr/bin/perl. If you get errors about being unable to find the DBI module, for example, you're using the wrong perl. Ensure the first line of your perl scripts look like the following:

   #!/cis/bin/perl

PHP

PostgreSQL access from PHP web pages is directly supported when those pages are served from chapman. In the near future, the main and research web servers will also support direct access to PostgreSQL from PHP. Talk to BobKrzaczek if you need this functionality now.

JDBC

JDBC is supported on the new Solaris filesystems, but currently undocumented.

Servers

chapman

This is a temporary server. It will eventually be migrated to titan in the future.

The database server on chapman serves the DIRS and LIAS research groups.

Name chapman.cis.rit.edu
Type PostgreSQL 7.3.3
Admin BobKrzaczek
Port 5432
Space 7 GB, more or less
Access only within CIS networks (Buildings 18 and 76)

saturn

This database server is intended for general, non-research CIS use. We don't intend to exclude research groups from using this server, it's just that each group typically has its own larger filesystem elsewhere in the Center, and connecting to a server dedicated to a research group will typically give you more space to work with.

TBD.

titan

This one serves the DIRS and LIAS research groups. It is not online yet.

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r4 < r3 < r2 < r1 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback