Re: Primary Keys and Foreign Keys in PgAccess

From: Constantin Teodorescu <teo(at)flex(dot)ro>
To: Marija Fras <mariafra(at)ac(dot)uma(dot)es>, PostgreSQL Interfaces <pgsql-interfaces(at)postgresql(dot)org>
Subject: Re: Primary Keys and Foreign Keys in PgAccess
Date: 1998-11-18 12:59:51
Message-ID: 3652C4C7.6A8B5792@flex.ro
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Marija Fras wrote:
>
> I just started to use PgAccess (it's 0.86; PostgreSQL 6.3) and it makes
> me wonder how (if) can you say that a field is PRIMARY KEY or FOREIGN
> KEY as a matter of fact. If this can´t be done then isn´t it a bit
> unconvinient?
> Really hope you would care to answer me! Thank´s.

Last stable versions : PgAccess 0.92b ( http://www.flex.ro/pgaccess )
and PostgreSQL 6.4.

PgAccess 0.92b implements primary keys.

In a couple of weeks it would be availabe PostgreSQL 6.4.1 and PgAccess
0.92 final.

PostgreSQL does not implement (yet) foreign keys as language syntax
althought they can be implemented using functions, so PgAccess cannot
operate with them.

There is a simple possibility to force the value of a column to be in
another table with constraints.

Example :

create table students (id int4, name text, primary key(id));
create function is_student(int4) returns bool as 'select count(*) > 0
from students where id = $1' language 'sql';
create table classes (..... , student int4, constraint good_student
check is_student(student));

It works fine!

All the best,

Constantin Teodorescu
FLEX Consulting Braila, ROMANIA

Browse pgsql-interfaces by date

  From Date Subject
Next Message Mark Himsley 1998-11-18 17:22:29 Case problems in table and column names
Previous Message Postgres DBA 1998-11-18 08:48:17 RE: [GENERAL] problem of upper/lower case in table names