Re: how to insert row with specific oid

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: ZongtianHou <zongtianhou(at)icloud(dot)com>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: how to insert row with specific oid
Date: 2020-06-19 07:13:09
Message-ID: 171a2765d49779b4ad73fc58c6a3f35acd343d04.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Fri, 2020-06-19 at 15:02 +0800, ZongtianHou wrote:
> Could I insert a row to table with specific row oid. just like insert
> into tbl values (xx,xx) oid=xx? Is there some syntax to do this?

No, you cannot determine the OID that will be inserted.

Using tables WITH OIDS is deprecated, and the feature is gone in v12.

If you want to insert specific values, you shouldn't be using a
system-generated OID but a regular column of type "bigint" or so.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message ZongtianHou 2020-06-19 07:17:18 Re: how to insert row with specific oid
Previous Message ZongtianHou 2020-06-19 07:02:30 how to insert row with specific oid