J'ai 2 tables:requête PostgreSQL impliquant entier []
CREATE TABLE article (
id serial NOT NULL,
title text,
tags integer[] -- array of tag id's from TAG table
)
CREATE TABLE tag (
id serial NOT NULL,
description character varying(250) NOT NULL
)
... et doivent sélectionner des étiquettes de table TAG tenue dans 'balises de nombre entier []' de ARTICLE basé sur le titre de l'article.
donc essayé quelque chose comme
SELECT *
FROM tag
WHERE tag.id IN ((select article.tags::int4
from article
where article.title = 'some title'));
... qui me donne
ERROR: cannot cast type integer[] to integer
LINE 1: ...FROM tag WHERE tag.id IN ( (select article.tags::int4 from ...
Je suis coincé avec PostgreSql 8.3 à la fois environnement de développement et de production.
C'est assez cool –