LIMIT QUESTION

Started by Martin Wongalmost 27 years ago11 messagesgeneral
Jump to latest
#1Martin Wong
martin@minook.com.sg

Hi,

I've an elementary question. What's wrong with the following :

dbtest=> select * from testusers limit 10;
ERROR: parser: parse error at or near "10"
dbtest=> select version();
version
-------------------------------------------------------------
PostgreSQL 6.4.2 on i586-pc-linux-gnu, compiled by gcc 2.7.2.
(1 row)

the testuser table has about 1000 rows.

Please comment.

Thanks

#2Michael J Davis
michael.j.davis@tvguide.com
In reply to: Martin Wong (#1)
RE: [GENERAL] LIMIT QUESTION

I think "limit" is new with version 6.5.

-----Original Message-----
From: Martin Wong [SMTP:martin@minook.com.sg]
Sent: Wednesday, April 28, 1999 8:07 PM
To: pgsql-general@postgreSQL.org
Subject: [GENERAL] LIMIT QUESTION

Hi,

I've an elementary question. What's wrong with the following :

dbtest=> select * from testusers limit 10;
ERROR: parser: parse error at or near "10"
dbtest=> select version();
version
-------------------------------------------------------------
PostgreSQL 6.4.2 on i586-pc-linux-gnu, compiled by gcc 2.7.2.
(1 row)

the testuser table has about 1000 rows.

Please comment.

Thanks

#3Chris Bitmead
chris.bitmead@bigfoot.com
In reply to: Martin Wong (#1)
Re: [GENERAL] LIMIT QUESTION

Only PostgreSQL 6.5 Beta supports LIMIT.

Show quoted text

I've an elementary question. What's wrong with the following :

dbtest=> select * from testusers limit 10;
ERROR: parser: parse error at or near "10"
dbtest=> select version();
version
-------------------------------------------------------------
PostgreSQL 6.4.2 on i586-pc-linux-gnu, compiled by gcc 2.7.2.
(1 row)

the testuser table has about 1000 rows.

Please comment.

Thanks

#4José Soares
jose@sferacarta.com
In reply to: Martin Wong (#1)
Re: [GENERAL] LIMIT QUESTION

Chris Bitmead ha scritto:

Only PostgreSQL 6.5 Beta supports LIMIT.

I've an elementary question. What's wrong with the following :

dbtest=> select * from testusers limit 10;
ERROR: parser: parse error at or near "10"
dbtest=> select version();
version
-------------------------------------------------------------
PostgreSQL 6.4.2 on i586-pc-linux-gnu, compiled by gcc 2.7.2.
(1 row)

the testuser table has about 1000 rows.

Please comment.

Thanks

Use SET QUERY_LIMT TO 10;
this should work in 6.4.2
______________________________________________________________
PostgreSQL 6.5.0 on i586-pc-linux-gnu, compiled by gcc 2.7.2.3
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jose'

#5Martin Wong
martin@minook.com.sg
In reply to: José Soares (#4)
RE: [GENERAL] LIMIT QUESTION

dbtest=> set QUERY_LIMIT TO 10;
ERROR: parser: parse error at or near "10"
dbtest=> set QUERY_LIMT TO 10;
ERROR: parser: parse error at or near "10"

Didn't work. I guess I'll have to re-install postgresql 6.5

BTW, is this 6.5 version stable enough for production?
Please comment.

And also if 6.4.2 is up to production level. I'm sure it is though, haven't
found any problems yet.

Thanks

Martin

-----Original Message-----
���o�l : Jos� Soares <jose@sferacarta.com>
���� : Chris Bitmead <chris.bitmead@bigfoot.com>
CC : Martin Wong <martin@minook.com.sg>; pgsql-general@postgresql.org
<pgsql-general@postgresql.org>
���� : 1999�N4��30�� 0:01
���� : Re: [GENERAL] LIMIT QUESTION

Show quoted text

Chris Bitmead ha scritto:

Only PostgreSQL 6.5 Beta supports LIMIT.

I've an elementary question. What's wrong with the following :

dbtest=> select * from testusers limit 10;
ERROR: parser: parse error at or near "10"
dbtest=> select version();
version
-------------------------------------------------------------
PostgreSQL 6.4.2 on i586-pc-linux-gnu, compiled by gcc 2.7.2.
(1 row)

the testuser table has about 1000 rows.

Please comment.

Thanks

Use SET QUERY_LIMT TO 10;
this should work in 6.4.2
______________________________________________________________
PostgreSQL 6.5.0 on i586-pc-linux-gnu, compiled by gcc 2.7.2.3
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jose'

#6Martin Wong
martin@minook.com.sg
In reply to: Martin Wong (#5)
RE: [GENERAL] LIMIT QUESTION

Sorry for the previous posting. The following worked.

BTW, this affects just this database or throughout the entire postgresql
server?

And, how does one reset this variable to max?

Thanks

martin
-----Original Message-----
���o�l : Margarita Barvinok <brita@math.lsa.umich.edu>
���� : pgsql-general@postgreSQL.org <pgsql-general@postgreSQL.org>
���� : 1999�N4��30�� 0:01
���� : Re: [GENERAL] LIMIT QUESTION

This works in 6.4.2:

set QUERY_LIMIT TO '10'; or
set QUERY_LIMIT = '10';

On Thu, 29 Apr 1999, [iso-8859-1] Jos� Soares wrote:

Show quoted text

Use SET QUERY_LIMT TO 10;
this should work in 6.4.2
______________________________________________________________
PostgreSQL 6.5.0 on i586-pc-linux-gnu, compiled by gcc 2.7.2.3
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jose'

#7Margarita Barvinok
brita@math.lsa.umich.edu
In reply to: José Soares (#4)
Re: [GENERAL] LIMIT QUESTION

This works in 6.4.2:

set QUERY_LIMIT TO '10'; or
set QUERY_LIMIT = '10';

On Thu, 29 Apr 1999, [iso-8859-1] Jos��� Soares wrote:

Show quoted text

Use SET QUERY_LIMT TO 10;
this should work in 6.4.2
______________________________________________________________
PostgreSQL 6.5.0 on i586-pc-linux-gnu, compiled by gcc 2.7.2.3
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jose'

#8Jim Mercer
jim@reptiles.org
In reply to: Margarita Barvinok (#7)
serious bug in "alter table tbname rename to newname"

============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================

Your name : Jim Mercer
Your email address : jim@reptiles.org

Category : runtime: back-end
Severity : critical

Summary: alter table tabname rename to newname does not rename extra files

System Configuration
--------------------
Operating System : FreeBSD 2.x/3.x

PostgreSQL version : 6.4 and 6.4.2

Compiler used : gcc

Hardware:
---------
Pentium 128M ram
FreeBSD bigbird.nag.ca 3.0-RELEASE FreeBSD 3.0-RELEASE #1: Tue Feb 2 22:50:41 EST 1999 root@bigbird.nag.ca:/usr/src/sys/compile/BIGBIRD i386

Versions of other tools:
------------------------

--------------------------------------------------------------------------

Problem Description:
--------------------
when a table exceeds 2gb, it appears that postgres will create subfiles for the data.
when you rename a table, the sub files do no get renamed.
see backend/commands/rename.c [renamerel()]

--------------------------------------------------------------------------

Test Case:
----------
create a table in excess of 2gig, which in turn creates subfiles
in data/base/tabname.
rename the table.
the subfiles are not renamed.

--------------------------------------------------------------------------

Solution:
---------
possible solution is to check if the table has subfiles, look for those subfiles and rename them as well.

--------------------------------------------------------------------------

--
[ Jim Mercer Reptilian Research jim@reptiles.org +1 416 410-5633 ]
[ The telephone, for those of you who have forgotten, was a commonly used ]
[ communications technology in the days before electronic mail. ]
[ They're still easy to find in most large cities. -- Nathaniel Borenstein ]

#9Margarita Barvinok
brita@math.lsa.umich.edu
In reply to: Martin Wong (#6)
RE: [GENERAL] LIMIT QUESTION

This is from the Tutorial for version 6.4 of PostgreSQL.

SET - Set run-time parameters for session

SET variable { TO | = } { 'value' | DEFAULT }
SET TIME ZONE { 'timezone' | LOCAL };

QUERY_LIMIT
Sets the number of rows returned by a query.
Value
Maximum number of rows to return for a query. The default is
to allow an unlimited number of rows.
#
Sets the maximum number of rows returned by a query to #.
DEFAULT
Sets the maximum number of rows returned by a query to be
unlimited.
By default, there is no limit to the number of rows returned by a
query.

On Thu, 29 Apr 1999, Martin Wong wrote:

Show quoted text

Sorry for the previous posting. The following worked.

BTW, this affects just this database or throughout the entire postgresql
server?

And, how does one reset this variable to max?

Thanks

martin

This works in 6.4.2:

set QUERY_LIMIT TO '10'; or
set QUERY_LIMIT = '10';

#10José Soares
jose@sferacarta.com
In reply to: Martin Wong (#6)
Re: [GENERAL] LIMIT QUESTION

Martin Wong ha scritto:

Sorry for the previous posting. The following worked.

BTW, this affects just this database or throughout the entire postgresql
server?

Only current_session;

And, how does one reset this variable to max?

RESET QUERY_LIMIT;

______________________________________________________________
PostgreSQL 6.5.0 on i586-pc-linux-gnu, compiled by gcc 2.7.2.3
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jose'

#11The Hermit Hacker
scrappy@hub.org
In reply to: Martin Wong (#5)
RE: [GENERAL] LIMIT QUESTION

v6.5 is definitely not stable enough for production...purely a "use at own
risk" at this time...

On Thu, 29 Apr 1999, Martin Wong wrote:

dbtest=> set QUERY_LIMIT TO 10;
ERROR: parser: parse error at or near "10"
dbtest=> set QUERY_LIMT TO 10;
ERROR: parser: parse error at or near "10"

Didn't work. I guess I'll have to re-install postgresql 6.5

BTW, is this 6.5 version stable enough for production?
Please comment.

And also if 6.4.2 is up to production level. I'm sure it is though, haven't
found any problems yet.

Thanks

Martin

-----Original Message-----
���������o���l : Jos��� Soares <jose@sferacarta.com>
������������ : Chris Bitmead <chris.bitmead@bigfoot.com>
CC : Martin Wong <martin@minook.com.sg>; pgsql-general@postgresql.org
<pgsql-general@postgresql.org>
������������ : 1999���N4������30������ 0:01
������������ : Re: [GENERAL] LIMIT QUESTION

Chris Bitmead ha scritto:

Only PostgreSQL 6.5 Beta supports LIMIT.

I've an elementary question. What's wrong with the following :

dbtest=> select * from testusers limit 10;
ERROR: parser: parse error at or near "10"
dbtest=> select version();
version
-------------------------------------------------------------
PostgreSQL 6.4.2 on i586-pc-linux-gnu, compiled by gcc 2.7.2.
(1 row)

the testuser table has about 1000 rows.

Please comment.

Thanks

Use SET QUERY_LIMT TO 10;
this should work in 6.4.2
______________________________________________________________
PostgreSQL 6.5.0 on i586-pc-linux-gnu, compiled by gcc 2.7.2.3
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jose'

Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org