A
A
Alexander Afanasiev2017-01-18 15:25:25
PostgreSQL
Alexander Afanasiev, 2017-01-18 15:25:25

How to do full text search in postgresql on multiple tables?

Hello. I have 2 tables:

CREATE TABLE documents
(
  id serial NOT NULL,
  name character varying(512),
  accept_date date,
  "number" character varying(255),
  document_type integer,
  docdate date
)

CREATE TABLE paragraphs
(
  id bigserial NOT NULL,
  iddoc integer,
  "position" integer,
  text text
)

I'm trying to master the search on this article .
How can I search by document title and paragraph text (and some other fields), if these fields are in different tables.
Can this be done at all?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2017-01-18
@BuriK666

Use UNION

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question