Skip site navigation (1) Skip section navigation (2)

BUG #4633: Bug in PL/PgSQL "SELECT .. INTO" statement parser

From: "Oleg" <serovOv(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4633: Bug in PL/PgSQL "SELECT .. INTO" statement parser
Date: 2009-01-27 21:15:33
Message-ID: 200901272115.n0RLFXuw062425@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      4633
Logged by:          Oleg
Email address:      serovOv(at)gmail(dot)com
PostgreSQL version: PostgreSQL 8.3
Operating system:   CentOS
Description:        Bug in PL/PgSQL "SELECT .. INTO" statement parser
Details: 

Here is an example:

CREATE TABLE test2 (
	id BIGINT,
	chunk_id BIGINT
);
CREATE TABLE test1 (
	id BIGINT
);

CREATE OR REPLACE FUNCTION "bug" () RETURNS pg_catalog.void AS
$body$
DECLARE
    row_test1 test1%rowtype;
    row_test2 test2%rowtype;
BEGIN
    SELECT test1, test2
        FROM test1 JOIN test2 ON(chunk.id = test2.chunk_id)
        LIMIT 1
   	INTO row_test1, row_test2;

END;
$body$
LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY DEFINER;

Will throw error:
ERROR:  LIMIT #,# syntax is not supported
HINT:  Use separate LIMIT and OFFSET clauses.
QUERY:  SELECT test1, test2 FROM test1 JOIN test2 ON(chunk.id =
test2.chunk_id) LIMIT 1, 0,  $1
CONTEXT:  SQL statement in PL/PgSQL function "bug" near line 8

********** Ошибка **********

ERROR: LIMIT #,# syntax is not supported
SQL state: 42601
Подсказка:Use separate LIMIT and OFFSET clauses.
Контекст:SQL statement in PL/PgSQL function "bug" near line 8

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2009-01-27 21:45:53
Subject: Re: BUG #4633: Bug in PL/PgSQL "SELECT .. INTO" statement parser
Previous:From: Guillaume SmetDate: 2009-01-27 20:56:58
Subject: Re: BUG #4631: Hibernate Restriction bigint~~bigint

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group