pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Areski Belaid <areski5@hotmail.com>
To: pgsql-php@postgresql.org
Subject: Incompatibility Postgres 7.1 - Postgres 7.2.1
Date: Tue, 4 Jun 2002 13:16:31 +0200
Message-ID: <OE43kLQ8aZRhQdOgl4r00004c1d@hotmail.com> (raw)
References: <3CCE936B.245D870C@juliana-multimedia.com>
	<200204301522.44037.jm.poure@freesurf.fr>
	<3CCECCD8.A11B8F8C@juliana-multimedia.com>
	<OE2969dStaJAyBCsAng00003d0c@hotmail.com>
	<1022941995.3cf8db2b32686@webmail.acucore.com>


----- Original Message -----
From: "Dan Wilson" <dan@acucore.com>
To: "Areski Belaid" <areski5@hotmail.com>
Cc: <pgsql-php@postgresql.org>
Sent: Saturday, June 01, 2002 4:33 PM
Subject: Re: [PHP] Incompatibility Postgres 7.1 - Postgres 7.3


> Postgres has two different timestamp types now.  There is "timestamp with
> timezone" and "timestamp without timezone".  Internally the "with
timezone" is
> stored as timestamptz. And by default, a timestamp will have a timezone.
You
> can think of timestamptz as the same as timestamp.
>
> So there is really not a problem here unless you wanted a "timestamp
without
> timezone".  If this is the case, currently phpPgAdmin doesn't provide for
the
> creation of timestamp without timezone through the table create
> functionality.  You will have to do it manually through the "Run SQL" box
in
> the DB Details page.
>
> -Dan
>
> Quoting Areski Belaid <areski5@hotmail.com>:
>
> > Someone can help me ....
> >
> > I have a compatibility problem between Postgres 7.1 - Postgres 7.3...
> > Guess !!! It's  --- timestamptz ---
> >
> > When I create a field with timestamp type... the new postgresql replace
that
> > by
> > timestamptz.... I use phpPgAdmin, I don't know where is from  the
problem...
> >
> > Simple example, If I execute that :
> >     CREATE TABLE "statistic" (
> >            "Id" int4 NOT NULL,
> >            "DATE" timestamp);
> >
> > I shall have that on the database:
> >       CREATE TABLE "statistic" (
> >            "Id" int4 NOT NULL,
> >            "DATE" timestamptz);
> >
> > Grrrrrr, =)
> >
> > Helpsssssss, Areski
> >


It's working if I introduce the sql command directly in the shell...

CREATE TABLE "statistic" (
          "Id" int4 NOT NULL,
          "DATE" timestamp without time zone);

One thing good, but I just realize That my  problem isn't coming of the time
zone
BUT of the precision...

EXAMPLE:
If I want know the number of day between two date ($lastdate -
$firstdate)...

Value of firstdate = 2002-05-31 12:27:05.121201
Value of lastdate = 2002-06-04 12:29:25.147232

$oneday = 60*60*24*1;
$number_day_between_two_date = intval(( strtotime($lastdate) -
strtotime($firstdate) )/$oneday);

I did that and It' was working without problem before the upgrate of
postgres (Postgres 7.1 - Postgres 7.2.1)

Someone have a idea... What I can do to know the number of day between two
date...


Areski'ch




view thread (3+ messages)

Message-ID: <OE43kLQ8aZRhQdOgl4r00004c1d@hotmail.com>
Permalink:  ../OE43kLQ8aZRhQdOgl4r00004c1d@hotmail.com/
Also on:    postgresql.org/message-id/OE43kLQ8aZRhQdOgl4r00004c1d@hotmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: areski5@hotmail.com
  Subject: Re: Incompatibility Postgres 7.1 - Postgres 7.2.1
  In-Reply-To: <OE43kLQ8aZRhQdOgl4r00004c1d@hotmail.com>
  References: <3CCE936B.245D870C@juliana-multimedia.com> <200204301522.44037.jm.poure@freesurf.fr> <3CCECCD8.A11B8F8C@juliana-multimedia.com> <OE2969dStaJAyBCsAng00003d0c@hotmail.com> <1022941995.3cf8db2b32686@webmail.acucore.com> <OE43kLQ8aZRhQdOgl4r00004c1d@hotmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox