temporay table : error is repeated.

Поиск
Список
Период
Сортировка
От Patrick Coulombe
Тема temporay table : error is repeated.
Дата
Msg-id 395A5E54.331C2479@mediacces.com
обсуждение исходный текст
Список pgsql-sql
Let me try to explain why i want to use temporary tables, maybe you have
others solutions for me (it's call experience) :)

I use PHP to interact with postgres.

1) The "user" do is selection (form - checkbox).
2) Results.
3) Options : he can print it, save it, and make MODIFICATIONS.

That's the problem... modfications : I don't want to let the "user"
change my db, but just add, modify, erase his selection-result. So I'm
thinking about this : put the result of is selection in a temporary
table to let him add, modify and erase is result without affect the
original db.

What I don't understand is when the temporary table will drop? When you
do it in psql, no ploblem cause when you quit this utility he drop
automatically the db - right? How does it work when you query from a web
page in PHP?

After... The query can be as big as that (depends on selection of the
user) ie :

select distinct * from medias, contacts where medias.media_id =
contacts.media_id AND medias_categories.media_id = medias.media_id AND
medias_categories.categorie_id = 1 AND contacts_titres.contact_id =
contacts.contact_id AND (contacts_titres.titre_id = 12) AND (type_id = 1
OR type_id = 2 OR type_id = 0) AND (langue_id = 1 OR langue_id = 2) AND
nation_id = 1 UNION select distinct * from medias, contacts where
medias.media_id = contacts.media_id AND medias_categories.media_id =
medias.media_id AND medias_categories.categorie_id = 3 AND
medias_regions.media_id = medias.media_id AND (medias_regions.region_id
= 11 OR medias_regions.region_id = 13 OR medias_regions.region_id = 6)
AND (type_id = 1 OR type_id = 2 OR type_id = 0) AND (langue_id = 1 OR
langue_id = 2) AND nation_id = 1 AND niveau_id = 1 UNION select distinct
* from medias, contacts where medias.media_id = contacts.media_id AND
medias_categories.media_id = medias.media_id AND
medias_categories.categorie_id = 5 AND medias_regions.media_id =
medias.media_id AND (medias_regions.region_id = 6 OR
medias_regions.region_id = 7 OR medias_regions.region_id = 3) AND
(type_id = 1 OR type_id = 2 OR type_id = 0) AND (langue_id = 1 OR
langue_id = 2) AND nation_id = 1 AND (bulletin != 1 OR bulletin is null)
UNION select distinct * from medias, contacts where medias.media_id =
contacts.media_id AND medias_categories.media_id = medias.media_id AND
medias_categories.categorie_id = 6 AND contacts_secteurs.contact_id =
contacts.contact_id AND (contacts_secteurs.soussecteur_id = 9 OR
contacts_secteurs.soussecteur_id = 67 OR
contacts_secteurs.soussecteur_id = 74 OR
contacts_secteurs.soussecteur_id = 6) AND (type_id = 1 OR type_id = 2 OR
type_id = 0) AND (langue_id = 1 OR langue_id = 2) AND nation_id = 1



TEMPORARY table with UNION : problem or not???

Sorry for this long post... but it's the last option of my project!
Thank you for let me know what you thinking about that.
Sorry for my english, but I get better everyday.

Patrick


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

Предыдущее
От: "Robert B. Easter"
Дата:
Сообщение: Re: retrieving a serial number
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Finding the names of inheriting classes