pgr_quote_ident¶
Nom¶
pgr_quote_ident — Quotes the input text to be used as an identifier in an SQL statement string.
Note
This function is intended for the developer’s aid.
Synopsis¶
Returns the given identifier idname suitably quoted to be used as an identifier in an SQL statement string.
text pgr_quote_ident(text idname);
Description¶
Parameters
idname: | text Name of an SQL identifier. Can include . dot notation for schemas.table identifiers |
---|
Returns the given string suitably quoted to be used as an identifier in an SQL statement string.
- When the identifier idname contains on or more . separators, each component is suitably quoted to be used in an SQL string.
Histoire
- Nouveau depuis la version 2.0.0
Exemples¶
Everything is lower case so nothing needs to be quoted.
SELECT pgr_quote_ident('the_geom');
pgr_quote_ident
---------------
the_geom
(1 row)
SELECT pgr_quote_ident('public.edge_table');
pgr_quote_ident
-------------------
public.edge_table
(1 row)
The column is upper case so its double quoted.
SELECT pgr_quote_ident('edge_table.MYGEOM');
pgr_quote_ident
-------------------
edge_table."MYGEOM"
(1 row)
SELECT pgr_quote_ident('public.edge_table.MYGEOM');
pgr_quote_ident
---------------------------
public.edge_table."MYGEOM"
(1 row)
The schema name has a capital letter so its double quoted.
SELECT pgr_quote_ident('Myschema.edge_table');
pgr_quote_ident
----------------------
"Myschema".edge_table
(1 row)
Ignores extra . separators.
SELECT pgr_quote_ident('Myschema...edge_table');
pgr_quote_ident
---------------------
"Myschema".edge_table
(1 row)
Voir aussi¶
- Guide du développeur for the tree layout of the project.
- pgr_getTableName to get the name of the table as is stored in the postgres administration tables.