agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ertan Küçükoðlu <ertan.kucukoglu@1nar.com.tr>
Cc: pgsql-sql@postgresql.org
Subject: Re: FirebirdSQL to PostgreSQL
Date: Tue, 12 Sep 2017 08:10:50 -0400
Message-ID: <31482.1505218250@sss.pgh.pa.us> (raw)
In-Reply-To: <000401d32bba$b83ca550$28b5eff0$@1nar.com.tr>
References: <000401d32bba$b83ca550$28b5eff0$@1nar.com.tr>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>

=?iso-8859-9?B?RXJ0YW4gS/zn/Gtv8Gx1?= <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



view thread (3+ messages)  latest in thread

Message-ID: <31482.1505218250@sss.pgh.pa.us>
Permalink:  ../31482.1505218250@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/31482.1505218250@sss.pgh.pa.us

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ertan.kucukoglu@1nar.com.tr
  Subject: Re: FirebirdSQL to PostgreSQL
  In-Reply-To: <31482.1505218250@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox