0

When I try to query from greenplum.Double quotes Including take time in select list of columns while querying to database.

Input DDL : Scenario is

CREATE TABLE "People" (
 "ID" SERIAL NOT NULL,
 "Email" TEXT NOT NULL,
 PRIMARY KEY(id)
);

Error I get:

select * from people;

ERROR: relation "people" does not exist
LINE 1: select * from people;

Case : It's Ok to Manage when we have few columns. but also we have to deal with table having more than 150 columns and when i try to query for only 72 column for my select projection list. double quotes need to be include around each column. which takes more time to write query in editor.

Also, When talend ETL tool output the data it creates the table automatically in double quotes around column for every DDL.

Any help on it would be much appreciated ?

NEO
  • 389
  • 8
  • 31

1 Answers1

1

If you use lower case names all the times, you don't need to add quotes around table and column names.

However if a name has upper case letters in it, you are required to quote the name.

You have two choices: 1) Rename everything, make it lower case. 2) Quote every name which has upper case letters in it.

A. Scherbaum
  • 809
  • 4
  • 8
  • I want to use everything in lower case but ETL tool always writes ddl statement column in double quotes. therefore at the time of query i have to take care of double quotes. – NEO Feb 25 '17 at 23:35
  • It is Automated process of creation of DDL statement in greenplum. But i want to avoid at the time of reading the data from psql utility. is there any way to turn off double quotes around column. – NEO Feb 25 '17 at 23:36
  • Your ETL get's the name from somewhere - are they uppercase in your source system? – A. Scherbaum Feb 26 '17 at 00:14
  • Yes source data is in format for ex : CustomerName , SalesOrder – NEO Feb 26 '17 at 00:31
  • Any chance you can change the mapping in Talend? And have the output names lowercase? – A. Scherbaum Feb 27 '17 at 01:36
  • it is possible way . but each table on an average having 100 + column and every time i have to perform lower case thing will not work. – NEO Feb 27 '17 at 03:32
  • You should only change the mapping in Talend once, and tell Talend to create lower case names in the output. – A. Scherbaum Feb 28 '17 at 22:26
  • This feature is not available in tmap component.Have you done anything earlier using talend? – NEO Mar 01 '17 at 06:41