Re: [SQL] Insane behaviour in 8.3.3

2012-06-15 Thread Robert Edwards

On 14/06/12 18:39, Achilleas Mantzios wrote:


dynacom=# SELECT id from items_tmp WHERE id=1261319 AND 
xid=currval('xadmin_xid_seq');
  id

(0 rows)
dynacom=# -- THIS IS INSANE


Have you tried:

SELECT id from items_tmp WHERE id=1261319 AND 
xid=currval('xadmin_xid_seq'::text)


or even:

SELECT id from items_tmp WHERE id=1261319 AND 
xid=currval(('xadmin_xid_seq'::text)::regclass)


Bob Edwards.

--
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] Insane behaviour in 8.3.3

2012-06-15 Thread Achilleas Mantzios
On Παρ 15 Ιουν 2012 09:34:16 Richard Huxton wrote:
> On 14/06/12 09:39, Achilleas Mantzios wrote:
> > dynacom=# SELECT id from items_tmp WHERE id=1261319 AND xid=61972;
> > 
> > id
> > 
> > -
> > 
> >   1261319
> > 
> > (1 row)
> > dynacom=# -- ok this is how it should be
> > dynacom=# SELECT id from items_tmp WHERE id=1261319 AND
> > xid=currval('xadmin_xid_seq');
> > 
> >   id
> > 
> > 
> > (0 rows)
> > dynacom=# -- THIS IS INSANE
> 
> Perhaps just do an EXPLAIN ANALYSE on both of those. If for some reason
> one is using the index and the other isn't then it could be down to a
> corrupted index. Seems unlikely though.

Hello Richard,
I had the same thought, and did the EPXLAIN ANALYZE and it gave results which 
looked pretty much
like the below (unfortunately i didn't keep the original exact output, cause i 
was in a hurry to solve the problem):

dynacom=# EXPLAIN ANALYZE SELECT id from items_tmp where id=1261319 AND 
xid=62035;  
 QUERY PLAN 
 
-
 Index Scan using it_tmp_pk on items_tmp  (cost=0.00..8.28 rows=1 width=4) 
(actual time=0.017..0.018 rows=1 loops=1)
   Index Cond: ((id = 1261319) AND (xid = 62035))
 Total runtime: 0.042 ms
(3 rows)

dynacom=# 
dynacom=# EXPLAIN ANALYZE SELECT id from items_tmp where id=1261319 AND 
xid=currval('xadmin_xid_seq');
 QUERY PLAN 


 Bitmap Heap Scan on items_tmp  (cost=4.53..120.32 rows=1 width=4) (actual 
time=58.212..58.212 rows=1 loops=1)
   Recheck Cond: (id = 1261319)
   Filter: (xid = currval('xadmin_xid_seq'::regclass))
   ->  Bitmap Index Scan on it_tmp_pk  (cost=0.00..4.53 rows=37 width=0) 
(actual time=0.021..0.021 rows=39 loops=1)
 Index Cond: (id = 1261319)
 Total runtime: 58.235 ms
(6 rows)

dynacom=# 

After that, i tried to REINDEX items_tmp, which succeeded, and also made the 
last select return correctly one row.
Being suspicious of the general condition of the database,I then tried to 
REINDEX DATABASE the whole db, which failed 
at some point because of corrupted data, but i didn't indicate which table had 
the corruption. I then wrote a script to 
make more verbose what table was being reindexed at any time and this time i 
got no errors. I also re-issued the batch 
REINDEX DATABASE command again with no errors. So it was indeed an index/data 
corruption problem.

Thanx to Richard and Adrian

-
Achilleas Mantzios
IT DEPT

-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] Insane behaviour in 8.3.3

2012-06-15 Thread Scott Marlowe
You do realize you're missing four years of bug fixes right?

-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] Insane behaviour in 8.3.3

2012-06-15 Thread Achilleas Mantzios
On Παρ 15 Ιουν 2012 10:28:20 Scott Marlowe wrote:
> You do realize you're missing four years of bug fixes right?

On Πεμ 14 Ιουν 2012 11:39:35 Achilleas Mantzios wrote:
> Unfortunately the remote installations are neither physically accessible
> nor by TCP/IP accesible (comms are done via UUCP and administration via
> minicom, and the costs are just huge 5 USD/min for 33Kbits/sec). So, i
> would exhaust all posibilities before deciding to ship a new postgresql
> version there, and remotely upgrade, physically travel to the ship or even
> trying to do a backup/initdb/restore in the existing version. Any help
> would be really really appreciated.
> 
> Also, as you might have understood, upgrading, although generally a good
> idea, does not apply so easily in our case.

