Consider the following:

  CREATE TEMP TABLE tbl (
    id SERIAL NOT NULL,
    PRIMARY KEY (id)
  );

  COPY tbl (id) FROM stdin;
  1
  2
  3
  4
  \.

  SELECT substring ('1234567890' FOR (SELECT count (*) FROM tbl)::int);

This returns '1234', as expected.  But

  SELECT substring ('1234567890' FOR (SELECT count (*) FROM tbl));

returns NULL.  I think the problem is that "SELECT count(*)" returns a
BIGINT whereas "substring" expects an INT.  Shouldn't there be a warning? 


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to