|
- to_tsvector( config> regconfig> , document> text)
- tsvector
- reduce document text to tsvector>
- to_tsvector('english', 'The Fat Rats')
- 'fat':2 'rat':3
+
+
+
+ get_current_ts_config()
+
+ regconfig
+ get default text search configuration
+ get_current_ts_config()
+ english
|
- length(tsvector>)
+
+
+
+ length(tsvector>)
+
integer
number of lexemes in tsvector>
length('fat:2,4 cat:3 rat:5A'::tsvector)
3
|
- setweight(tsvector>, "char">)
+
+
+
+ numnode(tsquery>)
+
+ integer
+ number of lexemes plus operators in tsquery>
+ numnode('(fat & rat) | cat'::tsquery)
+ 5
+
+ |
+
+
+
+ plainto_tsquery( config> regconfig> , query> text)
+
+ tsquery
+ produce tsquery> ignoring punctuation
+ plainto_tsquery('english', 'The Fat Rats')
+ 'fat' & 'rat'
+
+ |
+
+
+
+ querytree(query tsquery>)
+
+ text
+ get indexable part of a tsquery>
+ querytree('foo & ! bar'::tsquery)
+ 'foo'
+
+ |
+
+
+
+ setweight(tsvector>, "char">)
+
tsvector
assign weight to each element of tsvector>
setweight('fat:2,4 cat:3 rat:5B'::tsvector, 'A')
'cat':3A 'fat':2A,4A 'rat':5A
|
- strip(tsvector>)
+
+
+
+ strip(tsvector>)
+
tsvector
remove positions and weights from tsvector>
strip('fat:2,4 cat:3 rat:5A'::tsvector)
'cat' 'fat' 'rat'
|
- to_tsquery( config> regconfig> , query> text)
+
+
+
+ to_tsquery( config> regconfig> , query> text)
+
tsquery
normalize words and convert to tsquery>
to_tsquery('english', 'The & Fat & Rats')
'fat' & 'rat'
|
- plainto_tsquery( config> regconfig> , query> text)
- tsquery
- produce tsquery> ignoring punctuation
- plainto_tsquery('english', 'The Fat Rats')
- 'fat' & 'rat'
-
- |
- numnode(tsquery>)
- integer
- number of lexemes plus operators in tsquery>
- numnode('(fat & rat) | cat'::tsquery)
- 5
+
+
+
+ to_tsvector( config> regconfig> , document> text)
+
+ tsvector
+ reduce document text to tsvector>
+ to_tsvector('english', 'The Fat Rats')
+ 'fat':2 'rat':3
|
- querytree(query tsquery>)
+
+
+
+ ts_headline( config regconfig>, document text>, query tsquery> , options text> )
+
text
- get indexable part of a tsquery>
- querytree('foo & ! bar'::tsquery)
- 'foo'
+ display a query match
+ ts_headline('x y z', 'z'::tsquery)
+ x y <b>z</b>
|
- ts_rank( weights float4[]>, vector tsvector>, query tsquery> , normalization integer> )
+
+
+
+ ts_rank( weights float4[]>, vector tsvector>, query tsquery> , normalization integer> )
+
float4
rank document for query
ts_rank(textsearch, query)
0.818
|
- ts_rank_cd( weights float4[]>, vector tsvector>, query tsquery> , normalization integer> )
+
+
+
+ ts_rank_cd( weights float4[]>, vector tsvector>, query tsquery> , normalization integer> )
+
float4
rank document for query using cover density
ts_rank_cd('{0.1, 0.2, 0.4, 1.0}', textsearch, query)
2.01317
|
- ts_headline( config regconfig>, document text>, query tsquery> , options text> )
- text
- display a query match
- ts_headline('x y z', 'z'::tsquery)
- x y <b>z</b>
-
- |
- ts_rewrite(query tsquery>, target tsquery>, substitute tsquery>)
+
+
+
+ ts_rewrite(query tsquery>, target tsquery>, substitute tsquery>)
+
tsquery
replace target with substitute within query
ts_rewrite('a & b'::tsquery, 'a'::tsquery, 'foo|bar'::tsquery)
'b' & ( 'foo' | 'bar' )
|
- get_current_ts_config()
- regconfig
- get default text search configuration
- get_current_ts_config()
- english
-
- |
- tsvector_update_trigger()
+
+
+
tsvector_update_trigger
+
+ tsvector_update_trigger()
+
trigger
trigger function for automatic tsvector> column update
CREATE TRIGGER ... tsvector_update_trigger(tsvcol, 'pg_catalog.swedish', title, body)
|
- tsvector_update_trigger_column()
+
+
+
tsvector_update_trigger_column
+
+ tsvector_update_trigger_column()
+
trigger
trigger function for automatic tsvector> column update
CREATE TRIGGER ... tsvector_update_trigger_column(tsvcol, configcol, title, body)
|
- ts_debug( config regconfig>, document text>, OUT alias> text>, OUT description> text>, OUT token> text>, OUT dictionaries> regdictionary[]>, OUT dictionary> regdictionary>, OUT lexemes> text[]>)
+
+
+
+ ts_debug( config regconfig>, document text>, OUT alias> text>, OUT description> text>, OUT token> text>, OUT dictionaries> regdictionary[]>, OUT dictionary> regdictionary>, OUT lexemes> text[]>)
+
setof record
test a configuration
ts_debug('english', 'The Brightest supernovaes')
(asciiword,"Word, all ASCII",The,{english_stem},english_stem,{}) ...
|
- ts_lexize(dict regdictionary>, token text>)
+
+
+
+ ts_lexize(dict regdictionary>, token text>)
+
text[]
test a dictionary
ts_lexize('english_stem', 'stars')
{star}
|
- ts_parse(parser_name text>, document text>, OUT tokid> integer>, OUT token> text>)
+
+
+
+ ts_parse(parser_name text>, document text>, OUT tokid> integer>, OUT token> text>)
+
setof record
test a parser
ts_parse('default', 'foo - bar')
(1,foo) ...
|
- ts_token_type(parser_name> text>, OUT tokid> integer>, OUT alias> text>, OUT description> text>)
+
+
+
+ ts_token_type(parser_name> text>, OUT tokid> integer>, OUT alias> text>, OUT description> text>)
+
setof record
get token types defined by parser
ts_token_type('default')
(1,asciiword,"Word, all ASCII") ...
|
- ts_stat(sqlquery text>, weights text>, OUT word text>, OUT ndoc integer>, OUT nentry integer>)
+
+
+
+ ts_stat(sqlquery text>, weights text>, OUT word text>, OUT ndoc integer>, OUT nentry integer>)
+
setof record
get statistics of a tsvector> column
ts_stat('SELECT vector from apod')
+
+
avg(expression)
|
- count(*)
+
+
+
+ count(*)
+
bigint
number of input rows
|
- max(expression)
+
+
+
+ max(expression)
+
any array, numeric, string, or date/time type
same as argument type
|
- min(expression)
+
+
+
+ min(expression)
+
any array, numeric, string, or date/time type
same as argument type
|
- sum(expression)
+
+
+
+ sum(expression)
+
smallint, int,
bigint, real, double
+
+
corr(Y, X)
population
+
+
covar_pop(Y, X)
sample
+
+
covar_samp(Y, X)
|
+
+
regr_avgx(Y, X)
|
+
+
regr_avgy(Y, X)
|
+
+
regr_count(Y, X)
+
+
regr_intercept(Y, X)
|
+
+
regr_r2(Y, X)
+
+
regr_slope(Y, X)
|
+
+
regr_sxx(Y, X)
|
+
+
regr_sxy(Y, X)
|
+
+
regr_syy(Y, X)
+
+
stddev(expression)
population
+
+
stddev_pop(expression)
sample
+
+
stddev_samp(expression)
population
+
+
var_pop(expression)
sample
+
+
var_samp(expression)
name of current database
+ |
+ current_query()
+ text
+ text of the currently executing query, as submitted
+ by the client (might contain more than one statement)
+
+
|
current_schema[()]
name
user name of current execution context
- |
- current_query()
- text
- text of the currently executing query, as submitted
- by the client (might contain more than one statement)
-
-
- |
-
- pg_backend_pid()
- int
-
- Process ID of the server process attached to the current session
-
-
-
- |
- pg_listening_channels()
- setof text
- channel names that the session is currently listening on
-
-
|
inet_client_addr()
inet
|
- pg_my_temp_schema()
- oid
- OID of session's temporary schema, or 0 if none
+
+ pg_backend_pid()
+ int
+
+ Process ID of the server process attached to the current session
+
+
+
+ |
+ pg_conf_load_time()
+ timestamp with time zone
+ configuration load time
|
|
- pg_postmaster_start_time()
- timestamp with time zone
- server start time
+ pg_listening_channels()
+ setof text
+ channel names that the session is currently listening on
|
- pg_conf_load_time()
+ pg_my_temp_schema()
+ oid
+ OID of session's temporary schema, or 0 if none
+
+
+ |
+ pg_postmaster_start_time()
timestamp with time zone
- configuration load time
+ server start time
|
- current
- current
- current
+
+
+
+
+
+
+ current
+
+
+
+ current
+
+
+
+ current
is function visible in search path
|
-
pg_operator_is_visible(operator_oid)
+
pg_opclass_is_visible(opclass_oid)
boolean
- is operator visible in search path
+ is operator class visible in search path
|
-
pg_opclass_is_visible(opclass_oid)
+
pg_operator_is_visible(operator_oid)
boolean
- is operator class visible in search path
+ is operator visible in search path
|
pg_table_is_visible(table_oid)
-
-
-
+
+
+
text
get SQL name of a data type
- |
- pg_get_keywords()
- setof record
- get list of SQL keywords and their categories
-
|
pg_get_constraintdef(constraint_oid)
text
or definition of just one index column when
+ |
+ pg_get_keywords()
+ setof record
+ get list of SQL keywords and their categories
+
|
text
get current snapshot
|
-
txid_snapshot_xmin(txid_snapshot)
- bigint
- get xmin of snapshot
+
txid_snapshot_xip(txid_snapshot)
+ setof bigint
+ get in-progress transaction IDs in snapshot
|
txid_snapshot_xmax(txid_snapshot)
get xmax of snapshot
|
-
txid_snapshot_xip(txid_snapshot)
- setof bigint
- get in-progress transaction IDs in snapshot
+
txid_snapshot_xmin(txid_snapshot)
+ bigint
+ get xmin of snapshot
|
txid_visible_in_snapshot(bigint, txid_snapshot)
|
+
+
current_setting(setting_name)
text
|
+
+
-
-
+
+
|
-
pg_terminate_backend(pid int>)
+ pg_reload_conf()
boolean
- Terminate a backend
+ Cause server processes to reload their configuration files
|
- pg_reload_conf()
+ pg_rotate_logfile()
boolean
- Cause server processes to reload their configuration files
+ Rotate server's log file
|
- pg_rotate_logfile()
+
pg_terminate_backend(pid int>)
boolean
- Rotate server's log file
+ Terminate a backend
+
pg_current_xlog_insert_location
+
pg_current_xlog_location
-
pg_current_xlog_location
-
pg_current_xlog_insert_location
-
pg_xlogfile_name_offset
+
pg_xlogfile_name_offset
|
-
pg_start_backup(label> text> , fast> boolean> )
+ pg_current_xlog_insert_location()
text
- Prepare for performing on-line backup
+ Get current transaction log insert location
|
- pg_stop_backup()
+ pg_current_xlog_location()
text
- Finish performing on-line backup
+ Get current transaction log write location
|
- pg_switch_xlog()
+
pg_start_backup(label> text> , fast> boolean> )
text
- Force switch to a new transaction log file
+ Prepare for performing on-line backup
|
- pg_current_xlog_location()
+ pg_stop_backup()
text
- Get current transaction log write location
+ Finish performing on-line backup
|
- pg_current_xlog_insert_location()
+ pg_switch_xlog()
text
- Get current transaction log insert location
+ Force switch to a new transaction log file
|
-
pg_xlogfile_name_offset(location> text>)
+
pg_xlogfile_name(location> text>)
- text>, integer>
- Convert transaction log location string to file name and decimal byte offset within file
+ texttype>
+ Convert transaction log location string to file name
|
-
pg_xlogfile_name(location> text>)
+
pg_xlogfile_name_offset(location> text>)
- texttype>
- Convert transaction log location string to file name
+ text>, integer>
+ Convert transaction log location string to file name and decimal byte offset within file
|
- pg_total_relation_size(regclass)
+ pg_database_size(oid)
bigint
-
- Total disk space used by the table with the specified OID or name,
- including all indexes and
TOAST> data
-
+ Disk space used by the database with the specified OID
|
- pg_table_size(regclass)
+ pg_database_size(name)
bigint
-
- Disk space used by the table with the specified OID or name,
- excluding indexes (but including TOAST, free space map, and visibility
- map)
-
+ Disk space used by the database with the specified name
|
|
- pg_database_size(oid)
+
pg_relation_size(relation regclass, fork text)
bigint
- Disk space used by the database with the specified OID
+
+ Disk space used by the specified fork ('main',
+ 'fsm' or 'vm'>)
+ of the table or index with the specified OID or name
+
|
- pg_database_size(name)
+
pg_relation_size(relation regclass)
bigint
- Disk space used by the database with the specified name
+
+ Shorthand for pg_relation_size(..., 'main')
+
|
- pg_tablespace_size(oid)
+ pg_size_pretty(bigint)
- bigint
- Disk space used by the tablespace with the specified OID
+ text
+ Converts a size in bytes into a human-readable format with size units
|
- pg_tablespace_size(name)
+ pg_table_size(regclass)
bigint
- Disk space used by the tablespace with the specified name
+
+ Disk space used by the table with the specified OID or name,
+ excluding indexes (but including TOAST, free space map, and visibility
+ map)
+
|
-
pg_relation_size(relation regclass, fork text)
+ pg_tablespace_size(oid)
bigint
-
- Disk space used by the specified fork ('main',
- 'fsm' or 'vm'>)
- of the table or index with the specified OID or name
-
+ Disk space used by the tablespace with the specified OID
|
-
pg_relation_size(relation regclass)
+ pg_tablespace_size(name)
bigint
-
- Shorthand for pg_relation_size(..., 'main')
-
+ Disk space used by the tablespace with the specified name
|
- pg_size_pretty(bigint)
+ pg_total_relation_size(regclass)
- text
- Converts a size in bytes into a human-readable format with size units
+ bigint
+
+ Total disk space used by the table with the specified OID or name,
+ including all indexes and
TOAST> data
+
void
Obtain exclusive advisory lock
-
|
pg_advisory_lock_shared(key> bigint>)
void
Obtain shared advisory lock
-
|
-
pg_try_advisory_lock(key> bigint>)
+
pg_advisory_unlock(key> bigint>)
boolean
- Obtain exclusive advisory lock if available
+ Release an exclusive advisory lock
|
-
pg_try_advisory_lock(key1> int>, key2> int>)
+
pg_advisory_unlock(key1> int>, key2> int>)
boolean
- Obtain exclusive advisory lock if available
+ Release an exclusive advisory lock
-
|
-
pg_try_advisory_lock_shared(key> bigint>)
+ pg_advisory_unlock_all()
- boolean
- Obtain shared advisory lock if available
+ void
+ Release all advisory locks held by the current session
|
-
pg_try_advisory_lock_shared(key1> int>, key2> int>)
+
pg_advisory_unlock_shared(key> bigint>)
boolean
- Obtain shared advisory lock if available
+ Release a shared advisory lock
-
|
-
pg_advisory_unlock(key> bigint>)
+
pg_advisory_unlock_shared(key1> int>, key2> int>)
boolean
- Release an exclusive advisory lock
+ Release a shared advisory lock
|
-
pg_advisory_unlock(key1> int>, key2> int>)
+
pg_try_advisory_lock(key> bigint>)
boolean
- Release an exclusive advisory lock
+ Obtain exclusive advisory lock if available
-
|
-
pg_advisory_unlock_shared(key> bigint>)
+
pg_try_advisory_lock(key1> int>, key2> int>)
boolean
- Release a shared advisory lock
+ Obtain exclusive advisory lock if available
|
-
pg_advisory_unlock_shared(key1> int>, key2> int>)
+
pg_try_advisory_lock_shared(key> bigint>)
boolean
- Release a shared advisory lock
+ Obtain shared advisory lock if available
-
|
- pg_advisory_unlock_all()
+
pg_try_advisory_lock_shared(key1> int>, key2> int>)
- void
- Release all advisory locks held by the current session
+ boolean
+ Obtain shared advisory lock if available
-
-
Like most other relational database products,
aggregate functions>.