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

BUG #4783: new syntax in tablefunction - not output cells

From: "Alex" <oktogen(at)mail(dot)ru>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4783: new syntax in tablefunction - not output cells
Date: 2009-04-26 10:24:48
Message-ID: 200904261024.n3QAOmnM004576@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      4783
Logged by:          Alex
Email address:      oktogen(at)mail(dot)ru
PostgreSQL version: 8.4
Operating system:   WinXP
Description:        new syntax in tablefunction - not output cells
Details: 

CREATE TABLE tst (
  "id" BIGSERIAL, 
  "vl" DOUBLE PRECISION DEFAULT 0 NOT NULL, 
  CONSTRAINT "tst_pkey" PRIMARY KEY("id")
) WITHOUT OIDS;

INSERT INTO   tst(id) 
VALUES  (1),(2),(2),(2),(2),(2),(2),(2),(2),(2),
(2),(2),(2),(2),(2),(2),(2),(2),(2),(2),(2),(2),(2),(2),(2),(2),(2),(2),(2),
(2),(2),(2),(2),(2),
(2),(2),(2),(2),(2),(2),(2),(2),(2),(2),(2),(2),
(2),(2),(2),(2),(2),(2),(2),(2),(2),(2),(2),(2),
(2),(2),(2),(2),(2),(2),(2),(2),(2),(2),(2),(2),
(2),(2),(2),(2),(2),(2),(2),(2),(2),(2),(2),(2);


CREATE OR REPLACE FUNCTION 
test1 () RETURNS TABLE(id BIGINT,   vl DOUBLE PRECISION) AS
$body$
BEGIN 
  RETURN QUERY
  SELECT
    id,
    vl
  FROM tst;
END
$body$
LANGUAGE 'plpgsql'
IMMUTABLE
CALLED ON NULL INPUT
SECURITY DEFINER
COST 1000 ROWS 1000;

CREATE OR REPLACE FUNCTION 
test2 () RETURNS TABLE(id BIGINT,   vl DOUBLE PRECISION) AS
$body$
  SELECT
    id,
    vl
  FROM tst;
END
$body$
LANGUAGE 'sql'
IMMUTABLE
CALLED ON NULL INPUT
SECURITY DEFINER
COST 1000 ROWS 1000;

query SELECT * FROM test1(); return NULL's if
name columns in "RETURN QUERY" = name columns  in 
"RETURNS TABLE".

was tested with languages: plpgsql and sql 
this is bag or feature?
thank's

Responses

pgsql-bugs by date

Next:From: Pavel StehuleDate: 2009-04-26 12:06:40
Subject: Re: BUG #4783: new syntax in tablefunction - not output cells
Previous:From: Larry SilvermintzDate: 2009-04-26 00:46:45
Subject: Solution: : Bug Report: PGAdminIII Query Tool Edit Window Key Commands stopped working between 1.0 and 1.10.0 beta.

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