Re: Implementing an expanded object in C - Mailing list pgsql-general

From Michel Pelletier
Subject Re: Implementing an expanded object in C
Date
Msg-id CACxu=vJXGuq4gY_TJv8C=uLKiVE=4vB2zKzH14CBa9SP5k3yiw@mail.gmail.com
Whole thread Raw
In response to Re: Implementing an expanded object in C  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
List pgsql-general
Thanks Andrew, sorry for my late reply it took me a while to get time to analyze the issue.

You are of course correct, I had confusion around the create type statement, but the good news is, I have figured out the final ins and outs of creating an expanded type, and my matrix type can now be used as variables plpgsql functions and works great!  Thanks to you and Tom and everyone else who helped me get unblocked and making progress.

-Michel

On Sun, Jan 27, 2019 at 7:14 PM Andrew Gierth <andrew@tao11.riddles.org.uk> wrote:
>>>>> "Michel" == Michel Pelletier <pelletier.michel@gmail.com> writes:

 Michel> Replying to my own problem here, I guess this was a situation
 Michel> where explaining it in detail revealed the problem to me. By
 Michel> specifying my type is 'passedbyvalue'

That cannot possibly be appropriate.

 Michel> CREATE TYPE matrix (
 Michel>     internallength = 8,

Your type is clearly not a fixed-length type, because fixed-length types
cannot have expanded datums. A fixed-length type must contain its entire
representation within the fixed length - it is not allowed to be a
pointer to something else.

--
Andrew (irc:RhodiumToad)

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Connection issue
Next
From: Jason W
Date:
Subject: How to find out tables that are frequently read/ write?