org.postgresql.util.PSQLException - column does not exist

From: Wayne Oliver <wayn0(dot)ml(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: org.postgresql.util.PSQLException - column does not exist
Date: 2013-07-22 08:50:55
Message-ID: A112A3F6-29E6-4AA3-86D5-8D391EE34337@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Good day all,

I have a small java app that has been running against and oracle backend for some time.
Recently we have decided to move the postgres as our database of choice.

Right now we are porting and testing all our apps against the postgres backend.
So far it's going pretty well. I have been able to fix all the issues we have encountered so far.

Already I have had to change the apps source in a few places due to data type mismatches and this has gone smoothly.

Now the app runs until it checks a specific table, then complains that a column is missing.
I am pretty sure this is a driver issue rather than a postgres issue, but I was hoping somebody here could point me in the right direction.

here is the the error, the query and the table structures.

Many thanks.

billing=> \dS deposit_link;
Table "jbilling.deposit_link"
Column | Type | Modifiers
------------------+------------------+-----------
id | bigint | not null
deposit_type_id | bigint | not null
order_details_id | bigint | not null
amount | double precision | not null
Indexes:
"deposit_link_pkey" PRIMARY KEY, btree (id)
Foreign-key constraints:
"deposit_link_fk_1" FOREIGN KEY (deposit_type_id) REFERENCES deposit_type(id)
"deposit_link_fk_2" FOREIGN KEY (order_details_id) REFERENCES order_details(id)

billing=> \dS order_details
Table "jbilling.order_details"
Column | Type | Modifiers
-----------------+-----------------------------+-----------
id | bigint | not null
mdn | bigint | not null
delivery_date | timestamp without time zone | not null
product_package | bigint | not null
user_id | bigint | not null
status | character varying(5) | not null
Indexes:
"order_details_pkey" PRIMARY KEY, btree (id)
"order_details_mdn_key" UNIQUE CONSTRAINT, btree (mdn, status, delivery_date)
"order_details_idx_1" btree (status)
Foreign-key constraints:
"order_details_fk_1" FOREIGN KEY (status) REFERENCES order_details_status(status)
Referenced by:
TABLE "deposit_link" CONSTRAINT "deposit_link_fk_2" FOREIGN KEY (order_details_id) REFERENCES order_details(id)
TABLE "mlh_group" CONSTRAINT "mlh_group_fk_1" FOREIGN KEY (pilot_order_details_id) REFERENCES order_details(id)
TABLE "mlh_group" CONSTRAINT "mlh_group_fk_2" FOREIGN KEY (member_order_details_id) REFERENCES order_details(id)
TABLE "mlh_quotes" CONSTRAINT "mlh_quotes_fk_1" FOREIGN KEY (pilot_order_details_id) REFERENCES order_details(id)
TABLE "order_link" CONSTRAINT "order_link_fk_1" FOREIGN KEY (order_details_id) REFERENCES order_details(id)

billing=> SELECT dl.amount FROM deposit_link dl, order_details od WHERE od.mdn = 1146255650307 AND od.id = dl.order_details_id;
amount
--------
(0 rows)

DEBUG 2013-07-18 14:48:43,221 [main] : QUERY: SELECT dl.amount FROM deposit_link dl, order_details od WHERE od.mdn = 1146255650307 AND od.id = dl.order_details_id
ERROR 2013-07-18 14:48:43,251 [main] : org.postgresql.util.PSQLException: ERROR: column "mdn" does not exist
Position: 39
org.postgresql.util.PSQLException: ERROR: column "mdn" does not exist
Position: 39

Like I say, any help pointers would be greatly appreciated.

--
Wayne Oliver

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2013-07-22 13:08:18 Re: org.postgresql.util.PSQLException - column does not exist
Previous Message Mag Gam 2013-07-21 06:29:32 Mag Gam