Re: ORDER BY question

Lists: pgsql-novice
From: chrizkoh(at)yahoo(dot)com (Christopher Koh)
To: pgsql-novice(at)postgresql(dot)org
Subject: Can Postgresql run in MS Windows
Date: 2003-08-30 23:40:30
Message-ID: 2f07f39.0308301540.38115604@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Is it possible to make it run?


From: "Gaetano Mendola" <mendola(at)bigfoot(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Cc: "Christopher Koh" <chrizkoh(at)yahoo(dot)com>
Subject: Re: Can Postgresql run in MS Windows
Date: 2003-08-30 23:41:07
Message-ID: 003701c36f50$2f56cb70$10d4a8c0@mm.eutelsat.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

"Christopher Koh" <chrizkoh(at)yahoo(dot)com> wrote:

> Is it possible to make it run?

Right now it's possible using the cygwin,
there are also works in progress for a native
port to win32.

Regards
Gatano Mendola


From: "Luis H" <pgsql-novice(at)geekhouse(dot)no-ip(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Can Postgresql run in MS Windows
Date: 2003-08-31 22:16:34
Message-ID: 001e01c3700d$a773dd60$0500a8c0@islagirl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

http://www.postgresql.org/docs/faqs/text/FAQ_MSWIN
----- Original Message -----
From: "Christopher Koh" <chrizkoh(at)yahoo(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Sent: Saturday, August 30, 2003 7:40 PM
Subject: [NOVICE] Can Postgresql run in MS Windows

> Is it possible to make it run?
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>


From: "Luis H(dot)" <pgsql-novice(at)geekhouse(dot)no-ip(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: ORDER BY question
Date: 2003-09-01 01:44:12
Message-ID: 000501c3702a$8bbea3d0$0200a8c0@atticus
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

I have two tables, table A contains users (id, username, password) , and
table B contains a row that signifies the 'owner' of each particular entry,
referencing an id in A.

so example

table A
id username password
------------------------
1 me *****
2 you *******

table B
description owner
-------------------------
'something cool' 2
'another thing' 1

What I want to do is do a query where I order table B by owner, but
alphabetically by username. The problem, obviously, is that table B only
contains id's (numbers, indexing to A), which don't correspond to the
alphabetical order of the usernames.

I'm not very familiar with subqueries, but I expect I should be able to
somehow select ID's from table A ordered by username, and use this index to
order table B by owner.

Hopefully I made sense.

Thanks in advance!


From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: "Luis H(dot)" <pgsql-novice(at)geekhouse(dot)no-ip(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: ORDER BY question
Date: 2003-09-01 07:04:36
Message-ID: 20030901070436.GA28569@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Please don't start new topics by by replying to unrelated messages.

On Sun, Aug 31, 2003 at 21:44:12 -0400,
"Luis H." <pgsql-novice(at)geekhouse(dot)no-ip(dot)com> wrote:
> I have two tables, table A contains users (id, username, password) , and
> table B contains a row that signifies the 'owner' of each particular entry,
> referencing an id in A.
>
> What I want to do is do a query where I order table B by owner, but
> alphabetically by username. The problem, obviously, is that table B only
> contains id's (numbers, indexing to A), which don't correspond to the
> alphabetical order of the usernames.

You should do a join on A and B and then you can order the output by
fields in both A and B.


From: Nabil Sayegh <nas(at)e-trolley(dot)de>
To: "Luis H(dot)" <pgsql-novice(at)geekhouse(dot)no-ip(dot)com>
Cc: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: ORDER BY question
Date: 2003-09-01 07:57:00
Message-ID: 1062403020.32576.4.camel@billy
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Am Mo, 2003-09-01 um 03.44 schrieb Luis H.:
> I have two tables, table A contains users (id, username, password) , and
> table B contains a row that signifies the 'owner' of each particular entry,
> referencing an id in A.
>
> so example
>
> table A
> id username password
> ------------------------
> 1 me *****
> 2 you *******
>
> table B
> description owner
> -------------------------
> 'something cool' 2
> 'another thing' 1
>
>
> What I want to do is do a query where I order table B by owner, but
> alphabetically by username. The problem, obviously, is that table B only
> contains id's (numbers, indexing to A), which don't correspond to the
> alphabetical order of the usernames.

SELECT * FROM a JOIN b ON (a.id=b.owner) ORDER BY a.username
or
SELECT * FROM a, b WHERE a.id=b.owner ORDER BY a.username

If you had the columnnames the same in A and B for the id you could do:
SELECT * FROM a JOIN B USING (id_a) ORDER BY a.username

> I'm not very familiar with subqueries, but I expect I should be able to
> somehow select ID's from table A ordered by username, and use this index to
> order table B by owner.

No need for subselects here

--
e-Trolley Sayegh & John, Nabil Sayegh
Tel.: 0700 etrolley /// 0700 38765539
Fax.: +49 69 8299381-8
PGP : http://www.e-trolley.de


From: "Luis H(dot)" <pgsql-novice(at)geekhouse(dot)no-ip(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: ORDER BY question
Date: 2003-09-01 13:57:04
Message-ID: 003601c37090$ecc79450$0200a8c0@atticus
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Thanks for the info! Group by should do the trick.

Why does replying to an unrelated message create an issue, btw? I changed
the subject, headers and contents of the e-mail. Or at least I thought I
did!

Also, why do people reply to both the message sender and the mailing list?
Doesn't it just arrive duplicated in the sender's mailbox.

Cheers,
- Luis
----- Original Message -----
From: "Bruno Wolff III" <bruno(at)wolff(dot)to>
To: "Luis H." <pgsql-novice(at)geekhouse(dot)no-ip(dot)com>
Cc: <pgsql-novice(at)postgresql(dot)org>
Sent: Monday, September 01, 2003 3:04 AM
Subject: Re: [NOVICE] ORDER BY question

> Please don't start new topics by by replying to unrelated messages.
>
> On Sun, Aug 31, 2003 at 21:44:12 -0400,
> "Luis H." <pgsql-novice(at)geekhouse(dot)no-ip(dot)com> wrote:
> > I have two tables, table A contains users (id, username, password) , and
> > table B contains a row that signifies the 'owner' of each particular
entry,
> > referencing an id in A.
> >
> > What I want to do is do a query where I order table B by owner, but
> > alphabetically by username. The problem, obviously, is that table B only
> > contains id's (numbers, indexing to A), which don't correspond to the
> > alphabetical order of the usernames.
>
> You should do a join on A and B and then you can order the output by
> fields in both A and B.
>


From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: "Luis H(dot)" <pgsql-novice(at)geekhouse(dot)no-ip(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: ORDER BY question
Date: 2003-09-01 19:09:54
Message-ID: 20030901190954.GB1782@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

On Mon, Sep 01, 2003 at 09:57:04 -0400,
"Luis H." <pgsql-novice(at)geekhouse(dot)no-ip(dot)com> wrote:
> Thanks for the info! Group by should do the trick.
>
> Why does replying to an unrelated message create an issue, btw? I changed
> the subject, headers and contents of the e-mail. Or at least I thought I
> did!

Because message threading isn't tracked by subject. There are other
headers that indicate a message is a reply and you didn't change the one
your mail client uses. Doing this hides your message in a thread with
a different topic.

> Also, why do people reply to both the message sender and the mailing list?
> Doesn't it just arrive duplicated in the sender's mailbox.

How do we know you are subscribed to the list?

If you don't want to be copied personally, setting the mail-followup-to
header will do this for many clients.


From: "Luis H(dot)" <pgsql-novice(at)geekhouse(dot)no-ip(dot)com>
To: "Bruno Wolff III" <bruno(at)wolff(dot)to>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: ORDER BY question
Date: 2003-09-01 19:34:40
Message-ID: 001701c370c0$165bc2d0$0301a8c0@bigbertha
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

I looked into the headers, and saw all the thread tracking info. I had no
idea this was going on in the background. Sorry for any confusion this might
have caused in your mail clients!

- Luis

----- Original Message -----
From: "Bruno Wolff III" <bruno(at)wolff(dot)to>
To: "Luis H." <pgsql-novice(at)geekhouse(dot)no-ip(dot)com>
Cc: <pgsql-novice(at)postgresql(dot)org>
Sent: Monday, September 01, 2003 3:09 PM
Subject: Re: [NOVICE] ORDER BY question

> On Mon, Sep 01, 2003 at 09:57:04 -0400,
> "Luis H." <pgsql-novice(at)geekhouse(dot)no-ip(dot)com> wrote:
> > Thanks for the info! Group by should do the trick.
> >
> > Why does replying to an unrelated message create an issue, btw? I
changed
> > the subject, headers and contents of the e-mail. Or at least I thought I
> > did!
>
> Because message threading isn't tracked by subject. There are other
> headers that indicate a message is a reply and you didn't change the one
> your mail client uses. Doing this hides your message in a thread with
> a different topic.
>
> > Also, why do people reply to both the message sender and the mailing
list?
> > Doesn't it just arrive duplicated in the sender's mailbox.
>
> How do we know you are subscribed to the list?
>
> If you don't want to be copied personally, setting the mail-followup-to
> header will do this for many clients.
>


From: Al Hulaton <ahulaton(at)commandprompt(dot)com>
To: Christopher Koh <chrizkoh(at)yahoo(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Can Postgresql run in MS Windows
Date: 2003-09-02 18:49:52
Message-ID: 1062528592.19131.48.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Hello Christopher,

On Sat, 2003-08-30 at 16:40, Christopher Koh wrote:
> Is it possible to make it run?

Many of the other postings answered your question, but one thing to keep
in mind when running PostgreSQL + Cygwin, because Cygwin is an emulation
layer, it's not as robust as running it straight on Linux.

For instance, our Mammoth PostgreSQL server for Windows is hard coded to
a limit of 50 concurrent connections. Anything about that, things get
unstable. For that reason, most of our clients run PostgreSQL + Cygwin
in low-load or development environments.

There will be a native community version for Windows soon and I presume
the performance will be better. Until then PostgreSQL + Cygwin is
completely usable, just not as scalable as a pure Linux solution.

Best,
Al Hulaton | Sr. Account Engineer | Command Prompt, Inc.
503.222.2783 | ahulaton(at)commandprompt(dot)com
Home of Mammoth PostgreSQL and 'Practical PostgreSQL'
Managed PostgreSQL, Linux services and consulting
Read and Search O'Reilly's 'Practical PostgreSQL' at
http://www.commandprompt.com