Re: Unique is non unique; no nulls

From: cbrazvan(at)laitek(dot)com
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Gregory Stark" <stark(at)enterprisedb(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Unique is non unique; no nulls
Date: 2007-09-23 04:27:14
Message-ID: 52696.89.123.64.241.1190521634.squirrel@webmail.laitek.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)enterprisedb(dot)com> writes:
>> "Razvan Costea-Barlutiu" <cbrazvan(at)laitek(dot)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
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gregory Stark 2007-09-23 06:04:39 Re: Unique is non unique; no nulls
Previous Message Tom Lane 2007-09-23 03:19:44 Re: Can't connect (2 dbs) or login (2 others)