Table X its full, what can i do now?

From: "x asasaxax" <xanaruto(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Table X its full, what can i do now?
Date: 2008-07-09 15:00:05
Message-ID: 91495cb0807090800w57ec7b78jcb506a58195acfb7@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi everyone,

I have the following sql script:

CREATE SEQUENCE "public"."teste_seq"
INCREMENT 1 MINVALUE 1
MAXVALUE 32767 START 1
CACHE 1 CYCLE;

CREATE TABLE "public"."teste" (
"id" SMALLINT DEFAULT nextval('teste_seq'::regclass) NOT NULL,
CONSTRAINT "id_pk" PRIMARY KEY("id")
) WITHOUT OIDS;

for($i=1;$i<32767;$i++)
{
$sql = "insert into teste values(DEFAULT)";
echo pg_query($sql);
}
$sql = "delete from teste where id=5";
pg_query($sql);
$sql = "delete from teste where id=10";
pg_query($sql);
$sql = "delete from teste where id=51";
pg_query($sql);
$sql = "delete from teste where id=35";
pg_query($sql);
$sql = "delete from teste where id=125";
pg_query($sql);
$sql = "delete from teste where id=425";
pg_query($sql);
The table teste its full but it has some holes, i can´t insert no
more, it give´s me the error: duplicate key violates unique constraint
"id_pk".
What can i do to be able to continue inserting rows on this table?

Thanks a lot.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Madison Kelly 2008-07-09 15:01:46 Re: rollback
Previous Message Merlin Moncure 2008-07-09 14:35:48 Re: rollback