Vertica THROW_ERROR function not working?
Posted: Tue Mar 01, 2016 3:36 pm
Hi all,
I am confused by how to use the THROW_ERROR function which was introduced in Vertica 7.2.x.
Documentation:
https://my.vertica.com/docs/7.2.x/HTML/ ... _ERROR.htm
I am trying to re-create the example, but I do not get the same results:
I was expecting to see the USER GENERATED ERROR message. Am I missing something obvious?
Thanks!
I am confused by how to use the THROW_ERROR function which was introduced in Vertica 7.2.x.
Documentation:
https://my.vertica.com/docs/7.2.x/HTML/ ... _ERROR.htm
I am trying to re-create the example, but I do not get the same results:
Code: Select all
dbadmin=> select version();
version
------------------------------------
Vertica Analytic Database v7.2.1-4
(1 row)
dbadmin=> create table table_name (foo int);
CREATE TABLE
dbadmin=> select foo, throw_error('The column "foo" has been renamed "bar". Please try the new column name.') from table_name;
foo | throw_error
-----+-------------
(0 rows)
dbadmin=> alter table table_name rename foo to bar;
ALTER COLUMN
dbadmin=> select foo, throw_error('The column "foo" has been renamed "bar". Please try the new column name.') from table_name;
ERROR 2624: Column "foo" does not exist
Thanks!