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 ]