Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id B50CAC76A5C for ; Sun, 26 Feb 2012 14:50:31 -0400 (AST) Received: from nm38-vm0.bullet.mail.ne1.yahoo.com ([98.138.229.144]) by makus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1S1jB0-0002Ii-0L for pgsql-sql@postgresql.org; Sun, 26 Feb 2012 18:50:31 +0000 Received: from [98.138.90.56] by nm38.bullet.mail.ne1.yahoo.com with NNFMP; 26 Feb 2012 18:50:17 -0000 Received: from [98.138.87.6] by tm9.bullet.mail.ne1.yahoo.com with NNFMP; 26 Feb 2012 18:50:16 -0000 Received: from [127.0.0.1] by omp1006.mail.ne1.yahoo.com with NNFMP; 26 Feb 2012 18:50:16 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 975270.13438.bm@omp1006.mail.ne1.yahoo.com Received: (qmail 76483 invoked by uid 60001); 26 Feb 2012 18:50:16 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1330282216; bh=UTQEFQm2Wttp508j+V2CGw6zzLi74IJ9jzT7NWC6yuA=; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=yK7u+SMA6pgT1lX89BI6uUAfcdhx6dBFQxyYe7oPVPAZYrvpTpjyIxBqzjgqnU8GtseJbYuNz1v4UYaeUif4e1aTNN6cL5hL6Sq6ENJ92/43udgmZ3JDft0aIM2rbVI7hc3ODro0CsQhdndRDcOGQJ9AnRW/TqzklJiBThQbJ7k= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=SpSHJwkQvUz+jSSGJuoMq4SId73yUkO+rqc0xeszkizHhx/ZOPH7gRH7i9JgUqajgm0JKFBFxgIIbl2BFHg/PsEGyMTgc8MdKJ1Ct8ulpQ59cl+sI+zm8+Tn7nyWXpcKGdrnULTm86yMjEIs2WOqs734SdkbWztFmQRFXFb3TD0=; X-YMail-OSG: 7uzmH3cVM1lsqpLlR4pAulpySIjFzPLRyfW7lbGFFiGT_bJ _iBh3gYxkG2CmMjjmN_9Uxane7JuK_zOBNL1_C_gWXec11J9eTc400wZk56H 5o.qTlnfQatbU.6X.I7VvLpMw_bGuyKeFGKvkLKn9k9EoJhjAGLK_telrOeL TrWDlRHCFrK32Ua4Suif0Dr8WjPcbhlOtMeeM4_V_3EcpCS1MYEfDriBcsJw 4dGKedGrr_.DIxBkgqAqV3XZ8FwbKV.8OQp2XxsyVQcD9zda3x6b4HyRDbRb 5x61gzMLpxv.F6uTc0tz4rTpZgZ4f1FBV0FgCbidB.fsrEL5gPLK6CgZgF8I kN18vz6bciN7TG.TtW6w8Q.I2xQnCrx_opZLO2nSaSjGuMvbtXslQ7VisaE3 N6IiGd2g5C4MNWMc0JSXw2x84zlsBtEKB0Kx1a1NzLyBs32FQTL4CQ3BIouS DzDeeug-- Received: from [182.177.139.126] by web121605.mail.ne1.yahoo.com via HTTP; Sun, 26 Feb 2012 10:50:16 PST X-Mailer: YahooMailWebService/0.8.116.338427 Message-ID: <1330282216.75125.YahooMailNeo@web121605.mail.ne1.yahoo.com> Date: Sun, 26 Feb 2012 10:50:16 -0800 (PST) From: Rehan Saleem Reply-To: Rehan Saleem Subject: SQL View to PostgreSQL View To: "pgsql-sql@postgresql.org" MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="2053635335-855576221-1330282216=:75125" X-Pg-Spam-Score: 1.6 (+) X-Archive-Number: 201202/83 X-Sequence-Number: 36376 --2053635335-855576221-1330282216=:75125 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi ,=0AI am trying to convert=A0sql=0Aview to postgresql view but i am=A0ge= tting=A0the=0Afollowing error i=A0dont=A0know how=0Ato handle=A0dbo.=0Ain p= ostgresql and when i remove dbo. from table name then view got created but = it does not show any data, while this is working perfectly fine in sql, her= e is my code and error details=A0=0A=0ACREATE OR REPLACE VIEW vwkbcomparesi= tes as=0Aselect a.kbid kb_a, b.kbid kb_b, a.chr chr_a, a.start start_a, a."= end" end_a, (a."end" - a.start)+1 tagsize_a,=A0=0Ab.chr chr_b, b.start star= t_b, b."end" end_b, (b."end" - b.start)+1 tagsize_b,=0A=A0 =A0 abs((a."end"= + a.start)/2 - (b."end" + b.start)/2) centredistance,=0Acase=A0=0Awhen a."= end" <=3D b."end" and a.start >=3D b.start =A0=0Athen (a."end" - a.start)= =A0=0Awhen b."end" <=3D a."end" and b.start >=3D a.start =A0=A0=0Athen (b."= end" - b.start)=A0=0Awhen a."end" <=3D b."end" and a.start <=3D b.start =A0= =A0=0Athen (a."end" - b.start)=A0=0Awhen a."end" >=3D b."end" and a.start = >=3D b.start=0Athen (b."end" - a.start) =A0=0Aend bpoverlap=0Afrom =A0dbo.k= bsites a inner join dbo.kbsites b on a.chr=3Db.chr=0A inner join dbo.kbdeta= ils kbd on a.kbid=3Dkbd.kbid=0Awhere kbd.active=3D'1' ;=0A=0Ai am getting t= his error , how can i fix this.=0A=0AERROR: =A0schema "dbo" does not exist= =0ALINE 15: =A0from =A0dbo.kbsites a inner join dbo.kbsites b on a.chr=3Db.= chr=0A=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ^=0A=0A********** Error **********=0A= =0AERROR: schema "dbo" does not exist=0ASQL state: 3F000=0ACharacter: 761= =0A --2053635335-855576221-1330282216=:75125 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Hi ,<= /div>
I am trying to convert sql=0Aview to postgresql view = but i am getting the=0Afollowing error = i  know how= =0Ato handle dbo.=0Ain pos= tgresql and when i remove dbo. from table name then view got created but it= does not show any data, while this is working perfectly fine in sql, here = is my code and error details 

