Thread: Maybe a Bug, maybe bad SQL

Maybe a Bug, maybe bad SQL

From
Daryl Herzmann
Date:
HI,I am running postgres version 7.0 and I do this...

akrherz=# create table test (day date);
CREATE
akrherz=# insert into test values('2000_04_02');
INSERT 13166281 1
akrherz=# insert into test values('2000_04_01');
INSERT 13166282 1
akrherz=# insert into test values('2000_04_03');
INSERT 13166283 1
akrherz=# select day, date_part('day',  day) AS day from test;   day     | day 
------------+-----2000-04-02 |   12000-04-01 |   12000-04-03 |   3
(3 rows)

Is this fixed in a newer version?  Am I doing something wrong?


TIA,Daryl Herzmann



Re: Maybe a Bug, maybe bad SQL

From
Bruce Momjian
Date:
With 7.1beta, I get:    day     | day ------------+----- 2000-04-02 |   2 2000-04-01 |   1 2000-04-03 |   3(3 rows)

> HI,
>     I am running postgres version 7.0 and I do this...
> 
> akrherz=# create table test (day date);
> CREATE
> akrherz=# insert into test values('2000_04_02');
> INSERT 13166281 1
> akrherz=# insert into test values('2000_04_01');
> INSERT 13166282 1
> akrherz=# insert into test values('2000_04_03');
> INSERT 13166283 1
> akrherz=# select day, date_part('day',  day) AS day from test;
>     day     | day 
> ------------+-----
>  2000-04-02 |   1
>  2000-04-01 |   1
>  2000-04-03 |   3
> (3 rows)
> 
> 
>     Is this fixed in a newer version?  Am I doing something wrong?
> 
> 
> TIA,
>     Daryl Herzmann
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
> http://www.postgresql.org/users-lounge/docs/faq.html
> 


--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


Re: Maybe a Bug, maybe bad SQL

From
Grant
Date:
version 7.0.3

binary_data=# select day, date_part('day',  day) AS day from test;   day     | day
------------+-----02/04/2000 |   201/04/2000 |   103/04/2000 |   3
(3 rows)

binary_data=#

Why does everyone reply to the person as well as CC to the list when the
person is on the list anyhow?



Re: Maybe a Bug, maybe bad SQL

From
Tom Lane
Date:
Daryl Herzmann <akrherz@iastate.edu> writes:
> akrherz=# create table test (day date);
> CREATE
> akrherz=# insert into test values('2000_04_02');
> INSERT 13166281 1
> akrherz=# insert into test values('2000_04_01');
> INSERT 13166282 1
> akrherz=# insert into test values('2000_04_03');
> INSERT 13166283 1

Would that be a daylight-savings transition date in your timezone?
If so, this is a known date-to-timestamp conversion bug.  It's fixed
for 7.1.
        regards, tom lane


Re: Maybe a Bug, maybe bad SQL

