当前位置:网站首页>Gbase 8C - SQL reference 6 SQL syntax (11)

Gbase 8C - SQL reference 6 SQL syntax (11)

2022-07-27 05:56:00 aisirea

  1. CREATE TABLESPACE

Function description

Create a new tablespace in the database .

Grammar format

CREATE TABLESPACE tablespace_name

    [ OWNER { new_owner | CURRENT_USER | SESSION_USER } ]

    LOCATION 'directory'

    [ WITH ( tablespace_option = value [, ... ] ) ]

Parameter description

  1. tablespace_name: Name of the tablespace to be created , The table space name cannot be the same as other table spaces in the data cluster , And the name cannot be "pg" start , Such names are reserved for system table spaces ;
  2. user_name: Specify the owner of the tablespace , By default , The owner of the new tablespace is the current user , Only system administrators can create tablespaces , Can pass OWNER Clause assigns the ownership of the table space to other non system administrators ;
  3. directory: Directories for tablespaces , The directory should be empty and owned by the system user , The directory must be an absolute path ;
  4. tablespace_option: Table space parameters to be set or reset , Currently available seq_page_cost、random_page_cost as well as effective_io_concurrency Parameters ;
    1. seq_page_cost: Specify sequential reading page The cost of ;
    2. random_page_cost: Specify random read page The cost of ;
    3. effective_io_concurrency: The number of requests that the disk subsystem can effectively process at the same time ;

matters needing attention

Only system administrators can create tablespaces .

It is not allowed to execute within a transaction block CREATE TABLESPACE.

All in the database cluster CN and DN Nodes are assigned the same tablespace path . When creating a table space , Users need to have permissions on the same location path on all servers involved in the cluster .

Example

create tablespace gbase8c LOCATION '~/data/dbs';

Grammar compatible

CREATE TABLESPACE It's a kind of PostgreSQL Expand .

Related to the grammar

CREATE DATABASE, CREATE TABLE, CREATE INDEX, DROP TABLESPACE, ALTER TABLESPACE

  1. CREATE TEXT SEARCH CONFIGURATION

Function description

Create a new text search configuration .

Grammar format

CREATE TEXT SEARCH CONFIGURATION name (

    PARSER = parser_name |

    COPY = source_config

)

Parameter description

  1. name: The name of the text search configuration to create , Can be modified by patterns ;
  2. parser_name: The name of the text search analyzer used for this configuration ;
  3. source_config: The name of the existing text search configuration to copy ;

matters needing attention

PARSER and COPY Options are mutually exclusive , Because when an existing configuration is copied , Its analyzer configuration has also been copied .

Example

CREATE TEXT SEARCH CONFIGURATION gdt1(copy=pg_catalog.english);

CREATE TEXT SEARCH CONFIGURATION

Grammar compatible

stay SQL There is no in the standard CREATE TEXT SEARCH CONFIGURATION sentence .

Related to the grammar

ALTER TEXT SEARCH CONFIGURATION, DROP TEXT SEARCH CONFIGURATION

  1. CREATE TEXT SEARCH DICTIONARY

Function description

Create a new full-text search dictionary . Dictionary is a method of identifying and processing specific words in full-text retrieval .

Grammar format

CREATE TEXT SEARCH DICTIONARY name (

    TEMPLATE = template

    [, option = value [, ... ]]

)

Parameter description

  1. name: The name of the dictionary to be created , Can be modified by patterns ;
  2. template: The name of the template that defines the basic behavior of the dictionary ;
  3. option: Template related parameter names ;
  4. value: Template related parameter values ;

matters needing attention

The user who defines the text retrieval dictionary will become its owner .

Example

CREATE TEXT SEARCH DICTIONARY my_russian (

    template = snowball,

    language = russian,

    stopwords = myrussian

);

Grammar compatible

stay SQL There is no in the standard CREATE TEXT SEARCH DICTIONARY sentence .

Related to the grammar

ALTER TEXT SEARCH DICTIONARY, DROP TEXT SEARCH DICTIONARY

  1. CREATE TEXT SEARCH PARSER

Function description

Create a new text search parser .

Grammar format

CREATE TEXT SEARCH PARSER name (

    START = start_function ,

    GETTOKEN = gettoken_function ,

    END = end_function ,

    LEXTYPES = lextypes_function

    [, HEADLINE = headline_function ]

)

