In all DBMS, when you declare a "view" using the with ... as () syntax, you are expected to use it immediately. If you try to execute only the with ... as () construct, you will get an error and PostgreSQL will wait for you to complete the query.
You have two options: either remove the "with" construct and obtain the result of your "returning" clause, or append a query to the "view" created through with ... as () to read its contents, as follows:
with app as (
INSERT INTO public.tag
(class, name, value_type, history_type, persistent_history_limit_type,persistent_history_size, cache_size, unity, threshold_group, threshold, threshold_saving_option, threshold_time, uses_linear_regression, linear_regression_cluster_period, linear_regression_number_of_clusters, enum_mapping, site_id, as_id, use_bit_info, tag_bit, writing_only, active, detail, scanner_id, top_output, top_input, bottom_input, bottom_output, primary_rated, transducer_rated, secondary_rated, raw_upper_range, invert, scaling_type, relative_offset, absolute_offset)
VALUES
('TAG', 'PLCOFFLINEx', 2, 1, 0, 1, 1, '', 'System', 1.0, 2, 0, 0, 0, 0, '', 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) RETURNING oid as lastid
)
select * from app
From Doc:
... and the WITH clause itself is attached to a primary statement that can also be a SELECT, INSERT, UPDATE, or DELETE
I hope this helps!