datatype questions

From: Brian <signal(at)shreve(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: datatype questions
Date: 1998-06-23 01:45:24
Message-ID: Pine.LNX.3.96.980622203847.11098B-100000@mercury.shreve.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am trying to convert a table into PostgresSQL from MySQL, and had a few
questions:

CREATE TABLE forum (
id int(11) DEFAULT '0' NOT NULL auto_increment,
name varchar(30),
email varchar(100),
topic varchar(50),
body blob,
host varchar(50),
thread int(11) DEFAULT '0' NOT NULL,
datestamp datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
KEY datestamp (datestamp),
PRIMARY KEY (id),
KEY thread (thread)
);

1. Where in the documentation can you look to find what "modifiers" are
supported by postgres after the declaration of the field. such as NOT
NULL, PRIMARY KEY, KEY, DEFAULT, UNIQUE, etc. I call them modifiers but
what are they really called?

2. Does postgres support anything even like a "blob" data type?

3. Does Postgres support something like "auto_increment".

Once again, sorry if these questions are obvious. If I knew where to look
in the documentation for what can be in a field declaration, I would have
looked there.

In regards to the part that looks like this:

KEY datestamp (datestamp),
PRIMARY KEY (id),
KEY thread (thread)

Can you declare like that in your Postgres tables, or do you have to do
like:

CREATE INDEX on forum idx1 (datestamp);
CREATE INDEX on forum idx2 (id);
CREATE INDEX on forum idx3 (thread);

If so, then how would you say "primary"? I know some databases such as
mSQL did away with "PRIMARY KEY", and you just make indices instead, such
as above, none of which are "primary".

Thank you for your help.

Brian

/-------------------------- signal(at)shreve(dot)net -----------------------------\
| Brian Feeny | USR TC Hubs | ShreveNet Inc. (318)222-2638 |
| Network Administrator | Perl, Linux | Web hosting, online stores, |
| ShreveNet Inc. | USR Pilot | Dial-Up 14.4-56k, ISDN & LANs |
| 89 CRX DX w/MPFI, lots of |-=*:Quake:*=-| http://www.shreve.net/ |
| mods/Homepage coming soon |LordSignal/SN| Quake server: 208.206.76.47 |
\-------------------------- 318-222-2638 x109 -----------------------------/

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mattias Kregert 1998-06-23 10:37:57 Q: How to convert int to date?
Previous Message Tom Good 1998-06-22 16:07:36 Re: [GENERAL] Importing delimited files