| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | Jay Levitt <jay(dot)levitt(at)gmail(dot)com> |
| Cc: | PG Hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: Designing an extension for feature-space similarity search |
| Date: | 2012-02-16 19:34:34 |
| Message-ID: | 14004.1329420874@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Jay Levitt <jay(dot)levitt(at)gmail(dot)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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Marti Raudsepp | 2012-02-16 19:49:43 | Re: possible new option for wal_sync_method |
| Previous Message | Dimitri Fontaine | 2012-02-16 18:57:39 | Re: [trivial patch] typo in doc/src/sgml/sepgsql.sgml |