mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-18 18:44:06 +08:00
Add SPI_getnspname(), including documentation.
This commit is contained in:
parent
70c9763d48
commit
4f6f5db474
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
$PostgreSQL: pgsql/doc/src/sgml/spi.sgml,v 1.39 2005/01/22 22:56:36 momjian Exp $
|
||||
$PostgreSQL: pgsql/doc/src/sgml/spi.sgml,v 1.40 2005/03/29 02:53:53 neilc Exp $
|
||||
-->
|
||||
|
||||
<chapter id="spi">
|
||||
@ -2153,6 +2153,60 @@ char * SPI_getrelname(Relation <parameter>rel</parameter>)
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
<refentry id="spi-spi-getnspname">
|
||||
<refmeta>
|
||||
<refentrytitle>SPI_getnspname</refentrytitle>
|
||||
</refmeta>
|
||||
|
||||
<refnamediv>
|
||||
<refname>SPI_getnspname</refname>
|
||||
<refpurpose>return the namespace of the specified relation</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<indexterm><primary>SPI_getnspname</primary></indexterm>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<synopsis>
|
||||
char * SPI_getnspname(Relation <parameter>rel</parameter>)
|
||||
</synopsis>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
||||
<para>
|
||||
<function>SPI_getnspname</function> returns a copy of the name of
|
||||
the namespace that the specified <structname>Relation</structname>
|
||||
belongs to. This is equivalent to the relation's schema. You should
|
||||
<function>pfree</function> the return value of this function when
|
||||
you are finished with it.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Arguments</title>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><literal>Relation <parameter>rel</parameter></literal></term>
|
||||
<listitem>
|
||||
<para>
|
||||
input relation
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Return Value</title>
|
||||
|
||||
<para>
|
||||
The name of the specified relation's namespace.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
</sect1>
|
||||
|
||||
<sect1 id="spi-memory">
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.136 2005/03/25 21:57:58 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.137 2005/03/29 02:53:53 neilc Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -760,6 +760,12 @@ SPI_getrelname(Relation rel)
|
||||
return pstrdup(RelationGetRelationName(rel));
|
||||
}
|
||||
|
||||
char *
|
||||
SPI_getnspname(Relation rel)
|
||||
{
|
||||
return get_namespace_name(RelationGetNamespace(rel));
|
||||
}
|
||||
|
||||
void *
|
||||
SPI_palloc(Size size)
|
||||
{
|
||||
|
@ -2,7 +2,7 @@
|
||||
*
|
||||
* spi.h
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/executor/spi.h,v 1.50 2004/11/16 18:10:13 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/include/executor/spi.h,v 1.51 2005/03/29 02:53:53 neilc Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -113,6 +113,7 @@ extern Datum SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool
|
||||
extern char *SPI_gettype(TupleDesc tupdesc, int fnumber);
|
||||
extern Oid SPI_gettypeid(TupleDesc tupdesc, int fnumber);
|
||||
extern char *SPI_getrelname(Relation rel);
|
||||
extern char *SPI_getnspname(Relation rel);
|
||||
extern void *SPI_palloc(Size size);
|
||||
extern void *SPI_repalloc(void *pointer, Size size);
|
||||
extern void SPI_pfree(void *pointer);
|
||||
|
Loading…
Reference in New Issue
Block a user