Re: [Pgsql-ayuda] valores predeterminados en tablas

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Martin Marques <martin(at)bugs(dot)unl(dot)edu(dot)ar>
Cc: pgsql-ayuda(at)tlali(dot)iztacala(dot)unam(dot)mx
Subject: Re: [Pgsql-ayuda] valores predeterminados en tablas
Date: 2003-08-18 22:13:36
Message-ID: 20030818221335.GC2375@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

On Sat, Aug 16, 2003 at 10:14:40AM -0300, Martin Marques wrote:
> Existe alguna forma de que un campo de una tabla tome un valor por defecto
> (DEFAULT) sacado de una consulta de SELECT?

Del manual:

"DEFAULT default_expr

The DEFAULT clause assigns a default data value for the column whose
column definition it appears within. The value is any variable-free
expression (subselects and cross-references to other columns in the
current table are not allowed). The data type of the default
expression must match the data type of the column.

The default expression will be used in any insert operation that
does not specify a value for the column. If there is no default
for a column, then the default is NULL."

http://www14.us.postgresql.org/docs/7.3/static/sql-createtable.html

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"You knock on that door or the sun will be shining on places inside you
that the sun doesn't usually shine" (en Death: "The High Cost of Living")

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Alvaro Herrera 2003-08-18 22:20:58 Re: [Pgsql-ayuda] ayuda sigo trancado con el tema!!!!
Previous Message Alvaro Herrera 2003-08-18 22:09:43 Re: [Pgsql-ayuda] Diccionario de la base de datos