mirror of
https://github.com/fiatjaf/khatru.git
synced 2025-03-26 17:51:49 +01:00
fix: postgresql tags_to_tagvalues func definition
This commit is contained in:
parent
ec4cd51ebd
commit
13a0c45fff
@ -17,8 +17,8 @@ func (b *PostgresBackend) Init() error {
|
||||
b.DB = db
|
||||
|
||||
_, err = b.DB.Exec(`
|
||||
CREATE FUNCTION tags_to_tagvalues(jsonb) RETURNS text[]
|
||||
AS 'SELECT array_agg(t->>1) FROM (SELECT jsonb_array_elements($1) AS t)s WHERE length(array_agg(t->>0)) = 1;'
|
||||
CREATE OR REPLACE FUNCTION tags_to_tagvalues(jsonb) RETURNS text[]
|
||||
AS 'SELECT array_agg(t->>1) FROM (SELECT jsonb_array_elements($1) AS t)s WHERE length(t->>0) = 1;'
|
||||
LANGUAGE SQL
|
||||
IMMUTABLE
|
||||
RETURNS NULL ON NULL INPUT;
|
||||
|
Loading…
x
Reference in New Issue
Block a user