Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1drri4-00012R-1e for pgsql-sql@arkaria.postgresql.org; Tue, 12 Sep 2017 20:23:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1drri3-0005O6-AL for pgsql-sql@arkaria.postgresql.org; Tue, 12 Sep 2017 20:23:03 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1drri2-0005NF-BC for pgsql-sql@postgresql.org; Tue, 12 Sep 2017 20:23:02 +0000 Received: from mta04.3.doruk.net.tr ([81.21.172.142] helo=mta04.doruk.net.tr) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1drrhy-00025F-KH for pgsql-sql@postgresql.org; Tue, 12 Sep 2017 20:23:00 +0000 Received: from cmail19.webkontrol.doruk.net.tr ([212.58.6.99]) by mta04.doruk.net.tr with esmtp (Exim 4.86) (envelope-from ) id 1drrh5-00062w-Iv for pgsql-sql@postgresql.org; Tue, 12 Sep 2017 23:22:03 +0300 Received: from DESKTOPM80CG12 ([46.166.179.50]) by cmail19.webkontrol.doruk.net.tr (IceWarp 11.1.2.0) with ASMTP id 201709122323167732 for ; Tue, 12 Sep 2017 23:23:16 +0300 From: =?utf-8?B?RXJ0YW4gS8O8w6fDvGtvxJ9sdQ==?= To: References: <000401d32bba$b83ca550$28b5eff0$@1nar.com.tr> <31482.1505218250@sss.pgh.pa.us> In-Reply-To: <31482.1505218250@sss.pgh.pa.us> Subject: Re: FirebirdSQL to PostgreSQL Date: Tue, 12 Sep 2017 23:22:51 +0300 Message-ID: <001601d32c04$e8f83bb0$bae8b310$@1nar.com.tr> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Content-language: tr Thread-index: AQGWUJd7gml9vFvMMDDrruYZCA/QyQG/3oBGox1o6KA= List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org > -----Original Message----- > From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.o= rg] On Behalf Of Tom Lane > Sent: Tuesday, September 12, 2017 3:11 PM > To: Ertan K=C3=BC=C3=A7=C3=BCko=C4=9Flu > Cc: pgsql-sql@postgresql.org > Subject: Re: [SQL] FirebirdSQL to PostgreSQL > > =3D?iso-8859-9?B?RXJ0YW4gS/zn/Gtv8Gx1?=3D w= rites: >> I have below sql running fine on FirebirdSQL but not on PostgreSQL. As=20 >> I am not the editor of the SQL, I cannot fix it to work with=20 >> PostgreSQL. Any help is appreciated. > > You're not being consistent about quoting, e.g. you've got this > >> COALESCE(DT.IAIK_OG, 0) AS "IAIK_OG", > > which seems to be trying to reference this field of the DT subselect: > >> (sum(M.TES_IMARALANICIOG)/(select sum(I.ILC_IMARALANICI_OG) from=20 >> ILCELER_TABLOSU I where I.ILCEADI =3D 'C=C3=9DHANBEYL=C3=9D')*60) as "I= AIK_OG", > > but it won't match because IAIK_OG is not the same name as "IAIK_OG". > (According to Postgres --- some other systems treat this differently.) Be= st rule is to always quote a particular name or never quote it. > > regards, tom lane Thanks you Tom. That was it. For now, I simply removed all quotes and query executed just f= ine. --=20 Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql