pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Alanoly Andrews <alanolya@invera.com>
To: Craig James <cjames@emolecules.com>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: [GENERAL] Re: Cannot retrieve images inserted through VB and odbc, after a table reorganization.
Date: Wed, 03 Sep 2014 12:10:19 -0700
Message-ID: <5407679B.2030906@aklaver.com> (raw)
In-Reply-To: <a45db4656040438eaf2034a8f5870b8d@Exch2.invera.com>
References: <6909b219ecae4d41b431efdaf6c953a3@Exch2.invera.com>
	<CAFwQ8rd0Abfm=0j4Oq5D0hcRPBn=D7A-HJzSPJmDk=EgDMA9zQ@mail.gmail.com>
	<a45db4656040438eaf2034a8f5870b8d@Exch2.invera.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

On 09/03/2014 09:26 AM, Alanoly Andrews wrote:
> *Hi Craig,*
>
> **
>
> *I’m reloading into the very same database. *
>
> *If I insert a new row into the table (through VB/ODBC), I’m able to
> retrieve it (again from VB). But if after inserting the new row, I do a
> reorg of the table (eg. with a “cluster table”), I’m no longer able to
> retrieve that same row. In short, as long as the newly inserted rows are
> not “re-written” in some way, they can be retrieved through VB/ODBC. *

To follow up on my previous post with regards to OIDs. That may have 
been a wrong fork. A little testing:

test=# CREATE TABLE image (
     name            text,
     raster          oid
);

test=# create index img_idx on image (raster);

test=# INSERT INTO image (name, raster)
     VALUES ('another beautiful image', 
lo_import('/home/aklaver/Pictures/IMG_0359JPG'));

test=# INSERT INTO image (name, raster)
     VALUES ('another beautiful image', 
lo_import('/home/aklaver/Pictures/IMG_0360.JPG'));

test=# INSERT INTO image (name, raster)
     VALUES ('another beautiful image', 
lo_import('/home/aklaver/Pictures/IMG_0361.JPG'));

test=# select oid, relfilenode from pg_class where relname ='image';
   oid   | relfilenode
--------+-------------
  532144 |      532175

test=# cluster image using img_idx;
CLUSTER
test=# select oid, relfilenode from pg_class where relname ='image';
   oid   | relfilenode
--------+-------------
  532144 |      532182

Note the OID for the table stays the same but the relfilenode changes. 
This also happens with the other situations you describe(unless you use 
--oids with pg_dump).

So to revise my previous statement, my guess is your VB/ODBC code is 
using the relfilenode value to refer to the table and when that changes 
it cannot find it any more.

>
> **
>
> *Alanoly.*
>



-- 
Adrian Klaver
adrian.klaver@aklaver.com


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



view thread (16+ messages)  latest in thread

Message-ID: <5407679B.2030906@aklaver.com>
Permalink:  ../5407679B.2030906@aklaver.com/
Also on:    postgresql.org/message-id/5407679B.2030906@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: adrian.klaver@aklaver.com, alanolya@invera.com, cjames@emolecules.com, pgsql-general@postgresql.org
  Subject: Re: [GENERAL] Re: Cannot retrieve images inserted through VB and odbc, after a table reorganization.
  In-Reply-To: <5407679B.2030906@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox