0

How could I remove simple quotation marks that appear in empty cells? See image below

View of a table including simple quotation marks

The columns can be either TEXT or CHARACTER VARYING(), these signs are still present. I have other tables with no quotation marks in empty cells... The extract above is the result of an importation of an ORACLE table into my PGSQL database. This is probably the reason why.

Zong
  • 6,160
  • 5
  • 32
  • 46
wiltomap
  • 3,933
  • 8
  • 37
  • 54
  • This might be related to the software displaying the values. What is it ? It might also be related to the import. How was it done ? Right now, the question lacks the necessary information to be answered. – Denys Séguret Jun 19 '14 at 11:01
  • The software is pgAdmin III. The table was imported with Navicat tool that allows connection to various database types and migration of data between databases. – wiltomap Jun 19 '14 at 11:04
  • 1
    `''` indicates empty string, which is different than Null in PostgreSQL. Here, I'd venture that those empty strings are supposed to be nulls, but Navicat inserted empty strings. – Eric Workman Jun 19 '14 at 11:08

1 Answers1

0

My guess it that the importation process introduced single quotes. If this query solves it

select num_position, replace(num_position, '''', '')
from t;

then replace all single quotes

update t
set
    num_position = replace(num_position, '''', ''),
    num_plan = replace(num_plan, '''', '')
Clodoaldo Neto
  • 118,695
  • 26
  • 233
  • 260