CREATE OR REPLACE VIEW vwkbcomparesites as
select a.= kbid kb_a, b.kbid kb_b, a.chr chr_a, a.start start_a, a."end" end_a, (a."en= d" - a.start)+1 tagsize_a, 
=09b.chr chr_b, b.start start_b, b."end" en= d_b, (b."end" - b.start)+1 tagsize_b,
    abs((a."end" = + a.start)/2 - (b."end" + b.start)/2) centredistance,
=09=09case 
=
=09=09=09when a."end" <=3D b."end" and a.start >=3D b.start  
=09=09=09=09then (a."e= nd" - a.start) 
=09=09=09when b."end" <=3D a."end" and b.start >= =3D a.start   
=09=09=09=09then (b."end" - b.start) 
=09=09=09= when a."end" <=3D b."end" and a.start <=3D b.start    
=09=09=09=09= then (a."end" - b.start) 
=09=09=09when a."end" >=3D b."end" = and a.start >=3D b.start
=09=09=09=09then (b."end" - a.start)  
=09=09=09end bpoverlap
=09from  dbo.kbsites a inner join dbo.kbsites b on a.chr=3Db= .chr
=09= inner join dbo.kbdetails kbd on a.kbid=3Dkbd.kbid
=09=09where kbd.ac= tive=3D'1' ;

i am getting th= is error , how can i fix this.

ERR= OR:  schema "dbo" does not exist
LINE 15:  from  d= bo.kbsites a inner join dbo.kbsites b on a.chr=3Db.chr
  &nb= sp;             ^

**= ******** Error **********

ERROR: schema "dbo" does not exist
SQL state: 3F000
Character: 761

<= /div>
--2053635335-855576221-1330282216=:75125--