org.postgresql.util.PSQLException - column does not exist - Mailing list pgsql-novice

From Wayne Oliver
Subject org.postgresql.util.PSQLException - column does not exist
Date
Msg-id A112A3F6-29E6-4AA3-86D5-8D391EE34337@gmail.com
Whole thread Raw
Responses Re: org.postgresql.util.PSQLException - column does not exist  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: org.postgresql.util.PSQLException - column does not exist  (Luca Ferrari <fluca1978@infinito.it>)
List 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

pgsql-novice by date:

Previous
From: Mag Gam
Date:
Subject: Mag Gam
Next
From: Tom Lane
Date:
Subject: Re: org.postgresql.util.PSQLException - column does not exist