Skip to content

LexDbFunctions

BenjaminWaldron edited this page May 17, 2005 · 14 revisions

The LexDB uses a PostgreSQL database to provide a source of lexical items for client applications such as the LKB. This page provides a description of the internal (but "public") database functions used by a client connected to the LexDB. See also LexDbInternals for some documentation on the structure of the database itself.

check_psql_server_version RETURNS SETOF text

Returns nothing if psql server version is compatible with the LexDB. Else returns message text.

clear_rev() RETURNS boolean

Empty rev and rev_key tables. Register updated modstamp.

Returns t.

commit_rev(user text) RETURNS boolean

Call as user lexdb.

Update public schema with contents of rev and rev_key. Register updated modstamp.

Does NOT empty contents of rev and rev_key. Call clear_rev() as standard user to do this.

Returns t.

complete('''field''' text,'''val''' text) RETURNS SETOF text

Returns possible completions of val amongst values taken by field in table lex.

current_timestamp() RETURNS text

Returns current timestamp.

db_owner() RETURNS text

Returns name of database owner (default lexdb).

dump_public_rev_rev_key_to_tmp_tmp_key() RETURNS boolean

Places sorted copy of rev table in tmp. Places sorted copy of rev_key in tmp_key. These tables may then be accessed by the client (and placed in a file on client's local filesystem).

Returns t.

filter() RETURNS text

Returns filter of user (stored in meta table).

initialize_user_schema() RETURNS boolean

Creates and initializes private schema for user. Registers schema in public.meta.

Returns t if a new schema is created. If the schema already exists, or is the user is the database owner (lexdb), returns f.

lex_id_set() RETURNS SETOF text

Returns set of name field values in lex table.

lexdb_version() RETURNS text

Returns lexdb_version from meta table.

list_fld() RETURNS SETOF text

Returns (ordered) field names for rev tables.

lookup_general('''field''' text,'''val''' text) RETURNS SETOF text

Returns set of name for records in which field has value val.

lookup_general_null(text) RETURNS SETOF text

Returns set of name for records in which field is null.

merge_dfn_from_tmp_dfn() RETURNS integer

Call as database owner.Tables tmp_dfn must contain dfn entries to be merged.

Returns number of new entries.

merge_public_rev_rev_key_from_tmp_tmp_key() RETURNS integer

Call as database owner. Tables tmp and tmp_key must contain rev and rev_key entries to be merged.

Updates rev/rev_key tables to include all entries in tmp/tmp_key fields. Register updated modstamp.

Returns number of new entries.

register_modstamp() RETURNS text

Updates modstamp.

Returns current timestamp.

retrieve_all_entries() RETURNS SETOF rev

Returns contents of lex.

retrieve_entries_by_orthkey('''key''' text) RETURNS SETOF rev

Returns entries in lex for with corresponding key in table rev_key.

retrieve_entry('''name''' text)

Returns entries in lex matching name.

TO DO...

  • retrieve_head_entry retrieve_private_revs retrieve_semi_extra retrieve_semi_frame retrieve_semi_pred retrieve_semi_var return_field_info2 rev_key_p rev_new semi_out_of_date semi_setup_post semi_setup_pre semi_up_to_date_p
Clone this wiki locally