47.2. Вспомогательные интерфейсные функции
- SPI_fname — определить имя столбца с заданным номером
- SPI_fnumber — определить номер столбца с заданным именем
- SPI_getvalue — получить строковое значение указанного столбца
- SPI_getbinval — получить двоичное значение указанного столбца
- SPI_gettype — получить имя типа данных указанного столбца
- SPI_gettypeid — получить OID типа данных указанного столбца
- SPI_getrelname — возвращает имя указанного отношения
- SPI_getnspname — возвращает пространство имён указанного отношения
- SPI_result_code_string — возвращает код ошибки в виде строки
Функции, описанные здесь, предоставляют возможности для извлечения информации из наборов результатов, возвращаемых SPI_execute
и другими функциями SPI.
Все функции, описанные в этом разделе, могут использоваться и в подключённых, и в неподключённых функциях на C.
2.2. Concepts
PostgreSQL is a relational database management system (RDBMS). That means it is a system for managing data stored in relations. Relation is essentially a mathematical term for table. The notion of storing data in tables is so commonplace today that it might seem inherently obvious, but there are a number of other ways of organizing databases. Files and directories on Unix-like operating systems form an example of a hierarchical database. A more modern development is the object-oriented database.
Each table is a named collection of rows. Each row of a given table has the same set of named columns, and each column is of a specific data type. Whereas columns have a fixed order in each row, it is important to remember that SQL does not guarantee the order of the rows within the table in any way (although they can be explicitly sorted for display).
Tables are grouped into databases, and a collection of databases managed by a single PostgreSQL server instance constitutes a database cluster.