Skip to main content
added 274 characters in body; edited body
Source Link
Pablo
  • 9.9k
  • 6
  • 45
  • 73

You can transfer the desired hstore key/value data to new columns:
1-Create the desired columns (ex. addres, city, key1, key2, keyn)
2-Run:

UPDATE table 
SET 
address=hstorecolumn->address>'address',
city=hstorecolumn->city>'city',
key1=hstorecolumn->key1>'key1',
key2=hstorecolumn->key2>'key2',
keyn=hstorecolumn->keyn;>'keyn';

Or you can simply get used to hstore, it works pretty well and I have so many good results with it that I can say IMO "hstore changed my life". lol

EDIT:
An example on how to use hstore:
SELECT streetdatatable.hstoredatacolumn -> 'address', streetdatatable.hstoredatacolumn -> 'city' FROM someschema. streetdatatable

It will show you all the address and cities values.

You can transfer the desired hstore key/value data to new columns:
1-Create the desired columns (ex. addres, city, key1, key2, keyn)
2-Run:

UPDATE table 
SET 
address=hstorecolumn->address,
city=hstorecolumn->city,
key1=hstorecolumn->key1,
key2=hstorecolumn->key2,
keyn=hstorecolumn->keyn;

Or you can simply get used to hstore, it works pretty well and I have so many good results with it that I can say IMO "hstore changed my life". lol

You can transfer the desired hstore key/value data to new columns:
1-Create the desired columns (ex. addres, city, key1, key2, keyn)
2-Run:

UPDATE table 
SET 
address=hstorecolumn->'address',
city=hstorecolumn->'city',
key1=hstorecolumn->'key1',
key2=hstorecolumn->'key2',
keyn=hstorecolumn->'keyn';

Or you can simply get used to hstore, it works pretty well and I have so many good results with it that I can say IMO "hstore changed my life". lol

EDIT:
An example on how to use hstore:
SELECT streetdatatable.hstoredatacolumn -> 'address', streetdatatable.hstoredatacolumn -> 'city' FROM someschema. streetdatatable

It will show you all the address and cities values.

Source Link
Pablo
  • 9.9k
  • 6
  • 45
  • 73

You can transfer the desired hstore key/value data to new columns:
1-Create the desired columns (ex. addres, city, key1, key2, keyn)
2-Run:

UPDATE table 
SET 
address=hstorecolumn->address,
city=hstorecolumn->city,
key1=hstorecolumn->key1,
key2=hstorecolumn->key2,
keyn=hstorecolumn->keyn;

Or you can simply get used to hstore, it works pretty well and I have so many good results with it that I can say IMO "hstore changed my life". lol