Search Postgresql Archives

hstore syntax

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

Trying to write a sql function to return hstore generated from a select. But I'm thinking there must be a better way.

SELECT 'key => "' || s.part || '"')::hstore

is neither pretty nor secure. At least I need to escape any '"' in s.part. I'll do so if there's no better way to write this (?)

Also, it seems there's no length or size function for hstore? This is what I've got working now array_length(akeys(s.hstore_field), 1). It seems to be a rather long way to do it, but it works.


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux