BUG #6529: Invalid numeric input syntax for 'select into' queries

From: nehxby(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #6529: Invalid numeric input syntax for 'select into' queries
Date: 2012-03-13 14:19:38
Message-ID: E1S7SZe-00085R-BA@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 6529
Logged by: Maxim Turchin
Email address: nehxby(at)gmail(dot)com
PostgreSQL version: 9.1.3
Operating system: Ubuntu 11.10
Description:

CREATE TYPE test_bug_type AS
(value numeric(15,2),
currency_id varchar);

CREATE TABLE test_bug_table (
id serial PRIMARY KEY,
test_field test_bug_type
);

INSERT INTO test_bug_table (test_field) VALUES ('(15.50,USD)');

DO
$$DECLARE
test_bug_var test_bug_type;
BEGIN
SELECT test_field INTO test_bug_var FROM test_bug_table LIMIT 1;
--ERROR: invalid input syntax for type numeric: "(15.50,USD)"
--CONTEXT: PL/pgSQL function "inline_code_block" line 7 at SQL statement

-- OR:
INSERT INTO test_bug_table (test_field) VALUES ('(35.80,EUR)')
RETURNING test_field INTO test_bug_var;
--ERROR: invalid input syntax for type numeric: "(35.80,EUR)"

RAISE NOTICE 'Test %', test_bug_var;
END;$$;

DROP TABLE test_bug_table;
DROP TYPE test_bug_type;

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2012-03-13 17:12:00 Re: BUG #6489: Alter table with composite type/table
Previous Message stuart.bishop 2012-03-13 09:00:18 BUG #6528: pglesslog still referenced in docs, but no 9.1 support