Re: [EXT] Re: Can we get the CTID value - Mailing list pgsql-general

From Garfield Lewis
Subject Re: [EXT] Re: Can we get the CTID value
Date
Msg-id 91151F3E-6983-4CD1-B643-16486E5F228D@lzlabs.com
Whole thread Raw
In response to Re: [EXT] Re: Can we get the CTID value  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [EXT] Re: Can we get the CTID value  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
On 2022-01-20, 1:11 PM, "Tom Lane" <tgl@sss.pgh.pa.us> 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 blah'::yourtype;
>
>    This'll invoke the type's input function to parse the literal string,
>    and later it'll invoke the output function to reconstruct a string
>
>    to send to the client, and there's no table involved.
>
>                regards, tom lane

Understood, however, my last question/comment would be shouldn't the example above just result in a CTID something like
(x,y)where x and y are some known UNKNOWN/INVALID values or something else representing the fact that there is no
currentCTID associated with the element? Basically, what I am saying is shouldn't any search for a CTID in the case
justreturn some value to indicate the CTID doesn't exist or is UNKNOWN/INVALID?
 

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" does not exist
LINE 1: select ctid, 'test'
               ^

Regards,
Garfield


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: [EXT] Re: Can we get the CTID value
Next
From: Bryn Llewellyn
Date:
Subject: Re: psql does not provide proper response