And i forgot to mention, minicom term emulation quality sucks, even giving 
simple
shell commands is a PITA, upgrading the whole fleet would mean bast case 
scenario
minimum 21K USD for the whole fleet + suspension of all other activities for 
two months.
If physical travel was involved, the cost would be increased at even higher 
levels.


-
Achilleas Mantzios
IT DEPT

-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] Insane behaviour in 8.3.3

2012-06-15 Thread Samuel Gendler
On Fri, Jun 15, 2012 at 1:24 AM, Achilleas Mantzios <
[email protected]> wrote:

>
> And i forgot to mention, minicom term emulation quality sucks, even giving
> simple
> shell commands is a PITA, upgrading the whole fleet would mean bast case
> scenario
> minimum 21K USD for the whole fleet + suspension of all other activities
> for two months.
> If physical travel was involved, the cost would be increased at even
> higher levels.
>

And what is the cost of data corruption on large numbers of systems?  And
how much to fix that, especially if multiple systems fail at the same time?
 Some things aren't free. $21K in exchange for NOT having had to keep
systems up to date for 4 years seems like a decent trade.


Re: [SQL] Insane behaviour in 8.3.3

2012-06-15 Thread Samuel Gendler
On Fri, Jun 15, 2012 at 2:28 AM, Samuel Gendler
wrote:

>
>
> On Fri, Jun 15, 2012 at 1:24 AM, Achilleas Mantzios <
> [email protected]> wrote:
>
>>
>> And i forgot to mention, minicom term emulation quality sucks, even
>> giving simple
>> shell commands is a PITA, upgrading the whole fleet would mean bast case
>> scenario
>> minimum 21K USD for the whole fleet + suspension of all other activities
>> for two months.
>> If physical travel was involved, the cost would be increased at even
>> higher levels.
>>
>
> And what is the cost of data corruption on large numbers of systems?  And
> how much to fix that, especially if multiple systems fail at the same time?
>  Some things aren't free. $21K in exchange for NOT having had to keep
> systems up to date for 4 years seems like a decent trade.
>
>
Just call up an oracle sales rep and get a price quote for a single
baseline system.  Put that next to the postgresql upgrade cost for your
whole fleet.


Re: [SQL] Insane behaviour in 8.3.3

2012-06-15 Thread Achilleas Mantzios
On Παρ 15 Ιουν 2012 12:28:21 Samuel Gendler wrote:
> On Fri, Jun 15, 2012 at 1:24 AM, Achilleas Mantzios <
> 
> [email protected]> wrote:
> > And i forgot to mention, minicom term emulation quality sucks, even
> > giving simple
> > shell commands is a PITA, upgrading the whole fleet would mean bast case
> > scenario
> > minimum 21K USD for the whole fleet + suspension of all other activities
> > for two months.
> > If physical travel was involved, the cost would be increased at even
> > higher levels.
> 
> And what is the cost of data corruption on large numbers of systems?  And
> how much to fix that, especially if multiple systems fail at the same time?
>  Some things aren't free. $21K in exchange for NOT having had to keep
> systems up to date for 4 years seems like a decent trade.

After 12 years of using PostgreSQL in this environment, I can assure you that 
things are not so scary.
We have multiple plans of action in case a slave installation totally gets 
damaged, 
plus PostgreSQL has been a real beast of reliability.
Also here you neglet the cost of actual migration, test plans, which adds to 
the whole picture.
Moving from 7.4 to 8.3 back in 2008, was not easy at all (tsearch, intarray, 
loads of black magic, etc..). 
You could no just send a tech guy to the ship to perform the migration, he 
would have to know
what he is actually doing and why when executing the 100 lines script line by 
line.
Some time in the future, we will commence another round of migration, 
(at any point in time we need to support all current working versions)  
but we will have to feel a substantial reason to do so.

-
Achilleas Mantzios
IT DEPT

-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] Insane behaviour in 8.3.3

2012-06-15 Thread Achilleas Mantzios
On Παρ 15 Ιουν 2012 12:29:38 Samuel Gendler wrote:
> On Fri, Jun 15, 2012 at 2:28 AM, Samuel Gendler
> 
> wrote:
> > On Fri, Jun 15, 2012 at 1:24 AM, Achilleas Mantzios <
> > 
> > [email protected]> wrote:
> >> And i forgot to mention, minicom term emulation quality sucks, even
> >> giving simple
> >> shell commands is a PITA, upgrading the whole fleet would mean bast case
> >> scenario
> >> minimum 21K USD for the whole fleet + suspension of all other activities
> >> for two months.
> >> If physical travel was involved, the cost would be increased at even
> >> higher levels.
> > 
> > And what is the cost of data corruption on large numbers of systems?  And
> > how much to fix that, especially if multiple systems fail at the same
> > time?
> > 
> >  Some things aren't free. $21K in exchange for NOT having had to keep
> > 
> > systems up to date for 4 years seems like a decent trade.
> 
> Just call up an oracle sales rep and get a price quote for a single
> baseline system.  Put that next to the postgresql upgrade cost for your
> whole fleet.

