pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marin D <marin@cybernet.bg>
To: Pich LY <ly@esigetel.fr>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] FOREIGN KEY ...
Date: Fri, 19 Jun 1998 10:56:08 +0300 (EET DST)
Message-ID: <Pine.LNX.3.96.980619105347.30838B-100000@server.iclub.techno-link.com> (raw)
In-Reply-To: <358946E5.2938@esigetel.fr>


The message says it all...

The syntax is recognized ( u've used the right one ) but foreign keys are
not implemented in this version.

U may wish to take a look at contrib/spi/refint* 
under the Postgres source tree for implementation of referential integrity

	Marin

          -= Why do we need gates in a world without fences? =-


On Thu, 18 Jun 1998, Pich LY wrote:

> Hi there,
> 
> I'm a french student at ESIGETEL, a school engineer specialized in
> Networks and Telecommunications.
> 
> Now, I've some trouble with my end year project. We are 4 students
> working on an local Intranet using PostgreSQL as the database manager
> (and Apache as the HTTP server).
> 
> The problem is insignifiant : how can you declare an attribute as a
> foreign key ?
> The tables we are focus on are :
>         CLIENT          FACTURATION
>         ------          -----------
> (pkey)  no_cli  <--\    no_factu        (pkey)
>         client      \-- no_cli          (foreign key)
>         adr_cli         adr_livr
>         ...             ...
> 
> The query (in SQL language) used to declare the "FACTURATION" table is :
>         CREATE TABLE Facturation
>         (
>                 no_factu        INTEGER PRIMARY KEY,
>                 no_cli          INTEGER REFERENCES Client,
>                 adr_livr        VARCHAR(50),
>                 ...
>         );
> 
> We can also use :
>         CREATE TABLE Facturation
>         (
>                 no_factu        INTEGER PRIMARY KEY,
>                 no_cli          INTEGER,
>                 adr_livr        VARCHAR(50),
>                 ...
>                 CONSTRAINT ct_factu REFERENCES (no_cli) FOREIGN KEY
> Client (no_cli)
>         );
> 
> But it doesn't seems to work ! "psql" gives us the following message :
>         "NOTICE:  CREATE TABLE/FOREIGN KEY clause ignored: not yet
> implemented"
> !!!
> 
> What's the right syntaxe ???
> 
> Thanks for the help...
> 
> ;-)
> 




view thread (22+ messages)  latest in thread

Message-ID: <Pine.LNX.3.96.980619105347.30838B-100000@server.iclub.techno-link.com>
Permalink:  ../Pine.LNX.3.96.980619105347.30838B-100000@server.iclub.techno-link.com/
Also on:    postgresql.org/message-id/Pine.LNX.3.96.980619105347.30838B-100000@server.iclub.techno-link.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: marin@cybernet.bg, ly@esigetel.fr
  Subject: Re: [SQL] FOREIGN KEY ...
  In-Reply-To: <Pine.LNX.3.96.980619105347.30838B-100000@server.iclub.techno-link.com>
  References: <358946E5.2938@esigetel.fr> <Pine.LNX.3.96.980619105347.30838B-100000@server.iclub.techno-link.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox