From: Patrick Coulombe <pcoulombe@mediacces.com>
To: pgsql-sql@postgresql.org
Subject: temporay table : error is repeated.
Date: Wed, 28 Jun 2000 16:21:40 -0400
Message-ID: <395A5E54.331C2479@mediacces.com> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: pcoulombe@mediacces.com
Subject: Re: temporay table : error is repeated.
In-Reply-To: <395A5E54.331C2479@mediacces.com>
References: <395A5E54.331C2479@mediacces.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox