Re: SQL Newbie Question

Поиск
Список
Период
Сортировка
От btober@ct.metrocast.net
Тема Re: SQL Newbie Question
Дата
Msg-id 45B8D2A4.9000601@ct.metrocast.net
обсуждение исходный текст
Ответ на Re: SQL Newbie Question  (Ron Johnson <ron.l.johnson@cox.net>)
Ответы Re: SQL Newbie Question  (Ron Johnson <ron.l.johnson@cox.net>)
Re: SQL Newbie Question  (Inoqulath <inoqulath@aol.de>)
Список pgsql-general
Ron Johnson wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 01/25/07 09:30, Inoqulath wrote:
>
>> Hello Folks
>>
>> Have a look at this Table:
>>
>> CREATE TABLE foo(
>> id serial,
>> a_name text,
>> CONSTRAINT un_name UNIQUE (a_name));
>>
>> Obviously, inserting a string twice results in an error ...is there any "conflict algorithm" (SQLite:"INSERT OR
>> [IGNORE|ABORT] INTO foo [...]")?...
>>
> No.
>
>   Unique \U*nique"\, a. [F. unique; cf. It. unico; from L. unicus,
>      from unus one. See {One}.]
>      Being without a like or equal; ...
>

I think he is not asking "How do I insert duplicate rows into a
unique-constrained column?", but rather that he wants to have the insert
transaction proceed successfully, ignoring the duplicates, i.e., the
resulting inserted rows will number less than the original source rows
by exactly the subset of duplicate source rows.

My suggestion would be to load the data into an unconstrained temporary
table, then select distinct from that for insertion into your actual
working table.




В списке pgsql-general по дате отправления:

Предыдущее
От: Ron Johnson
Дата:
Сообщение: Re: column limit
Следующее
От: Ron Johnson
Дата:
Сообщение: Re: Problem with result ordering