Re: [EXT] Re: Can we get the CTID value

From: Garfield Lewis <garfield(dot)lewis(at)lzlabs(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, PostgreSQL mailing lists <pgsql-general(at)postgresql(dot)org>
Subject: Re: [EXT] Re: Can we get the CTID value
Date: 2022-01-20 18:00:53
Message-ID: 6CCE2477-12BB-4287-9CE0-3DBFB3E6652D@lzlabs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On 2022-01-20, 12:52 PM, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Garfield Lewis <garfield(dot)lewis(at)lzlabs(dot)com> writes:
> > I need the page and possibly row of the data location to be stored as an element of the new type. This is to simulate a structure from another database system.
>
> You need to rethink. The datatype input function cannot know even that
> the value is going to be stored anywhere, let alone exactly where.
> Moreover, what would happen if the row is moved somewhere else due
> to an update of some other column?
>
> You might be able to build something for cross-linking by putting
> the logic in AFTER INSERT/UPDATE/DELETE triggers, but I think a
> custom datatype is not going to be helpful for that.
>
> regards, tom lane

Thx, Tom...

I think you are right in the case of INPUT/RECEIVE, however we should be able to get that info during OUTPUT/SEND (I think) since it is fixed at that point. At the time I return the information to the user I could augment the output to add that information to the output. However, I still don't know if it is even possible to get that information in those functions. Is that at all possible?

Regards,
Garfield

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2022-01-20 18:11:04 Re: [EXT] Re: Can we get the CTID value
Previous Message Tom Lane 2022-01-20 18:00:17 Re: Query much slower from php than psql or dbeaver