Download PostgreSQL 7.2 Programmer`s Guide
Transcript
16.4.2. How These Rules Work ........................................................................... 214 16.4.2.1. A First Rule Step by Step............................................................ 216 16.4.3. Cooperation with Views........................................................................... 219 16.5. Rules and Permissions.......................................................................................... 224 16.6. Rules versus Triggers ........................................................................................... 225 17. Interfacing Extensions To Indexes .................................................................................... 228 17.1. Introduction .......................................................................................................... 228 17.2. Access Methods.................................................................................................... 228 17.3. Access Method Strategies..................................................................................... 229 17.4. Access Method Support Routines ........................................................................ 229 17.5. Operator Classes................................................................................................... 230 17.6. Creating the Operators and Support Routines ...................................................... 230 18. Index Cost Estimation Functions ...................................................................................... 234 19. GiST Indexes..................................................................................................................... 237 20. Triggers ............................................................................................................................. 239 20.1. Trigger Creation ................................................................................................... 239 20.2. Interaction with the Trigger Manager................................................................... 240 20.3. Visibility of Data Changes.................................................................................... 242 20.4. Examples .............................................................................................................. 243 21. Server Programming Interface .......................................................................................... 246 21.1. Interface Functions ............................................................................................... 246 SPI_connect ......................................................................................................... 246 SPI_finish............................................................................................................. 248 SPI_exec............................................................................................................... 249 SPI_prepare.......................................................................................................... 252 SPI_execp............................................................................................................. 254 SPI_cursor_open .................................................................................................. 256 SPI_cursor_find.................................................................................................... 258 SPI_cursor_fetch.................................................................................................. 259 SPI_cursor_move ................................................................................................. 260 SPI_cursor_close.................................................................................................. 261 SPI_saveplan........................................................................................................ 262 21.2. Interface Support Functions ................................................................................. 264 SPI_fnumber ........................................................................................................ 264 SPI_fname............................................................................................................ 265 SPI_getvalue ........................................................................................................ 266 SPI_getbinval ....................................................................................................... 267 SPI_gettype .......................................................................................................... 269 SPI_gettypeid....................................................................................................... 270 SPI_getrelname .................................................................................................... 271 21.3. Memory Management .......................................................................................... 272 SPI_copytuple ...................................................................................................... 272 SPI_copytupledesc............................................................................................... 274 SPI_copytupleintoslot .......................................................................................... 275 SPI_modifytuple .................................................................................................. 276 SPI_palloc ............................................................................................................ 278 SPI_repalloc......................................................................................................... 279 SPI_pfree.............................................................................................................. 280 SPI_freetuple........................................................................................................ 281 SPI_freetuptable................................................................................................... 282 SPI_freeplan......................................................................................................... 283 21.4. Visibility of Data Changes.................................................................................... 284 viii