Download Manual del usuario de PostgreSQL [ Postgres
Transcript
Capítulo 15. Aplicaciones QUIET This variable is equivalent to the command line option -q. It is probably not too useful in interactive mode. SINGLELINE This variable is set be the command line options -S. You can unset or reset it at run time. SINGLESTEP This variable is equivalent to the command line option -s. USER The database user you are currently connected as. This is set everytime you connect to a database (including program startup), but can be unset. SQL Interpolation An additional useful feature of psql variables is that you can substitute (“interpolate”) them into regular SQL statements. The syntax for this is again to prepend the variable name with a colon (:). testdb=> \set foo ’my_table’ testdb=> SELECT * FROM :foo; would then query the table my_table. The value of the variable is copied literally, so it can even contain unbalanced quotes or backslash commands. You must make sure that it makes sense where you put it. Variable interpolation will not be performed into quoted SQL entities. A popular application of this facility is to refer to the last inserted OID in subsequent statement to build a foreign key scenario. Another possible use of this mechanism is to 421
Related documents
PostgreSQL User`s Guide - BITS
RSA Security 6.1 User's Manual
Nouveau temple de l`art - Mairie d`Aix-en
PostgreSQL 7.2 User's Guide
Allen-Bradley Bulletin 2362
PostgreSQL 7.1 User`s Guide
PostgreSQL 7.1 User`s Guide
Scala InfoChannel Player 3 Setup Guide
Manual de Referência do PostgreSQL 7.2
INVENTARIO DE ARCHIVO DE BAJA
Manual de Usuario C+ Titanium2.indd