Re: Using CTID system column as a "temporary" primary key

Поиск
Список
Период
Сортировка
Искать
От
Kirk Wolak
Тема
Re: Using CTID system column as a "temporary" primary key
Дата
Msg-id
CACLU5mQ2XMd5c4tetUHacVE538c8nd1t2CWSfDvis2GCKg0L9A@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Using CTID system column as a "temporary" primary key Sebastien Flaesch <sebastien.flaesch@4js.com>
Re: Using CTID system column as a "temporary" primary key Geoff Winkless <pgsqladmin@geoff.dj>
Re: Using CTID system column as a "temporary" primary key Sebastien Flaesch <sebastien.flaesch@4js.com>
Re: Using CTID system column as a "temporary" primary key Christophe Pettus <xof@thebuild.com>
Re: Using CTID system column as a "temporary" primary key Sebastien Flaesch <sebastien.flaesch@4js.com>
Re: Using CTID system column as a "temporary" primary key Maciek Sakrejda <m.sakrejda@gmail.com>
Re: Using CTID system column as a "temporary" primary key Kirk Wolak <wolakk@gmail.com>
Re: Using CTID system column as a "temporary" primary key Laurenz Albe <laurenz.albe@cybertec.at>
Re: Using CTID system column as a "temporary" primary key Sebastien Flaesch <sebastien.flaesch@4js.com>
Re: Using CTID system column as a "temporary" primary key Laurenz Albe <laurenz.albe@cybertec.at>
Re: Using CTID system column as a "temporary" primary key Sebastien Flaesch <sebastien.flaesch@4js.com>
Re: Using CTID system column as a "temporary" primary key Sebastien Flaesch <sebastien.flaesch@4js.com>
Re: Using CTID system column as a "temporary" primary key Adrian Klaver <adrian.klaver@aklaver.com>
Re: Using CTID system column as a "temporary" primary key "Peter J. Holzer" <hjp-pgsql@hjp.at>
Re: Using CTID system column as a "temporary" primary key Adrian Klaver <adrian.klaver@aklaver.com>
Re: Using CTID system column as a "temporary" primary key "Peter J. Holzer" <hjp-pgsql@hjp.at>
Re: Using CTID system column as a "temporary" primary key Sebastien Flaesch <sebastien.flaesch@4js.com>
Re: Using CTID system column as a "temporary" primary key Adrian Klaver <adrian.klaver@aklaver.com>
Re: Using CTID system column as a "temporary" primary key Dominique Devienne <ddevienne@gmail.com>
Re: Using CTID system column as a "temporary" primary key Francisco Olarte <folarte@peoplecall.com>
Re: Using CTID system column as a "temporary" primary key Dominique Devienne <ddevienne@gmail.com>
Re: Using CTID system column as a "temporary" primary key Laurenz Albe <laurenz.albe@cybertec.at>
Re: Using CTID system column as a "temporary" primary key Alban Hertroys <haramrae@gmail.com>
Re: Using CTID system column as a "temporary" primary key Sebastien Flaesch <sebastien.flaesch@4js.com>
Re: Using CTID system column as a "temporary" primary key Francisco Olarte <folarte@peoplecall.com>
Re: Using CTID system column as a "temporary" primary key Christophe Pettus <xof@thebuild.com>
Re: Using CTID system column as a "temporary" primary key Sebastien Flaesch <sebastien.flaesch@4js.com>
Re: Using CTID system column as a "temporary" primary key Sebastien Flaesch <sebastien.flaesch@4js.com>
On Tue, Mar 28, 2023 at 6:40 AM Sebastien Flaesch <sebastien.flaesch@4js.com> wrote:
...
 
I think if you're honest with yourself you already know the answer to this question. The only real solution is to update the legacy code to use the primary key, or (if that's not possible) change the table definition to add your own indexed BIGSERIAL value called "ROWID" to the rows and use that instead (assuming it will be large enough).

Geoff

I have to second this...  Why not, during conversion, create a ROWID BIGSERIAL column in the PG only version.  (And if not large enough, it's easy enough to use a NUMERIC field, and a sequence)
Then the code would have access to this field, and when it uses it to delete/update it should work.

I cringe at the thought of using CTID.  And while it's probably "safe enough" inside a single transaction.  I doubt that there is much "testing" of this concept. 

Having been through this process (Oracle to PG), I wonder how far you are into the process...  Because Packages/Package Variables, Global Temp Tables, and Autonomous Transactions all consumed significant time in our process, as well as variable/field naming problems...  If you pull off converting this to PG without changing the source.  Let me know...

Regards, Kirk
В списке pgsql-general по дате отправления
От: Ron
Дата:
От: Adrian Klaver
Дата:
FAQ