Re: Tablas temporary

From: Jaime Casanova <systemguards(at)yahoo(dot)com>
To: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: Tablas temporary
Date: 2004-12-02 17:02:15
Message-ID: 20041202170215.83063.qmail@web50010.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

--- Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl> escribió:

> On Wed, Dec 01, 2004 at 11:20:49PM -0700, Ivan
> Manjarrez López wrote:
>
> > Mi pregunta es ¿que de cierto es que no se borran
> las tablas creadas
> > por el comando CREATE TEMPORARY y que la carpeta
> tmp que usan para
> > estas mismas van creciendo?
>
> Nada.
>

CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ]
TABLE table_name (
{ column_name data_type [ DEFAULT default_expr ] [
column_constraint [ ... ] ]
| table_constraint
| LIKE parent_table [ { INCLUDING | EXCLUDING }
DEFAULTS ] } [, ... ]
)
[ INHERITS ( parent_table [, ... ] ) ]
[ WITH OIDS | WITHOUT OIDS ]
[ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ]

TEMPORARY or TEMP
If specified, the table is created as a temporary
table. Temporary tables are automatically dropped at
the end of a session, or optionally at the end of the
current transaction (see ON COMMIT below). Existing
permanent tables with the same name are not visible to
the current session while the temporary table exists,
unless they are referenced with schema-qualified
names. Any indexes created on a temporary table are
automatically temporary as well.

ON COMMIT
The behavior of temporary tables at the end of a
transaction block can be controlled using ON COMMIT.
The three options are:

PRESERVE ROWS
No special action is taken at the ends of
transactions. This is the default behavior.

DELETE ROWS
All rows in the temporary table will be deleted at the
end of each transaction block. Essentially, an
automatic TRUNCATE is done at each commit.

DROP
The temporary table will be dropped at the end of the
current transaction block.

Asi que las tablas creadas con la clausula temporary
se borran al terminar la sesion, pero NO al terminar
la transaccion a menos que hayas especificado la
opcion ON COMMIT DROP.

Atentamente,
Jaime Casanova

_________________________________________________________
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Ernesto Quiñones A. 2004-12-02 17:03:52 Re: Como hago para conectar Postgres con SQL 2000 y/o transformar Postgres a SQL2000
Previous Message Cristian Alejandro Rossel Moraga 2004-12-02 15:51:16 Re: esquemas