Re: BUG #5719: Constraint Problem

Поиск
Список
Период
Сортировка
От Alex Hunsaker
Тема Re: BUG #5719: Constraint Problem
Дата
Msg-id AANLkTikm8NXG_FpFVUsJhH1zyjBw4Y2bkAgWi6ACYDda@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #5719: Constraint Problem  ("KOTAPATI.KRISHNAIAH" <kotapati.krishna@hotmail.com>)
Ответы Re: BUG #5719: Constraint Problem
Список pgsql-bugs
On Thu, Oct 21, 2010 at 03:05, KOTAPATI.KRISHNAIAH
<kotapati.krishna@hotmail.com> wrote:
>
> The following bug has been logged online:
>
> Bug reference: =C2=A0 =C2=A0 =C2=A05719
> Logged by: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0KOTAPATI.KRISHNAIAH
> Email address: =C2=A0 =C2=A0 =C2=A0kotapati.krishna@hotmail.com
> PostgreSQL version: PostgreSQL8.3.1
> Operating system: =C2=A0 Microsoft Windows [Version 6.1.7600]
> Description: =C2=A0 =C2=A0 =C2=A0 =C2=A0Constraint Problem
> Details:
>
> create table kittu1 as select * from kota1; =C2=A0when i use this command=
 ,i got
> the following details:

I may have misunderstood the problem, I dont see a bug here.  Im
assuming you want kittu1 to have the constraints that kota1 has.
create table ... as select ... won't work simply because the the
select does not have the information needed.

Try:
create table kittu1 (like kota1 including constraints including
defaults including indexes);
insert into kittu1 select * from kota1;

Or if you just want the not null constraints:
create table kittu1 (like kota1 including constraints);

See http://www.postgresql.org/docs/8.3/static/sql-createtable.html for more.
[ note it looks like with postgresql 9.0 and up you can just say like
kota1 including all ]

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

Предыдущее
От: "KOTAPATI.KRISHNAIAH"
Дата:
Сообщение: BUG #5719: Constraint Problem
Следующее
От: andreas
Дата:
Сообщение: Re: BUG #5705: btree_gist: Index on inet changes query result