jeudi 29 mai 2014

PostgreSQL - supprimer une ligne qui est créé par django utilisant PHPPgAdmin ? -Débordement de pile


Using django, I added a new entry to my table. Now I want to delete it using PHPPgAdmin (postgresql), but I get No unique Identifier for this row error. What is the problem?


django automatically adds an auto-incrementing primary key, so I cannot figure out what the issue is?


I read this post, but it did not help. If you notice the image carefully, you will see that the primary key column label is id but not pk as it should be in django.


enter image description here


EDIT: No primary key is seen on table; enter image description here


But this is what django executes;


python manage.py sql auth


CREATE TABLE "auth_user" (
"id" serial NOT NULL PRIMARY KEY,
"password" varchar(128) NOT NULL,
"last_login" timestamp with time zone NOT NULL,
"is_superuser" boolean NOT NULL,
"username" varchar(30) NOT NULL UNIQUE,
"first_name" varchar(30) NOT NULL,
"last_name" varchar(30) NOT NULL,
"email" varchar(75) NOT NULL,
"is_staff" boolean NOT NULL,
"is_active" boolean NOT NULL,
"date_joined" timestamp with time zone NOT NULL
)
;

EDIT: A screenshot from PHPPgAdmin, showing id as primary key enter image description here



Using django, I added a new entry to my table. Now I want to delete it using PHPPgAdmin (postgresql), but I get No unique Identifier for this row error. What is the problem?


django automatically adds an auto-incrementing primary key, so I cannot figure out what the issue is?


I read this post, but it did not help. If you notice the image carefully, you will see that the primary key column label is id but not pk as it should be in django.


enter image description here


EDIT: No primary key is seen on table; enter image description here


But this is what django executes;


python manage.py sql auth


CREATE TABLE "auth_user" (
"id" serial NOT NULL PRIMARY KEY,
"password" varchar(128) NOT NULL,
"last_login" timestamp with time zone NOT NULL,
"is_superuser" boolean NOT NULL,
"username" varchar(30) NOT NULL UNIQUE,
"first_name" varchar(30) NOT NULL,
"last_name" varchar(30) NOT NULL,
"email" varchar(75) NOT NULL,
"is_staff" boolean NOT NULL,
"is_active" boolean NOT NULL,
"date_joined" timestamp with time zone NOT NULL
)
;

EDIT: A screenshot from PHPPgAdmin, showing id as primary key enter image description here


0 commentaires:

Enregistrer un commentaire