datatype questions

Поиск
Список
Период
Сортировка
От Brian
Тема datatype questions
Дата
Msg-id Pine.LNX.3.96.980622203847.11098B-100000@mercury.shreve.net
обсуждение исходный текст
Ответы Re: [GENERAL] datatype questions  (Peter Mount <pgsqlgen@retep.org.uk>)
Re: [GENERAL] datatype questions  (Aleksey Dashevsky <postgres@luckynet.co.il>)
Список 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@shreve.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 -----------------------------/



В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Good
Дата:
Сообщение: Re: [GENERAL] Importing delimited files
Следующее
От: Naushit Sakarvadia
Дата:
Сообщение: User authetication failed.