From
darcy@druid.net (D'Arcy J.M. Cain)
Date:
Thus spake Grant
> Why does everyone reply to the person as well as CC to the list when the
> person is on the list anyhow?

Politeness.  You reply to the list so that others benefit from the discussion
and you copy the sender since some people don't get to their mailing lists
as quickly as their regular mail.  One assumes that they have slightly
more interest in the answer since they asked the question.  Any good email
client will filter out the dup.

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.


Re: Maybe a Bug, maybe bad SQL

From
Bruce Momjian
Date:
> version 7.0.3
> 
> binary_data=# select day, date_part('day',  day) AS day from test;
>     day     | day
> ------------+-----
>  02/04/2000 |   2
>  01/04/2000 |   1
>  03/04/2000 |   3
> (3 rows)
> 
> binary_data=#
> 
> Why does everyone reply to the person as well as CC to the list when the
> person is on the list anyhow?

Good question.  They get the reply faster by sending it to them and the
list, and if someone later wants to reply only to the poster, they have
the email address right there.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


Re: Maybe a Bug, maybe bad SQL

From
Cedar Cox
Date:
> > Why does everyone reply to the person as well as CC to the list when the
> > person is on the list anyhow?
> 
> Good question.  They get the reply faster by sending it to them and the
> list, and if someone later wants to reply only to the poster, they have
> the email address right there.

And some people have the 'nomail' option set so they don't receive mail
from the list but they can still post...



Re: Maybe a Bug, maybe bad SQL

From
"Ross J. Reedstrom"
Date:
On Wed, Mar 21, 2001 at 08:20:22AM -0500, Bruce Momjian wrote:
> > version 7.0.3
> > 
> > binary_data=# select day, date_part('day',  day) AS day from test;
> >     day     | day
> > ------------+-----
> >  02/04/2000 |   2
> >  01/04/2000 |   1
> >  03/04/2000 |   3
> > (3 rows)
> > 
> > binary_data=#
> > 
> > Why does everyone reply to the person as well as CC to the list when the
> > person is on the list anyhow?
> 
> Good question.  They get the reply faster by sending it to them and the
> list, and if someone later wants to reply only to the poster, they have
> the email address right there.

Note also that it's a mailing list cultural thing: many lists operate
in a 'post only to the list' mode. Those of us on the pgsql lists do the
'list and person' thing, in response to direct questions, for the reasons
Bruce and D'Arcy point out. Note that by knowing the reasons, one may
then make informed decisions, like my posting of this message directly
to the list only, since it's a peripheral issue and multiple people
are involved in the conversation. It's not uncommon, when debugging
a particular problem, or discussing implementation of a new feature,
to have a thread of discussion by CC'ing three or four developers,
plus the HACKERS list for archiving and general interest.

In short, it's a cultural thing.

Ross


Re: Maybe a Bug, maybe bad SQL

From
Bruce Momjian
Date:
> Note also that it's a mailing list cultural thing: many lists operate
> in a 'post only to the list' mode. Those of us on the pgsql lists do the
> 'list and person' thing, in response to direct questions, for the reasons
> Bruce and D'Arcy point out. Note that by knowing the reasons, one may
> then make informed decisions, like my posting of this message directly
> to the list only, since it's a peripheral issue and multiple people
> are involved in the conversation. It's not uncommon, when debugging
> a particular problem, or discussing implementation of a new feature,
> to have a thread of discussion by CC'ing three or four developers,
> plus the HACKERS list for archiving and general interest.

My mailer would have trouble sending just to the list and not to both. 
To do list-only, the mailing list software would have to set the
Reply-To to be to the list.

Marc had it set up that way a few times, but most didn't like it.  In
fact, the big problem with that setup is that you can't easily reply
just to the poster.

Most mailers have a 'reply to user' and 'reply to group' mode.  Reply to
user goes only to the poster, while reply-to group goes to both.

At least that is how I understand the issue.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


Re: Maybe a Bug, maybe bad SQL

From
Tom Lane
Date:
darcy@druid.net (D'Arcy J.M. Cain) writes:
> Thus spake Grant
>> Why does everyone reply to the person as well as CC to the list when the
>> person is on the list anyhow?

> Politeness.  You reply to the list so that others benefit from the discussion
> and you copy the sender since some people don't get to their mailing lists
> as quickly as their regular mail.  One assumes that they have slightly
> more interest in the answer since they asked the question.  Any good email
> client will filter out the dup.

Or, if you don't have such a good email client, see the "eliminatecc"
subscription option offered by our majordomo server.

A further tip: if you don't like getting multiple copies of messages
that are cross-posted to multiple lists, you can tell the majordomo
serverset ALL unique

"help set" will extract a pretty useful description of all the options
majordomo supports (there are a lot of 'em these days).
        regards, tom lane


Re: Maybe a Bug, maybe bad SQL

From
Louis-David Mitterrand
Date:
On Wed, Mar 21, 2001 at 10:49:41AM -0500, Bruce Momjian wrote:
> > Note also that it's a mailing list cultural thing: many lists operate
> > in a 'post only to the list' mode. Those of us on the pgsql lists do the
> > 'list and person' thing, in response to direct questions, for the reasons
> > Bruce and D'Arcy point out. Note that by knowing the reasons, one may
> > then make informed decisions, like my posting of this message directly
> > to the list only, since it's a peripheral issue and multiple people
> > are involved in the conversation. It's not uncommon, when debugging
> > a particular problem, or discussing implementation of a new feature,
> > to have a thread of discussion by CC'ing three or four developers,
> > plus the HACKERS list for archiving and general interest.
> 
> My mailer would have trouble sending just to the list and not to both. 
> To do list-only, the mailing list software would have to set the
> Reply-To to be to the list.

Sorry, but what an inappropriate answer coming from an IT professionnal.
You MUA doesn't support answering to a mailing list? Why not consider
upgrading to a modern MUA that _does_ support that functionality? Are we
condemned to use obsolete software? Are we stuck in old habits for ever?

> Marc had it set up that way a few times, but most didn't like it.  In
> fact, the big problem with that setup is that you can't easily reply
> just to the poster.

The "reply-to: list"? Oh, I see: that one almost made it on the pgsql-*
lists... *shiver*

As if subject mangling and annoying footers were not enough.

> Most mailers have a 'reply to user' and 'reply to group' mode.  Reply to
> user goes only to the poster, while reply-to group goes to both.

Hint: http://www.mutt.org

>   +  If your life is a hard drive,     |  830 Blythe Avenue
>   +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

I wish people could also lose the preaching in their signatures.
1) what does "christ" mean to muslim or hindu or atheist pgsql users?
2) it might be offensive to them
3) why not talk about what we have in common (hint: databases), not the
most divisive issue in the history of humanity: religion
4) were I Jesus, I wouldn't appreciate being held as a mere "backup" ;-)


Mailing list gripes (was Re: Re: Maybe a Bug, maybe bad SQL)

From
Tom Lane
Date:
Louis-David Mitterrand <vindex@apartia.ch> writes:
> As if subject mangling and annoying footers were not enough.

You can turn off subject mangling in your subscription preferences.
If you haven't gone through majordomo's "help set" info recently,
you might spend the time to do so --- there's a lot of interesting new
preference options in recent majordomo releases.  I find setting
subscription class = UNIQUE particularly helpful to handle subscriptions
to multiple pgsql lists.

I haven't looked to see if the footers can be turned off or not.
Personally I'd vote for losing them altogether...

> I wish people could also lose the preaching in their signatures.

Amen, brother ;-)
        regards, tom lane