View Single Post

   
  #6 (permalink)  
Old 04-17-2008, 09:32 PM
Tom Lane
 
Posts: n/a
Default Re: user defined types and strings

Kjetil Haaland <kjetil.haaland@student.uib.no> writes:
> On Wednesday 23 February 2005 18:23, Michael Fuhr wrote:
>> Hmmm...haven't we already had this conversation? :-)


> We have had almost the same conversation before. The type works in my
> functions, but since the string is just a pointer to a memory place it goes
> away when the type is stored in tables in the database.


The point here is that you've built a two-part structure:

<length> <pointer to string> <some other fields>
|
+------------> text of string

and this is fundamentally not going to work. A datum has to be one
piece of memory. Consider something like

<length> <some other fields> <text of string>

where the length is now variable.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Reply With Quote