From pio.gianvito@gmail.com Sat Jul 18 08:20:10 2009 Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 3E4C9633DAF for ; Sat, 18 Jul 2009 05:20:10 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 72712-08 for ; Sat, 18 Jul 2009 05:19:59 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by mail.postgresql.org (Postfix) with ESMTP id 8B9C8633B43 for ; Sat, 18 Jul 2009 05:19:59 -0300 (ADT) Received: by ey-out-2122.google.com with SMTP id 22so248225eye.61 for ; Sat, 18 Jul 2009 01:19:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to:subject :date:mime-version:content-type:x-priority:x-msmail-priority :x-mailer:x-mimeole; bh=H+d5LOamOSa2vjNlGZp7MhCA6OZDGd+vSxNq73LWHxk=; b=pjB9VAvxivYaEoBtDwXu4E2T744FFxwWwN4XA6MeYTMZ8EYKS3p5D38c1CJnjCXftl mVa6NHdIzlVYXrsHMRaUW8U/mOyslOUnapcuoEgWJxnUodAXdyNfc11DGKDSyo/mg5Nh X87L0ojBsahgLu/hRsJfZyBOVahqgdTLAdLiI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:subject:date:mime-version:content-type :x-priority:x-msmail-priority:x-mailer:x-mimeole; b=aLsHgZCKpQ/E4VJAzTFwxG/FYba2f6zB6wa4sItr1/md8C+R1jQWIumQC9IbxkgiSm fgvdpP6Giwzm/BXatEYM7DbGa4afj8h45FVWXd9F/tvXuVICNW2jsU7FQdsLI/mi/9l9 H92/Tm9oeNsmZUG6Vj2romxLhFtDtetCl2DCw= Received: by 10.216.16.212 with SMTP id h62mr558105weh.201.1247905197858; Sat, 18 Jul 2009 01:19:57 -0700 (PDT) Received: from PCGianvito (net-93-144-128-52.t2.dsl.vodafone.it [93.144.128.52]) by mx.google.com with ESMTPS id f13sm5918562gvd.23.2009.07.18.01.19.55 (version=SSLv3 cipher=RC4-MD5); Sat, 18 Jul 2009 01:19:56 -0700 (PDT) Message-ID: <24F73F01AD1B4036A4C3F461ED6759CE@PCGianvito> From: "Gianvito Pio" To: Subject: Timestamp with timezone with Default value Date: Sat, 18 Jul 2009 10:19:52 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0017_01CA0791.49E30EB0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6002.18005 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6002.18005 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200907/79 X-Sequence-Number: 32820 This is a multi-part message in MIME format. ------=_NextPart_000_0017_01CA0791.49E30EB0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi all, how can I define a column of timestamp with timezone type...with a = default value? Thanks ------=_NextPart_000_0017_01CA0791.49E30EB0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi all,
how can I define a column of timestamp = with=20 timezone type...with a default value?
 
Thanks
 