Parameter description

  1. name: The name of the text search parser to be created , Can be modified by patterns ;
  2. start_function: The name of the parser start function ;
  3. gettoken_function: The parser takes down the name of a token ;
  4. end_function: The name of the parser end function ;
  5. lextypes_function: The parser lexical analyzer function name ;
  6. headline_function: The parser title function .

matters needing attention

Except for the title function, other functions are required .

Grammar compatible

stay SQL There is no in the standard CREATE TEXT SEARCH PARSER sentence .

Related to the grammar

ALTER TEXT SEARCH PARSER, DROP TEXT SEARCH PARSER

  1. CREATE TEXT SEARCH TEMPLATE

Function description

Create a new text search template .

Grammar format

CREATE TEXT SEARCH TEMPLATE name (

    [ INIT = init_function , ]

    LEXIZE = lexize_function

)

Parameter description

  1. name: The name of the text search template to be created , Can be modified by patterns ;
  2. init_function: The initialization function name of the template ;
  3. lexize_function: The name of the word segmentation function of the template .

matters needing attention

Parameters can be sorted arbitrarily .

Grammar compatible

stay SQL There is no in the standard CREATE TEXT SEARCH TEMPLATE sentence .

Related to the grammar

ALTER TEXT SEARCH TEMPLATE, DROP TEXT SEARCH TEMPLATE

  1. CREATE TRANSFORM

Function description

Create a new transformation .

Grammar format

CREATE [ OR REPLACE ] TRANSFORM FOR type_name LANGUAGE lang_name (

    FROM SQL WITH FUNCTION from_sql_function_name [ (argument_type [, ...]) ],

    TO SQL WITH FUNCTION to_sql_function_name [ (argument_type [, ...]) ]

);

Parameter description

type_name: The name of the data type to be converted ;

lang_name: The language name of the conversion ;

from_sql_function_name[(argument_type [, ...])]: Change this type from SQL Function name converted to the process language ;

to_sql_function_name[(argument_type [, ...])]: Convert this type from procedural language to SQL The function name of ;

matters needing attention

The user who wants to create the transformation must have a USAGE jurisdiction , And having from-SQL and to-SQL Functional EXECUTE jurisdiction .

Example

CREATE TRANSFORM FOR hstore LANGUAGE plpythonu (

    FROM SQL WITH FUNCTION hstore_to_plpython(internal),

    TO SQL WITH FUNCTION plpython_to_hstore(internal)

);

Grammar compatible

This grammar is a kind of PostgreSQL Expand . differ SQL Standard CREATE TRANSFORM command ( Used to adapt data types to client languages ).

Related to the grammar

CREATE FUNCTION, CREATE LANGUAGE, CREATE TYPE, DROP TRANSFORM

  1. CREATE TYPE

Function description

Define a new data type in the current database . The user who defines the data type will become the owner of that data type .

There are five types of CREATE TYPE, Respectively : Combination type 、 Enumeration type 、 Range type 、 Foundation type and shell type .

  1. Combination type

The combination type is specified by a list of attribute names and data types . If the data type of the attribute is sortable , You can also specify the collation of this attribute . The combination type is essentially the same as the row type of the table , But if you want to define only one type , Use CREATE TYPE Avoid creating an actual table . Individual composite types are also useful , For example, it can be used as a function parameter or return type . In order to be able to create composite types , Must have on all its attribute types USAGE Privilege .

  1. Enumeration type

A list of several tags , Each tag value is a non empty string , And the length of the string must not exceed 64 Bytes .

  1. Range type

Range type subtype It can be anything with a related B Tree operator class ( Used to determine the order of the range type values ) The type of . Usually , Default for subtypes B The tree operator class is used to determine the order .

  1. The base type

Users can customize a new basic type ( Scalar type ). Generally speaking, these functions must use C Or another low-level language .

  1. shell type

Is a placeholder for the type to be defined later , By issuing a CREATE TYPE Command can create this type . When creating basic types , need shell Type as a forward reference .

Grammar format

CREATE TYPE name AS

    ( [ attribute_name data_type [ COLLATE collation ] [, ... ] ] )

CREATE TYPE name AS ENUM

    ( [ 'label' [, ... ] ] )

CREATE TYPE name AS RANGE (

    SUBTYPE = subtype

    [ , SUBTYPE_OPCLASS = subtype_operator_class ]

    [ , COLLATION = collation ]

    [ , CANONICAL = canonical_function ]

    [ , SUBTYPE_DIFF = subtype_diff_function ]

)

