Re: [GENERAL] New To List

From: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
To: moebius(at)ip-solutions(dot)net
Cc: PostgresGeneral <pgsql-general(at)hub(dot)org>, olly(at)linda(dot)lfix(dot)co(dot)uk
Subject: Re: [GENERAL] New To List
Date: 2000-01-15 10:09:40
Message-ID: 200001151009.KAA21853@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

moebius(at)ip-solutions(dot)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(dot)Elphick(at)lfix(dot)co(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message yura 2000-01-15 10:49:35 case-insensitive like operator
Previous Message Gerald Sievers 2000-01-15 05:59:42 Re: Postgresql Perl Problem