Re: [GENERAL] New To List
От | Oliver Elphick |
---|---|
Тема | Re: [GENERAL] New To List |
Дата | |
Msg-id | 200001151009.KAA21853@linda.lfix.co.uk обсуждение исходный текст |
Ответ на | New To List (moebius@ip-solutions.net) |
Список | pgsql-general |
moebius@ip-solutions.net wrote: > I do have a question though. I am trying to take a DB >written for MySql and convert the format of statements >over to Postgres for creation. I can't seem to find a >value 'blob' in PG. Is there something similar?? Also if large objects may be what you want? >anyone can help me with this (see below). I can't figure >out how to make a primary, unique key. Here's the sql >file: >CREATE TABLE session ( > sid varchar(255) NOT NULL, > val blob NOT NULL, > changed varchar(14) NOT NULL, > PRIMARY KEY (sid), > UNIQUE sid_2 (sid) >); CREATE TABLE session ( sid varchar(255) PRIMARY KEY, you don't need the UNIQUE constraint, since it is implicit in PRIMARY KEY. A unique constraint on a single field can be expressed by field type UNIQUE If a combination of fields is the primary key, you can use CREATE TABLE foo ( f1 TEXT NOT NULL, f2 TEXT NOT NULL, ..., PRIMARY KEY (f1,f2) ); -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight http://www.lfix.co.uk/oliver PGP key from public servers; key ID 32B8FAA1 ======================================== "For I know that my redeemer liveth, and that he shall stand at the latter day upon the earth" Job 19:25
В списке pgsql-general по дате отправления: