DEV Community

Pacharapol Withayasakpunt
Pacharapol Withayasakpunt

Posted on

A quick glance at PostgreSQL (Node.js driver) - better than doc-type NoSQL, and too good to be true

And I like it more than not like it, that is it like NoSQL in "strict mode".

  • TEXT[] with JSONB index or GIN index is supported.
  • ARRAY, JSONB and TIMESTAMP, with automatic conversion to-and-back JavaScript Objects, Array, Object and Date.
  • Unsurprisingly, ALTER TABLE ADD COLUMN is supported.

No, I don't use standard Postgres this time

I don't know if MongoDB supports extensions, but Postgres does, and even third parties.

I am talking about non-English full text search, in Chinese and Japanese; using


FROM postgres:13
RUN apt-get update
RUN apt-get install -y wget

RUN wget
RUN apt-get install -y ./groonga-apt-source-latest-buster.deb
RUN echo "deb buster-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
RUN wget --quiet -O - | apt-key add -
RUN apt-get update
RUN apt-get install -y postgresql-13-pgdg-pgroonga
RUN apt-get install -y groonga-tokenizer-mecab
Enter fullscreen mode Exit fullscreen mode


version: "3"
    build: ./packages/db
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgress
      - POSTGRES_DB=postgres
      - "5433:5432"
      - pgdata:/var/lib/postgresql/data
Enter fullscreen mode Exit fullscreen mode

So, what did I really install on my machine?

I did install Postgres on my machine to test it first; but I don't think it is really needed.

More importantly,

  • pgAdmin

I still want better full-text search.

What about

  • Column specific search, if wanted
  • Non-text search query string

I am positive I can create my own query language, as I have done it before; but what matters more here is performance... as I am privileged
enough to have today.

And, yeah, MongoDB does have full-text index; but it is very primitive to me.

Discussion (0)