Jump to: navigation, search

PostgreSQL QUOTE IDENT

From w3cyberlearnings

Contents

Postgresql quote_ident

Add a neccessary quote to be used as an identifier in an SQL statement string.

Syntax quote_ident

quote_ident(string)

Example 1

test2=# SELECT quote_ident('good man');
 quote_ident 
-------------
 "good man"
(1 row)

Example 2

test2=# SELECT user_firstname,
test2-# quote_ident(user_firstname)
test2-# FROM profile;
 user_firstname | quote_ident 
----------------+-------------
 Jim            | "Jim"
 king           | king
 Jammi          | "Jammi"
 Bob            | "Bob"
                | 
(5 rows)

Related Links


Navigation
Web
SQL
MISC
References