Escape , in table name in export_objects

Moderator: NorbertKrupa

Post Reply
SanjeetSingh
Newbie
Newbie
Posts: 4
Joined: Sat Oct 31, 2015 12:25 pm

Escape , in table name in export_objects

Post by SanjeetSingh » Sat Oct 31, 2015 12:41 pm

If a table name have a comma in its name, export_objects is not able to fetch the table schema statement.

Got the table statement at schema level like this
select export_objects('','san','false');

CREATE TABLE san.","
(
name varchar(80)
);


But while fetching specific table schema statement comma in name does not work

phjain=> select export_objects('','san.,','false');
ERROR 2569: Catalog object san. does not exist
phjain=> select export_tables('','san.,');
ERROR 2569: Catalog object san. does not exist

I know this is a comma delimited string, but looking for a way to escape comma in table/schema/projection name.

SanjeetSingh
Newbie
Newbie
Posts: 4
Joined: Sat Oct 31, 2015 12:25 pm

Re: Escape , in table name in export_objects

Post by SanjeetSingh » Sat Oct 31, 2015 3:31 pm

Same problem for dot(.) and spaces at start and end of names.
Seems like Vertica is parsing object names list based on using delimiters . and , after trimming.

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1825
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: Escape , in table name in export_objects

Post by JimKnicely » Wed Nov 04, 2015 2:20 am

That must be a bug. The only way to get the table to export us by just specifying the table schema:

Code: Select all

dbadmin=> CREATE SCHEMA san;
CREATE SCHEMA

dbadmin=> CREATE TABLE san.","
dbadmin-> (
dbadmin(>     name varchar(80)
dbadmin(> );
CREATE TABLE

dbadmin=> select export_tables('','san');
                              export_tables
-------------------------------------------------------------------------
 CREATE SCHEMA san;


CREATE TABLE san.","
(
    name varchar(80)
);
(1 row)
Jim Knicely

Image

Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.

Post Reply

Return to “Vertica Database Administration”