Search Postgresql Archives

Re: Determine if range list contains specified integer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 27, 2022 at 9:19 AM Andrus <kobruleht2@xxxxxx> wrote:

Product type table contains product types. Some ids may missing :


    create table artliik (liiginrlki char(3) primary key);


As an aside, don't use the "character" data type:

    create table strings ( id char(100) primary key, kirjeldLku chr(200) );
    insert into strings values ('item1', '1,4-5' );
    insert into strings values ('item2', '1,2,3,6-9,23-44,45' );


Those are ranges.  PostgreSQL has actual range types.  Using them instead of using text should make life considerably easier.

If you can go with PostgreSQL v14 you get access to multirange types.

Absent that you probably can use PostgreSQL array of ranges to accomplish a similar goal.

David J.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux