Page 1 of 1

What are the special characters restricted in Vertica?

Posted: Wed Jun 19, 2013 2:47 pm
by ajit_nayak
Hi,

I want to know ,what are the special characters which are restricted in vertica for creating tables.

Example : if I tried test.sub1 then it is showing error and same as test*sub1.

Please suggest .

Thanks
Ajit

Re: What are the special characters restricted in vertica

Posted: Thu Jun 20, 2013 10:48 am
by nnani
Hello Ajit,

You need to follow the standard template while creating tables.

Code: Select all

CREATE TABLE [ IF NOT EXISTS ] [[db-name.]schema.]table-name
(Column-definition
);
There is no other way you can use table names in CREATE TABLE statement

Can you elaborate on the error that you are getting.

Re: What are the special characters restricted in vertica

Posted: Thu Jun 20, 2013 11:17 am
by id10t
Hi!


Read here: https://my.vertica.com/docs/6.1.x/HTML/ ... m#8944.htm

Code: Select all

daniel=> create table "test.sub1" (id int);
CREATE TABLE
daniel=> create table "test*sub1" (id int);
CREATE TABLE
daniel=> 

Re: What are the special characters restricted in vertica

Posted: Thu Jun 20, 2013 1:28 pm
by ajit_nayak
I am not saying about "test*sub1" i need test*sub1..

It is not possible ....
I need to know what are the special charaters restricted like (*)

Re: What are the special characters restricted in vertica

Posted: Thu Jun 20, 2013 2:03 pm
by Julie
ajit_nayak,

sKwa showed you how to create a table named test*sub1!

Just surround it in double quotes in your create table statement. But keep in mind, every time you refer to that table you'll have to use the double quotes...

Code: Select all

dbadmin=> create table "test*sub1" (id int);
CREATE TABLE
dbadmin=> \d "test*sub1"
                                   List of Fields by Tables
 Schema |    Table    | Column | Type | Size | Default | Not Null | Primary Key | Foreign Key
--------+-------------+--------+------+------+---------+----------+-------------+-------------
 public | "test*sub1" | id     | int  |    8 |         | f        | f           |
(1 row)

dbadmin=> select * from "test*sub1";
 id
----
(0 rows)