From: Joop <root@localhost.localdomain.invalid>
To: pgsql-sql@postgresql.org
Subject: stored queries
Date: Tue, 23 Dec 2003 10:25:42 +0100
Message-ID: <pan.2003.12.23.09.23.24.185553@localhost.localdomain.invalid> (raw)
Hello everyone,
I'm just about to start on the reporting part of a PostgreSQL / PHP
application. I think it would be a good idea to create a table in my db in
which I can store queries, something like this:
create table stored_queries (
id bigint primary key,
name varchar,
description varchar,
parameters varchar[][],
query text
);
The frontend to it would present the user with a choice of the NAMEs of
the records, check if PARAMETERs are required (the dimensions would be
name and datatype), if so ask for the parameters and eventually run QUERY
with these parameters.
This approach seems very logical to me, so I think someone must have
invented this weel already :-). I googled for "stored queries" but didn't
find much. I would really like tips, feedback on this approach. Is it a
bad idea, and if so, why? What pitfalls will I run into?
Thanks!
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: root@localhost.localdomain.invalid
Subject: Re: stored queries
In-Reply-To: <pan.2003.12.23.09.23.24.185553@localhost.localdomain.invalid>
* 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