Re: [SQL] FirebirdSQL to PostgreSQL - Mailing list pgsql-sql

From Tom Lane
Subject Re: [SQL] FirebirdSQL to PostgreSQL
Date
Msg-id 31482.1505218250@sss.pgh.pa.us
Whole thread Raw
In response to [SQL] FirebirdSQL to PostgreSQL  (Ertan Küçükoğlu <ertan.kucukoglu@1nar.com.tr>)
Responses Re: [SQL] FirebirdSQL to PostgreSQL
List pgsql-sql
Ertan Küçükoğlu <ertan.kucukoglu@1nar.com.tr> writes:
> I have below sql running fine on FirebirdSQL but not on PostgreSQL. As I am
> not the editor of the SQL, I cannot fix it to work with 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
> ILCELER_TABLOSU I where I.ILCEADI = 'CÝHANBEYLÝ')*60) as "IAIK_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.)
Best rule is to always quote a particular name or never quote it.
        regards, tom lane


-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

pgsql-sql by date:

Previous
From: Ertan Küçükoğlu
Date:
Subject: [SQL] FirebirdSQL to PostgreSQL
Next
From: Ertan Küçükoğlu
Date:
Subject: Re: [SQL] FirebirdSQL to PostgreSQL