Thread: date_part bug?

date_part bug?

From
Tim Williams
Date:
Greetings,

When I run the following set of statements in postgres v6.4 (built on
Debian Linux):

create table tmp (v1 date, v2 datetime);
insert into tmp values ('06-01-1999', '06-01-1999');
select date_part('month', v1) as m1, date_part('month', v2) as m2 from
tmp;

I see the following results:

m1|m2
--+--
 5| 6
(1 row)

Why is date_part giving different results for date and date_time?  Why
is it wrong for 'date'? Anybody seen this before?

Thanks much in advance,
- Tim


Re: [GENERAL] date_part bug?

From
Herouth Maoz
Date:
At 20:00 +0200 on 17/12/98, Tim Williams wrote:


> I see the following results:
>
> m1|m2
> --+--
>  5| 6
> (1 row)
>
> Why is date_part giving different results for date and date_time?  Why
> is it wrong for 'date'? Anybody seen this before?

Basically, it's a timezone problem.

When you give bare dates, they give you midnight of that same day. My guess
is that since date does not contain the timezone information contained in
datetime, it somehow forgets daylight saving time in its interpretation
into the internal format or out of it.

What's your timezone? Have you tried changing it to see whether it affects
the result?

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma



Some obstacles

From
Kaare Rasmussen
Date:
After having toyed with PostgresQL for some time, I finally decided
that I will have time (selv delusion...) to do some real stuff.

So I walk right into the first problems

1. Views on UNIONS are not supported. When will they be supported? It's
one of the basic reasons to use views (when things gets too involved :-)

2. I can't seem to find my view after having added it. I mean - how do
I list it? It doesn't show up in a pg_dump :-(

To explain some things, maybe it's necessary to know that I still use
6.3 (because I run SuSE Linux 5.3).


Strange error with Pg.so

From
Kaare Rasmussen
Date:
I have a strange error with Pg.so. I have a Perl program that should
run as a CGI script.

Strangely enough, it works if I run it from the command line now (at
least it outputs a html page), but when I try it from my web server it
complains with an error like

[Sat Dec 26 11:02:48 1998] [error] Can't load
'/usr/lib/perl5/site_perl/i586-linux/auto/Pg/Pg.so' for module Pg:
Unable to resolve symbol at
/usr/lib/perl5/i586-linux/5.00404/DynaLoader.pm line 166.

and this is what Dynaloader has to say about it:

    # Many dynamic extension loading problems will appear to come from
    # this section of code: XYZ failed at line 123 of DynaLoader.pm.
    # Often these errors are actually occurring in the initialisation
    # C code of the extension XS file. Perl reports the error as being
    # in this perl code simply because this was the last perl code
    # it executed.

What is surprising for me is that the error only appears when run
through the web server.

It happens before any action is taken; it complains about the "use Pg;"
statement

Well, I'm using PostgreSQL 6.3.2, maybe I should try to install 6.4.1?



Re: [GENERAL] Strange error with Pg.so

From
Mike Meyer
Date:
You don't say what system you're on, but it's clearly some variant of
Unix. Check to see if there's an environment variable that controls
the search path for dynamically loaded libraries, and whether it's
different in the two environments. Might check the rest of the
environment for differences as well.

    <mike


On Wed, 30 Dec 1998, Kaare Rasmussen wrote:

> Date: Wed, 30 Dec 1998 12:13:19 +0100 (CET)
> From: Kaare Rasmussen <kar@webline.dk>
> To: pgsql-general@postgreSQL.org
> Subject: [GENERAL] Strange error with Pg.so
>
> I have a strange error with Pg.so. I have a Perl program that should
> run as a CGI script.
>
> Strangely enough, it works if I run it from the command line now (at
> least it outputs a html page), but when I try it from my web server it
> complains with an error like
>
> [Sat Dec 26 11:02:48 1998] [error] Can't load
> '/usr/lib/perl5/site_perl/i586-linux/auto/Pg/Pg.so' for module Pg:
> Unable to resolve symbol at
> /usr/lib/perl5/i586-linux/5.00404/DynaLoader.pm line 166.
>
> and this is what Dynaloader has to say about it:
>
>     # Many dynamic extension loading problems will appear to come from
>     # this section of code: XYZ failed at line 123 of DynaLoader.pm.
>     # Often these errors are actually occurring in the initialisation
>     # C code of the extension XS file. Perl reports the error as being
>     # in this perl code simply because this was the last perl code
>     # it executed.
>
> What is surprising for me is that the error only appears when run
> through the web server.
>
> It happens before any action is taken; it complains about the "use Pg;"
> statement
>
> Well, I'm using PostgreSQL 6.3.2, maybe I should try to install 6.4.1?
>
>
>
>