Incompatibility Postgres 7.1 - Postgres 7.2.1

From: "Areski Belaid" <areski5(at)hotmail(dot)com>
To: <pgsql-php(at)postgresql(dot)org>
Subject: Incompatibility Postgres 7.1 - Postgres 7.2.1
Date: 2002-06-04 11:16:31
Message-ID: OE43kLQ8aZRhQdOgl4r00004c1d@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php


----- Original Message -----
From: "Dan Wilson" <dan(at)acucore(dot)com>
To: "Areski Belaid" <areski5(at)hotmail(dot)com>
Cc: <pgsql-php(at)postgresql(dot)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(at)hotmail(dot)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

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Dan Wilson 2002-06-04 18:27:36 Beta 2.4.2
Previous Message N4sir Simbolon 2002-06-04 03:08:32 Re: Problems while compiling php_4-2.1 with PostgreSQL