------=_NextPart_000_0017_01CA0791.49E30EB0-- From jasmin.dizdarevic@gmail.com Sat Jul 18 10:25:19 2009 Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 5715D633228 for ; Sat, 18 Jul 2009 07:25:19 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 01887-07 for ; Sat, 18 Jul 2009 07:25:02 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by mail.postgresql.org (Postfix) with ESMTP id 5F21F633F04 for ; Sat, 18 Jul 2009 07:25:08 -0300 (ADT) Received: by fg-out-1718.google.com with SMTP id 13so256874fge.0 for ; Sat, 18 Jul 2009 03:25:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=+lDRhJdoJtkP+AV6u9lux7fTYRJFe0gLqYo8vnTOwFs=; b=ZwJ0N20274/yharxeiVJ/3tC/pagDZG73GFFj2T/S6QxBUdi8wvZuKHh8vuEKSppHa 6iewbX1+/uiHAIG3EZCb460kWIQsYWrOATDlc7KPQ0LqES3PowylfE1SwGPcYxoxvyQj gZxjlYwfZd0+sqsdbtV3222AaEOUAr2ye4Z1I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=s7FGEY80lCqG/7VoIztkz0hGpW64d6CbT8dIMosqFDENU2rWAWjX5cSxJ1NNj0Saa9 4Ug+0MaAZje533cJiH42qgRoD+I2BIMalyjWjEhVAYQkAnLv7YHzZ5sgOGB1l3b2QDHE OBcKHk/RLwZlSss8QoW8IXs6R+zicP35ak3kU= MIME-Version: 1.0 Received: by 10.86.98.18 with SMTP id v18mr1650982fgb.13.1247912706341; Sat, 18 Jul 2009 03:25:06 -0700 (PDT) In-Reply-To: <24F73F01AD1B4036A4C3F461ED6759CE@PCGianvito> References: <24F73F01AD1B4036A4C3F461ED6759CE@PCGianvito> Date: Sat, 18 Jul 2009 12:25:06 +0200 Message-ID: Subject: Re: Timestamp with timezone with Default value From: Jasmin Dizdarevic To: Gianvito Pio , pgsql-sql@postgresql.org Content-Type: multipart/alternative; boundary=000e0cd25dc0927a8f046ef851a9 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200907/80 X-Sequence-Number: 32821 --000e0cd25dc0927a8f046ef851a9 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, i think: create. ...( myCol timestamp with timezone default now() ) the function now() returns a timestamp with timezone ( http://www.postgresql.org/docs/8.4/static/functions-datetime.html) i currently have no db to test it - but it should work. jasmin 2009/7/18 Gianvito Pio > Hi all, > how can I define a column of timestamp with timezone type...with a defaul= t > value? > > Thanks > > --=20 Mit freundlichen Gr=FC=DFen Dizdarevic Jasmin Sonnenbergstr. 3 6714 N=FCziders, AUT jasmin.dizdarevic@gmail.com +43 664 411 79 29 --000e0cd25dc0927a8f046ef851a9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,
=A0
i think:
create. ...(
=A0
=A0 myCol timestamp with=A0timezone=A0default now()
)
the function now() returns a timestamp with timezone (http://www.po= stgresql.org/docs/8.4/static/functions-datetime.html)
=A0
i currently have no db to test it - but it should work.
=A0
jasmin
2009/7/18 Gianvito Pio <pio.gianvito@gmail.com>
Hi all,
how can I define a column of timestamp= with timezone type...with a default value?
=A0
Thanks
=A0



--
Mit freundlichen Gr=FC=DFen

Dizdarevic Jasmin<= br>Sonnenbergstr. 3
6714 N=FCziders, AUT

jasmin.dizdarevic@gmail.com
+43 664 411 79 29=

--000e0cd25dc0927a8f046ef851a9-- From jasen@xnet.co.nz Sun Jul 19 13:00:04 2009 Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id B330763247B for ; Sun, 19 Jul 2009 10:00:04 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 64625-05 for ; Sun, 19 Jul 2009 09:59:53 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from titania.wxnz.net (titania.wxnz.net [58.28.4.13]) by mail.postgresql.org (Postfix) with ESMTP id 37550632274 for ; Sun, 19 Jul 2009 09:59:54 -0300 (ADT) Received: from gonzo (ip-118-90-142-183.xdsl.xnet.co.nz [118.90.142.183]) by titania.wxnz.net (Postfix) with ESMTP id 31D261DB8331 for ; Mon, 20 Jul 2009 00:59:50 +1200 (NZST) Received: from news by gonzo with local (Exim 4.69) (envelope-from ) id 1MSVzH-0006zp-73 for pgsql-sql@postgresql.org; Mon, 20 Jul 2009 00:59:31 +1200 To: pgsql-sql@postgresql.org Path: not-for-mail From: Jasen Betts Newsgroups: gmane.comp.db.postgresql.sql Subject: Re: Timestamp with timezone with Default value Date: 19 Jul 2009 12:59:31 GMT Organization: Dis (not Dat) Organisation Lines: 20 Message-ID: References: <24F73F01AD1B4036A4C3F461ED6759CE@PCGianvito> NNTP-Posting-Host: localhost Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: reversiblemaps.ath.cx 1248008371 26717 127.0.0.1 (19 Jul 2009 12:59:31 GMT) X-Face: ?)Aw4rXwN5u0~$nqKj`xPz>xHCwgi^q+^?Ri*+R(&uv2=E1Q0Zk(>h!~o2ID@6{uf8s; a +M[5[U[QT7xFN%^gR"=tuJw%TXXR'Fp~W; (T"1(739R%m0Yyyv*gkGoPA.$b,D.w:z+<'"=-lVT?6 {T?=R^:W5g|E2#EhjKCa+nt":4b}dU7GYB*HBxn&Td$@f%.kl^:7X8rQWd[NTc"P"u6nkisze/Q; 8 "9Z{peQF,w)7UjV$c|RO/mQW/NMgWfr5*$-Z%u46"/00mx-,\R'fLPe.)^ User-Agent: slrn/pre1.0.0-2 (Linux) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200907/82 X-Sequence-Number: 32823 On 2009-07-18, Gianvito Pio wrote: > This is a multi-part message in MIME format. > > ------=_NextPart_000_0017_01CA0791.49E30EB0 > Content-Type: text/plain; > charset="iso-8859-1" > Content-Transfer-Encoding: quoted-printable > > Hi all, > how can I define a column of timestamp with timezone type...with a = > default value? Same as any other column with a default value. If you're inserting NULL into the column the NULL will override the default. Postgres does what you tell it. If you want the default value use the keyword DEFAULT (in for the value in that column) or don't mention that column. The DEFAULT keyword also works with UPDATE.