Обсуждение: Error editing table WITH primary key
Hello all,<br /><br />I have installed PostgreSQL 8.3.5 and PgAdmin 1.8.4 - Rev.7358.<br /><br />I have populated a recentdatabase inserting all SQL command on pgadmin a SQL-window. Tables shows right constraints PRIMARY KEY, but when Itry to edit table data a warning message with the title "Edit table data without primary key" is showed and I cannot insertdata on that tables.<br /><br />If I create a table from inside PgAdmin then all goes ok.<br /><br />Any idea whatis the problem ?<br /><br />Greetings.<br />-- <br />Terry Yapt<br />
Re: Error editing table WITH primary key
Hi Terry,
Is your primary key defined as “Unique”? If this is the case, you may be trying to add a value for the key that already exists. Or it may be defined as “not null) and you may be trying to insert a row with a null primary key.
I hope it’s as simple as this for you. J
Good luck!
Sue Walker-Thornton
Sue Walker-Thornton
ConITS Contract
NASA Langley Research Center
Integrated Library Systems Application & Database Administrator
130 Research Drive
Hampton, VA 23666
Office: (757) 224-4074
Fax: (757) 224-4001
Pager: (757) 988-2547
Email: susan.m.thornton@nasa.gov
From: pgadmin-support-owner@postgresql.org [mailto:pgadmin-support-owner@postgresql.org] On Behalf Of Terry Yapt
Sent: Friday, January 16, 2009 7:08 AM
To: pgadmin-support@postgresql.org
Subject: [pgadmin-support] Error editing table WITH primary key
Hello all,
I have installed PostgreSQL 8.3.5 and PgAdmin 1.8.4 - Rev.7358.
I have populated a recent database inserting all SQL command on pgadmin a SQL-window. Tables shows right constraints PRIMARY KEY, but when I try to edit table data a warning message with the title "Edit table data without primary key" is showed and I cannot insert data on that tables.
If I create a table from inside PgAdmin then all goes ok.
Any idea what is the problem ?
Greetings.
--
Terry Yapt
On 16/01/2009 18:56, Thornton, Susan M. (LARC-B702)[NCI INFORMATION SYSTEMS] wrote: > Is your primary key defined as "Unique"? If this is the case, you > may be trying to add a value for the key that already exists. Or it may Is a primary key not unique by definition? - doesn't the primary key uniquely identify a row in a table? Ray. ------------------------------------------------------------------ Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland rod@iol.ie Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals ------------------------------------------------------------------
Re: Error editing table WITH primary key
Sorry - my bad. Here is the postgresql definition of a PRIMARY-KEY: The PRIMARY KEY column constraint specifies that a column of a table may contain only unique (non-duplicate), non-NULL values. The definition of the specified column does not have to include an explicit NOT NULL constraint to be included in a PRIMARY KEY constraint. Sue -----Original Message----- From: Raymond O'Donnell [mailto:rod@iol.ie] Sent: Friday, January 16, 2009 4:17 PM To: Thornton, Susan M. (LARC-B702)[NCI INFORMATION SYSTEMS] Cc: Terry Yapt; pgadmin-support@postgresql.org Subject: Re: [pgadmin-support] Error editing table WITH primary key On 16/01/2009 18:56, Thornton, Susan M. (LARC-B702)[NCI INFORMATION SYSTEMS] wrote: > Is your primary key defined as "Unique"? If this is the case, you > may be trying to add a value for the key that already exists. Or it may Is a primary key not unique by definition? - doesn't the primary key uniquely identify a row in a table? Ray. ------------------------------------------------------------------ Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland rod@iol.ie Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals ------------------------------------------------------------------
It was solved itself. All tables, insert data and primary key's creation was launched from a SQL script. Perhaps the primary key had been creating by PostgreSQL in the background and then pgAdmin could not access that data tables for editing ??
I don't know what was the real reason but it was solved among an hour or so.
Solved then...
Greetings...
Sorry - my bad. Here is the postgresql definition of a PRIMARY-KEY:
The PRIMARY KEY column constraint specifies that a column of a table may
contain only unique (non-duplicate), non-NULL values. The definition of
the specified column does not have to include an explicit NOT NULL
constraint to be included in a PRIMARY KEY constraint.
Sue
-----Original Message-----
From: Raymond O'Donnell [mailto:rod@iol.ie]
Sent: Friday, January 16, 2009 4:17 PM
To: Thornton, Susan M. (LARC-B702)[NCI INFORMATION SYSTEMS]
Cc: Terry Yapt; pgadmin-support@postgresql.org
Subject: Re: [pgadmin-support] Error editing table WITH primary key
On 16/01/2009 18:56, Thornton, Susan M. (LARC-B702)[NCI INFORMATION
SYSTEMS] wrote:
> Is your primary key defined as "Unique"? If this is the case,
you
> may be trying to add a value for the key that already exists. Or it
may
Is a primary key not unique by definition? - doesn't the primary key
uniquely identify a row in a table?
Ray.
------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------
--
Terry Yapt
My problem is solved.
It was solved itself. All tables, insert data and primary key's creation was launched from a SQL script. Perhaps the primary key had been creating by PostgreSQL in the background and then pgAdmin could not access that data tables for editing ??
I don't know what was the real reason but it was solved among an hour or so.
Solved then...
Greetings...2009/1/17 Thornton, Susan M. (LARC-B702)[NCI INFORMATION SYSTEMS] <Susan.M.Thornton@nasa.gov>Sorry - my bad. Here is the postgresql definition of a PRIMARY-KEY:
The PRIMARY KEY column constraint specifies that a column of a table may
contain only unique (non-duplicate), non-NULL values. The definition of
the specified column does not have to include an explicit NOT NULL
constraint to be included in a PRIMARY KEY constraint.
Sue
-----Original Message-----
From: Raymond O'Donnell [mailto:rod@iol.ie]
Sent: Friday, January 16, 2009 4:17 PM
To: Thornton, Susan M. (LARC-B702)[NCI INFORMATION SYSTEMS]
Cc: Terry Yapt; pgadmin-support@postgresql.org
Subject: Re: [pgadmin-support] Error editing table WITH primary key
On 16/01/2009 18:56, Thornton, Susan M. (LARC-B702)[NCI INFORMATION
SYSTEMS] wrote:
> Is your primary key defined as "Unique"? If this is the case,
you
> may be trying to add a value for the key that already exists. Or it
may
Is a primary key not unique by definition? - doesn't the primary key
uniquely identify a row in a table?
Ray.
------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------
--
Terry Yapt