Re: PgAdmin uses wrong column for primary key

From: Andreas Pflug <pgadmin(at)pse-consulting(dot)de>
To: Andrus Moor <eetasoft(at)online(dot)ee>
Cc: pgadmin-support(at)postgresql(dot)org
Subject: Re: PgAdmin uses wrong column for primary key
Date: 2005-12-26 14:47:47
Message-ID: 43B00293.1070701@pse-consulting.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Andrus Moor wrote:
> Platform: PgAdmin and server running in the same Windows XP computer.
> "PostgreSQL 8.1.0 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC)
> 3.4.2 (mingw-special)"
>
> Language: English
> Distribution: binary
> Version: 1.4.0
>
>
> To reproduce:
>
> 1. Run the code:
>
> CREATE TABLE btest
> ( jrk numeric(3),
> kontoklass char(10) primary key,
> vkontoklas char(10)
> ) ;
>
> CREATE TABLE test2 AS SELECT * FROM btest ;
> ALTER TABLE test2 DROP jrk, ADD PRIMARY KEY (kontoklass);
>
> 2. Open table test2 for editing in pgAdmin III Edit Data window
>
> Observed result:
>
> column heading is: vkontoklas [PK] bpchar
>
> PgAdmin works like vkontoklas column is primary key !

Good catch!
The PK detection code in the view tool assumed the column numbering
would start with one, without holes. This doesn't always true, esp. in
your case.

Fixed for HEAD and 1.4.2, thanks for reporting.

Regards,
Andreas

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message Jim C. Nasby 2005-12-27 19:31:34 Re: COPY permissions problem - Windows XP
Previous Message Sim Zacks 2005-12-26 12:45:09 Re: BUG: Wrong Explain diagram