Removing OIDs without recreate

Started by Együd Csabaalmost 22 years ago7 messagesgeneral
Jump to latest
#1Együd Csaba
csegyud@vnet.hu

Hi,
I'm winder if I can change the clause 'WITH OIDS' to 'WITHOUT OIDS' on a
table without recreating it (eg. usong ALTER TABLE). The problem is that my
tables are very big, and I do not need the OIDs at all. It was a mistake to
create them with OIDs.
Is there any way to correct it. Does it make any sense? Can it run out of
OIDs during time?

many thanks,
-- Csaba Egy�d

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.677 / Virus Database: 439 - Release Date: 2004. 05. 04.

#2Karel Zak
zakkr@zf.jcu.cz
In reply to: Együd Csaba (#1)
Re: Removing OIDs without recreate

On Fri, May 07, 2004 at 10:15:46AM +0200, Egy�d Csaba wrote:

Hi,
I'm winder if I can change the clause 'WITH OIDS' to 'WITHOUT OIDS' on a
table without recreating it (eg. usong ALTER TABLE). The problem is that my
tables are very big, and I do not need the OIDs at all. It was a mistake to
create them with OIDs.
Is there any way to correct it. Does it make any sense? Can it run out of
OIDs during time?

ALTER TABLE ... SET WITHOUT OIDS;

http://www.postgresql.org/docs/7.4/static/sql-altertable.html

Karel

--
Karel Zak <zakkr@zf.jcu.cz>
http://home.zf.jcu.cz/~zakkr/

#3Együd Csaba
csegyud@vnet.hu
In reply to: Karel Zak (#2)
Re: Removing OIDs without recreate

Using 'ALTER TABLE tablename SET WITHOUT OIDS;' command it
rises an error saying
'ERROR: parser: parse error at or near "set" at character 23'
What is wrong with it?

-- Csaba

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.677 / Virus Database: 439 - Release Date: 2004. 05. 04.

#4Karel Zak
zakkr@zf.jcu.cz
In reply to: Együd Csaba (#3)
Re: Removing OIDs without recreate

On Fri, May 07, 2004 at 01:13:52PM +0200, Egy�d Csaba wrote:

Using 'ALTER TABLE tablename SET WITHOUT OIDS;' command it
rises an error saying
'ERROR: parser: parse error at or near "set" at character 23'
What is wrong with it?

Which PostgreSQL version do you have?

Karel

--
Karel Zak <zakkr@zf.jcu.cz>
http://home.zf.jcu.cz/~zakkr/

#5Együd Csaba
csegyud@vnet.hu
In reply to: Karel Zak (#4)
Re: Removing OIDs without recreate

cygwin/7.3.4
The doc contains the option but doesn't work - at least for me.

--Csaba

-----Original Message-----
From: Karel Zak [mailto:zakkr@zf.jcu.cz]
Sent: 2004. m�jus 7. 13:48
To: Egy�d Csaba
Cc: 'Pgsql-General@Postgresql.Org (E-mail)'
Subject: Re: [GENERAL] Removing OIDs without recreate

On Fri, May 07, 2004 at 01:13:52PM +0200, Egy�d Csaba wrote:

Using 'ALTER TABLE tablename SET WITHOUT OIDS;' command it
rises an error saying
'ERROR: parser: parse error at or near "set" at character 23'
What is wrong with it?

Which PostgreSQL version do you have?

Karel

--
Karel Zak <zakkr@zf.jcu.cz>
http://home.zf.jcu.cz/~zakkr/
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.677 / Virus Database: 439 - Release Date: 2004. 05. 04.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.677 / Virus Database: 439 - Release Date: 2004. 05. 04.

#6Karel Zak
zakkr@zf.jcu.cz
In reply to: Együd Csaba (#5)
Re: Removing OIDs without recreate

On Fri, May 07, 2004 at 01:59:39PM +0200, Egy�d Csaba wrote:

cygwin/7.3.4
The doc contains the option but doesn't work - at least for me.

http://www.postgresql.org/docs/7.3/static/sql-altertable.html

The ALTER TABLE ... SET WITHOUT OIDS is in new in 7.4

Release 7.4 notes:

ALTER TABLE ... WITHOUT OIDS (Rod)

--
Karel Zak <zakkr@zf.jcu.cz>
http://home.zf.jcu.cz/~zakkr/

#7Együd Csaba
csegyud@vnet.hu
In reply to: Karel Zak (#6)
Re: Removing OIDs without recreate

Sorry I made a mistake, I saw docs for 7.4, because I use an other server
running that version.
So this won't work on 7.3.*.
Can I drop OID column painlessly? Does it lead to any problems?

Thank you,
-- Csaba

-----Original Message-----
From: 'Karel Zak' [mailto:zakkr@zf.jcu.cz]
Sent: 2004. m�jus 7. 14:06
To: Egy�d Csaba
Cc: 'Pgsql-General@Postgresql.Org (E-mail)'
Subject: Re: [GENERAL] Removing OIDs without recreate

On Fri, May 07, 2004 at 01:59:39PM +0200, Egy�d Csaba wrote:

cygwin/7.3.4
The doc contains the option but doesn't work - at least for me.

http://www.postgresql.org/docs/7.3/static/sql-altertable.html

The ALTER TABLE ... SET WITHOUT OIDS is in new in 7.4

Release 7.4 notes:

ALTER TABLE ... WITHOUT OIDS (Rod)

--
Karel Zak <zakkr@zf.jcu.cz>
http://home.zf.jcu.cz/~zakkr/
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.677 / Virus Database: 439 - Release Date: 2004. 05. 04.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.677 / Virus Database: 439 - Release Date: 2004. 05. 04.