Commit e0852543 authored by Bruce Momjian's avatar Bruce Momjian

Add 0.98.

parent dbdb80ba
---------------------------------------------------------------------------
Copyright (c) 1994-7 Regents of the University of California
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose, without fee, and without a written agreement
is hereby granted, provided that the above copyright notice and this
paragraph and the following two paragraphs appear in all copies.
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
---------------------------------------------------------------------------
PGACCESS 0.98 29 August 1999
================================
I dedicate this program to my little daughters Ana-Maria and Emilia and to my
wife for their understanding. I hope they will forgive me for spending so many
time far from them.
1. How to INSTALL ?
You will need a Tcl/Tk package, at least Tcl 7.6 and Tk 4.2, recommended
Tcl/Tk 8.x
For Unix users, unpack the pgaccess-xxx.tar.gz archieve in you preferred
directory (usually /usr/local).
Check where your "wish" program is and modify (if needed) the file
/usr/local/pgaccess/pgaccess and set variables PGACCESS_HOME and
PATH_TO_WISH to the appropriate directories.
Include the /usr/local/pgaccess directory into your PATH or make a
symbolic link to it wherever you want (in PATH directories).
Example:
$ ln -s /usr/local/pgaccess/pgaccess /usr/bin/pgaccess
You will find also some documentation and FAQ in the doc directory.
2. Usage
You run it with the command:
pgaccess [database]
[database] is optional.
3. Bug reporting
First of all : operating system, PostgreSQL version,Tcl/Tk version.
A more detailed story of what have you done when error occurred.
Tcl/Tk stops usually with a error message and there is a button there
"Stack Trace" and if you press it, you will see a detailed information
about the procedure containing the error. Please send it to me.
Some information about table structure, no. of fields, records would
be also good.
===========================================================================
You would find always the latest version at http://www.flex.ro/pgaccess
Please feel free to e-mail me with any suggestion or bug description
that will help to improve it.
Constantin Teodorescu <teo@flex.ro>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="GENERATOR" CONTENT="Mozilla/4.03 [en] (X11; I; Linux 2.0.30 i586) [Netscape]">
<TITLE>PgAccess - Copyright notice</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<TT>---------------------------------------------------------------------------</TT>
<BR><TT></TT>&nbsp;
<BR><TT></TT>&nbsp;<TT></TT>
<P><TT>Copyright (c) 1994-7 Regents of the University of California</TT><TT></TT>
<P><TT>Permission to use, copy, modify, and distribute this software and
its</TT>
<BR><TT>documentation for any purpose, without fee, and without a written
agreement</TT>
<BR><TT>is hereby granted, provided that the above copyright notice and
this</TT>
<BR><TT>paragraph and the following two paragraphs appear in all copies.</TT><TT></TT>
<P><TT>IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY
PARTY FOR</TT>
<BR><TT>DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
INCLUDING</TT>
<BR><TT>LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS</TT>
<BR><TT>DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED
OF THE</TT>
<BR><TT>POSSIBILITY OF SUCH DAMAGE.</TT><TT></TT>
<P><TT>THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,</TT>
<BR><TT>INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY</TT>
<BR><TT>AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER
IS</TT>
<BR><TT>ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS
TO</TT>
<BR><TT>PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.</TT>
</BODY>
</HTML>
This diff is collapsed.
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.61 [en] (X11; I; Linux 2.2.11 i586) [Netscape]">
</head>
<body bgcolor="#FEFEDF">
<h2>
PgAccess developer API</h2>
<hr>
<br>Starting with PgAccess 0.98 I am planning to make available a complete
API for the PgAccess developers. I plan to make PgAccess not just an administrative
tool, but also a tool for easy build of small applications.
<p>That's why PgAccess 0.98 has been internally restructured, every main
module of PgAccess has became a namespace (see Tcl namespaces) in order&nbsp;
to hide the variables and internal procedures to the user. Also, all the
global variables that have been used before were grouped under a single
big associative array called <b>PgAcVar</b> (PgAccess variables) so they
should not interfere with user defined global variables.
<br>&nbsp;
<br>&nbsp;
<p><b><font size=+1>Global variables available</font></b>
<br>&nbsp;
<center><table BORDER=0 WIDTH="100%" NOSAVE >
<tr NOSAVE>
<td ALIGN=LEFT VALIGN=TOP NOSAVE><b>PgAcVar</b></td>
<td>The main global associative array that hold together various information
needed by PgAccess. User should <b><font color="#FF0000">NOT</font></b>
alter it under any circumstances.</td>
</tr>
<tr NOSAVE>
<td VALIGN=TOP NOSAVE><b>CurrentDB</b></td>
<td>The handler of the current opened database. Can be used for database
operations as selects or command execution.</td>
</tr>
<tr NOSAVE>
<td ALIGN=LEFT VALIGN=TOP NOSAVE><b>Messages</b></td>
<td NOSAVE>The associative array that holds the translation for the current
language. Loaded from the appropriate language file from lib/languages
directory</td>
</tr>
<tr NOSAVE>
<td ALIGN=LEFT VALIGN=TOP NOSAVE><b>PGACCESS_HOME</b></td>
<td>Keep the system directory of PgAccess root installation</td>
</tr>
</table></center>
<br>&nbsp;
<p><b><font size=+1>Window naming convention</font></b>
<p>Every toplevel window defined by PgAccess has the following naming convention.
Every window name starts with <tt>.pgaw</tt> (PgAccess window) followed
by a colon and a name. <i>Example:</i>
<blockquote><tt>.pgaw:User , .pgaw:About , .pgaw:ImportExport</tt></blockquote>
<b><font size=+1>Namespaces available</font></b>
<p>For every tab from the main database window there is a namespace defined
(Tables, Queries, Views, Functions, Sequences, Reports, Forms, Scripts,
Users, Schema). Every namespace has by default the following&nbsp; procedures:
<ul>
<li>
<tt>new</tt>&nbsp; , no parameter needed</li>
<li>
<tt>open</tt> , need a single parameter, the object name</li>
<li>
<tt>design</tt> , need a single parameter, the object name</li>
</ul>
You can use these procedures if you want to produce the same efects as
clicking on the desired tab and then on the "New", "Open" or "Design" buttons
from the main database window.
<br><i>Example:</i>
<blockquote><tt>Tables::open "customers"</tt>
<br><tt>Queries::open "Invoices received"</tt>
<br><tt>Forms::open "Add new invoice"</tt></blockquote>
The <tt>Tables::open</tt> procedure accepts two optional parameters, filter
and order.
<br><i>Example:</i>
<blockquote><tt>Tables::open "phonebook" "name ~* 'joe'" "age desc"</tt></blockquote>
will open a table view window with predefined filter "name ~* 'joe'" and
ordered by descending age.
<p>There is also a special namespace called Database.&nbsp; Here are some
procedures and functions defined for this namespace available to the user:
<br>&nbsp;
<table BORDER NOSAVE >
<tr BGCOLOR="#FFCCFF" NOSAVE>
<td NOSAVE><b>Name</b></td>
<td NOSAVE><b>Parameters</b></td>
<td><b>Type</b></td>
<td><b>Returns</b></td>
<td NOSAVE><b>Description</b></td>
</tr>
<tr>
<td><b>vacuum</b></td>
<td>none</td>
<td>procedure</td>
<td>nothing</td>
<td>vacuums the current database</td>
</tr>
<tr ALIGN=LEFT VALIGN=TOP NOSAVE>
<td><b>getTablesList</b></td>
<td>none</td>
<td>function</td>
<td>list</td>
<td NOSAVE>returns the list of tables from the current database</td>
</tr>
<tr ALIGN=LEFT VALIGN=TOP NOSAVE>
<td><b>executeUpdate</b></td>
<td>sqlcmd</td>
<td>function</td>
<td>integer</td>
<td NOSAVE>execute the sqlcmd command on the current database returning
1 if no errors ocurred or 0 if the command failed</td>
</tr>
</table>
<p><b><font size=+1>Global functions available</font></b>
<br>&nbsp;
<table BORDER NOSAVE >
<tr BGCOLOR="#99FFCC" NOSAVE>
<td><b>Name</b></td>
<td><b>Parameters</b></td>
<td NOSAVE><b>Description</b></td>
</tr>
<tr ALIGN=LEFT VALIGN=TOP NOSAVE>
<td><b>setCursor</b></td>
<td>type</td>
<td NOSAVE>Set the cursor for all PgAccess windows, type of cursor can
be WAIT or CLOCK or WATCH for the hourglass , anything else (or none) to
return to the normal cursor shape</td>
</tr>
<tr ALIGN=LEFT VALIGN=TOP NOSAVE>
<td><b>parameter</b></td>
<td>msg</td>
<td NOSAVE>Shows a modal input dialog with the msg message, wait for user
to enter the data and returns it as a string</td>
</tr>
<tr>
<td><b>showError</b></td>
<td>msg</td>
<td>Shows a modal dialog window with an error message</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</body>
</html>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.61 [en] (X11; I; Linux 2.2.11 i586) [Netscape]">
<base target="right">
</head>
<body bgcolor="#00FFFF">
<img SRC="ball.gif" ><a href="main.html">What is PgAccess?</a>
<br><img SRC="ball.gif" ><a href="whatsnew.html">What's new?</a>
<br><img SRC="ball.gif" ><a href="features.html">Features</a>
<br><img SRC="ball.gif" ><a href="screenshots.html">Screenshots</a>
<br><img SRC="ball.gif" ><a href="faq.html">FAQ</a>
<br><img SRC="ball.gif" ><a href="documentation.html">Documentation</a>
<br><img SRC="ball.gif" ><a href="todo.html">To-Do list</a>
<br><img SRC="ball.gif" ><a href="download.html">Download</a>
<br>&nbsp;
<p><br>
<center>
<p><a href="http://www.linux.org"><img SRC="linux1.gif" BORDER=0 ></a></center>
<p><b>Other links</b>
<br><img SRC="ball.gif" ><a href="http://www.postgresql.org">PostgreSQL</a>
<br><img SRC="ball.gif" ><a href="http://www.neuron.com/stewart/vtcl/index.html">Visual Tcl</a>
<br><img SRC="ball.gif" ><a href="http://www.scriptics.com">Tcl/Tk</a>
<br><img SRC="ball.gif" ><a href="http://www.linux.org">Linux</a>
<br><img SRC="ball.gif" ><a href="http://www.java.ro/vtclava/index.html">vTcLava</a>
</body>
</html>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="GENERATOR" CONTENT="Mozilla/4.03 [en] (X11; I; Linux 2.0.30 i586) [Netscape]">
<TITLE>PgAccess - Copyright notice</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<TT>---------------------------------------------------------------------------</TT>
<BR><TT></TT>&nbsp;
<BR><TT></TT>&nbsp;<TT></TT>
<P><TT>Copyright (c) 1994-7 Regents of the University of California</TT><TT></TT>
<P><TT>Permission to use, copy, modify, and distribute this software and
its</TT>
<BR><TT>documentation for any purpose, without fee, and without a written
agreement</TT>
<BR><TT>is hereby granted, provided that the above copyright notice and
this</TT>
<BR><TT>paragraph and the following two paragraphs appear in all copies.</TT><TT></TT>
<P><TT>IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY
PARTY FOR</TT>
<BR><TT>DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
INCLUDING</TT>
<BR><TT>LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS</TT>
<BR><TT>DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED
OF THE</TT>
<BR><TT>POSSIBILITY OF SUCH DAMAGE.</TT><TT></TT>
<P><TT>THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,</TT>
<BR><TT>INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY</TT>
<BR><TT>AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER
IS</TT>
<BR><TT>ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS
TO</TT>
<BR><TT>PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.</TT>
</BODY>
</HTML>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.61 [en] (X11; I; Linux 2.2.11 i586) [Netscape]">
</head>
<body bgcolor="#FEFEDF">
<h2>
Documentation</h2>
<hr WIDTH="100%">
<p>Still need to be written. Some information can be found in the help
included in the main program.
<p>Jim Lemon &lt;Jim.Lemon@uts.EDU.AU> has started writing a <a href="tutorial/index.html">tutorial</a>.
Thought it is based on earlier versions than 0.98 it is a beginning after
all, isn't it ?
</body>
</html>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.61 [en] (X11; I; Linux 2.2.11 i586) [Netscape]">
</head>
<body bgcolor="#FEFEDF">
<h2>
Download</h2>
<hr>
<br>The primary site for PgAccess downloads is:
<ul><a href="ftp://ftp.flex.ro/pub/pgaccess">ftp://ftp.flex.ro/pub/pgaccess</a>
<ul>
<li>
<a href="ftp://ftp.flex.ro/pub/pgaccess/pgaccess-0.98.tar.gz">Unix tar.gz
file</a></li>
<li>
<a href="ftp://ftp.flex.ro/pub/pgaccess/pgaccess-0.98.zip">Windows .zip
file</a></li>
</ul>
</ul>
<p>Another one (just with a little bit faster, try this one first) would
be :
<ul><a href="ftp://speedy.flex.ro/pub/pgaccess">ftp://speedy.flex.ro/pub/pgaccess</a>
<ul>
<li>
<a href="ftp://speedy.flex.ro/pub/pgaccess/pgaccess-0.98.tar.gz">Unix tar.gz
file</a></li>
<li>
<a href="ftp://speedy.flex.ro/pub/pgaccess/pgaccess-0.98.zip">Windows .zip
file</a></li>
</ul>
</ul>
<br>&nbsp;
</body>
</html>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.61 [en] (X11; I; Linux 2.2.12 i586) [Netscape]">
</head>
<body bgcolor="#FEFEDF">
<h2>
PgAccess - FAQ</h2>
<hr>
<br><b>1. When I run PgAccess I got a message complaining about the crypt
library! What should I do?</b>
<blockquote>Versions of PostgreSQL prior to 6.5.1 couldn't reliably detect
the presence of the crypt library on RedHat 5.x systems. That's why the
libpgtcl library does not include reference to crypt. You will need to
get a proper copy of libpgtcl.so library or to compile one. Go to the postgresql
source directory into src/interfaces/libpgtcl and edit Makefile adding
-lcrypt to the end of the line SHLIB_LINKS. Make clean and make again.
Your libpgtcl.so is now prepare to run PgAccess. I strongly recommend you
to upgrade to PostgreSQL 6.5.1 where this problem has been solved.</blockquote>
<b>2. I cannot connect to a database from another machine</b>
<blockquote>There may be two problems here. First of all, PgAccess running
on the localhost is using two PostgreSQL dependent libraries, libpq and
libpgtcl. Each of them are compiled for a specific PostgreSQL version.
If the PostgreSQL version running on your server is different you might
experience problems. The other problem is related to access rights. On
the PostgreSQL server, in data directory there is a file pg_hba.conf that
will grant access rights to users based on host authentication. Ask your
database administrator to check if your workstation is listed there with
the appropriate access rights. Try for the beginning the 'trust' mode,
allowing full access to the databases.</blockquote>
<b>3. I am experiencing core dumps when trying to run PgAccess. Is PgAccess
broken?</b>
<blockquote>No. There were NEVER reported crashes because of PgAccess.
All of them were related to bad libraries usage. The most frequent was
the installing of a new PostgreSQL on a RedHat 5.x server where the postgresql-clients
rpm still exists. So, PgAccess was trying to use the old libpgtcl.so library
suitable for an older version of PostgreSQL. Before installing a new PostgreSQL
(either by compiling it ot by rpm packages) remove ANY TRACE of old PostgreSQL.
PgAccess is fully relying on libpgtcl library in order to get access to
the database so when you are experiencing that kind of problems, double-check
libpq and libpgtcl libraries.</blockquote>
<b>4. When I try to run PgAccess I get the following error : Application
initialization failed: couldn't connect to display ""</b>
<blockquote>That kind of error was reported on some Linux RedHat 5.x systems
when user has su - to root and tried to run PgAccess. Some unknown errors
in login scripts are not defining the DISPLAY environment and the wish
application cannot connect to the X display. Try typing <tt>export DISPLAY=localhost:0.0</tt>
and run PgAccess again.</blockquote>
<b>5. Cannot run PgAccess on a Windows machine.</b>
<blockquote>In order to use PgAccess on Windows you must have installed
two libraries libpq.dll and libpgtcl.dll suitable for your Tcl/Tk package
and your PostgreSQL server. Note that libraries that work with Tcl/Tk 8.0.x
won't work with Tcl/Tk 8.1.x and libraries that work with 6.4.2 backend
won't work with 6.5.x. So, you must properly identify your Tcl/Tk package
version and your PostgreSQL version and download from the Downloads section
(or pick from the win32/dll directory of PgAccess distribution) the right
files. Copy them into your Windows/System directory and try again. Also,
you should be able to access over the network the machine running the PostgreSQL
server (try ping-ing it) and have the proper access rights to the database.</blockquote>
<b>6. How much costs PgAccess?</b>
<blockquote>PgAccess is a free tool. You won't have to pay anything in
order to use it. It is protected by the following <a href="copyright.html">copyright</a>
as PostgreSQL is. I cannot guarantee technical support but I will try to
answer to your questions as much as I can.</blockquote>
<b>7. I want to translate PgAccess messages for xxx language. What should
I do?</b>
<blockquote>In the PgAccess distribution in lib/languages directory there
are files with messages translated for different languages. Copy one of
them and name it after your native language and then start editing it translating
all the messages. Save it into the same directory and that's all. Don't
forget to send me a copy in order to include it into the standard distribution.</blockquote>
<p><br><b>8. I am receiving the following error: <tt>message invalid command
name "namespace" while executing "namespace eval Mainlib</tt>&nbsp; ..."</b>
<blockquote>That means 100% that you have an older version of Tcl/Tk that
don't recognize namespaces command. Please upgrade to Tcl/Tk 8.0.x minimum</blockquote>
<br>&nbsp;
<br>&nbsp;
<br>&nbsp;
</body>
</html>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.61 [en] (X11; I; Linux 2.2.11 i586) [Netscape]">
</head>
<body bgcolor="#FEFEDF">
<b>Tables</b>
<br>- opening multiple tables for viewing, max. n records (changed by preferences
menu)
<br>- column resizing, dragging the vertical grid line (better in table
space rather than in the table header)
<br>- text wrap in cells - layout saved for every table
<br>- import/export to external files (SDF,CSV)
<br>- filter capabilities (enter filter like (price>3.14)
<br>- sort order capabilities (enter manually the sort field(s))
<br>- editing in place
<br>- improved table generator assistant
<br>- improved field editing
<br><b>Queries</b>
<br>- define , edit and stores "user defined queries"
<br>- store queries as views
<br>- execution of queries with optional user input parameters ( select
* from invoices where year=[parameter "Year of selection"] )
<br>- viewing of select type queries result
<br>- query deleting and renaming
<br>- visual query builder with drag &amp; drop capabilities. For any of
you who had installed the Tcl/Tk plugin for Netscape Navigator, you can
see it at work <a href="qbtclet.html">clicking here</a>
<br><b>Sequences</b>
<br>- defines sequences, delete them and inspect them
<br><b>Functions</b>
<br>- define, inspect and delete functions in SQL, plpgsql and pgtcl languages
<br><b>Reports</b>
<br>- design and display simple reports from tables
<br>- fields and labels, font changing, style and size
<br>- saves and loads report description from database
<br>- show report previews, sample postscript output file
<br><b>Forms</b>
<br>- open user defined forms
<br>- form design module available
<br>- query widget available, controls bound to query results
<br>- <a href="forms.html">click here</a> for a description of forms and
how they can be used
<br><b>Scripts</b>
<br>- define, modify and call user defined scripts
<br><b>Users</b>
<br>- define and modify user information
<p><b><a href="api.html">PgAccess API</a></b> for developing small applications
<br>&nbsp;
</body>
</html>
This diff is collapsed.
This diff is collapsed.
<HTML>
<HEAD>
<TITLE>PgAccess</TITLE>
<FRAMESET COLS="200,*" border=0 framespacing=0 frameborder=no>
<FRAME NAME="left" scrolling="none" src="contents.html">
<FRAME NAME="right" scrolling="nonw" src="main.html">
</FRAMESET>
</HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>PgAccess on Irix</TITLE>
<META NAME="GENERATOR" CONTENT="Mozilla/3.04Gold (X11; I; Linux 2.0.33 i586) [Netscape]">
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EF" VLINK="#51188E" ALINK="#FF0000">
<H1>INSTALLING PgAccess UNDER IRIX 5.3.
<HR WIDTH="100%"></H1>
<P><B><FONT COLOR="#000080">This HOWO-TO make PgAccess working under Irix
is written by Stuart Rison</FONT></B></P>
<P>These are the steps that I had to follow to get pgaccess to run on an
INDIGO2 running postgreSQL 6.3.2 under IRIX 5.3. I make no guarantee whatsoever
that the same step will work for others but at least it should point you
in the right direction. Also, I am a biologist by training so I only got
pgaccess working by fudging (that is, trial and error) this means that
some of the steps may be unnecessary (e.g. compiling $postgreSQL_source/src/interfaces/libpgtcl
as both a shared and static library) and they certainly haven't been optimised
(I know nothing about compiler switches etc.).</P>
<P><B>1) Requirements:</B></P>
<UL>
<P>You will need:</P>
<UL>
<LI>postgreSQL source (http://www.postgresql.org)</LI>
<LI>tcl8.0 source (http://www.tclconsortium.org/)</LI>
<LI>tk8.0 source (http://www.tclconsortium.org/)</LI>
<LI>pgaccess source (http://www.flex.ro/pgaccess)</LI>
</UL>
</UL>
<P><B>2) Installation:</B></P>
<P>a) tcl/tk:</P>
<UL>
<P>You must first install tcl and then tk (in that order). I just used
./configure, no switches and gmake. Their installation should be trouble
free. Then you must move headers and libraries to the right places so:</P>
<P>Header files: both tcl and tk have a header file (tcl.h and tk.h). The
tcl.h file is in $tcl_source_dir/generic and the tk.h file is in $tk_source_dir/generic;
both should be copied to /usr/local/include.</P>
<P>Libraries: compilation (with cc) of tcl and tk yield libraries libtcl8.0.a
and libtk8.0.a in $source_dir/unix. Both should be copied to /usr/local/lib.</P>
</UL>
<P>b) postgreSQL:</P>
<UL>
<P>Make sure you have a fully patched postgreSQL source. If your ./configure
says it can't load 'IRIX' settings then you most probably will need to
patch ./configure.</P>
<P>Configure using ./configure with the following switches: ./configure
--with-includes=/usr/local/include</P>
<P>--with-libraries=/usr/local/lib --with-tcl [this and previous line as
one]</P>
<P>Then make, make install as usual</P>
</UL>
<P>c) Compiling libpgtcl:</P>
<UL>
<P>The source for libpgtcl is in $postgreSQL_directory/src/interfaces/libpgsql.</P>
<P>I do this twice. Once with just gmake. This produces a static library
libpgtcl.a which I leave where it is (I don't know what to do with it but
it may just come in handy). The I modify Makefile manually with a text
editor. Essentially I modify two line:</P>
<P>before:</P>
<P># Shared library stuff</P>
<P>install-shlib-dep := shlib :=</P>
<P>after:</P>
<P># Shared library stuff</P>
<P>install-shlib-dep := install-shlib shlib := libpgtcl.so.1</P>
<P>Then gmake -f Makefile_modified. This creates two shared (.so) libraries:
libpgtcl.so and libpgtcl.so.1. I can't tell the difference between them
so I copied them both to /usr/lib/.</P>
</UL>
<P>d) running pgaccess:</P>
<UL>
<P>Uncompress pgaccess (usually with gunzip and tar). So long as 'wish'
(a binary produced when compiling tk8.0) is somewhere in your path, you
should be able to run pgaccess with:</P>
<P>wish -f $pgaccess_dir/pgaccess.tcl [postgreSQL_database_name]</P>
</UL>
<P>e) et voila!</P>
<P><B>3) Concluding remarks:</B></P>
<UL>
<P>As I stated at the start of this document, following the procedure indicated
above worked for me. I am sure, however, that a few of the steps are unnecessary/non-optimised/stupid
etc. If any Unix (IRIX) boffin is reading this and you spot anything you
would like to comment/correct etc. please e-mail me (stuart@ludwig.ucl.ac.uk).
Also, if you just have questions and think I might help, please contact
me at the same e-mail.</P>
<P>Finally, I can accept no responsibility if these steps don't work for
you or if it all goes horribly wrong and you 'damage' your computer trying
them. Let common sense prevail!</P>
</UL>
<P>Good luck</P>
<P>Stuart Rison LICR University College London London W1P 8BT<BR>
<A HREF="mailto:stuart@ludwig.ucl.ac.uk">stuart@ludwig.ucl.ac.uk</A></P>
</BODY>
</HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE></TITLE>
<META NAME="GENERATOR" CONTENT="Mozilla/3.04Gold (X11; I; Linux 2.0.32 i586) [Netscape]">
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EF" VLINK="#51188E" ALINK="#FF0000">
<P>The mailing list for PgAccess is : &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B><TT>pgsql-interfaces@postgresql.org</TT></B></P>
<P>If you have some questions regarding PgAccess you should mail to this
address. I will also answer to messages addresed directly to me but it
would be better to post your messages here because it might be possible
to get an answer quickly from another user of PgAccess.</P>
<P>
<HR WIDTH="100%"></P>
<P>To subscribe please send a mail message to&nbsp;:</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B><TT><FONT SIZE=+1>pgsql-interfaces-request@postgresql.org
</FONT></TT></B>&nbsp;</P>
<P>having a single line in the body message :&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B><TT><FONT SIZE=+1>subscribe</FONT></TT></B></P>
<P>In a couple of minutes , if everything is ok, you must receive something
like that :</P>
<P>
<HR WIDTH="100%"></P>
<P><TT>Welcome to the pgsql-interfaces mailing list!</TT></P>
<P><TT>Please save this message for future reference. Thank you.</TT></P>
<P><TT>If you ever want to remove yourself from this mailing list, you
can send mail to &lt;Majordomo@hub.org&gt; with the following command in
the body of your email message:</TT></P>
<P><TT>unsubscribe pgsql-interfaces yourname@yourdomain</TT></P>
<TT></TT>
</BODY>
</HTML>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.61 [en] (X11; I; Linux 2.2.12 i586) [Netscape]">
</head>
<body bgcolor="#FEFEDF">
<h1>
PgAccess
<hr WIDTH="100%"></h1>
A free graphical database management tool for <a href="http://www.postgresql.org">PostgreSQL</a>.
PgAccess has been written by <a href="mailto:teo@flex.ro">Constantin Teodorescu</a>
using Visual Tcl, the best tool for developing Tcl/Tk applications I've
ever seen.
<p><b>Last version</b>
<br>Last stable version is 0.98 , released on 29 August 1999. Read <a href="whatsnew.html">what's
new</a> in 0.98.
<p><b>Portability issues</b>
<br>PgAccess is available for every platform where PostgreSQL was ported
and where a Tcl/Tk package is available. PgAccess has been reported running
on :
<br>- Linux
<br>- FreeBSD
<br>- Solaris
<br>- HPUX
<br>- Irix
<br>- Windows 95,98,NT
<p>PgAccess needs Tcl/Tk versions 8.0.x and higher thought PgAccess. For
win32 platforms there are some special DLL's that have to be downloaded
and installed, more information <a href="win32.html">here</a>.
<p>PgAccess is protected by the following <a href="copyright.html">copyright</a>.
</body>
</html>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.61 [en] (X11; I; Linux 2.2.11 i586) [Netscape]">
<title>PgAccess - a Tcl/Tk PostgreSQL interface</title>
</head>
<body bgcolor="#FFFFFF">
<h1>
PgAccess - a free database management tool for <a href="http://www.postgreSQL.org">PostgreSQL</a></h1>
<hr>
<li>
Download the last version of PgAccess <a href="pgaccess-0.96.tar.gz">(press
shift and click this link) (tar.gz file)</a>&nbsp; or&nbsp;&nbsp; <a href="pgaccess.zip">this
one (zip file for Windows)</a></li>
<center>
<p><br>Latest stable version of PgAccess is 0.97 , released 16 August 1999
!
<p><font size=+2>PgAccess 0.93 and higher will not work from the beginning
with PostgreSQL 6.3.x !!</font>
<br><font size=+2>Read <a href="pg93patch.html">here</a> how to apply a
simple patch in order to make it work !</font></center>
<b><font color="#000000"><font size=+2></font></font></b>
<center><table BORDER=2 NOSAVE >
<tr NOSAVE>
<td NOSAVE><b><font color="#FF0000"><font size=+2>NEW</font></font></b></td>
<td NOSAVE><b><font color="#000000"><font size=+2>International version
(english, french, italian, romanian)</font></font></b></td>
</tr>
<tr NOSAVE>
<td NOSAVE><b><font color="#FF0000"><font size=+2>NEW</font></font></b></td>
<td><b><font size=+2>Context sensitive Help</font></b></td>
</tr>
</table></center>
<center>
<p>Precompiled libpgtcl and libpq binaries and dll's for i386 are <a href="ftp://ftp.flex.ro/pub/pgaccess">here
</a>!!!</center>
<h3>
<font color="#000080">Installation problems</font></h3>
<ul>
<li>
Some problems related with locale special characters could be solved by
this <a href="specialchars.html">simple patch</a></li>
<li>
I think that there were some problems loading libpgtcl library. I invite
you to read a <a href="index.html#libpgtcl">special section concerning
libpgtcl</a></li>
<li>
For Silicon Graphics Indigo computers, Irix operating system, there is
a <a href="irix.html">HOWTO make PgAccess to work</a></li>
</ul>
<h3>
<font color="#191970">What does PgAccess now!</font></h3>
Here are some screenshots from PgAccess windows : <a href="pic-pga-1.gif">Main
window </a>, <a href="pic-pga-2.gif">table builder </a>, <a href="pic-pga-4.gif">table(query)
view </a>, <a href="pic-pga-3.gif">visual query builder </a>.
<p><b>Tables</b>
<br>- opening multiple tables for viewing, max. n records (changed by preferences
menu)
<br>- column resizing, dragging the vertical grid line (better in table
space rather than in the table header)
<br>- text wrap in cells - layout saved for every table
<br>- import/export to external files (SDF,CSV)
<br>- filter capabilities (enter filter like (price>3.14)
<br>- sort order capabilities (enter manually the sort field(s))
<br>- editing in place
<br>- improved table generator assistant
<br>- improved field editing
<br><b>Queries</b>
<br>- define , edit and stores "user defined queries"
<br>- store queries as views
<br>- execution of queries with optional user input parameters ( select
* from invoices where year=[parameter "Year of selection"] )
<br>- viewing of select type queries result
<br>- query deleting and renaming
<br>- visual query builder with drag &amp; drop capabilities. For any of
you who had installed the Tcl/Tk plugin for Netscape Navigator, you can
see it at work <a href="qbtclet.html">clicking here</a>
<br><b>Sequences</b>
<br>- defines sequences, delete them and inspect them
<br><b>Functions</b>
<br>- define, inspect and delete functions in SQL, plpgsql and pgtcl languages
<br><b>Reports</b>
<br>- design and display simple reports from tables
<br>- fields and labels, font changing, style and size
<br>- saves and loads report description from database
<br>- show report previews, sample postscript output file
<br><b>Forms</b>
<br>- open user defined forms
<br>- form design module available
<br>- query widget available, controls bound to query results
<br>- <a href="forms.html">click here</a> for a description of forms and
how they can be used
<br><b>Scripts</b>
<br>- define, modify and call user defined scripts
<br><b>Users</b>
<br>- define and modify user information
<p>Here is <a href="pga-rad.html">a special section concerning forms and
scripts</a> .
<p>This program is protected by the following <a href="copyright.html">copyright</a>
<p>If you have any comment, suggestion for improvements, please feel free
to e-mail to : <a href="mailto:teo@flex.ro">teo@flex.ro</a>
<p><b><font color="#FF1493"><font size=+2>Mailing list for PgAccess </font></font></b><a href="maillist.html">Here
you will find how to subscribe to this mailing list</a>.
<p>
<hr>
<h1>
More information about libpgtcl - downloads</h1>
&nbsp;&nbsp;&nbsp;&nbsp; Also, you will need the PostgreSQL to Tcl interface
library, lined as a Tcl/Tk 'load'-able module. It is called libpgtcl and
the source is located in the PostgreSQL directory /src/interfaces/libpgtcl.
Specifically, you will need a libpgtcl library that is 'load'-able from
Tcl/Tk.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This is technically different from
an ordinary PostgreSQL loadable object file, because libpgtcl is a collection
of object files. Under Linux, this is called libpgtcl.so.
<p>&nbsp;&nbsp;&nbsp;&nbsp; One of the solutions is to remove from the
source the line containing <b>load libpgtcl.so </b>and to load pgaccess.tcl
not with wish, but with pgwish (or wishpg) that wish that was linked with
libpgtcl library! I do not recommend this one.
<p>&nbsp;&nbsp;&nbsp;&nbsp; If you have installed RedHat 5.x, you should
get the last distribution kit of PostgreSQL and compile it from scratch.
RedHat 5.x is using some new versions of libraries and you have to compile
and install again at least <b>libpq </b>and <b><tt>libpgtcl </tt></b>libraries.
<p>&nbsp;&nbsp;&nbsp; PostgreSQL 6.4 release has a minor bug. I does not
include by default the crypt lib when compiling libpgtcl. So, you will
need to manually add a -lcrypt to SHLIB line in Makefile in src/interfaces/libpgtcl
and then make clean and make again. The new libpgtcl.so library is properly
configured to run pgaccess.
<br>&nbsp;
</body>
</html>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.5 [en] (X11; I; Linux 2.0.36 i586) [Netscape]">
</head>
<body text="#000000" bgcolor="#FFFFFF" link="#0000FF" vlink="#FF0000" alink="#000088">
<h1>
PgAccess 0.93 patch to make it work with PostgreSQL 6.3.x
<hr WIDTH="100%"></h1>
<p><br>PgAccess 0.93 is working fine with PostgreSQL 6.4.x due to some
changes in libpgtcl !
<p>There is a small patch that you have to make in order to make it work
with 6.3.x !
<p>Replace in procedure <tt>wpg_exec</tt> the following line:
<p><tt>set pgsql(errmsg) [pg_result $pgsql(res) -error]</tt>
<p>with this one :
<p><tt>set pgsql(errmsg) "NO ERROR INFORMATION SUPPLIED"</tt>
<p>And it will work fine! In some error cases, you will not get the appropriate
error message from libpgtcl.
<p>&nbsp;<a href="index.html">Back</a>
</body>
</html>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="GENERATOR" CONTENT="Mozilla/4.04 [en] (X11; I; Linux 2.0.32 i586) [Netscape]">
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EF" VLINK="#51188E" ALINK="#FF0000">
<H1>
PgAccess - Scripts and Forms&nbsp;
<HR WIDTH="100%"></H1>
Beginning with 0.70 version, I have introduced in PgAccess two new modules
for operating with scripts and forms.
<P>&nbsp;&nbsp; This would give to PgAccess the power of creating application
directly into PgAccess, defining new modules, procedures, forms and possibly
making it a rapid development tool for PostgreSQL. The "scripts" and "forms"
modules are using two new tables called pga_forms and pga_scripts. PgAccess
take care of creating them if user is opening a new database and grant
ALL permissions on them to PUBLIC.
<BR>&nbsp;
<BR>&nbsp;&nbsp; Of course, when Designing a script, a simple text editor
is opened and text is saved as is in pga_scripts table. When "designing"
a form, a "form editor" that would be very similar with "Visual Tcl" is
invoked.
<P>&nbsp;&nbsp; This mechanism and the extremely versatile scripting mode
of Tcl/Tk would give PgAccess a great power for creating end user application
using PostgreSQL. The most important thing is that the user could call
procedures and functions that I have used for building up PgAccess !
<H3>
Forms</H3>
&nbsp;&nbsp; Forms are used for creating windows and placing widgets inside
it. When PgAccess interpret them, a new window appear, with buttons as
defined that could call "user defined scripts", "user defined procedures"
or "internal PgAccess procedures".
<BR>&nbsp;&nbsp; Forms can hold all the widgets allowed in Tcl/Tk , buttons,
check-boxes, radio-buttons, list-boxes, frames, canvases, etc. With these
forms, you can control your application so PgAccess would become just a
"shell", a startup point for you applications. See the&nbsp; <A HREF="forms.html">special
section concerning forms.</A>
<H3>
Scripts</H3>
&nbsp;&nbsp; Scripts are normal Tcl/Tk code that is interpreted by Tcl/Tk.
You can define your own procedures inside a script called "Library" for
example. You can call your procedures from within another script, from
another procedure.
<BR>&nbsp;&nbsp; The most important thing is that you have total access
to the PgAccess core of functions and procedures used by me in building
PgAccess as an application. Just write <B><TT><FONT COLOR="#000080">open_table
"Your sample table"</FONT></TT></B> and you'll see the result.
<BR>&nbsp;&nbsp; If you are writing a script called "Autoexec" then it
will be executed every time the database is opened. You can put inside
different commands that you want to be executed such as : running scripts
that would define your own procedures such as <B><TT><FONT COLOR="#000080">execute_script
"My own procedure library"</FONT></TT></B> or open a form with <B><TT><FONT COLOR="#000080">open_form
"Main window with menu buttons"</FONT></TT></B> , and so on.
<P>
<HR WIDTH="100%">
<BR>Remember : I'm waiting your messages at <A HREF="mailto:teo@flex.ro">teo@flex.ro</A>
<P>
<HR WIDTH="50%">
</BODY>
</HTML>
<html>
<title> Visual Query Builder in Tcl/Tk </title>
<body bgcolor=white>
<h1> Visual Query Builder</h1>
<hr>
This visual query builder is included in <a href='http://www.flex.ro/pgaccess'>
PgAccess</a>, a visual interface to
<a href='http://www.postgreSQL.org'> PostgreSQL</a> written entirely in
vTcl , (Visual Tcl).
<p align="center">
<embed src="qbtclet.tcl" width=590 height=485>
</p>
<br>
Visual Query Designer demo<br>
Click <a href='qbtclet.tar.gz'>here</a> to download the source </a>
created by Constantin Teodorescu with vTcl (visual Tcl), teo@flex.ro
<hr>
Facitilies<br>
- drag and drop selection of fields<br>
- drag and drop fields from a table to another do create links<br>
- move table position by dragging<br>
- point and click any link or table then press delete to delete them<br>
- modify sort order by clicking on (unsorted)<br>
- enter filter conditions as criteria (>2000 , ='item')<br>
- easy panning of table and result panels<br>
- show SQL command<br>
<br>
If you want to use it for your database, modify ql_read_struct in order to read
your table structure.
<br>
Feel free to use, modify or copy this software for non-commercial purposes.<br>
In any other case, please contact me.
<br>
FLEX Consulting Braila, ROMANIA is able to deliver high end interfaces
and any other commercial products written in Tcl/Tk just like that you have seen.
</body>
</html>
This diff is collapsed.
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.61 [en] (X11; I; Linux 2.2.12 i586) [Netscape]">
</head>
<body bgcolor="#FEFEDF">
<h3>
Image gallery
<hr WIDTH="100%"></h3>
<ul>
<li>
&nbsp;<a href="mainwindow.gif">Main window</a> 9 Kb</li>
<li>
&nbsp;<a href="newtable.gif">Creating a new table</a> 9 Kb</li>
<li>
&nbsp;<a href="permissions.gif">Table access control</a> 10 Kb</li>
<li>
&nbsp;<a href="addindex.gif">Adding a new index</a> 12 Kb</li>
<li>
&nbsp;<a href="vdesigner.gif">The visual query designer</a> 16 Kb</li>
<li>
&nbsp;<a href="function.gif">Working with functions</a> 10 Kb</li>
<li>
&nbsp;<a href="forms.gif">Form designer</a> 19 Kb</li>
<li>
&nbsp;<a href="newuser.gif">User management</a> 4 Kb</li>
<li>
&nbsp;<a href="help.gif">Help</a> 7 Kb</li>
</ul>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Special locale characters</TITLE>
<META NAME="GENERATOR" CONTENT="Mozilla/3.04Gold (X11; I; Linux 2.0.32 i586) [Netscape]">
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EF" VLINK="#51188E" ALINK="#FF0000">
<H1>Special locale characters and PgAccess
<HR WIDTH="100%"></H1>
<P>The problem is related with some special characters used in different
countries because PgAccess did not use fonts with `-ISO8859-1' encoding
-- </P>
<P>The sollution was proposed by H.P.Heidinger ( hph@hphbbs.ruhr.de) and
it's very simple.</P>
<P>If you look into PgAccess, you will find fonts declared as follows :</P>
<P><TT>$ grep -e '-font' -i pgaccess.tcl<BR>
-font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* \<BR>
-font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* \<BR>
-font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* \<BR>
-font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* \</TT></P>
<P>It should be something like: -adobe-helvetica-medium-r-normal-*-*-120-*-*-*-*-iso8859-1</P>
<P>You can achieve this by running the following script :</P>
<P><TT>#!/bin/sh<BR>
cp pgaccess.tcl pgaccess.tcl-org<BR>
cat pgaccess.tcl |\<BR>
sed -e's/\-\*\-\*\ /\-iso8859\-1\ /g' |\<BR>
sed -e's/\-\*\-\*\}/\-iso8859\-1}/g' |\<BR>
sed -e's/\-\*\-\*\]/\-iso8859\-1]/g' |\<BR>
sed -e's/\-\*\-\*$/\-iso8859\-1/g' |\<BR>
sed -e's/\-Clean\-/\-Fixed\-/g' |\<BR>
sed -e's/clean/fixed/g' &gt;pgaccess.iso<BR>
mv pgaccess.iso pgaccess.tcl<BR>
chmod +x pgaccess.tcl</TT></P>
<P>The final version of PgAccess (1.0) will let the user decide what fonts
will be used through a &quot;preferences&quot; dialog window.</P>
</BODY>
</HTML>
<html>
<body bgcolor="#FEFEDF">
<h2>ToDo List</h2><hr>
- Finish the report generator module<br>
- Enhance the form designer<br>
- Enhance the scripts module<br>
- Translations in other languages<br>
<br>
Please send any suggestions by mail to <a href="mailto:teo@flex.ro">Constantin Teodorescu</a>.
</body>
</html>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html><head><title>PgAccess - a Tcl/Tk interface for PostgreSQL</title></head>
<body bgcolor="#C0C0C0">
<h1>PgAccess - a Tcl/Tk interface for PostgreSQL</h1>
<hr>
<a name="intro">
<ul><li><a href="intro.html">Introduction</a>
<ul><li><a href="intro.html#whatpga">What is PgAccess?</a>
<li><a href="intro.html#helppga">How to get help with PgAccess</a>
</ul>
<a name="start">
<li><a href="start.html">Getting Started</a>
<ul><li><a href="start.html#getpga">How to get PgAccess</a>
<li><a href="start.html#uncpga">How to uncompress PgAccess</a>
<li><a href="start.html#putpga">Putting PgAccess where it will be found</a>
<li><a href="start.html#startpga">Starting PgAccess</a>
<li><a href="irix.html">Installing PgAccess under IRIX 5.3</a>
</ul>
<a name="problems">
<li><a href="problems.html">Common Initial Problems</a>
<ul><li><a href="problems.html#connfail">Connection failure</a>
<li><a href="problems.html#nonuser">User not defined</a>
<li><a href="problems.html#libpg">libpgtcl not found</a>
<li><a href="problems.html#spchar">Locale specific characters</a>
<li><a href="problems.html#pg63">Problems with PostgreSQL 6.3.x</a>
</ul>
<li><a href="tut.html">PgAccess tutorial</a>
<ul><li><a href="tut_user.html">User Administration</a>
<li><a href="tut_new.html">Creating a table</a>
<li><a href="tut_edit.html">Editing a table</a>
<li><a href="tut_sel1.html">Querying - SELECT</a>
</ul>
</body></html>
<html><head><title>PgAccess - Introduction</title></head>
<body bgcolor="#C0C0C0">
<h1>PgAccess - Introduction</h1>
<a name="whatpga"><h2>What is PgAccess?</h2>
PgAccess is a graphical user interface for the PostgreSQL database management
system written in the Tcl/Tk scripting language by Constantin Teodorescu. It
allows the user to interact with PostgreSQL in a manner similar to many PC
database applications, with menu choices and graphical tools like buttons.
This means that the user can avoid the basic command line interface for most
common tasks. PgAccess doesn't change the way PostgreSQL operates, just makes
it easier to use for those familiar with graphical interfaces.<p>
Obviously, you <u>must</u> have PostgreSQL installed and running, and Tcl/Tk on
your system before you can use PgAccess.<p>
PgAccess is an "open source" application. The source code is available to the
user, and may be modified by the user. The user can fix a bug, or change the
way a function operates. You may not want to get that involved with the
programming, but you have the option to do so. If you feel you have made an
improvement to the program, you are encouraged to share it with other users.<p>
If you are not familiar with how open source software can be altered and
redistributed, please read <a href="copyright.html">this</a>.<p>
<a name="helppga"><h2>How to get help with PgAccess</h2>
The mailing list for PgAccess is: <b>pgsql-interfaces@postgresql.org</b><p>
If you have any questions regarding PgAccess you should subscribe to this
list in the following way:<p>
First subscribe to the list by sending an email message to:<p>
<samp>pgsql-interfaces-request@postgresql.org</samp><p>
Send a single line in the body of the message as follows:<p>
<samp>subscribe</samp><p>
In a short time you should receive a message beginning like this:<p>
<samp>Welcome to the pgsql-interfaces mailing list!<br>
...</samp><p>
This will contain instructions on how to remove yourself from the mailing
list, so save that message. You may only want to ask a few questions and then
stop receiving messages.<p>
You may also email <a href="mailto:teo@flex.ro">Constantin Teodorescu</a>
directly, although writing to a mailing list with many correspondents will often
produce a quicker answer.<p>
<a href="index.html#intro">Back to index</a>
</body></html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>PgAccess on Irix</TITLE>
<META NAME="GENERATOR" CONTENT="Mozilla/3.04Gold (X11; I; Linux 2.0.33 i586) [Netscape]">
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000EF" VLINK="#51188E" ALINK="#FF0000">
<H1>INSTALLING PgAccess UNDER IRIX 5.3.
<HR WIDTH="100%"></H1>
<P><B><FONT COLOR="#000080">This HOWO-TO make PgAccess working under Irix
is written by Stuart Rison</FONT></B></P>
<P>These are the steps that I had to follow to get pgaccess to run on an
INDIGO2 running postgreSQL 6.3.2 under IRIX 5.3. I make no guarantee whatsoever
that the same step will work for others but at least it should point you
in the right direction. Also, I am a biologist by training so I only got
pgaccess working by fudging (that is, trial and error) this means that
some of the steps may be unnecessary (e.g. compiling $postgreSQL_source/src/interfaces/libpgtcl
as both a shared and static library) and they certainly haven't been optimised
(I know nothing about compiler switches etc.).</P>
<P><B>1) Requirements:</B></P>
<UL>
<P>You will need:</P>
<UL>
<LI>postgreSQL source (http://www.postgresql.org)</LI>
<LI>tcl8.0 source (http://www.tclconsortium.org/)</LI>
<LI>tk8.0 source (http://www.tclconsortium.org/)</LI>
<LI>pgaccess source (http://www.flex.ro/pgaccess)</LI>
</UL>
</UL>
<P><B>2) Installation:</B></P>
<P>a) tcl/tk:</P>
<UL>
<P>You must first install tcl and then tk (in that order). I just used
./configure, no switches and gmake. Their installation should be trouble
free. Then you must move headers and libraries to the right places so:</P>
<P>Header files: both tcl and tk have a header file (tcl.h and tk.h). The
tcl.h file is in $tcl_source_dir/generic and the tk.h file is in $tk_source_dir/generic;
both should be copied to /usr/local/include.</P>
<P>Libraries: compilation (with cc) of tcl and tk yield libraries libtcl8.0.a
and libtk8.0.a in $source_dir/unix. Both should be copied to /usr/local/lib.</P>
</UL>
<P>b) postgreSQL:</P>
<UL>
<P>Make sure you have a fully patched postgreSQL source. If your ./configure
says it can't load 'IRIX' settings then you most probably will need to
patch ./configure.</P>
<P>Configure using ./configure with the following switches: ./configure
--with-includes=/usr/local/include</P>
<P>--with-libraries=/usr/local/lib --with-tcl [this and previous line as
one]</P>
<P>Then make, make install as usual</P>
</UL>
<P>c) Compiling libpgtcl:</P>
<UL>
<P>The source for libpgtcl is in $postgreSQL_directory/src/interfaces/libpgsql.</P>
<P>I do this twice. Once with just gmake. This produces a static library
libpgtcl.a which I leave where it is (I don't know what to do with it but
it may just come in handy). The I modify Makefile manually with a text
editor. Essentially I modify two line:</P>
<P>before:</P>
<P># Shared library stuff</P>
<P>install-shlib-dep := shlib :=</P>
<P>after:</P>
<P># Shared library stuff</P>
<P>install-shlib-dep := install-shlib shlib := libpgtcl.so.1</P>
<P>Then gmake -f Makefile_modified. This creates two shared (.so) libraries:
libpgtcl.so and libpgtcl.so.1. I can't tell the difference between them
so I copied them both to /usr/lib/.</P>
</UL>
<P>d) running pgaccess:</P>
<UL>
<P>Uncompress pgaccess (usually with gunzip and tar). So long as 'wish'
(a binary produced when compiling tk8.0) is somewhere in your path, you
should be able to run pgaccess with:</P>
<P>wish -f $pgaccess_dir/pgaccess.tcl [postgreSQL_database_name]</P>
</UL>
<P>e) et voila!</P>
<P><B>3) Concluding remarks:</B></P>
<UL>
<P>As I stated at the start of this document, following the procedure indicated
above worked for me. I am sure, however, that a few of the steps are unnecessary/non-optimised/stupid
etc. If any Unix (IRIX) boffin is reading this and you spot anything you
would like to comment/correct etc. please e-mail me (stuart@ludwig.ucl.ac.uk).
Also, if you just have questions and think I might help, please contact
me at the same e-mail.</P>
<P>Finally, I can accept no responsibility if these steps don't work for
you or if it all goes horribly wrong and you 'damage' your computer trying
them. Let common sense prevail!</P>
</UL>
<P>Good luck</P>
<P>Stuart Rison LICR University College London London W1P 8BT<BR>
<A HREF="mailto:stuart@ludwig.ucl.ac.uk">stuart@ludwig.ucl.ac.uk</A></P>
<a href="index.html#start">Back to index</a>
</BODY>
</HTML>
Cassileth, BR~Unorthodox Cancer Medicine~Cancer Investigation~~1986~4~6~591-598
<html><head><title>PgAccess - Common Problems</title></head>
<body bgcolor="#C0C0C0">
<h1>Common Problems with PgAccess</h1>
<a name="connfail"><h2>Connection failure</h2>
One of the most common initial problems is the message:<p>
<samp>Error connecting database<br>
Connection to database failed<br>
connectDB() failed: Is the<br>
postmaster running and<br>
accepting TCP/IP (with -i)<br>
connections at 'localhost' on<br>
port '5432'?</samp><p>
This usually occurs because the "postmaster" (the postgreSQL backend) was not
started with the <samp>-i</samp> option. Usually just adding <samp>-i</samp> to
the command line that starts the postmaster and restarting will fix this.<p>
If you have installed the prewritten script to start <b>postgreSQL</b>
automatically, this option is (currently) commented out:<p>
<samp># PGOPTS="-i"</samp><p>
just remove the hash and space and comment out the "blank" option above:<p>
<samp>PGOPTS=""</samp><p>
<a name="nonuser"><h2>User not defined</h2>
Initially, <b>postgreSQL</b> only has one user, <samp>postgres</samp>, and any
other user who starts up PgAccess will get the message:<p>
<samp>Error connecting database<br>
Connection to database failed<br>
FATAL 1: SetUserId: user<br>
'jim' is not in 'pg_shadow'</samp><p>
See <b>User Administration</b> in the <b>PgAccess tutorial</b> for a description
of how to create users.<p>
<a name="libpg"><h2>libpgtcl not found</h2>
PgAccess requires a library of functions named <samp>libpgtcl</samp>. This
should be available with the postgreSQL distribution, and is usually placed in
the correct location when installing postgreSQL. First check that there is a
file named <samp>libpgtcl.so</samp> (perhaps with a number appended - or
<samp>libpgtcl.dll</samp> on Windows systems) on your
system. If not, you will have to download and perhaps compile this library.<p>
<samp>ftp://ftp.flex.ro/pub/pgaccess</samp><p>
is one place that you can download precompiled libpgtcl libraries for
PgAccess.<p>
<a name="spchar">
<h2>Locale specific characters</h2>
This problem occurs with some special characters used in different
countries because PgAccess did not use fonts with `-ISO8859-1' encoding.<p>
One solution was proposed by H.P.Heidinger ( hph@hphbbs.ruhr.de) and
is very simple.<p>
If you look in the file pgaccess.tcl, you will find the fonts declared in
this manner:<p>
<TT>$ grep -e '-font' -i pgaccess.tcl<BR>
-font -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-* \<br>
...</TT></P>
The font declarations should be altered to:<p>
<tt>-font -Adobe-Helvetica-Medium-R-Normal-*-*-120-*-*-*-*-iso8859-1<br>
...</tt><p>
That is, inserting an asterisk between the first pair of hyphens, and changing
the final two asterisks to <samp>iso8859</samp> and <samp>1</samp>
respectively.<p>
You can alter the source code by running the following script :
<P><TT>#!/bin/sh<BR>
cp pgaccess.tcl pgaccess.tcl-org<BR>
cat pgaccess.tcl |\<BR>
sed -e's/\-\*\-\*\ /\-iso8859\-1\ /g' |\<BR>
sed -e's/\-\*\-\*\}/\-iso8859\-1}/g' |\<BR>
sed -e's/\-\*\-\*\]/\-iso8859\-1]/g' |\<BR>
sed -e's/\-\*\-\*$/\-iso8859\-1/g' |\<BR>
sed -e's/\-Clean\-/\-Fixed\-/g' |\<BR>
sed -e's/clean/fixed/g' &gt;pgaccess.iso<BR>
mv pgaccess.iso pgaccess.tcl<BR>
chmod +x pgaccess.tcl</TT><P>
The final version of PgAccess (1.0) will let the user decide what fonts
will be used through a &quot;preferences&quot; dialog window.</p>
<a name="pg63">
<h2>Problem with PostgreSQL 6.3.x</h2>
PgAccess 0.93 and later may have problems working with PostgreSQL 6.3.x.
Changes in libpgtcl have been made to remove these, but if you are
using PostgreSQL 6.3.x, this patch will allow you to get around the problems.<p>
In the procedure <tt>wpg_exec</tt> change the following line:<p>
<tt>set pgsql(errmsg) [pg_result $pgsql(res) -error]</tt><p>
to this:<p>
<tt>set pgsql(errmsg) "NO ERROR INFORMATION SUPPLIED"</tt><p>
and the program will work. The only disadvantage is that with some error
conditions, you will not get the appropriate error message from libpgtcl.<p>
<a href="index.html#problems">Back to index</a>
</body></html>
<html><head><title>PgAccess - Getting Started</title></head>
<body bgcolor="#C0C0C0">
<h1>PgAccess - Getting Started</h1>
<a name="getpga"><h2>How to get PgAccess</h2>
If you have this HTML help system, you have probably already downloaded
PgAccess. If not, or you wish to download the latest version, it is available
from the URL:<p>
<samp>http://www.flex.ro</samp><p>
The home page will contain instructions on which files to download for your
operating system. Download the file to a directory where the program will
eventually reside (see below).<p>
<a name="uncpga"><h2>How to uncompress PgAccess</h2>
PgAccess, like most applications available for download, is usually downloaded
in compressed format to save download time. You must uncompress these files in
order to use the application.<p>
<h3>UNIX (Linux, BSD, IRIX, Solaris, etc.)</h3>
The files will be compressed using "gzip" and packaged using "tar", and have
filenames like this:<p>
<samp>pgaccess-n.nn.tar.gz</samp><p>
Note that "n.nn" will be the version number in an actual file.<p>
First decide where you want to have the program. A typical location on UNIX
systems is <samp>/usr/local/src/&lt;name&gt;</samp>, where &lt;name&gt; is the name of
the program. To use this location, download or move the "tar.gz" file to the
directory <samp>/usr/local/src</samp>. Change to that directory, and
uncompress the file with the command:<p>
<samp>tar -zxvf pgaccess-n.nn.tar.gz</samp><p>
You should see the files listed as they are uncompressed and placed in the new
directory, and now have a directory named:<p>
<samp>/usr/local/src/pgaccess</samp><p>
In that directory will be all of the files that were packaged in the downloaded
file. When you have PgAccess working, you can delete the file with the ".tar"
or ".tar.gz" extension.
<h3>Windows</h3>
The files will be compressed so that "WinZip" will uncompress the package. Just
open the file with "WinZip" and the program files will be extracted.<p>
<a name="putpga"><h2>Putting PgAccess where it will be found</h2>
<h3>UNIX</h3>
In order to run PgAccess easily, the program file "pgaccess.tcl" should be in a
location on the "PATH" of the system. You can find out what the PATH is by
entering:<p>
<samp>echo $PATH<br>
/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:./:/usr/local/pgsql/bin
</samp><p>
Usually the directory <samp>/usr/local/bin</samp> will be in your PATH, and that
is a fairly common place to put programs like PgAccess. Other common
directories in the PATH are <samp>/usr/bin</samp> and <samp>/usr/sbin</samp>.
Simply move the file "pgaccess.tcl" to the directory where you want it.<p>
<h3>Windows</h3>
You will usually link PgAccess to an icon, so just specify the full path to the
program when you create the icon.
<a name=startpga"><h2>Starting PgAccess</h2>
The easiest way to start PgAccess is to simply invoke the program by name:<p>
<samp>pgaccess.tcl</samp><p>
If the program has been placed in a directory listed in the PATH, the PgAccess
window should appear.<p>
<h3>Starting from a menu</h3>
Most users will want to link the program to a menu or icon so that it can be
started using the mouse or other pointing device. Here is a method that will
work on most Linux X-Windows systems. Create a file named "pgaccess" in the directory
<samp>/etc/X11/wmconfig</samp> with the following contents:<p>
<samp>pgaccess name "PgAccess"<br>
pgaccess description "postgreSQL frontend"<br>
pgaccess mini-icon "mini-pgaccess.xpm"<br>
pgaccess group "Applications"<br>
pgaccess exec "pgaccess.tcl &"</samp><p>
This assumes that you have an "Applications" sub-menu. You may prefer
"Programs" or some other place. Also, you will have to create the
"mini-pgaccess.xpm" icon if you want it to appear. You can edit an existing
icon from the <samp>/usr/share/icons/mini</samp> directory in XPaint and rename
it. When you next start an X-Windows session, there should be a "PgAccess" item
on the menu that you have chosen. Clicking on this item should start
PgAccess.<p>
<a href="index.html#start">Back to index</a>
</body></html>
<html><head><title>PgAccess - Tutorial</title></head>
<body bgcolor="#C0C0C0">
<h1>PgAccess - Tutorial</h1>
<a name="admin"><h2>User Administration</h2>
The procedure for setting up <b>postgreSQL</b> usually results in a single user
named <samp>postgres</samp>. In order for anyone else to use <b>postgreSQL</b>,
users must be added. The program <samp>createuser</samp> accomplishes this.
First become the PostgreSQL administrator (usually <samp>postgres</samp>):<p>
<samp>su postgres</samp><p>
Then create a new user:<p>
<samp>createuser jim<br>
Enter user's postgres ID or RETURN to use unix user ID: 500 -&gt;<br>
Is user "jim" allowed to create databases (y/n) y<br>
Is user "jim" a superuser? (y/n) n<br>
createuser: jim was successfully added</samp><p>
You can use either the UNIX user ID or the postgres ID to identify users. See
the <b>postgreSQL</b> documentation in the "admin" section for a fuller
account of users and groups.<p>
To remove users, use the <samp>destroyuser</samp> command in the same way.<p>
<img src="screen1.jpg" border=1 align=right>
<a name="basic"><h2>Basic use of PgAccess</h2>
<h3>Creating a database</h3>
At the right is the window you should see when PgAccess starts up. The first
task for most users will be to create a database.<p>
Press the <em>New</em> button to bring up the window shown below. This will
allow you to specify the structure of the new table. It is important to note
that if you haven't specified a database when starting up PgAccess, this table
will be created in the database named <samp>&lt;username&gt;</samp>, your
username.<p>
Assume that you want to create a table with entries describing bibliographic
references in the field of chemistry. Choose a table name, such as
<samp>chemref</samp> that will be easy to recall and find in a list. Enter the
table name in the first input field.<p>
When you already have tables in a database, you can use the <em>Inherits</em>
button to toggle a list of existing tables to inherit characteristics of another
table. In this example, there should be no previous tables to use.<p>
Enter each field, giving it a name, field type and size, if the field type does
not imply the size. That is, if your first field was to be a sequence number,
and you selected <em>int2</em> as the field type, you would not have to specify
a field size. However, if your second field was to contain the author of the
reference, and was a <em>varchar</em> type, you would have to specify how many
characters would be allowed in the field.<p>
As you enter each field, click the <em>Add field</em> button to add it to the
list at the right side of the window. You can change the position of fields
using the <em>Move field up</em> and <em>Move field down</em> buttons, or delete
a field if you decide it isn't what you wanted. When you are finished
specifying fields, press the <em>Create table</em> button.<p>
<img src="newtable.jpg" border=1 align=right>
<a href="index.html#tut">Back to index</a>
</body></html>
<html><head><title>PgAccess Tutorial</title></head>
<body bgcolor="#C0C0C0">
<h1>PgAccess Tutorial - Editing a table</h1>
<img src="sel_tbl.jpg" border=1 align=right>
<h2>Adding records</h2>
Once you have a table, you can begin to add entries to it. In the main
PgAccess window, when you click the <em>Tables</em> button, you should see the
new table appear in the list of tables. Highlighting the table name by clicking
on it and clicking on the <em>Open</em> button will open that table in another
window, as shown below.<p>
The most straighforward way to add records to a table is to type the information
directly into the fields. Two records have been entered in the table shown. As
is common with this user interface, clicking the mouse while the pointer is in a
field will allow keyboard entry to that field. This type of entry is adequate
when the information arrives infrequently in small parcels, for instance in
keeping a table of contact information about other researchers. However, what
do you do when someone emails you the entire reference list for their doctoral
dissertation?<p>
This is best handled using the SQL <em>COPY</em> command.
First, the information will have to be massaged into shape in what is called a
'flat' ASCII file. This is simply a text file in which each line is a record,
and each field in each record is separated by a <em>delimiter</em> such as a
tilde (~). The fields will have to be in the same order as those in your table,
and there will have to be the same number of fields in each record as are in the
table, otherwise you may get unexpected data or no data at all. Say you produce
a text file named <samp>newref.txt</samp> that starts like this:<p>
<samp>Cassileth, BR~Unorthodox Cancer Medicine~Cancer Investigation~~1986~4~6~591-598
<br>...</samp><p>
Notice that there are two consecutive tildes to allow for the fact that this
particular entry doesn't have anything in the <b>Editor</b> field.
You can then perform a <em>Query</em> as follows:<p>
<samp>COPY psyref FROM '/home/jim/newref.txt' USING DELIMITERS
'~';</samp><p>
This will read the records from <samp>newref.txt</samp> and insert them into the
table <samp>psyref</samp>. See the PostgreSQL documentation under the headings
<br><b>Tutorial|The Query Language|Populating a Class with Instances</b><p>
<img src="addref.jpg" border=1 align=right>
<a href="index.html#tut">Back to index</a>
</body></html>
<html><head><title>PgAccess Tutorial</title></head>
<body bgcolor="#C0C0C0">
<h1>PgAccess Tutorial - Creating a table</h1>
<img src="screen1.jpg" border=1 align=right>
<h2>Creating a table</h2>
At the right is the window you should see when PgAccess starts up. The first
task for most users will be to create a database. Notice the 'buttons' at the
left of the main window. Clicking on these allows you to see the names of
different <em>objects</em> that are stored in your database, which should be
empty at the moment.<p>
Click the <em>Tables</em> and <em>New</em> buttons to bring up the window shown
below. This will allow you to specify the structure of the new table. It is
important to note that if you haven't specified a database when starting up
PgAccess, this table will be created in the database named
<samp>&lt;username&gt;</samp>, your username.<p>
Assume that you want to create a table with entries describing bibliographic
references in the field of psychology. Choose a table name, such as
<samp>psyref</samp> that will be easy to recall and find in a list. Enter the
table name in the first input field.<p>
When you already have tables in a database, you can use the <em>Inherits</em>
button to toggle a list of existing tables to inherit characteristics of another
table. In this example, there should be no previous tables to use.<p>
Enter each field, giving it a name, field type and size, if the field type does
not imply the size. That is, if your first field was to be a sequence number,
and you selected <em>int2</em> as the field type, you would not have to specify
a field size. However, if your second field was to contain the author of the
reference, and was a <em>varchar</em> type, you would have to specify how many
characters would be allowed in the field.<p>
As you enter each field, click the <em>Add field</em> button to add it to the
list at the right side of the window. You can change the position of fields
using the <em>Move field up</em> and <em>Move field down</em> buttons, or delete
a field if you decide it isn't what you wanted. When you are finished
specifying fields, press the <em>Create table</em> button.<p>
<img src="newtable.jpg" border=1 align=right>
<a href="index.html#tut">Back to index</a>
</body></html>
<html><head><title>PgAccess Tutorial</title></head>
<body bgcolor="#C0C0C0">
<h1>PgAccess Tutorial - SELECT</h1>
<img src="altern_q.jpg" border=1 align=right>
<h2>What is a query?</h2>
<em>Query</em> is the term for an SQL command which will perform an operation
on a table. It is sometimes confusing to newcomers, as some of the operations
seem to have nothing to do with querying in the common sense of <em>asking</em>.
As we saw in the previous section, a <em>query</em> can simply copy
records from an ASCII file to a table.<p>
The PostgreSQL documentation has a complete list of <em>queries</em> that can be
used. We'll start with the common task of selecting records with certain
characteristics.<p>
<h2>Selecting records</h2>
<img src="altern_v.jpg" border=1 align=right>
Suppose that I want to know all of the references in the sample table
<em>psyref</em> for which the word "alternative" appeared in the title.<p>
By clicking <em>Query</em>, then <em>New</em>, a <b>Query builder</b> window will
appear. Clicking in the area below the buttons will allow the user to enter an
SQL <em>query</em>. The specification of the <em>query</em> must be exact or
PostgreSQL will return an error message.<p>
The <em>query</em> shown will <b>SELECT</b> those records from <em>psyref</em>
that contain the word "alternative" anywhere in the <em>title</em> field. The
'*' indicates that all of the fields are to be returned. You might only want to
return, for instance, the <em>author</em> field if you were only interested in
which authors had used that word in the title of their work.<p>
At the right is the record that fulfils these conditions, displayed in the
<b>Table viewer</b>. If you wanted to save this query for use again,
clicking the <em>Save query definition</em> button will do so. You will then
see <em>altern</em> listed under <em>Queries</em> when you return to the main
window. By clicking the <em>Save this query as a view</em> tickbox in the
<b>Query builder</b>, the result of your query will be saved as a
<em>View</em> which you can access from <em>Views</em> in the main window.
Click the <em>Close</em> button to leave the <b>Query builder</b>.<p>
<a href="index.html#tut">Back to index</a>
</body></html>
<html><head><title>PgAccess Tutorial</title></head>
<body bgcolor="#C0C0C0">
<h1>PgAccess Tutorial - User Administration</h1>
While user administration is really not a part of the PgAccess program, it is
such a basic operation that a brief description is given here.
<h2>Creating users</h2>
The procedure for setting up <b>postgreSQL</b> usually results in a single user
named <samp>postgres</samp>. In order for anyone else to use <b>postgreSQL</b>,
users must be added. The program <samp>createuser</samp> accomplishes this.
First become the PostgreSQL administrator (usually <samp>postgres</samp>):<p>
<samp>su postgres</samp><p>
Then create a new user:<p>
<samp>createuser jim<br>
Enter user's postgres ID or RETURN to use unix user ID: 500 -&gt;<br>
Is user "jim" allowed to create databases (y/n) y<br>
Is user "jim" a superuser? (y/n) y<br>
createuser: jim was successfully added</samp><p>
You can use either the UNIX user ID or the postgres ID to identify users. See
the <b>postgreSQL</b> documentation in the "admin" section for a fuller
account of users and groups.<p>
The reason for using the command line to create the first user (other than
<em>postgres</em>) is that <em>postgres</em> may not have X-Window permission.
You can also create users using <b>PgAccess</b> if you are created as a
<em>superuser</em> as shown in the example above.<p>
<h2>Removing users</h2>
To remove users, use the <samp>destroyuser</samp> command in the same way.<p>
<a href="index.html#tut">Back to index</a>
</body></html>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.61 [en] (X11; I; Linux 2.2.11 i586) [Netscape]">
</head>
<body bgcolor="#FEFEDF">
<b>29 August 1999</b> - PgAccess 0.98 has been released!
<ul>
<li>
international version (romanian, french, italian translations available)
in separate files (japanese translation now possible)</li>
<li>
context sensitive help, complete help for SQL commands</li>
<li>
geometry changes for many forms</li>
<li>
form designer enhancements (widget icons , new attribute window style,
form startup script)</li>
<li>
ability to inspect PostgreSQL system tables (preferences)</li>
<li>
enhanced table design window, table permissions</li>
<li>
distribution archive changes</li>
<li>
unified internal global variables</li>
<li>
unified internal window naming conventions</li>
<li>
usage of Tcl namespaces for all modules</li>
<li>
PgAccess developer <a href="api.html">API</a></li>
<li>
web site enhancements</li>
</ul>
</body>
</html>
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.61 [en] (X11; I; Linux 2.2.11 i586) [Netscape]">
</head>
<body bgcolor="#FEFEDF">
<h2>
PgAccess on Win32</h2>
<hr>In order to run PgAccess on a Win32 workstation you should follow the
following steps:
<ol>
<li>
download and install a Tcl/Tk package from <a href="http://www.scriptics.com">Scriptics</a>
(8.0.x or 8.1.x)</li>
<li>
install PgAccess package</li>
<li>
check the Tcl/Tk version that you have</li>
<li>
check the PostgreSQL version installed on your database server machine</li>
<li>
get from win32/dll directory the appropriate libraries suitable for your
Tcl/Tk version and PostgreSQL version and copy them into your Windows/System
directory renaming them as libpq.dll and libpgtcl.dll</li>
<li>
check if your win32 workstation is able to see your database server (ping
yourdatabaseserver)</li>
<li>
ask your database administrator to verify if your win32 workstation has
access rights to the database (pg_hba.conf)</li>
</ol>
<p><br>You should be able to run PgAccess.
<br>&nbsp;
</body>
</html>
namespace eval Database {
proc {getTablesList} {} {
global CurrentDB PgAcVar
set tlist {}
if {[catch {
wpg_select $CurrentDB "select c.relname,count(c.relname) from pg_class C, pg_rewrite R where (r.ev_class = C.oid) and (r.ev_type = '1') group by relname" rec {
if {$rec(count)!=0} {
set itsaview($rec(relname)) 1
}
}
if {! $PgAcVar(pref,systemtables)} {
wpg_select $CurrentDB "select relname from pg_class where (relname !~ '^pg_') and (relkind='r') order by relname" rec {
if {![regexp "^pga_" $rec(relname)]} then {
if {![info exists itsaview($rec(relname))]} {
lappend tlist $rec(relname)
}
}
}
} else {
wpg_select $CurrentDB "select relname from pg_class where (relkind='r') order by relname" rec {
if {![info exists itsaview($rec(relname))]} {
lappend tlist $rec(relname)
}
}
}
} gterrmsg]} {
showError $gterrmsg
}
return $tlist
}
proc {vacuum} {} {
global PgAcVar CurrentDB
if {$CurrentDB==""} return;
set PgAcVar(statusline,dbname) [format [intlmsg "vacuuming database %s ..."] $PgAcVar(currentdb,dbname)]
setCursor CLOCK
set pgres [wpg_exec $CurrentDB "vacuum;"]
catch {pg_result $pgres -clear}
setCursor DEFAULT
set PgAcVar(statusline,dbname) $PgAcVar(currentdb,dbname)
}
proc {getPgType} {oid} {
global CurrentDB
set temp "unknown"
wpg_select $CurrentDB "select typname from pg_type where oid=$oid" rec {
set temp $rec(typname)
}
return $temp
}
proc {executeUpdate} {sqlcmd} {
global CurrentDB
return [sql_exec noquiet $sqlcmd]
}
}
This diff is collapsed.
namespace eval Functions {
proc {new} {} {
global PgAcVar
Window show .pgaw:Function
set PgAcVar(function,name) {}
set PgAcVar(function,nametodrop) {}
set PgAcVar(function,parameters) {}
set PgAcVar(function,returns) {}
set PgAcVar(function,language) {}
.pgaw:Function.fs.text1 delete 1.0 end
focus .pgaw:Function.fp.e1
wm transient .pgaw:Function .pgaw:Main
}
proc {design} {functionname} {
global PgAcVar CurrentDB
Window show .pgaw:Function
.pgaw:Function.fs.text1 delete 1.0 end
wpg_select $CurrentDB "select * from pg_proc where proname='$functionname'" rec {
set PgAcVar(function,name) $functionname
set temppar $rec(proargtypes)
set PgAcVar(function,returns) [Database::getPgType $rec(prorettype)]
set funcnrp $rec(pronargs)
set prolanguage $rec(prolang)
.pgaw:Function.fs.text1 insert end $rec(prosrc)
}
wpg_select $CurrentDB "select lanname from pg_language where oid=$prolanguage" rec {
set PgAcVar(function,language) $rec(lanname)
}
if { $PgAcVar(function,language)=="C" || $PgAcVar(function,language)=="c" } {
wpg_select $CurrentDB "select probin from pg_proc where proname='$functionname'" rec {
.pgaw:Function.fs.text1 delete 1.0 end
.pgaw:Function.fs.text1 insert end $rec(probin)
}
}
set PgAcVar(function,parameters) {}
for {set i 0} {$i<$funcnrp} {incr i} {
lappend PgAcVar(function,parameters) [Database::getPgType [lindex $temppar $i]]
}
set PgAcVar(function,parameters) [join $PgAcVar(function,parameters) ,]
set PgAcVar(function,nametodrop) "$PgAcVar(function,name) ($PgAcVar(function,parameters))"
}
proc {save} {} {
global PgAcVar
if {$PgAcVar(function,name)==""} {
focus .pgaw:Function.fp.e1
showError [intlmsg "You must supply a name for this function!"]
} elseif {$PgAcVar(function,returns)==""} {
focus .pgaw:Function.fp.e3
showError [intlmsg "You must supply a return type!"]
} elseif {$PgAcVar(function,language)==""} {
focus .pgaw:Function.fp.e4
showError [intlmsg "You must supply the function language!"]
} else {
set funcbody [.pgaw:Function.fs.text1 get 1.0 end]
regsub -all "\n" $funcbody " " funcbody
if {$PgAcVar(function,nametodrop) != ""} {
if {! [sql_exec noquiet "drop function $PgAcVar(function,nametodrop)"]} {
return
}
}
if {[sql_exec noquiet "create function $PgAcVar(function,name) ($PgAcVar(function,parameters)) returns $PgAcVar(function,returns) as '$funcbody' language '$PgAcVar(function,language)'"]} {
Window destroy .pgaw:Function
tk_messageBox -title PostgreSQL -parent .pgaw:Main -message [intlmsg "Function saved!"]
Mainlib::tab_click Functions
}
}
}
}
proc vTclWindow.pgaw:Function {base} {
global PgAcVar
if {$base == ""} {
set base .pgaw:Function
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
toplevel $base -class Toplevel
wm focusmodel $base passive
wm geometry $base 480x330+98+212
wm maxsize $base 1009 738
wm minsize $base 480 330
wm overrideredirect $base 0
wm resizable $base 1 1
wm deiconify $base
wm title $base [intlmsg "Function"]
bind $base <Key-F1> "Help::load functions"
frame $base.fp \
-height 88 -relief groove -width 125
label $base.fp.l1 \
-borderwidth 0 -relief raised -text [intlmsg Name]
entry $base.fp.e1 \
-background #fefefe -borderwidth 1 -textvariable PgAcVar(function,name)
bind $base.fp.e1 <Key-Return> {
focus .pgaw:Function.fp.e2
}
label $base.fp.l2 \
-borderwidth 0 -relief raised -text [intlmsg Parameters]
entry $base.fp.e2 \
-background #fefefe -borderwidth 1 -textvariable PgAcVar(function,parameters) -width 15
bind $base.fp.e2 <Key-Return> {
focus .pgaw:Function.fp.e3
}
label $base.fp.l3 \
-borderwidth 0 -relief raised -text [intlmsg Returns]
entry $base.fp.e3 \
-background #fefefe -borderwidth 1 -textvariable PgAcVar(function,returns)
bind $base.fp.e3 <Key-Return> {
focus .pgaw:Function.fp.e4
}
label $base.fp.l4 \
-borderwidth 0 -relief raised -text [intlmsg Language]
entry $base.fp.e4 \
-background #fefefe -borderwidth 1 -textvariable PgAcVar(function,language) -width 15
bind $base.fp.e4 <Key-Return> {
focus .pgaw:Function.fs.text1
}
label $base.fp.lspace \
-borderwidth 0 -relief raised -text { }
frame $base.fs \
-borderwidth 2 -height 75 -relief groove -width 125
text $base.fs.text1 \
-background #fefefe -foreground #000000 -borderwidth 1 -font $PgAcVar(pref,font_fix) -height 16 \
-tabs {20 40 60 80 100 120} -width 43 -yscrollcommand {.pgaw:Function.fs.vsb set}
scrollbar $base.fs.vsb \
-borderwidth 1 -command {.pgaw:Function.fs.text1 yview} -orient vert
frame $base.fb \
-borderwidth 2 -height 75 -width 125
frame $base.fb.fbc \
-borderwidth 2 -height 75 -width 125
button $base.fb.fbc.btnsave -command {Functions::save} \
-borderwidth 1 -padx 9 -pady 3 -text [intlmsg Save]
button $base.fb.fbc.btnhelp -command {Help::load functions} \
-borderwidth 1 -padx 9 -pady 3 -text [intlmsg Help]
button $base.fb.fbc.btncancel \
-borderwidth 1 -command {Window destroy .pgaw:Function} -padx 9 -pady 3 \
-text [intlmsg Cancel]
pack $base.fp \
-in .pgaw:Function -anchor center -expand 0 -fill x -side top
grid $base.fp.l1 \
-in .pgaw:Function.fp -column 0 -row 0 -columnspan 1 -rowspan 1 -sticky w
grid $base.fp.e1 \
-in .pgaw:Function.fp -column 1 -row 0 -columnspan 1 -rowspan 1
grid $base.fp.l2 \
-in .pgaw:Function.fp -column 3 -row 0 -columnspan 1 -rowspan 1 -sticky w
grid $base.fp.e2 \
-in .pgaw:Function.fp -column 4 -row 0 -columnspan 1 -rowspan 1 -pady 2
grid $base.fp.l3 \
-in .pgaw:Function.fp -column 0 -row 4 -columnspan 1 -rowspan 1 -sticky w
grid $base.fp.e3 \
-in .pgaw:Function.fp -column 1 -row 4 -columnspan 1 -rowspan 1
grid $base.fp.l4 \
-in .pgaw:Function.fp -column 3 -row 4 -columnspan 1 -rowspan 1 -sticky w
grid $base.fp.e4 \
-in .pgaw:Function.fp -column 4 -row 4 -columnspan 1 -rowspan 1 -pady 3
grid $base.fp.lspace \
-in .pgaw:Function.fp -column 2 -row 4 -columnspan 1 -rowspan 1
pack $base.fs \
-in .pgaw:Function -anchor center -expand 1 -fill both -side top
pack $base.fs.text1 \
-in .pgaw:Function.fs -anchor center -expand 1 -fill both -side left
pack $base.fs.vsb \
-in .pgaw:Function.fs -anchor center -expand 0 -fill y -side right
pack $base.fb \
-in .pgaw:Function -anchor center -expand 0 -fill x -side bottom
pack $base.fb.fbc \
-in .pgaw:Function.fb -anchor center -expand 0 -fill none -side top
pack $base.fb.fbc.btnsave \
-in .pgaw:Function.fb.fbc -anchor center -expand 0 -fill none -side left
pack $base.fb.fbc.btnhelp \
-in .pgaw:Function.fb.fbc -anchor center -expand 0 -fill none -side left
pack $base.fb.fbc.btncancel \
-in .pgaw:Function.fb.fbc -anchor center -expand 0 -fill none -side right
}
namespace eval Help {
proc {findLink} {} {
foreach tagname [.pgaw:Help.f.t tag names current] {
if {$tagname!="link"} {
load $tagname
return
}
}
}
proc {load} {topic args} {
global PgAcVar
if {![winfo exists .pgaw:Help]} {
Window show .pgaw:Help
tkwait visibility .pgaw:Help
}
wm deiconify .pgaw:Help
if {![info exists PgAcVar(help,history)]} {
set PgAcVar(help,history) {}
}
if {[llength $args]==1} {
set PgAcVar(help,current_topic) [lindex $args 0]
set PgAcVar(help,history) [lrange $PgAcVar(help,history) 0 [lindex $args 0]]
} else {
lappend PgAcVar(help,history) $topic
set PgAcVar(help,current_topic) [expr {[llength $PgAcVar(help,history)]-1}]
}
# Limit the history length to 100 topics
if {[llength $PgAcVar(help,history)]>100} {
set PgAcVar(help,history) [lrange $PgAcVar(help,history) 1 end]
}
.pgaw:Help.f.t configure -state normal
.pgaw:Help.f.t delete 1.0 end
.pgaw:Help.f.t tag configure bold -font $PgAcVar(pref,font_bold)
.pgaw:Help.f.t tag configure italic -font $PgAcVar(pref,font_italic)
.pgaw:Help.f.t tag configure large -font {Helvetica -14 bold}
.pgaw:Help.f.t tag configure title -font $PgAcVar(pref,font_bold) -justify center
.pgaw:Help.f.t tag configure link -font {Helvetica -12 underline} -foreground #000080
.pgaw:Help.f.t tag configure code -font $PgAcVar(pref,font_fix)
.pgaw:Help.f.t tag configure warning -font $PgAcVar(pref,font_bold) -foreground #800000
.pgaw:Help.f.t tag bind link <Button-1> {Help::findLink}
set errmsg {}
.pgaw:Help.f.t configure -tabs {30 60 90 120 150 180 210 240 270 300 330 360 390}
catch { source [file join $PgAcVar(PGACCESS_HOME) lib help $topic.hlp] } errmsg
if {$errmsg!=""} {
.pgaw:Help.f.t insert end "Error loading help file [file join $PgAcVar(PGACCESS_HOME) $topic.hlp]\n\n$errmsg" bold
}
.pgaw:Help.f.t configure -state disabled
focus .pgaw:Help.f.sb
}
proc {back} {} {
global PgAcVar
if {![info exists PgAcVar(help,history)]} {return}
if {[llength $PgAcVar(help,history)]==0} {return}
set i $PgAcVar(help,current_topic)
if {$i<1} {return}
incr i -1
load [lindex $PgAcVar(help,history) $i] $i
}
}
proc vTclWindow.pgaw:Help {base} {
global PgAcVar
if {$base == ""} {
set base .pgaw:Help
}
if {[winfo exists $base]} {
wm deiconify $base; return
}
toplevel $base -class Toplevel
wm focusmodel $base passive
set sw [winfo screenwidth .]
set sh [winfo screenheight .]
set x [expr {($sw - 640)/2}]
set y [expr {($sh - 480)/2}]
wm geometry $base 640x480+$x+$y
wm maxsize $base 1009 738
wm minsize $base 1 1
wm overrideredirect $base 0
wm resizable $base 1 1
wm deiconify $base
wm title $base [intlmsg "Help"]
bind $base <Key-Escape> "Window destroy .pgaw:Help"
frame $base.fb \
-borderwidth 2 -height 75 -relief groove -width 125
button $base.fb.bback \
-command Help::back -padx 9 -pady 3 -text [intlmsg Back]
button $base.fb.bi \
-command {Help::load index} -padx 9 -pady 3 -text [intlmsg Index]
button $base.fb.bp \
-command {Help::load postgresql} -padx 9 -pady 3 -text PostgreSQL
button $base.fb.btnclose \
-command {Window destroy .pgaw:Help} -padx 9 -pady 3 -text [intlmsg Close]
frame $base.f \
-borderwidth 2 -height 75 -relief groove -width 125
text $base.f.t \
-borderwidth 1 -cursor {} -font $PgAcVar(pref,font_normal) -height 2 \
-highlightthickness 0 -state disabled \
-tabs {30 60 90 120 150 180 210 240 270 300 330 360 390} -width 8 \
-wrap word -yscrollcommand {.pgaw:Help.f.sb set}
scrollbar $base.f.sb \
-borderwidth 1 -command {.pgaw:Help.f.t yview} -highlightthickness 0 \
-orient vert
pack $base.fb \
-in .pgaw:Help -anchor center -expand 0 -fill x -side top
pack $base.fb.bback \
-in .pgaw:Help.fb -anchor center -expand 0 -fill none -side left
pack $base.fb.bi \
-in .pgaw:Help.fb -anchor center -expand 0 -fill none -side left
pack $base.fb.bp \
-in .pgaw:Help.fb -anchor center -expand 0 -fill none -side left
pack $base.fb.btnclose \
-in .pgaw:Help.fb -anchor center -expand 0 -fill none -side right
pack $base.f \
-in .pgaw:Help -anchor center -expand 1 -fill both -side top
pack $base.f.t \
-in .pgaw:Help.f -anchor center -expand 1 -fill both -side left
pack $base.f.sb \
-in .pgaw:Help.f -anchor center -expand 0 -fill y -side right
}
.pgaw:Help.f.t insert end \
"ABORT" {bold} " rolls back the current transaction and causes all the updates made by the transaction to be discarded. This command is identical in behavior to the SQL92 command ROLLBACK, and is present only for historical reasons.
" {} "Synopsis" {bold} "
" {} "ABORT" {code} "
" {} "Compatibility SQL92" {bold} "
This command is a Postgres extension present for historical reasons. " {} "ROLLBACK" {bold} " is the SQL92 equivalent command."
.pgaw:Help.f.t insert end \
"Adding new records to an existing table" {bold} "
" {} "Open a table for viewing and editing" {link open_table} " and move to the end of the displayed records using the vertical scrollbar. You will find there a single row containing only * characters. Click with the mouse on a field and start edit the new record. Move through the fields using Tab and Shift-Tab.
The new record will be saved into the database when you will select another record (or press on the mouse right-button).
"
.pgaw:Help.f.t insert end "ALTER TABLE" {bold} " changes the definition of an existing table. The new columns and their types are specified in the same style and with the the same restrictions as in CREATE TABLE. The RENAME clause causes the name of a table or column to change without changing any of the data contained in the affected table. Thus, the table or column will remain of the same type and size after this command is executed.
" {} "Synopsis" {bold} "
ALTER TABLE table \[ * \] ADD \[ COLUMN \] column type
ALTER TABLE table \[ * \] RENAME \[ COLUMN \] column TO newcolumn
ALTER TABLE table RENAME TO newtable
" {code} "table" {italic} "
The name of an existing table to alter.
" {} "column" {italic} "
Name of a new or existing column.
" {} "type " {italic} "
Type of the new column.
" {} "newcolumn " {italic} "
New name for an existing column.
" {} "newtable " {italic} "
New name for an existing column.
You must own the table in order to change its schema.
" {} "Notes:" {italic} " The keyword COLUMN is noise and can be omitted.
\"\[*\]\" following a name of a table indicates that statement should be run over that table and all tables below it in the inheritance hierarchy. The PostgreSQL User's Guide has further information on inheritance.
Refer to " {} "CREATE TABLE" {link create_table} " for a further description of valid arguments."
.pgaw:Help.f.t insert end "ALTER USER" {bold} " is used to change the attributes of a user's Postgres account. Please note that \
it is not possible to alter a user's " {} "usesysid" {bold} " via the alter user statement. Also, it is only possible for \
the Postgres user or any user with read and modify permissions on " {} "pg_shadow" {bold} " to alter user passwords. \
If any of the clauses of the alter user statement are omitted, the corresponding value in the " {} "pg_shadow" {bold} " table is left unchanged. \
" {} "Synopsis" {bold} "
ALTER USER username
\[ WITH PASSWORD password \]
\[ CREATEDB | NOCREATEDB \]
\[ CREATEUSER | NOCREATEUSER \]
\[ IN GROUP groupname \[, ...\] \]
\[ VALID UNTIL 'abstime' \]
" {code} "Inputs" {bold} "
Refer to CREATE USER for a detailed description of each clause.
" {} "username" {italic} "
The Postgres account name of the user whose details are to be altered.
" {} "password" {italic} "
The new password to be used for this account.
" {} "groupname" {italic} "
The name of an access group into which this account is to be put.
" {} "abstime" {italic} "
The date (and, optionally, the time) at which this user's access is to be terminated.
" {} "Outputs" {bold} "
" {} "ALTER USER" {italic} "
Message returned if the alteration was successful.
" {} "ERROR: alterUser: user 'username' does not exist" {italic} "
Error message returned if the user specified doesn't exist.
" {} "Notes" {italic} "
" {} "ALTER USER" {bold} " statement is a Postgres language extension.
Refer to CREATE/DROP USER to create or remove a user account.
In the current release (v6.5), the IN GROUP clause is parsed but has no affect. When it is fully implemented, it is intended to modify the pg_group relation.
" {} "Compatibility" {bold} "
SQL92
There is no ALTER USER statement in SQL92. The standard leaves the definition of users to the \
implementation."
.pgaw:Help.f.t insert end \
"The author of PgAccess\n" {title} \
"
My name is Constantin Teodorescu, I'm 36 years old, I have graduated the Faculty of Computers and Automation Bucharest, ROMANIA, I have a 16 year experience in developing applications in various languages, Pascal, C, C++, Visual Basic, Delphi, Perl , Tcl/Tk and Java for different platforms. Currently working as a manager of a team that works in Unix with Java , SQL databases (Oracle, SYBASE) currently using PostgreSQL database for developing professional client/server multi-platform applications (standalone Java or Tcl/Tk ,Java applets) for different customers and various projects (accounting, invoicing, stock inventory).
In present I am the technical manager of FLEX Consulting Braila, a computer shop, software company, networking designer and consultant, ISP provider for Braila city. I'm also a columnist in the romanian technical magazine \"PC-Magazine\" and \"BYTE\".
I have discovered PostgreSQL in 1995 and from the first moment I decided to help it's development writting PgAccess, a graphical interface.
The work has been done using Visual Tcl, in my opinion the best tool for developing Tcl/Tk projects. Visual Tcl is free, more information at http://www.neuron.com/stewart/vtcl/index.html
I'm waiting for any suggestions at e-mail address teo@flex.ro"
.pgaw:Help.f.t insert end "BEGIN" {bold} "
By default, Postgres executes transactions in unchained mode (also known as " {} "autocommit" {bold} " in other database systems). In other words, each user statement is executed in its own transaction \
and a commit is implicitly performed at the end of the statement (if execution was successful, otherwise a rollback is done). BEGIN initiates a user transaction in chained mode, i.e. all user \
statements after BEGIN command will be executed in a single transaction until an explicit COMMIT, ROLLBACK or execution abort. Statements in chained mode are executed much faster, \
because transaction start/commit requires significant CPU and disk activity. Execution of multiple statements inside a transaction is also required for consistency when changing several related \
tables. \
The default transaction isolation level in Postgres is READ COMMITTED, where queries inside the transaction see only changes committed before query execution. So, you have to use SET \
TRANSACTION ISOLATION LEVEL SERIALIZABLE just after BEGIN if you need more rigorous transaction isolation. In SERIALIZABLE mode queries will see only changes committed \
before the entire transaction began (actually, before execution of the first DML statement in a serializable transaction). \
If the transaction is committed, Postgres will ensure either that all updates are done or else that none of them are done. Transactions have the standard ACID (atomic, consistent, isolatable, and durable) property.
" {} "Synopsis" {bold} "
" {} "
BEGIN \[ WORK | TRANSACTION \]
" {code} "Notes" {bold} "
The keyword TRANSACTION is just a cosmetic alternative to WORK. Neither keyword need be specified.
Refer to the LOCK statement for further information about locking tables inside a transaction.
Use " {} "COMMIT" {link commit} " or " {} "ROLLBACK" {link rollback} " to terminate a transaction.
" {} "Usage" {bold} "
To begin a user transaction:
" {} "BEGIN WORK;" {italic} "
" {} "Compatibility" {bold} "
BEGIN is a Postgres language extension.
" {} "SQL92" {bold} "
There is no explicit BEGIN WORK command in SQL92; transaction initiation is always implicit and it terminates either with a COMMIT or with a ROLLBACK statement.
Note: Many relational database systems offer an autocommit feature as a convenience.
SQL92 also requires SERIALIZABLE to be the default transaction isolation level. "
.pgaw:Help.f.t insert end "CLOSE" {bold} " frees the resources associated with an open cursor. After the cursor is closed, no subsequent operations are allowed on it. A cursor should be closed when it is no longer needed. \
An implicit close is executed for every open cursor when a transaction is terminated by \
" {} "COMMIT" {link commit} " or " {} "ROLLBACK" {link rollback} ".
" {} "Synopsis" {bold} "
CLOSE cursor
" {} "Usage" {bold} "
Close the cursor liahona:
CLOSE liahona;
" {} "Compatibility" {bold} "
SQL92
CLOSE is fully compatible with SQL92
" {} "Notes" {bold} "
Postgres does not have an explicit OPEN cursor statement; a cursor is considered open when it is declared. Use the DECLARE statement to declare a cursor."
.pgaw:Help.f.t insert end "CLUSTER" {bold} " instructs Postgres to cluster the class specified by classname approximately based on the index specified by indexname. The index must already have been defined on classname. \
When a class is clustered, it is physically reordered based on the index information. The clustering is static. In other words, as the class is updated, the changes are not clustered. No attempt is \
made to keep new instances or updated tuples clustered. If one wishes, one can recluster manually by issuing the command \
again.
" {} "Synopsis" {bold} "
CLUSTER indexname ON table
" {} "Inputs" {bold} "
" {} "indexname" {italic} "
The name of an index.
" {} "table" {italic} "
The name of a table.
" {} "Outputs" {bold} "
CLUSTER
The clustering was done successfully.
ERROR: relation <tablerelation_number> inherits \"invoice\"
ERROR: Relation x does not exist!
" {} "Usage" {bold} "
Cluster the employees relation on the basis of its salary attribute
CLUSTER emp_ind ON emp
" {} "Notes" {bold} "
The table is actually copied to a temporary table in index order, then renamed back to the original name. For this reason, all grant permissions and other indexes are lost when clustering is \
performed.
In cases where you are accessing single rows randomly within a table, the actual order of the data in the heap table is unimportant. However, if you tend to access some data more than others, \
and there is an index that groups them together, you will benefit from using CLUSTER.
Another place CLUSTER is helpful is in cases where you use an index to pull out several rows from a table. If you are requesting a range of indexed values from a table, or a single indexed \
value that has multiple rows that match, CLUSTER will help because once the index identifies the heap page for the first row that matches, all other rows that match are probably already on the \
same heap page, saving disk accesses and speeding up the query.
There are two ways to cluster data. The first is with the CLUSTER command, which reorders the original table with the ordering of the index you specify. This can be slow on large tables \
because the rows are fetched from the heap in index order, and if the heap table is unordered, the entries are on random pages, so there is one disk page retrieved for every row moved. Postgres \
has a cache, but the majority of a big table will not fit in the cache.
Another way to cluster data is to use
SELECT ... INTO TABLE temp FROM ... ORDER BY ...
This uses the Postgres sorting code in ORDER BY to match the index, and is much faster for unordered data. You then drop the old table, use ALTER TABLE/RENAME to rename temp to \
the old name, and recreate any indexes. The only problem is that OIDs will not be preserved. From then on, CLUSTER should be fast because most of the heap data has already been ordered, \
and the existing index is used. "
.pgaw:Help.f.t insert end "COMMIT" {bold} " commits the current transaction. All changes made by the transaction become visible to others and are guaranteed to be durable if a crash occurs.
" {} "Synopsis" {bold} "
" {} "
COMMIT \[ WORK | TRANSACTION \]
" {code} "Usage" {bold} "
To make all changes permanent:
COMMIT WORK;
" {} "Notes" {bold} "
The keywords WORK and TRANSACTION are noise and can be omitted.
Use " {} "ROLLBACK" {link rollback} " to abort a transaction."
This diff is collapsed.
.pgaw:Help.f.t insert end \
"Copyrights\n\n" {title} \
"
PostgreSQL is Copyright © 1996-9 by the PostgreSQL Global Development Group, and is distributed under the terms of the Berkeley license.
Postgres95 is Copyright © 1994-5 by the Regents of the University of California. Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
In no event shall the University of California be liable to any party for direct, indirect, special, incidental, or consequential damages, including lost profits, arising out of the use of this software and its documentation, even if the University of California has been advised of the possibility of such damage.
The University of California specifically disclaims any warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The software provided hereunder is on an \"as-is\" basis, and the University of California has no obligations to provide maintainance, support, updates, enhancements, or modifications.
"
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
.pgaw:Help.f.t insert end \
"CREATE SEQUENCE" {bold} " will enter a new sequence number generator into the current data base. This involves creating and initialising a new single-row table with the name seqname. The generator will be \"owned\" by the user issuing the command.
After a sequence is created, you may use the function nextval(seqname) to get a new number from the sequence. The function currval('seqname') may be used to determine the number returned by the last call to nextval(seqname) for the specified sequence in the current session. The function setval('seqname', newvalue) may be used to set the current value of the specified sequence. The next call to nextval(seqname) will return the given value plus the sequence increment.
" {} "Synopsis" {bold} "
CREATE SEQUENCE seqname
\[ INCREMENT increment \]
\[ MINVALUE minvalue \]
\[ MAXVALUE maxvalue \]
\[ START start \]
\[ CACHE cache \]
\[ CYCLE \]
" {code} "
" {} "Inputs" {bold} "
" {} "seqname" {italic} "
The name of a sequence to be created.
" {} "increment" {italic} "
The INCREMENT increment clause is optional. A positive value will make an ascending sequence, a negative one a descending sequence. The default value is one (1).
" {} "minvalue" {italic} "
The optional clause MINVALUE minvalue determines the minimum value a sequence can generate. The defaults are 1 and -2147483647 for ascending and descending sequences, respectively.
" {} "maxvalue" {italic} "
Use the optional clause MAXVALUE maxvalue to determine the maximum value for the sequence. The defaults are 2147483647 and -1 for ascending and descending sequences, respectively.
" {} "start" {italic} "
The optional START start clause enables the sequence to begin anywhere. The default starting value is minvalue for ascending sequences and maxvalue for descending ones.
" {} "cache" {italic} "
The CACHE cache option enables sequence numbers to be preallocated and stored in memory for faster access. The minimum value is 1 (only one value can be generated at a time, i.e. no cache) and this is also the default.
" {} "CYCLE" {italic} "
The optional CYCLE keyword may be used to enable the sequence to continue when the maxvalue or minvalue has been reached by an ascending or descending sequence respectively. If the limit is reached, the next number generated will be whatever the minvalue or maxvalue is, as appropriate.
" {} "CAUTION" {title} "
Unexpected results may be obtained if a cache setting greater than one is used for a sequence object that will be used concurrently by multiple backends. Each backend will allocate \"cache\" successive sequence values during one access to the sequence object and increase the sequence object's last_value accordingly. Then, the next cache-1 uses of nextval within that backend simply return the preallocated values without touching the shared object. So, numbers allocated but not used in the current session will be lost. Furthermore, although multiple backends are guaranteed to allocate distinct sequence values, the values may be generated out of sequence when all the backends are considered. (For example, with a cache setting of 10, backend A might reserve values 1..10 and return nextval=1, then backend B might reserve values 11..20 and return nextval=11 before backend A has generated nextval=2.) Thus, with a cache setting of one it is safe to assume that nextval values are generated sequentially; with a cache setting greater than one you should only assume that the nextval values are all distinct, not that they are generated purely sequentially. Also, last_value will reflect the latest value reserved by any backend, whether or not it has yet been returned by nextval.
CREATE SEQUENCE is a Postgres language extension. There is no CREATE SEQUENCE statement in SQL92."
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment