RE: [GENERAL] urgent: problems with query_limit

From: Marcus Mascari <mascarim(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: RE: [GENERAL] urgent: problems with query_limit
Date: 1999-07-01 00:12:09
Message-ID: 19990701001209.11670.rocketmail@web118.yahoomail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers


What I would like to see (perhaps its possible
right now, or a workaround is available) is a method
for yielding an elog() message when the number of
tuples to be returned is over a specified USER limit.

The thrust of this issue is that we are rolling out
a PostgreSQL database which is driven by a
Web environment for most users. However, some users
will have ODBC access to some of the tables. One
of these table has more than a million rows and is
a totally denormalized "sales" table for all
transactions performed. It is the main tables
the various managers will be attacking with ODBC.

However, what we would like to prevent is some
new user, unfamiliar with how to design aggregate
and restrive queries, from doing a SELECT * FROM sales
and having 1 gig of data shipped across the network
to their Excel, Access, or Crystal Report Writer
application. Instead, we would like to generate
an elog() error in the backend like:

"You are allowed to return a maximum of 20,000 rows."

or some such constraint, as a per-user attribute. We
don't want to restrict the tuples which can
participate in their queries, just the number of rows
returned. So, SELECT SUM(price) FROM sales, would
be okay. What we don't want is a query limit, which,
when reached, silently returns the number of rows
without the user knowing they didn't get all the
data they requested.

Any hints or tips to achieve this functionality?

Marcus "Mike" Mascari
(mascarim(at)yahoo(dot)com)

--- "Jackson, DeJuan" <djackson(at)cpsgroup(dot)com> wrote:
> Try: select * from table LIMIT 100;
>
> > Hi
> >
> > We upgraded our system from 6.4 to the new 6.5
> version. The set
> > query_limit function is not working
> > anymore in 6.5.
> >
> > db => set query_limit to '100';
> > SET VARIABLE
> > db => select * from table;
> >
> > statement is returning all records from the table.
> What's wrong here?
> >
> > Herbie

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Bitmead 1999-07-01 00:35:50 Re: [GENERAL] Re: Data warehousing
Previous Message Tom Lane 1999-06-30 22:18:01 Re: [INTERFACES] large objects

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 1999-07-01 00:26:57 Re: [HACKERS] regression bigtest needs very long time
Previous Message Stephen Boyle 1999-06-30 20:44:05 Postgres Upsizing Tool for MSAccess 97