SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
PostgreSQL 10 support

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
PostgreSQL 10 support
Author Message
Olegon



Joined: 07 Sep 2009
Posts: 39
Country: Kazakhstan

Post PostgreSQL 10 support Reply with quote
Hi!

Showing partitioned tables not supported.
Example:
Code:
CREATE TABLE public.table_with_parts
(
    id integer NOT NULL,
    date_fix date NOT NULL,
    some_text character varying(200) COLLATE pg_catalog."default"
) PARTITION BY RANGE (date_fix)
WITH (
    OIDS = FALSE
)
TABLESPACE pg_default;

ALTER TABLE public.table_with_parts
    OWNER to postgres;

-- Partitions SQL

CREATE TABLE public.before2017 PARTITION OF public.table_with_parts
    FOR VALUES FROM ('1998-01-01') TO ('2017-01-01');

CREATE TABLE public.year2017 PARTITION OF public.table_with_parts
    FOR VALUES FROM ('2017-01-01') TO ('2018-01-01');

CREATE TABLE public.year2018 PARTITION OF public.table_with_parts
    FOR VALUES FROM ('2018-01-01') TO ('9999-01-01');


SQL Editor and assistant shows before2017, year2017, year2018 as tables but doesn't show main table table_with_parts. See attachment.


Fixed by added 'p' in DB Query 'Objects' (AND relkind IN ('r', 'f', 'v', 'S', 'm', 'p')). But maybe need more for additional showing.
Wed Sep 19, 2018 1:01 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7839

Post Reply with quote
Hi.

Thank you for letting us know.

I think a better fix for that would be to clone "Objects (PostgreSQL)" query using right-click menu then "Copy" command.
Rename that copy to "Objects (PostgreSQL)"
and then change the minimum version attribute in the copy to 10.
In the copy, modify the WHERE close of the first query to

Code:

...
WHERE relnamespace = :SCHEMA_ID
       AND relkind IN ('r', 'f', 'v', 'S', 'm', 'p')
       AND (relkind != 'r' OR relpartbound IS NULL)


At the top, add the following line to the CASE excepression
Code:
WHEN 'p' THEN 'TA'


That would show partitioned table as a whole and hide its individual partitions.
Wed Sep 19, 2018 10:12 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.