What are the special characters restricted in Vertica?

Moderator: NorbertKrupa

Post Reply
ajit_nayak
Newbie
Newbie
Posts: 15
Joined: Tue May 14, 2013 1:25 pm

What are the special characters restricted in Vertica?

Post by ajit_nayak » Wed Jun 19, 2013 2:47 pm

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

User avatar
nnani
Master
Master
Posts: 302
Joined: Fri Apr 13, 2012 6:28 am
Contact:

Re: What are the special characters restricted in vertica

Post by nnani » Thu Jun 20, 2013 10:48 am

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.
nnani........
Long way to go

You can check out my blogs at vertica-howto

id10t
GURU
GURU
Posts: 732
Joined: Mon Apr 16, 2012 2:44 pm

Re: What are the special characters restricted in vertica

Post by id10t » Thu Jun 20, 2013 11:17 am

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=> 

ajit_nayak
Newbie
Newbie
Posts: 15
Joined: Tue May 14, 2013 1:25 pm

Re: What are the special characters restricted in vertica

Post by ajit_nayak » Thu Jun 20, 2013 1:28 pm

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 (*)

User avatar
Julie
Master
Master
Posts: 221
Joined: Thu Apr 19, 2012 9:29 pm

Re: What are the special characters restricted in vertica

Post by Julie » Thu Jun 20, 2013 2:03 pm

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)
Thanks,
Juliette

Post Reply

Return to “Vertica Premium Edition”