Problems with OIDs
am 24.10.2002 08:39:48 von Carlos
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!!
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
Re: Problems with OIDs
am 24.10.2002 10:23:05 von adriantineo
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??
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/users-lounge/docs/faq.html
Re: Problems with OIDs
am 24.10.2002 10:42:25 von Jules Alberts
On 24 Oct 2002 at 8:39, Carlos Garc=EDa G=F3mez 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 sa=
me
> name, because I need it to be this way) and get the an error telling me t=
hat
> 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!
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
http://archives.postgresql.org
Re: Problems with OIDs
am 24.10.2002 12:17:53 von Andrew McMillan
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/
------------------------------------------------------------ ---------
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)