RE: Libpq support to connect to standby server as priority

From: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
To: 'Haribabu Kommi' <kommi(dot)haribabu(at)gmail(dot)com>
Cc: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Dave Cramer <pg(at)fastcrypt(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, "Jing Wang" <jingwangian(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: Libpq support to connect to standby server as priority
Date: 2019-02-14 02:03:32
Message-ID: 0A3221C70F24FB45833433255569204D1FB98624@G01JPEXMBYT05
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

From: Haribabu Kommi [mailto:kommi(dot)haribabu(at)gmail(dot)com]
> No. It's not good if the user has to be bothered by
> default_transaction_read_only when he simply wants to a standby.
>
>
>
> OK. Understood.
> so if we are going to differentiate between readonly and standby types,
> then I still
> feel that adding a prefer-read to target_session_attrs is still valid
> improvement.

I agree that it's valid improvement to add prefer-read to target_session_attr, as a means to "get a read-only session."

> But the above improvement can be enhanced once the base work of GUC_REPORT
> is finished.

Is it already in progress in some thread, or are you trying to start from scratch? (I may have done it, but I don't remember it well...)

> Yes, I want to work on this patch, hopefully by next commitfest. In case
> if I didn't get time,
> I can ask for your help.

I'm glad to hear that. Sure. I'd like to review your patch, and possibly add/modify code if necessary. Are you going to add target_server_type={primary | standby | prefer_standby} as well as add prefer-read to target_session_attr?

> (I wonder which of server_type or server_role feels natural in
> English.)
>
>
>
> server_type may be good as it stands with connection option
> (target_server_type).

Thanks, agreed. That also follows PgJDBC's targetServerType.

Regards
Takayuki Tsunakawa

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-02-14 03:38:04 Re: Using POPCNT and other advanced bit manipulation instructions
Previous Message Tsunakawa, Takayuki 2019-02-14 01:31:49 RE: Protect syscache from bloating with negative cache entries