|
Home > Archive > PostgreSQL Bugs > May 2005 > BUG #1659: primary key accepts null value
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
BUG #1659: primary key accepts null value
|
|
| İbrahim 2005-05-11, 11:24 am |
|
The following bug has been logged online:
Bug reference: 1659
Logged by: İbrahim
Email address: ibrahimbayer@gmail.com
PostgreSQL version: 8.0.2
Operating system: Windows XP sp1
Description: primary key accepts null value
Details:
i m using pg 8.0.2 in a project with Visual Studio.NET at Windows Platform
but when i send a null value to my Prmary Key column it accepts that value.
I think it is a hard problem and i cant delete the null valued primary key
column by PgAdmin3 can you help me about this? Thanks İbrahim BAYER
Computer Engineer
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq
| |
| Ezequiel Tolnay 2005-05-12, 3:24 am |
| İbrahim wrote:
> The following bug has been logged online:
>
> Bug reference: 1659
> Logged by: İbrahim
> Email address: ibrahimbayer@gmail.com
> PostgreSQL version: 8.0.2
> Operating system: Windows XP sp1
> Description: primary key accepts null value
> Details:
>
> i m using pg 8.0.2 in a project with Visual Studio.NET at Windows Platform
> but when i send a null value to my Prmary Key column it accepts that value.
> I think it is a hard problem and i cant delete the null valued primary key
> column by PgAdmin3 can you help me about this? Thanks İbrahim BAYER
> Computer Engineer
Please include a reproducible example, otherwise you cannot expect
anyone to help you.
Regards,
Ezequiel Tolnay
| |
| Michael Fuhr 2005-05-12, 9:25 am |
| On Wed, May 11, 2005 at 01:36:00PM +0100, İbrahim wrote:
>
> i m using pg 8.0.2 in a project with Visual Studio.NET at Windows Platform
> but when i send a null value to my Prmary Key column it accepts that value.
PRIMARY KEY implies NOT NULL. Are you sure the value being inserted
is NULL and not, for example, an empty string? What's the output of
the following query (use your own table and column names)?
SELECT pkcolumn, length(pkcolumn), pkcolumn IS NULL FROM tablename;
Are you sure the column has a PRIMARY KEY constraint? If you connect
with psql, what's the output of the following command?
\d tablename
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend
|
|
|
|
|