Re: sql question (hopefully)

Поиск
Список
Период
Сортировка
От Mel Jamero
Тема Re: sql question (hopefully)
Дата
Msg-id 002601c335a7$9ce7bfb0$1b06a8c0@CMPMEL
обсуждение исходный текст
Ответ на Re: sql question (hopefully)  (Dani Oderbolz <oderbolz@ecologic.de>)
Ответы Re: sql question (hopefully)  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-novice
Hi Dani!

I got your point about the normalization.  Thanks!

How do i "build the query-string" from pgsql without creating a function?
Is this even possible?

I've almost given up and i'm now creating the function that can "build the
query-string" but if there's another way, I'd really like to find out. =)

The reason why I didn't normalize was because i would've ended up with
millions of tuples and the reply from the database would be too slow for the
application(s) we built.  I tried to come up with a better schema but I
couldn't find one that really returns a fast reply so I settled with the one
i presented.

I did break other rules of proper Relational Analysis and Design for the
sake of fast replies we needed.  I'll send it to this list in the future to
get better ideas.  I just have to solve our current problem.

Best Regards,

Mel



-----Original Message-----
From: pgsql-novice-owner@postgresql.org
[mailto:pgsql-novice-owner@postgresql.org]On Behalf Of Dani Oderbolz
Sent: Wednesday, June 18, 2003 9:28 PM
To: pgsql-novice
Subject: Re: [NOVICE] sql question (hopefully)


Mel Jamero wrote:

>problem is "select id from b_table" in #2 statement has the following
>output:
>id
>----
>2,3,4
>
>
Well,
this is completely different from the first case,
because for Postgres, "2,3,4" is just a string rather than a set
of numbers
(as in select id from b_table).
Sure, you could solve your problem with stuff like
- Build your query-String, then Execute this
- Parse your "2,3,4" String
But its better if you have the correct data in b_table,
that is, only one id in a given row (this is the first step
of a process called "Normalization". If you have more than one
value in a given row/column pair, you will have a lot more problems
than just this one.

Cheers,
Dani




---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


В списке pgsql-novice по дате отправления:

Предыдущее
От: "Mel Jamero"
Дата:
Сообщение: Re: sql question (hopefully)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: help:steps needed to get the content of table from the