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

2022-01-22 Thread Garfield Lewis
>As I said, that is impossible. > >Again, describe with many, many words what you are trying to achieve. >There is probably a solution for the underlying problem. > >Yours, >Laurenz Albe >-- >Cybertec | https://www.cybertec-postgresql.com Thanks all, for the responses.

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

2022-01-21 Thread Laurenz Albe
On Thu, 2022-01-20 at 17:00 +, Garfield Lewis wrote: > 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. As I said, that is impossible. Again, describe with many, many words what

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

2022-01-20 Thread David G. Johnston
On Thu, Jan 20, 2022 at 11:36 AM Garfield Lewis wrote: > The following knows there is no CTID so shouldn’t I be able to get > something similar programmatically? > > [sysprog@nucky lz_pgmod] (h-master-LZRDB-4714)*$ psql -U postgres -d > postgres -c "select ctid, 'test'" > ERROR: column "ctid" do

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

2022-01-20 Thread Garfield Lewis
On 2022-01-20, 1:11 PM, "Tom Lane" wrote: >No, it's the same problem in reverse: the output function cannot >know where the value came from. There is no hard and fast >reason that it must have come out of a table, either. Consider >something as simple as > > SELECT 'blah b

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

2022-01-20 Thread Tom Lane
Garfield Lewis writes: > 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

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

2022-01-20 Thread Garfield Lewis
> On 2022-01-20, 12:52 PM, "Tom Lane" wrote: > >Garfield Lewis 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

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

2022-01-20 Thread Tom Lane
Garfield Lewis 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 an

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

2022-01-20 Thread Garfield Lewis
A CTID is a special column documented here: https://www.postgresql.org/docs/12/ddl-system-columns.html Regards, Garfield

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

2022-01-20 Thread Garfield Lewis
Hi Laurenz, 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. Regards, Garfield

Re: Can we get the CTID value

2022-01-20 Thread o1bigtenor
On Wed, Jan 19, 2022 at 1:39 PM Garfield Lewis wrote: > > Hi, > > > > I am creating a new type and would like to know if it was possible to access > the CTID for the row affected by the INPUT and RECEIVE functions of the new > type? Actually, would it be possible from the OUTPUT and SEND functio

Re: Can we get the CTID value

2022-01-20 Thread Laurenz Albe
On Wed, 2022-01-19 at 19:38 +, Garfield Lewis wrote: > I am creating a new type and would like to know if it was possible to access > the CTID for the row affected by the INPUT and RECEIVE functions of the new > type? > Actually, would it be possible from the OUTPUT and SEND functions as well?