Incompatibility Postgres 7.1 - Postgres 7.2.1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



----- Original Message -----
From: "Dan Wilson" <dan@xxxxxxxxxxx>
To: "Areski Belaid" <areski5@xxxxxxxxxxx>
Cc: <pgsql-php@xxxxxxxxxxxxxx>
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@xxxxxxxxxxx>:
>
> > 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



[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux