Re: Two 'identical' DB's not acting identically

From: Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>
To: Shridhar Daithankar <shridhar_daithankar(at)persistent(dot)co(dot)in>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Two 'identical' DB's not acting identically
Date: 2003-04-15 10:28:10
Message-ID: 3E9BDEBA.2090601@mega-bucks.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Shridhar Daithankar wrote:
>
> If the databases were created with exactly same schema, even those should not
> differ. But that does not look like cause of your problem.

Really? So this means I might also have another problem?

> I suggest you try running some of your subqueries by hand both of these and
> see which of these return more than one row. I hope that helps.

Here is the output from running your three test queries on both dbs. The
last two return more than one row on both machines, and the last one
returns twice the number of error messages on the test db than on the
live db.

I find it strange that the last query produces 1 error message on the
live db but 2 on the test db ... I can't see any reason for this.

> select id from del_methods where dsc='YAMATO';

TAL=# select id from del_methods where dsc='YAMATO';
id
----
1
(1 row)

TEST=# select id from del_methods where dsc='YAMATO';
id
----
1
(1 row)

> select limit_id from rel_del_limits_wards where ward_id in (select
> id from wards where wards.ward=invoices.ward)

TAL=# select limit_id from rel_del_limits_wards where ward_id in (select
TAL(# id from wards where wards.ward=invoices.ward);
NOTICE: Adding missing FROM-clause entry in subquery for table "invoices"
limit_id
----------
1
1
1
1
(4 rows)

TEST=# select limit_id from rel_del_limits_wards where ward_id in (select
TEST(# id from wards where wards.ward=invoices.ward);
NOTICE: Adding missing FROM-clause entry in subquery for table "invoices"
NOTICE: Adding missing FROM-clause entry in subquery for table "invoices"
limit_id
----------
1
1
1
1
(4 rows)

> select(next_day::text || 'd')::interval from delivery_limit_types where
> id=(select limit_id from rel_del_limits_wards where ward_id in (select
> id from wards where wards.ward=invoices.ward))

TAL=# select(next_day::text || 'd')::interval from delivery_limit_types
where
TAL-# id=(select limit_id from rel_del_limits_wards where ward_id in
(select
TAL(# id from wards where wards.ward=invoices.ward));
NOTICE: Adding missing FROM-clause entry in subquery for table "invoices"
ERROR: More than one tuple returned by a subselect used as an expression.

TEST=# select(next_day::text || 'd')::interval from delivery_limit_types
where
TEST-# id=(select limit_id from rel_del_limits_wards where ward_id in
(select
TEST(# id from wards where wards.ward=invoices.ward));
NOTICE: Adding missing FROM-clause entry in subquery for table "invoices"
ERROR: More than one tuple returned by a subselect used as an expression.
NOTICE: Adding missing FROM-clause entry in subquery for table "invoices"
ERROR: More than one tuple returned by a subselect used as an expression.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message mlw 2003-04-15 11:51:30 Re: Are we losing momentum?
Previous Message Shridhar Daithankar 2003-04-15 10:16:12 Re: Two 'identical' DB's not acting identically