colpivot icon indicating copy to clipboard operation
colpivot copied to clipboard

Better column names

Open TristeFigure opened this issue 6 years ago • 1 comments

Column names are hard to query , e.g. "'column_name'" so here is how I sanitize them instead:

  • get rid of any quotation mark, simple or double.
  • substitue any non-alphanumeric character with a _
  • prefix the column name with a _ if it starts with a numeric character

Sorry for the formatting, my PG-SQL is too rusty for something better.

TristeFigure avatar Apr 17 '18 19:04 TristeFigure

@TristeFigure is there any other way of removing the single quotes from the column names?

ddavidebor avatar Mar 10 '19 00:03 ddavidebor