Re: Primary Keys and Foreign Keys in PgAccess - Mailing list pgsql-interfaces

From Constantin Teodorescu
Subject Re: Primary Keys and Foreign Keys in PgAccess
Date
Msg-id 3652C4C7.6A8B5792@flex.ro
Whole thread Raw
List 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

pgsql-interfaces by date:

Previous
From: tolik@icomm.ru (Anatoly K. Lasareff)
Date:
Subject: Re: [INTERFACES] RE: [HACKERS] PREPARE
Next
From: markh@clockworkweb.com (Mark Himsley)
Date:
Subject: Case problems in table and column names