CREATE TYPE name (

    INPUT = input_function,

    OUTPUT = output_function

    [ , RECEIVE = receive_function ]

    [ , SEND = send_function ]

    [ , TYPMOD_IN = type_modifier_input_function ]

    [ , TYPMOD_OUT = type_modifier_output_function ]

    [ , ANALYZE = analyze_function ]

    [ , INTERNALLENGTH = { internallength | VARIABLE } ]

    [ , PASSEDBYVALUE ]

    [ , ALIGNMENT = alignment ]

    [ , STORAGE = storage ]

    [ , LIKE = like_type ]

    [ , CATEGORY = category ]

    [ , PREFERRED = preferred ]

    [ , DEFAULT = default ]

    [ , ELEMENT = element ]

    [ , DELIMITER = delimiter ]

    [ , COLLATABLE = collatable ]

)

CREATE TYPE name

Parameter description

  1. name: The name of the type to create ( Can be modified by patterns );
  2. attribute_name: An attribute of a composite type ( Column ) The name of ;
  3. data_type: The name of the existing data type to be a column of the composite type ;
  4. collation: The name of an existing collation to associate to a column of a composite type or a range type ;
  5. label: Optional parameters . A text label associated with a value of an enumeration type ;
  6. subtype: The name of the element type of the scope type , The range represented by the range type belongs to this type ;

Range type subtype It can be anything with a related B Tree operator class ( Used to determine the order of the range type values ) The type of . Usually , Default for subtypes B The tree operator class is used to determine the order . To use a non default operator class , It can be used subtype_opclass Specify its name . If the subtype is sortable and you want to use a non default collation in the order of the range , It can be used collation Option to specify .

  1. subtype_operator_class: be used for subtype Of B The name of the tree operator class ;
  2. canonical_function: The name of the normalized function of the range type ;

canonical_function Must be defined before declaring the scope type . First, create a shell type , It is a placeholder type with no attributes but only name and owner . You can issue a command without additional parameters CREATE TYPE name To complete . Then you can use the shell Type to declare the function as a parameter and result , And finally declare the scope type with the same name . This will automatically replace with a legal scope type shell Type item .

  1. subtype_diff_function: Optional parameters , be used for subtype The name of the difference function of ;

subtype_diff_function Must accept two subtype The value of type is taken as the parameter , And return to a double precision Value represents the difference between two given values . Although it's optional , But providing this function will make the range type column GiST Indexing is more efficient .

  1. input_function: Function name that converts data from the external text form of the type to the internal form ;

