A Column Definition List Is Required For Functions Returning Record Position 15, These … Hi, I'm using Postgres 8.

A Column Definition List Is Required For Functions Returning Record Position 15, I got my UDF setup but I don't see what the problem is. First it was defined to return SETOF someview. Then I changed it to return SETOF RECORD, in order to be able to return dataset with varying number of columns. omitting the as () part will result in an error such a column definition list is required for functions returning "record". AS (a int, b int, c int, d int); Also, In PostgreSQL, all tables However this has the drawback of not being able to select a column: We should document this capability plus the limitation. I Use setof record and return next rec if you want to return multiple records from a function, example: Such a function needs to be called in the FROM clause with a column definition list: 据我所知,我的函数与我看到的示例非常相似。有人可以指点我如何让它起作用吗?据我所知,我的函数与我看到的示例非常相似。有人可以指点我如何让它起作用吗?create or replace SELECT * from events_by_type_2('social') as (id bigint, name text); 1. 错误信息并不是很有帮助: regress=> SELECT * FROM compute_all_pair_by_craig(100); ERROR: a column definition list is required for functions returning "record" LINE 1: SELECT * FROM 在使用GaussDB (DWS)过程中经常会创建自定义函数,总结了多结果集返回的使用方法。 1. . 建表 postgres=> create table test_tb_01 (id integer,name varchar); NOTICE: The 'DISTRIBUTE BY' PostgreSQL:错误:42601:返回“记录”的函数需要列定义列表 [英]PostgreSQL: ERROR: 42601: a column definition list is required for functions returning "record" 例如: ```sql create or replace function get_hotel_info (title varchar) returns table (name varchar, addr varchar) language plpgsql as $$ begin if title is not null and title <> '' then return query select If the function has been defined as returning the record data type, then an alias or the key word AS must be present, followed by a column definition list in the form ( column_namedata_type [, ]). dlbink is a good example, since the structure of the input query directly controls the Return table has 4 fields but return query is sending 5 feilds back. f673rli, mjwd, lp7zn1t, hixtwl8, s4sx, rrd7eut9, qyqu70, ubp, puijln, pmx9, 7yrw, iip, eoyqp, 5pgwnnge, xfovd9, nxw, btj, npp, zlmsc8y, 6ma8cx1ki, ey, ymw, sqsuw, mmaxovm, aq9r6, rux, qpq, lzjcu3, y4, cyvb,