Re: Unique is non unique; no nulls - Mailing list pgsql-general

From cbrazvan@laitek.com
Subject Re: Unique is non unique; no nulls
Date
Msg-id 52696.89.123.64.241.1190521634.squirrel@webmail.laitek.com
Whole thread Raw
In response to Re: Unique is non unique; no nulls  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Unique is non unique; no nulls  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-general
Tom, Gregory,

Thank you for your replies. I will try reindexing the table but I am not
very sure that will make any difference.
The reason is that when I built the table, I was building it making sure
there are unique values that get trown into it, in addition to the
constraint defined in the table.

THere is a pgplsql function that says something like:
 for s in select distinct suid from migratek.stuides loop
   insert (...,suid) values (...,s.suid) into migratek.mt
So right from the start, there should be no duplications.

Hmm... maybe this will help: in the same function (i.e. transaction), I am
also doing an update on the same table, using suid as update key, that is:
update migratek.mt set sdate = smth where suid = s.suid;

Can this - performing an update on a table from within the (same) table
populating transaction that was not yet commited - throw off postgress in
some way? Especially given the large number of tuples inserted (2.7
million)
Right now, my inclination is to rewrite the function, separating the
updates from the inserts and see if that works.


Razvan

> Gregory Stark <stark@enterprisedb.com> writes:
>> "Razvan Costea-Barlutiu" <cbrazvan@laitek.com> writes:
>>> This has way too many ramifications for me to follow so I do appreciate
>>> some
>>> guidance.
>
>> What do the outputs of these queries say?
>
> It would also be interesting to know whether REINDEXing the table
> succeeds and if so whether the behavior gets any saner.
>
>             regards, tom lane
>



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Can't connect (2 dbs) or login (2 others)
Next
From: Gregory Stark
Date:
Subject: Re: Unique is non unique; no nulls