Re: Designing an extension for feature-space similarity search - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Designing an extension for feature-space similarity search
Date
Msg-id 14004.1329420874@sss.pgh.pa.us
Whole thread Raw
In response to Re: Designing an extension for feature-space similarity search  (Jay Levitt <jay.levitt@gmail.com>)
List pgsql-hackers
Jay Levitt <jay.levitt@gmail.com> writes:
> Perfect. Composite types are exactly what I need here; the application can 
> declare its composite type and provide distance functions for each member, 
> and the extension can use those to calculate similarity. How do I introspect 
> the composite type's pg_class to see what it contains? I assume there's a 
> better way than SPI on system catalogs :)

Definitely.  Take a look at record_out, record_cmp, and sibling
functions on generic composites (src/backend/utils/adt/rowtypes.c).
You might or might not feel like wiring in more assumptions than those
have about the possible contents of the record type.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Dimitri Fontaine
Date:
Subject: Re: [trivial patch] typo in doc/src/sgml/sepgsql.sgml
Next
From: Marti Raudsepp
Date:
Subject: Re: possible new option for wal_sync_method