Re: FirebirdSQL to PostgreSQL

From: Ertan Küçükoğlu <ertan(dot)kucukoglu(at)1nar(dot)com(dot)tr>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: FirebirdSQL to PostgreSQL
Date: 2017-09-12 20:22:51
Message-ID: 001601d32c04$e8f83bb0$bae8b310$@1nar.com.tr
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> -----Original Message-----
> From: pgsql-sql-owner(at)postgresql(dot)org [mailto:pgsql-sql-owner(at)postgresql(dot)org] On Behalf Of Tom Lane
> Sent: Tuesday, September 12, 2017 3:11 PM
> To: Ertan Küçükoğlu <ertan(dot)kucukoglu(at)1nar(dot)com(dot)tr>
> Cc: pgsql-sql(at)postgresql(dot)org
> Subject: Re: [SQL] FirebirdSQL to PostgreSQL
>
> =?iso-8859-9?B?RXJ0YW4gS/zn/Gtv8Gx1?= <ertan(dot)kucukoglu(at)1nar(dot)com(dot)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

Thanks you Tom.

That was it. For now, I simply removed all quotes and query executed just fine.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Daniel Franco 2017-09-13 23:55:48 How could I improve a query with a function in the join clause?
Previous Message Tom Lane 2017-09-12 12:10:50 Re: FirebirdSQL to PostgreSQL