Project

General

Profile

« Previous | Next » 

Revision 8331

schemas/util.sql: mk_subset_by_row_num_func(): regular subset function: Fixed bug where need to add 1 to the 0-based offset_ to get the 1-based row_num (which is usually a serial column)

View differences:

schemas/util.sql
848 848
  RETURNS SETOF $$||view_||$$ AS
849 849
$BODY1$
850 850
SELECT * FROM $$||util.type_qual_name(view_::text::regtype)||$$
851
WHERE $$||quote_ident(row_num_col)||$$ BETWEEN COALESCE($2, 0) AND COALESCE(COALESCE($2, 0) + $1 - 1, 2147483647)
851
WHERE $$||quote_ident(row_num_col)||$$ BETWEEN COALESCE($2, 0)+1 AND COALESCE(COALESCE($2, 0)+1 + $1 - 1, 2147483647)
852 852
$BODY1$
853 853
  LANGUAGE sql STABLE
854 854
  COST 100

Also available in: Unified diff