:) I know, I have used this argument sometimes successfully, sometimes not.
The problem with oracle is not the price. The problem is that it just cannot do
what postgresql does, or what we have managed to do ourselves with postgresql.
Our replication system is unique, built in-house, and no commercial alternative 
existed,
exists, or (most probably) will exist.

-
Achilleas Mantzios
IT DEPT

-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] Insane behaviour in 8.3.3

2012-06-15 Thread Scott Marlowe
Not talking about going to something after 8.3.19, just updating to
the latest 8.3 version.  On most systems it's a simple:

sudo apt-get upgrade

or similar and sit back and watch.

On Fri, Jun 15, 2012 at 2:24 AM, Achilleas Mantzios
 wrote:
> On Παρ 15 Ιουν 2012 10:28:20 Scott Marlowe wrote:
>> You do realize you're missing four years of bug fixes right?
>
> On Πεμ 14 Ιουν 2012 11:39:35 Achilleas Mantzios wrote:
>> Unfortunately the remote installations are neither physically accessible
>> nor by TCP/IP accesible (comms are done via UUCP and administration via
>> minicom, and the costs are just huge 5 USD/min for 33Kbits/sec). So, i
>> would exhaust all posibilities before deciding to ship a new postgresql
>> version there, and remotely upgrade, physically travel to the ship or even
>> trying to do a backup/initdb/restore in the existing version. Any help
>> would be really really appreciated.
>>
>> Also, as you might have understood, upgrading, although generally a good
>> idea, does not apply so easily in our case.
>
> And i forgot to mention, minicom term emulation quality sucks, even giving 
> simple
> shell commands is a PITA, upgrading the whole fleet would mean bast case 
> scenario
> minimum 21K USD for the whole fleet + suspension of all other activities for 
> two months.
> If physical travel was involved, the cost would be increased at even higher 
> levels.
>
>
> -
> Achilleas Mantzios
> IT DEPT



-- 
To understand recursion, one must first understand recursion.

-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] Insane behaviour in 8.3.3

2012-06-15 Thread Achilleas Mantzios
On Παρ 15 Ιουν 2012 18:03:26 Scott Marlowe wrote:
> Not talking about going to something after 8.3.19, just updating to
> the latest 8.3 version.  On most systems it's a simple:
> 
> sudo apt-get upgrade
> 
> or similar and sit back and watch.

Thanx, unfortunately we dont have TCP/IP connectivity to (most of) the ships, 
and AFAIK apt-get does not yet work 
over advanced UUCP/minicom/kermit or other equivalent hich-tech dial up 
connection.
just joking :)

> 
> On Fri, Jun 15, 2012 at 2:24 AM, Achilleas Mantzios
> 
>  wrote:
> > On Παρ 15 Ιουν 2012 10:28:20 Scott Marlowe wrote:
> >> You do realize you're missing four years of bug fixes right?
> > 
> > On Πεμ 14 Ιουν 2012 11:39:35 Achilleas Mantzios wrote:
> >> Unfortunately the remote installations are neither physically accessible
> >> nor by TCP/IP accesible (comms are done via UUCP and administration via
> >> minicom, and the costs are just huge 5 USD/min for 33Kbits/sec). So, i
> >> would exhaust all posibilities before deciding to ship a new postgresql
> >> version there, and remotely upgrade, physically travel to the ship or
> >> even trying to do a backup/initdb/restore in the existing version. Any
> >> help would be really really appreciated.
> >> 
> >> Also, as you might have understood, upgrading, although generally a good
> >> idea, does not apply so easily in our case.
> > 
> > And i forgot to mention, minicom term emulation quality sucks, even
> > giving simple shell commands is a PITA, upgrading the whole fleet would
> > mean bast case scenario minimum 21K USD for the whole fleet + suspension
> > of all other activities for two months. If physical travel was involved,
> > the cost would be increased at even higher levels.
> > 
> > 
> > -
> > Achilleas Mantzios
> > IT DEPT

-
Achilleas Mantzios
IT DEPT

-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] Insane behaviour in 8.3.3

2012-06-15 Thread Richard Huxton

On 15/06/12 16:32, Achilleas Mantzios wrote:

On Παρ 15 Ιουν 2012 18:03:26 Scott Marlowe wrote:

