PostgreSQL

Скачать в pdf «PostgreSQL»


To create the same user joe using the postmaster on host eden, port 5000, avoiding the prompts and taking a look at the underlying query:


$ createuser -p 5000 -h eden -D -A -e joe


create user «joe» nocreatedb nocreateuser create user

d.30 declare


Name


DECLARE — Defines a cursor for table access


DECLARE cursorname [ BINARY ] [ INSENSITIVE ] [ SCROLL ]


CURSOR FOR query


[ FOR { READ ONLY | UPDATE [ OF column [,…] ] ]


Inputs


eursorname The name of the cursor to be used in subsequent FETCH operations.


BINARY Causes the cursor to fetch data in binary rather than in text format.


INSENSITIVE SQL92 keyword indicating that data retrieved from the cursor should be unaffected by updates from other processes or cursors. Since cursor operations occur within transactions in Postgres this is always the case. This keyword has no effect.


SCROLL SQL92 keyword indicating that data may be retrieved in multiple rows per FETCH operation. Since this is allowed at all times by Postgres this keyword has no effect.


query An SQL query which will provide the rows to be governed by the cursor. Refer to the SELECT statement for further information about valid arguments.


READ ONLY SQL92 keyword indicating that the cursor will be used in a read only mode. Since this is the only cursor access mode available in Postgres this keyword has no effect.


UPDATE SQL92 keyword indicating that the cursor will be used to update tables. Since cursor updates are not currently supported in Postgres this keyword provokes an informational error message.

Скачать в pdf «PostgreSQL»