Skip site navigation (1) Skip section navigation (2)

Fetching query result problem

From: Jacek Kałucki <laborm(at)rz(dot)onet(dot)pl>
To: psycopg(at)postgresql(dot)org
Subject: Fetching query result problem
Date: 2012-01-16 12:53:20
Message-ID: (view raw, whole thread or download thread mbox)
Lists: psycopg

I have a problem with some query.
When I issue it from within postgresql console, it returns correct rows count as a result,
but when executed within psycopg2 cursor.execute() row count differs.
In first situation I get 5 rows versus 3 at second time.
This is my query:
select "inventory_line"."iid" as "iid",
         "inventory_line"."il_depot_id" as "il_depot_id",
         "inventory_line"."il_expiry_date" as "il_expiry_date",
         "inventory_line"."il_info" as "il_info",
         "inventory_line"."il_location_x_id" as "il_location_x_id",
         "inventory_line"."il_location_y_id" as "il_location_y_id",
         "inventory_line"."il_location_z_id" as "il_location_z_id",
         "inventory_line"."il_lot_no" as "il_lot_no",
         "inventory_line"."il_package_id" as "il_package_id",
         "inventory_line"."il_pass_id" as "il_pass_id",
         "inventory_line"."il_product_id" as "il_product_id",
         "inventory_line"."il_production_date" as "il_production_date",
         "inventory_line"."il_quantity" as "il_quantity",
         "inventory_line"."il_quantity_spare" as "il_quantity_spare",
         "inventory"."in_close_date" as "in_close_date",
         "inventory"."in_inventory_name" as "in_inventory_name"
     from "inventory_line"
     inner join "inventory_pass" on "inventory_pass"."iid" = "inventory_line"."il_pass_id"
     inner join "inventory" on "inventory"."iid" = "inventory_pass"."ip_inventory_id"
     where "inventory_line"."il_product_id" = 6326 and "inventory"."in_branch_id" = 1 limit 100

Could you give me any suggestions how to figure the reason out?

Jacek Kałucki


psycopg by date

Next:From: Daniele VarrazzoDate: 2012-01-16 13:18:30
Subject: Re: Fetching query result problem
Previous:From: Peter IrbizonDate: 2012-01-12 00:43:35
Subject: Re: after application close MS Visual C++ runtime library error occurs

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group