Re: proposal - operators ? and ->> for type record, and functions record_keys and record_each_text

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal - operators ? and ->> for type record, and functions record_keys and record_each_text
Date: 2021-03-08 22:12:20
Message-ID: 1882658.1615241540@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> I found an interesting idea to have some basic functions and operators for
> record type (similar to json, jsonb or hstore).

I think this is a pretty bad idea, because there's no way to know what
data type the result of -> should be. "Smash it all to text" is a hack,
not a solution --- and if you find that hack satisfactory, you might as
well be using json or hstore.

Most of the other things you mention are predicated on the assumption
that the field set will vary from one value to the next, which again
seems more like something you'd do with json or hstore than with SQL
composites.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2021-03-08 22:16:23 Re: Proposal: Save user's original authenticated identity for logging
Previous Message Tom Lane 2021-03-08 21:38:55 Re: Removing vacuum_cleanup_index_scale_factor