The input function can be declared as having a cstring Parameters of type , Or there are three types cstring、oid、integer Parameters of .

    1. cstring The parameter is C The input text where the string exists .
    2. oid Parameters are of the type itself OID( For an array type, it is its element type OID).
    3. integer The parameter is the target column typmod( If you know , If you don't know, it will pass -1).

The input function must return a value of the data type itself . Usually , An input function should be declared as STRICT. If not , After reading a NULL When entering a value , When calling the input function, the first parameter will be NULL. under these circumstances , The function must still return NULL, Unless there is an error in calling the function ( This situation is mainly to support the field input function , Field input functions may need to be rejected NULL Input ).

  1. output_function: Function name that converts data from the internal form of the type to the external text form ;

The output function must be declared as a parameter with a new data type . Output function must return type cstring. about NULL Value does not call the output function

  1. receive_function: Optional parameters , A function name that converts data from an external binary form of a type to an internal form ;

Without this function , This type cannot participate in binary input . It is cheaper to convert binary expression into internal form , However, it is easier to transplant ( for example , Standard integer data types use network byte order as an external binary representation , The internal expression is the local byte order of the machine ).receive_function Sufficient checks should be performed to ensure that the value is valid .

The receiving function can be declared as having a internal Parameters of type , Or there are three types internal、oid、integer Parameters of .

    1. internal The parameter is a point to StringInfo Pointer to the buffer , It stores the received byte string .
    2. oid and integer The parameters are the same as those of the text input function .

The receiving function must return a value of the data type itself . Usually , A receiving function should be declared as STRICT. If not , After reading a NULL When calling the receiving function when entering a value, the first parameter will be NULL. under these circumstances , The function must still return NULL, Unless there is an error in the receiving function ( This situation is mainly to support the domain receiving function , The domain receiving function may need to reject NULL Input ).

  1. send_function: Function name that converts data from the internal form of the type to the external binary form ;

Without this function , This type will not participate in binary output . The send function must be declared as a parameter with a new data type . Sending function must return type bytea. about NULL Value does not call the send function .

  1. type_modifier_input_function: Optional parameters , Convert the modifier array of type to the function name of internal form ;
  2. type_modifier_output_function: Optional parameters , The function name that converts the internal form of the type modifier to the external text form ;

If the type supports modifiers ( Optional constraints attached to type declarations , for example ,char(5) or numeric(30,2)), Optional type_modifier_input_function as well as type_modifier_output_function. GBase 8c Allow user-defined types to have one or more simple constants or identifiers as modifiers . however , To store in the system directory , This information must be able to be packaged into a non negative integer value . The declared modifier will be marked with cstring The form of array is passed to type_modifier_input_function. type_modifier_input_function The validity of this value must be checked ( If the value is wrong, an error will be thrown ), If the value is correct , To return a nonnegative integer value , This value will be stored in “typmod” In the column . If the type does not type_modifier_input_function Then the type modifier will be rejected .type_modifier_output_function Put the internal integer typmod Value is converted back to the correct form for user display .type_modifier_output_function Must return a cstring value , This value is the string appended to the type name . for example ,numeric The function of may return (30,2). If the default display format is to store only typmod The integer value is placed in parentheses , It is allowed to omit type_modifier_output_function.

  1. analyze_function: Optional arguments to the function name that performs statistical analysis for this data type ;

By default , If this type has a default B-tree Operator class ,ANALYZE Will try to use type “equals” and “less-than” Operator to collect statistics . This behavior is not appropriate for non scalar types , Therefore, you can override this behavior by specifying a custom analysis function . The parsing function must be declared as having a type internal Parameters of , And return to a boolean result .

  1. internallength: Optional parameters , A numeric constant , Used to specify the byte length of the internal expression of the new type . Default to variable length .

Although only I/O Functions and other functions created for this type know the details of the internal expression of the new type , But some attributes of internal expression must be directed to GaussDB 200 Statement . The most important one is internallength. The basic data type can be of fixed length ( In this case internallength Is a positive integer ) Or longer ( hold internallength Set to VARIABLE, Internally, through the typlen Set to -1 Express ). All internal expressions of variable length types must be represented by a 4 Byte integer start ,internallength Defines the total length .

  1. alignment: Optional parameters , This parameter specifies the storage alignment requirements of the data type . If specified , Must be char、int2、int4 perhaps double, The default is int4;

The allowed value is equivalent to 1、2、4 or 8 Byte boundary alignment . Pay attention to the variable length type alignment The parameter must be at least 4, Because they need to contain a int4 As their first component .

  1. storage: Optional parameters , Storage strategy of this data type ; If specified , Must be plain、external、extended perhaps main, The default is plain;
    1. plain Specifies that this type of data will always be stored online and will not be compressed .( For fixed length type, only plain)
    2. extended Specifies that the system will first try to compress a long data value , And the value will be moved out of the main table row when the data is still too long .
    3. external Allowed values are moved out of the main table , But the system will not try to compress it .
    4. main Allow compression , But it is not encouraged to move values out of the main table ( If there is no other way to make the size of the row suitable , Data items with this storage strategy will still be moved out of the main table , But compared with extended as well as external Item to , The data items of this storage strategy will be preferentially retained in the main table ).

except plain All the other storage Values all imply that functions of this data type can be handled by TOAST Past value . The specified value only determines a kind of TOAST Default for columns of data type TOAST Storage strategy , Users can use ALTER TABLE SET STORAGE Choose another policy for the column .

  1. like_type: Optional parameters , The name of an existing data type that has the same expression as the new type , Will be copied from this type internallength、 passedbyvalue、alignment as well as storage Value ( Unless in this CREATE TYPE The rest of the command is covered with explicit instructions );

When the underlying implementation of a new type refers to an existing type , Specifying expressions in this way is particularly useful .

  1. category: Optional parameters . This type of classification code ( One ASCII character ), The default is “ User defined type ” Of 'U', To create custom categories , You can also choose other ASCII character ;
  2. preferred: Optional parameters , If this type is the preferred type in its type classification, it is TRUE, Otherwise FALSE, The default is FALSE, It is prudent to create a new priority type in an existing type classification , Because this may lead to great changes ;

category and preferred Parameters can be used to help control which implicit shapes are applied in the case of confusion . Each data type belongs to a single ASCII Classification of character naming , And each type can be in its classification “ The preferred ”. When it helps to solve overloaded functions or operators , The parser will first shape to the preferred type ( But it can only be modeled from other types of the same kind ). For types that do not implicitly convert to or from any other type , Just leave these settings as default . however , For groups of related types with implicit conversions , Mark them all as belonging to the same category and choose one or both “ The most commonly used ” The type of is usually useful as the first choice for this category . Adding a user-defined type to an existing built-in category ( for example , Number or string type ) In the middle of the day ,category Parameters are particularly useful . however , You can also create new categories that are all user-defined types . For such categories , You can choose any except capital letters ASCII character .

  1. default: Optional parameters , Default values for data types , If omitted , The default value is null , If the user wants the column of this data type to be defaulted to a non null value , You can specify a default value , The default value can be used DEFAULT Keyword assignment ( Such a default value can be appended to the explicit of a specific column DEFAULT Clause overrides );
  2. element: Optional parameters , The type created is an array ,element Specifies the type of array elements . for example , To define a 4 Array of byte integers (int4), Should be specified ELEMENT = int4;
  3. delimiter: Optional parameters , Specify the delimiter for separating values in the array composed of this type , You can put delimiter Set to a specific character , The default delimiter is comma (,), Note that the delimiter is related to the array element type , Not the array type itself ;
  4. collatable: Optional parameters , If this type of operation can use collation information , Then for TRUE, The default is FALSE, If collatable by TRUE, This type of column definition and expression may be achieved by using COLLATE Clause carries collation information , The implementation of functions that operate on this type is responsible for making real use of this information , Just marking types as sortable does not make them automatically use this kind of information ;

matters needing attention

Given a schema name , Then the type will be created in the specified schema . Otherwise it will be created in the current mode . The type name must be different from any existing type or domain in the same schema ( Because tables have related data types , The type name must also be different from the name of any existing table in the same schema ).

Example

CREATE TYPE g_compfoo AS (f1 int, f2 text);

CREATE TYPE

Grammar compatible

Create the first form of composite type CREATE TYPE The command conforms to SQL standard . Other forms are PostgreSQL Expand .SQL Standard CREATE TYPE The statement also defines other GBase 8c Forms that are not implemented in .

Related to the grammar

ALTER TYPE, CREATE DOMAIN, CREATE FUNCTION, DROP TYPE

  1. CREATE USER

Function description

Create user .

Grammar format

CREATE USER name [ [ WITH ] option [ ... ] ]

here option It can be :

      SUPERUSER | NOSUPERUSER

    | CREATEDB | NOCREATEDB

    | CREATEROLE | NOCREATEROLE

    | INHERIT | NOINHERIT

    | LOGIN | NOLOGIN

    | REPLICATION | NOREPLICATION

    | BYPASSRLS | NOBYPASSRLS

    | CONNECTION LIMIT connlimit

    | [ ENCRYPTED ] PASSWORD 'password'

    | VALID UNTIL 'timestamp'

    | IN ROLE role_name [, ...]

    | IN GROUP role_name [, ...]

    | ROLE role_name [, ...]

    | ADMIN role_name [, ...]

    | USER role_name [, ...]

    | SYSID uid

Parameter description

name: User name ;

matters needing attention

CREATE USER yes CREATE ROLE An alias for . The only difference is CREATE USER in LOGIN As the default , and NOLOGIN yes CREATE ROLE The default value of .

Example

CREATE ROLE gbasedbt3 PASSWORD'root';

CREATE ROLE

Grammar compatible

CREATE USER Sentence is a kind of PostgreSQL Expand .

Related to the grammar

ALTER USER, DROP USER, CREATE ROLE

  1. CREATE VIEW

Function description

Create a view . The view is different from the base table , Is a virtual table . Only the definition of view is stored in the database , Instead of storing the data corresponding to the view , These data are still stored in the original basic table . If the data in the basic table changes , The data queried from the view also changes . In this sense , The view is like a window , Through it, you can see the data and changes that users are interested in in in the database .

Grammar format

CREATE [ OR REPLACE ] [ TEMP | TEMPORARY ] [ RECURSIVE ] VIEW name [ ( column_name [, ...] ) ]

    [ WITH ( view_option_name [= view_option_value] [, ... ] ) ]

    AS query

    [ WITH [ CASCADED | LOCAL ] CHECK OPTION ]

Parameter description

  1. TEMPORARY | TEMP:GBase 8c Temporary does not support . Create a temporary view ;
  2. RECURSIVE: Create a recursive view ;

    CREATE RECURSIVE VIEW [ schema . ] view_name (column_names) AS SELECT ...;

Equivalent to :

    CREATE VIEW [ schema . ] view_name AS WITH RECURSIVE view_name (column_names) AS (SELECT ...) SELECT column_names FROM view_name;

For a recursive view, you must specify a view column name list .

  1. name: Name of the view to be created . Can be decorated with patterns ;
  2. column_name: List of optional names , The field name used as the view , If not given , The field name is taken from the field name in the query ;
  3. WITH ( view_option_name [= view_option_value] [, ... ] ): Specify some optional parameters for the view , Support the following parameters :
    1. check_option (string): It can be local perhaps cascaded, Equivalent to specifying WITH [ CASCADED | LOCAL ] CHECK OPTION( See below ), have access to ALTER VIEW Modify this option on an existing view ;
    2. security_barrier (boolean): Specify view row level security ;
  4. query: Provide rows and columns for the view SELECT or VALUES sentence ;
  5. WITH [ CASCADED | LOCAL ] CHECK OPTION: Control the view to update automatically , When you specify this option , Check INSERT and UPDATE Command to ensure that the new line meets the definition conditions of the view ( That is to say , New rows will be checked to ensure that they are visible through the view ). If Xinxing does not meet the conditions , Updates will be rejected . If not specified CHECK OPTION, Will allow INSERT and UPDATE life Create rows that are not visible through this view . The following check options are supported :
    1. LOCAL: Check the new row only according to the conditions directly defined in the view itself , Any defined on the underlying base view Conditions will not be checked ( Unless they also specify CHECK OPTION);
    2. CASCADED: The new row will be checked according to the conditions on this view and all the underlying base views , If CHECK OPTION To be designated , And not specified LOCAL and CASCADED, Will assume CASCADED;

CHECK OPTION Should not be with RECURSIVE View .

Be careful , Only in automatically updatable 、 No, INSTEAD OF Trigger or INSTEAD Only in the view of rules CHECK OPTION. If an automatically updatable view is defined in a view with INSTEAD OF On the base view of the trigger , that LOCAL CHECK OPTION It can be used to check the conditions on the automatically updatable view , But with INSTEAD OF The condition on the base view of the trigger will not be checked ( A cascade check option will not cascade to a trigger updatable view , And any check options defined directly on a trigger updatable view will be ignored ). If the view or any underlying relationship has INSERT or UPDATE The command is rewritten INSTEAD The rules , Then all check options will be ignored in the rewritten query , Include any from the definition with INSTEAD Check the automatically updatable view on the relationship of rules .

matters needing attention

Simple views are automatically updatable : The system will allow this view to be used in the same way as the regular table INSERT、UPDATE as well as DELETE sentence . If a view meets the following conditions , It is automatically updatable :

  1. In the FROM There is just one item in the list , And it must be a table or another updatable view .
  2. The top level of a view definition cannot contain WITH、DISTINCT、GROUP BY、HAVING、LIMIT perhaps OFFSET Clause .
  3. The top level of a view definition cannot contain collection operations (UNION、INTERSECT perhaps EXCEPT).
  4. The selection list of views cannot contain any aggregations 、 Window function or collection return function .

Automatically updatable views can mix updatable and non updatable columns . If the column is a simple reference to an updatable column in the underlying basic relationship , Is updatable . Otherwise, the column is read-only , And in one INSERT perhaps UPDATE Statement will report an error when trying to assign a value to it .

Example

CREATE VIEW g_view AS SELECT * FROM customer;

CREATE VIEW

Grammar compatible

CREATE OR REPLACE VIEW It's a kind of PostgreSQL Language extension of .

Related to the grammar

ALTER VIEW, DROP VIEW, CREATE MATERIALIZED VIEW

  1. DEALLOCATE

Function description

DEALLOCATE Used to delete the prepared statement written previously .

Grammar format

DEALLOCATE [ PREPARE ] { name | ALL }

Parameter description

  1. PREPARE: You can ignore ;
  2. name: The prepared statement to be deleted ;
  3. ALL: Delete all prepared statements .

matters needing attention

If the user does not explicitly delete a prepared statement , Then it will be deleted at the end of the session .

Grammar compatible

SQL The standard includes a DEALLOCATE sentence , But only for embedded SQL.

Related to the grammar

EXECUTE, PREPARE

原网站

版权声明
本文为[aisirea]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/208/202207270511209016.html