Re: [EXT] Re: How to tell which statement is being executed

2023-11-03 Thread Garfield Lewis
ion then Postgres will need to generate a truncation warning so it must know the TYPMOD of the column to do so. Regards Garfield From: Tom Lane Date: Friday, November 3, 2023 at 12:08 PM To: Garfield Lewis Cc: pgsql-generallists.postgresql.org Subject: [EXT] Re: How to tell which state

How to tell which statement is being executed

2023-11-03 Thread Garfield Lewis
Hi All, If I create a C function, is there a way from within that function for me to: 1. know whether it is being triggered by an INSERT or UPDATE statement * I’ve done some digging and it seems you can get this information if you provide a Planner hook, however, I need to know this m

Re: [EXT] Re: [Beginner Question] How to print the call link graph?

2023-07-01 Thread Garfield Lewis
> If no one here can, then superuser.com, unix.stackexchange.com or > stackoverflow.com should be able to. (Just don't cross-post...) If I understand the question this is a GDB question, correct? If so, I would simply set a breakpoint in GDB at that function like so: b SocketBackend commands

Re: [EXT] Re: SCROLLABLE/UPDATABLE cursor question

2023-04-24 Thread Garfield Lewis
> Garfield Lewis mailto:garfield.le...@lzlabs.com>> > wrote: > This is not a fork… it is pure Postgres 14 with an extension that checks for > a certain environment and reports a NOTICE otherwise. Oops, said extension meant trigger… -- Regards, Garfield A. Lewis

Re: [EXT] Re: SCROLLABLE/UPDATABLE cursor question

2023-04-24 Thread Garfield Lewis
> Adrian Klaver mailto:adrian.kla...@aklaver.com>> > wrote: > This: > psql:curs.pgs:2: NOTICE: DDL was performed without updating catalog > tables: Note that CREATE TABLE from a non-SDM client does not maintain > LzRelational catalog tables > seems to indicate you are using some sort of Post

Re: [EXT] Re: SCROLLABLE/UPDATABLE cursor question

2023-04-24 Thread Garfield Lewis
Tom Lane writes: > Doesn't that work already? Hi Tom, This works perfectly well for a NON-UPDATABLE cursor: [lzsystem@nucky LZRDB-5220] $ psql -U lzpgsupr -d wdbs -f curs.pgs -e BEGIN; BEGIN CREATE TABLE t0(c0 int); psql:curs.pgs:2: NOTICE: DDL was performed without updating catalog table

SCROLLABLE/UPDATABLE cursor question

2023-04-22 Thread Garfield Lewis
Hi All, I’m not sure where to ask the question so I’ll start here. Does anyone know if Postgres has any plans to support statements like FETCH/MOVE in the non-forward direction for SCROLLABLE/UPDATABLE cursors? -- Regards, Garfield A. Lewis

Re: [EXT] Re: Accessing composite type elements

2022-06-06 Thread Garfield Lewis
> take a look at libpqtypes. it's client side extension library to libpq that > implements the binary protocol. > > https://github.com/pgagarinov/libpqtypes > > merlin Thx, Merlin… I’ll have a look see…

Re: [EXT] Re: Accessing composite type elements

2022-06-02 Thread Garfield Lewis
> Binary representations are not too well documented :-(. However, > looking at record_send() helps here. will have a look… > Right, with the additional proviso that -1 "length" indicates a null > field value. Thx, Tom… never thought the null field… -- Regards, Garfield A. Lewis

Accessing composite type elements

2022-06-02 Thread Garfield Lewis
Hi All, I’m not sure if this is the actual place for this but I guess I can start here. The question I have is, I’ve created a composite type like this: CREATE TYPE myxml AS { encoding_ int4, xml_ xml }; In my client-side C code I am using PQgetvalue to pull in the data from the row/column. Ho

Re: [EXT] Re: Passing XML column in an array

2022-02-10 Thread Garfield Lewis
>The most obvious theory is that there are some nulls in the XT.XMLT1C1 >column. Since your code isn't bothering to check pXmlDataNulls[ix], >it would hit a null-pointer dereference when accessing pXmlData[ix]. > > regards, tom lane Thx, Tom... my bad... Regard

Passing XML column in an array

2022-02-10 Thread Garfield Lewis
Hi All, I have the following code: 141 if ( 0 != iXmlArrDim ) { 142 Datum*pXmlData = NULL; 143 bool *pXmlDataNulls = NULL; 144 uint32_t iXmlCount = 0; 145 bool bFirstTime= true; 146 147 Assert( XMLOID == ARR_ELEMENTS( p

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-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 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

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

Can we get the CTID value

2022-01-19 Thread Garfield Lewis
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 functions as well? Regards, Garfield

Re: [EXT] Re: XQuery/XPath 2.0+ support

2021-11-30 Thread Garfield Lewis
Thx, Tom... But isn't the libxml2 library not sufficient for this purpose? Note that I have not tried it yet, I am still just investigating possible solutions. -- Regards, Garfield A. Lewis On 2021-11-29, 12:08 PM, "Tom Lane" wrote: Garfield Lewis writes: >

XQuery/XPath 2.0+ support

2021-11-29 Thread Garfield Lewis
Hi All, I am investigating whether there are any plans to have XPath 2.0 support for Postgres XML natively or are there any available extension packages that includes this support? -- Regards, Garfield A. Lewis

Re: Using XMLNAMESPACES with XMLEMENT

2021-09-26 Thread Garfield Lewis
Thx @Pavel Stehule<mailto:pavel.steh...@gmail.com>, I’ll see if I can figure this out… ☺ Regards, Garfield From: Pavel Stehule Date: Friday, September 24, 2021 at 11:33 PM To: Garfield Lewis Cc: "pgsql-gene...@postgresql.org" Subject: Re: Using XMLNAMESPACES with XMLEME

Re: Using XMLNAMESPACES with XMLEMENT

2021-09-24 Thread Garfield Lewis
I’m using PG v12.6 and no I haven’t tried the path function. Do you have an example? -- Regards, Garfield A. Lewis From: Rob Sargent Date: Friday, September 24, 2021 at 6:52 PM To: Garfield Lewis Cc: "pgsql-gene...@postgresql.org" Subject: Re: Using XMLNAMESPACES with XMLEMENT

Using XMLNAMESPACES with XMLEMENT

2021-09-24 Thread Garfield Lewis
Hi All, I am attempting to port the following statement from DB2z to Postgres: SELECT e.empno, e.firstnme, e.lastname, XMLELEMENT ( NAME "foo:Emp", XMLNAMESPACES('http://www.foo.com' AS "foo"), XMLATTRIBUTES(e.empno as "serial"), e.

Re: Currently running queries with actual arguments?

2021-09-23 Thread Garfield Lewis
The way I normally get this info is by setting the following: log_statement = 'all' then the arguments will be printed in the postgres.log file. There could be some other way but that is what I know. -- Regards, Garfield On 2021-09-23, 11:33 AM, "rihad" wrote: Hi, is it possible to vie