Re: [Pgsql-ayuda] Poner fecha por defecto

From: Hector Miuler Malpica Gallegos <linux-db(at)iespana(dot)es>
To: Martin Marques <martin(at)bugs(dot)unl(dot)edu(dot)ar>, Linux-pgsql <pgsql-ayuda(at)tlali(dot)iztacala(dot)unam(dot)mx>
Subject: Re: [Pgsql-ayuda] Poner fecha por defecto
Date: 2003-11-07 22:07:33
Message-ID: 1068242852.1611.15.camel@lord.CSD
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Gracias por su ayuda, bueno amigos sigo con el problema, les mostrare lo
que sale

Mi maquina
------------------------------------------------------------------
test=# select current_time;
timetz
--------------------
16:58:35.687574-05
(1 row)

test=# select current_time AT TIME ZONE 'GMT';
timezone
--------------------
21:58:56.709209+00
(1 row)
------------------------------------------------------------------

Mi server (en el solo tengo acceso a la DB, nada mas)
------------------------------------------------------------------
basecsd=> select current_time;
timetz
--------------------
22:56:08.344389+01
(1 row)

basecsd=> select current_time AT TIME ZONE 'GMT';
ERROR: Function 'timezone(unknown, timetz)' does not exist
Unable to identify a function that satisfies the given argument
types
You may need to add explicit typecasts
------------------------------------------------------------------

solo es correcto si uso:
------------------------------------------------------------------
basecsd=> select current_timestamp;
timestamptz
-------------------------------
2003-11-07 23:00:26.946777+01
(1 row)

basecsd=> select current_timestamp AT TIME ZONE 'GMT';
timezone
----------------------------
2003-11-07 22:00:28.627471
(1 row)
------------------------------------------------------------------

pero en este caso como hago para usar campos por separado??
dia (2003-11-07), hora (22:00:28)

El jue, 06-11-2003 a las 08:39, Martin Marques escribió:
> El Jue 06 Nov 2003 09:58, Hector Miuler Malpica Gallegos escribió:
> > Hola amigos, quisiera saber si alguien me puede ayudar con una duda que
> > tengo, mi duda es con respecto poner un valor por defecto a la fecha, yo
> > estoy intentando usar
> > select current_date AT TIME ZONE 'PET';
> > bueno seria solo "current_date AT TIME ZONE 'PET'" como valor por
> > defecto, pero lo malo de esta es que me da la fecha y hora, y yo tengo
> > esos campos separados, tengo uno para hora y otro para la fecha.
>
> prueba=> select current_date;
> date
> ------------
> 2003-11-06
> (1 row)
>
> prueba=> select current_time;
> timetz
> --------------------
> 10:38:25.147277-03
> (1 row)
>
> prueba=> select current_time AT TIME ZONE 'PET';
> timezone
> --------------------
> 08:38:49.031340-05
> (1 row)
--
_\|/_
(O-O)
--oOO-(_)-OOo----------------------------------------
.--.
Hector Miuler Malpica G. |o_o |
Universidad Nacional del Callao - Peru |¡_/ |
Escuela de Ingenieria Electronica // \ \
(| | )
/'\_ _/`\
\__)=(___/

.''`. Powered by: ,__,
: :' : Debian GNU/Linux(SID) (2.4.21,Ext3) (oo)____
`. `' usuario registrado #308608 (__) mu )\
`- ||--|| *

Jabber miuler13(at)jabber(dot)org
ICQ 179326439
MSN miuler13(at)hotmail(dot)com
-----------------------------------------------------

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Alvaro Herrera 2003-11-07 22:13:52 Re: [Pgsql-ayuda] Curso PostgreSQL
Previous Message Patricio Muñoz 2003-11-07 21:01:37 Re: [Pgsql-ayuda] Eliminar datos