Not talking about going to something after 8.3.19, just updating to
the latest 8.3 version.  On most systems it's a simple:

sudo apt-get upgrade

or similar and sit back and watch.


Thanx, unfortunately we dont have TCP/IP connectivity to (most of) the ships, 
and AFAIK apt-get does not yet work
over advanced UUCP/minicom/kermit or other equivalent hich-tech dial up 
connection.
just joking :)


Can you run rsync over a serial connection? Never tried, but if you had 
something that took the same options as ssh I daresay you could get it 
working.



--
  Richard Huxton
  Archonet Ltd

--
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] Insane behaviour in 8.3.3

2012-06-15 Thread Scott Marlowe
Well, I'd see about finding a way to upgrade to 8.3.19.  8.3.3 has
know data eating bugs.

On Fri, Jun 15, 2012 at 9:32 AM, Achilleas Mantzios
 wrote:
> On Παρ 15 Ιουν 2012 18:03:26 Scott Marlowe wrote:
>> Not talking about going to something after 8.3.19, just updating to
>> the latest 8.3 version.  On most systems it's a simple:
>>
>> sudo apt-get upgrade
>>
>> or similar and sit back and watch.
>
> Thanx, unfortunately we dont have TCP/IP connectivity to (most of) the ships, 
> and AFAIK apt-get does not yet work
> over advanced UUCP/minicom/kermit or other equivalent hich-tech dial up 
> connection.
> just joking :)
>
>>
>> On Fri, Jun 15, 2012 at 2:24 AM, Achilleas Mantzios
>>
>>  wrote:
>> > On Παρ 15 Ιουν 2012 10:28:20 Scott Marlowe wrote:
>> >> You do realize you're missing four years of bug fixes right?
>> >
>> > On Πεμ 14 Ιουν 2012 11:39:35 Achilleas Mantzios wrote:
>> >> Unfortunately the remote installations are neither physically accessible
>> >> nor by TCP/IP accesible (comms are done via UUCP and administration via
>> >> minicom, and the costs are just huge 5 USD/min for 33Kbits/sec). So, i
>> >> would exhaust all posibilities before deciding to ship a new postgresql
>> >> version there, and remotely upgrade, physically travel to the ship or
>> >> even trying to do a backup/initdb/restore in the existing version. Any
>> >> help would be really really appreciated.
>> >>
>> >> Also, as you might have understood, upgrading, although generally a good
>> >> idea, does not apply so easily in our case.
>> >
>> > And i forgot to mention, minicom term emulation quality sucks, even
>> > giving simple shell commands is a PITA, upgrading the whole fleet would
>> > mean bast case scenario minimum 21K USD for the whole fleet + suspension
>> > of all other activities for two months. If physical travel was involved,
>> > the cost would be increased at even higher levels.
>> >
>> >
>> > -
>> > Achilleas Mantzios
>> > IT DEPT
>
> -
> Achilleas Mantzios
> IT DEPT
>
> --
> Sent via pgsql-sql mailing list ([email protected])
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql



-- 
To understand recursion, one must first understand recursion.

-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] Insane behaviour in 8.3.3

2012-06-15 Thread Raj Mathur (राज माथुर)
On Friday 15 Jun 2012, Samuel Gendler wrote:
> On Fri, Jun 15, 2012 at 1:24 AM, Achilleas Mantzios <
> 
> [email protected]> wrote:
> > And i forgot to mention, minicom term emulation quality sucks, even
> > giving simple
> > shell commands is a PITA, upgrading the whole fleet would mean bast
> > case scenario
> > minimum 21K USD for the whole fleet + suspension of all other
> > activities for two months.
> > If physical travel was involved, the cost would be increased at
> > even higher levels.
> 
> And what is the cost of data corruption on large numbers of systems? 
> And how much to fix that, especially if multiple systems fail at the
> same time? Some things aren't free. $21K in exchange for NOT having
> had to keep systems up to date for 4 years seems like a decent
> trade.

While I agree in principle with what you're saying, this specific 
comparison would be better stated as "What is the cost of data 
corruption multiplied by the risk of that corruption occurring?"

The cost of upgrading is known and unavoidable.  The cost of data 
corruption, while probably higher (unless Achilles has an effective 
backup/restore system), needs to be factored by its probability of 
occurance.

Of course, neither you nor I are in Achilles' shoes, so trying to figure 
out where they pinch is academic at best.

Regards,

-- Raj
-- 
Raj Mathur  || [email protected]   || GPG:
http://otheronepercent.blogspot.com || http://kandalaya.org || CC68
It is the mind that moves   || http://schizoid.in   || D17F

-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql