[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] PostgreSQL - slette og oprette tabel



Peter Rude <sslug@sslug> writes:

> Jeg har slettet en tabel "ordrelinjer"
>  >> pg_query("DROP TABLE ordrelinjer");  <<
>
>   i en postgresdatabase og oprettet en ny af samme navn.

>
> Warning: pg_query(): Query failed: ERROR: Cannot insert a duplicate
> key into unique index ordrelinjer_pkey

Bruger du en meget gammel version of PG? Det lyder som om indexet på
din primary key ikke blev slettet dengang du udførte DROP TABLE. Der
var engang, for meget længe side, hvor DROP TABLE ikke automatisk
fjernede den slags men det er mange år siden jeg har observeret sådan opførsel.

Du bør opgradere (hvis du fx stadig bruger 7.1.x) , eller bruge DROP INDEX
ordrelinjer_pkey.

Jeg plejer altid at partionere min databaser i schemes (CREATE
SCHEME.... CREATE TABLE somescheme.sometable) og så DROP SCHEME mens
jeg arbejder på udviklingen af den.



-- 
===============================================================
<sslug@sslug>                           Herlev, Denmark     
<URL:http://www.andreasen.org/>                             <*>   
===============================================================



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:44 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *