Problems with OIDs

Lists: pgsql-php
From: Carlos García Gómez <almah(at)wanadoo(dot)es>
To: "Lista Postgresql" <pgsql-php(at)postgresql(dot)org>
Subject: Problems with OIDs
Date: 2002-10-24 06:39:48
Message-ID: GGEBJDFLJINOAKJMLOPGOEDMCBAA.almah@wanadoo.es
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-php


Hi all!

I've got the following problem: I had a view with OID 5330 that had to be
removed from the database, afterwards I created again a view (with the same
name, because I need it to be this way) and get the an error telling me that
the view with OID 5330 cannot be found, How can I solve it??

Thank u all!!


From: "Adrian Tineo" <adriantineo(at)softhome(dot)net>
To: pgsql-php(at)postgresql(dot)org
Subject: Re: Problems with OIDs
Date: 2002-10-24 08:23:05
Message-ID: 001d01c27b36$99993400$4eddd8d9@supercable.es
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-php

From excellent Momjian's online book (URL for the extract is
http://www.ca.postgresql.org/docs/aw_pgsql_book/node71.html):

"Every row in POSTGRESQL is assigned a unique, normally invisible number
called an object identification number (OID). When the software is
initialized with initdb, a counter is created and set to approximately
seventeen-thousand. The counter is used to uniquely number every row.
Although databases may be created and destroyed, the counter continues to
increase. It is used by all databases, so identification numbers are always
unique. No two rows in any table or in any database will ever have the same
object ID."

So you can't have a view with the same OID, use another primary key instead.

The index for the book is
http://www.postgresql.org/docs/aw_pgsql_book/index.html. I learned a lot
from there!! Check it.

Adrian Tineo

> I've got the following problem: I had a view with OID 5330 that had to be
> removed from the database, afterwards I created again a view (with the
same
> name, because I need it to be this way) and get the an error telling me
that
> the view with OID 5330 cannot be found, How can I solve it??


From: "Jules Alberts" <jules(dot)alberts(at)arbodienst-limburg(dot)nl>
To: pgsql-php(at)postgresql(dot)org
Subject: Re: Problems with OIDs
Date: 2002-10-24 08:42:25
Message-ID: 200210240844.g9O8ifE2008368@artemis.cuci.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-php

On 24 Oct 2002 at 8:39, Carlos García Gómez wrote:
> Hi all!
>
> I've got the following problem: I had a view with OID 5330 that had to be
> removed from the database, afterwards I created again a view (with the same
> name, because I need it to be this way) and get the an error telling me that
> the view with OID 5330 cannot be found, How can I solve it??

OID's change when you do a dump / restore. Never use hardcoded OIDs in
your app!


From: Andrew McMillan <andrew(at)catalyst(dot)net(dot)nz>
To: Carlos García Gómez <almah(at)wanadoo(dot)es>
Cc: Lista Postgresql <pgsql-php(at)postgresql(dot)org>
Subject: Re: Problems with OIDs
Date: 2002-10-24 10:17:53
Message-ID: 1035454673.6372.755.camel@kant.mcmillan.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-php

On Thu, 2002-10-24 at 19:39, Carlos García Gómez wrote:
> Hi all!
>
> I've got the following problem: I had a view with OID 5330 that had to be
> removed from the database, afterwards I created again a view (with the same
> name, because I need it to be this way) and get the an error telling me that
> the view with OID 5330 cannot be found, How can I solve it??

You need to redefine the thing that you do not mention which refers to
the view - possibly this may be another view.

When you recreate that, it will be created referencing the correct OID.

Regards,
Andrew.
--
---------------------------------------------------------------------
Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington
WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St
DDI: +64(4)916-7201 MOB: +64(21)635-694 OFFICE: +64(4)499-2267
Survey for free with http://survey.net.nz/
---------------------------------------------------------------------