periodstructure giving errors...

Very likely you have an invalid period in the periods table.=20
Can you run this and see what happens?
SELECT * FROM period where age(enddate=2Cstartdate) !=3D '1 year'::interval=
and periodtypeid =3D (SELECT periodtypeid from periodtype where name =3D '=
Yearly')=3B

Also=2C you should get an error which will help you to decipher which perio=
d is not correct =2C something like=20
Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value vi=
olates unique constraint "in_periodstructure_iso" Detail: Key (iso)=3D(199=
5) already exists.
Best regards=2CJason

···

On Fri=2C Sep 12=2C 2014 at 5:03 PM=2C Moemedi Ntunyane <moemedi.ntunyane@h= otmail.com> wrote:
=0A=
=0A=
=0A=
Hi All

I have this problem while generating the resource tables...all other tables=
are fine except periodstructure...

Process=0A=
failed: PreparedStatementCallback=3B SQL [insert into _periodstructure =0A=
values (?=2C?=2C?=2C?=2C?=2C?=2C?=2C?=2C?=2C?=2C?=2C?=2C?)]=3B ERROR: null =
value in column "iso" =0A=
violates not-null constraint=3B nested exception is =0A=
org.postgresql.util.PSQLException: ERROR: null value in column "iso" =0A=
violates not-null constraint =20

Regards=2C

Moemedi Ntunyane
Co-founder KeyInConsulting
                 =0A=

_______________________________________________
=0A=
Mailing list: DHIS 2 developers in Launchpad
=0A=
Post to : dhis2-devs@lists.launchpad.net
=0A=
Unsubscribe : DHIS 2 developers in Launchpad
=0A=
More help : ListHelp - Launchpad Help
=0A=

--=20
Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+46764147049=0A=
                 =

--_6d81a58d-90ab-47cd-bee1-1995bfbce8c9_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<style><!--
.hmmessage P
{
margin:0px=3B
padding:0px
}
body.hmmessage
{
font-size: 12pt=3B
font-family:Calibri
}
--></style></head>
<body class=3D'hmmessage'><div dir=3D'ltr'>Hi Jason<br><br>Thanx=2C I just =
run the query you gave and no records were available and removed not =3D ye=
ar(!=3Dyear) and records where available. The date format is available as:<=

<br>1573=3B6=3B"2010-01-01"=3B"2010-01-31"<br>1589=3B6=3B"2010-02-01"=3B=

"2010-02-28"<br><br>The error available shows that there is key violation f=
or null values for iso column in the periodstructure table.<br><br><br><br>=
<font style=3D"" color=3D"#00B050" face=3D"Courier New"><b><i><font style=
=3D"font-size:8pt" size=3D"1">Moemedi Ntunyane</font><font style=3D"font-si=
ze:8pt" size=3D"1"><br></font><font style=3D"font-size:8pt" size=3D"1">Co-f=
ounder KeyInConsulting</font></i></b></font><br><br><br><div><hr id=3D"stop=
Spelling">Date: Mon=2C 15 Sep 2014 11:46:07 +0200<br>Subject: Re: [Dhis2-de=
vs] periodstructure giving errors...<br>From: jason.p.pickering@gmail.com<b=

To: moemedi.ntunyane@hotmail.com<br>CC: dhis2-devs@lists.launchpad.net<br=
<br><div dir=3D"ltr">Very likely you have an invalid period in the periods=

table.&nbsp=3B<div><br></div><div>Can you run this and see what happens?</=

<div><br></div><div>SELECT * FROM period where age(enddate=2Cstartdate)=

!=3D '1 year'::interval and periodtypeid =3D (SELECT periodtypeid from per=
iodtype where name =3D 'Yearly')=3B<br></div><div><br></div><div>Also=2C yo=
u should get an error which will help you to decipher which period is not c=
orrect =2C something like&nbsp=3B</div><div><br></div><div><div>Caused by: =
org.postgresql.util.PSQLException: ERROR: duplicate key value violates uniq=
ue constraint "in_periodstructure_iso"</div><div>&nbsp=3B Detail: Key (iso)=
=3D(1995) already exists.</div></div><div><br></div><div>Best regards=2C</d=

<div>Jason</div><div><br></div></div><div class=3D"ecxgmail_extra"><br><=

div class=3D"ecxgmail_quote">On Fri=2C Sep 12=2C 2014 at 5:03 PM=2C Moemedi=
Ntunyane <span dir=3D"ltr">&lt=3B<a href=3D"mailto:moemedi.ntunyane@hotmai=
l.com" target=3D"_blank">moemedi.ntunyane@hotmail.com</a>&gt=3B</span> wrot=
e:<br><blockquote class=3D"ecxgmail_quote" style=3D"border-left:1px #ccc so=
lid=3Bpadding-left:1ex=3B">=0A=
=0A=
=0A=
<div><div dir=3D"ltr">Hi All<br><br>I have this problem while generating th=
e resource tables...all other tables are fine except periodstructure...<br>=
<br>Process=0A=
failed: PreparedStatementCallback=3B SQL [insert into _periodstructure =0A=
values (?=2C?=2C?=2C?=2C?=2C?=2C?=2C?=2C?=2C?=2C?=2C?=2C?)]=3B ERROR: null =
value in column "iso" =0A=
violates not-null constraint=3B nested exception is =0A=
org.postgresql.util.PSQLException: ERROR: null value in column "iso" =0A=
violates not-null constraint &nbsp=3B<img src=3D"http&#58=3B//localhost&#58=
=3B8080/dhis2/images/error_small.png"><br><br>Regards=2C<br><br><font color=
=3D"#00B050" face=3D"Courier New"><b><i><font style=3D"font-size:8pt=3B" si=
ze=3D"1">Moemedi Ntunyane</font><font style=3D"font-size:8pt=3B" size=3D"1"=

<br></font><font style=3D"font-size:8pt=3B" size=3D"1">Co-founder KeyInCon=

sulting</font></i></b></font><br> </div></div>=0A=
<br>_______________________________________________<br>=0A=
Mailing list: <a href=3D"DHIS 2 developers in Launchpad" target=3D"_blan=
k">DHIS 2 developers in Launchpad</a><br>=0A=
Post to&nbsp=3B &nbsp=3B &nbsp=3B: <a href=3D"mailto:dhis2-devs@lists.launc=
hpad.net">dhis2-devs@lists.launchpad.net</a><br>=0A=
Unsubscribe : <a href=3D"DHIS 2 developers in Launchpad" target=3D"_blan=
k">DHIS 2 developers in Launchpad</a><br>=0A=
More help&nbsp=3B &nbsp=3B: <a href=3D"ListHelp - Launchpad Help"=
target=3D"_blank">ListHelp - Launchpad Help</a><br>=0A=
<br></blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><div dir=
=3D"ltr">Jason P. Pickering<br>email: <a href=3D"mailto:jason.p.pickering@g=
mail.com" target=3D"_blank">jason.p.pickering@gmail.com</a><br>tel:+4676414=
7049</div>=0A=
</div></div> </div></body>
</html>=

--_6d81a58d-90ab-47cd-bee1-1995bfbce8c9_--