mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
37 lines
2.2 KiB
HTML
37 lines
2.2 KiB
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><username></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>
|