Unable to create views #163

Closed
fromneo opened this Issue Jan 18, 2016 · 5 comments

Comments

Projects
None yet
2 participants
@fromneo

fromneo commented Jan 18, 2016

I tried creating a view but it does not work. Postico registers it as a materialized view instead. But when I right click and try to delete it through the GUI, it throws an error stating that "subscriptions is not a materialized view" and that I should "use DROP VIEW to remove a view". When I try creating it through psql or pgadmin, it works.

This is the query I ran:

create view clean.subscriptions as
select
id,account_id,created_at,updated_at,active,token,expires_at,on_trial,plan_type,period,invoice_count,

case when (status not in ('paid','cancelled') and subscribed_at is not null) then null else subscribed_at end as subscribed_at,

trial_id,extra_users,churned_at,external_payment,status,extra_features,payment_display,signup_plan,plan_features,current_plan_rate,provider,subscription_plan_id,reason,customer_id,external_id,retrial_at,cancelled_at,churned_at_old,demo

from
heroku.subscriptions

where
demo is null
@jakob

This comment has been minimized.

Show comment
Hide comment
@jakob

jakob Jan 20, 2016

Owner

Hmm. Could it be that you had a materialized view with the same name before? Postico sometimes gets confused when the type of a table changes, even after reloading (see #146). If that is the case, you need to close all windows and reconnect.

I'll see if I can find a way to fix this.

Owner

jakob commented Jan 20, 2016

Hmm. Could it be that you had a materialized view with the same name before? Postico sometimes gets confused when the type of a table changes, even after reloading (see #146). If that is the case, you need to close all windows and reconnect.

I'll see if I can find a way to fix this.

@jakob jakob added the started label Jan 20, 2016

@fromneo

This comment has been minimized.

Show comment
Hide comment
@fromneo

fromneo Jan 21, 2016

Yes, that seems to be the case. When I create a view using the same query but with a different name, there are no issues. But it didn't resolve after I restarted Postico. So creating a normal view only works if the name has never been used for a materialized view before.

fromneo commented Jan 21, 2016

Yes, that seems to be the case. When I create a view using the same query but with a different name, there are no issues. But it didn't resolve after I restarted Postico. So creating a normal view only works if the name has never been used for a materialized view before.

@jakob

This comment has been minimized.

Show comment
Hide comment
@jakob

jakob Jan 26, 2016

Owner

Could you try this build if it fixes the issue:
https://eggerapps-downloads.s3.amazonaws.com/postico-1304.zip

Owner

jakob commented Jan 26, 2016

Could you try this build if it fixes the issue:
https://eggerapps-downloads.s3.amazonaws.com/postico-1304.zip

@fromneo

This comment has been minimized.

Show comment
Hide comment
@fromneo

fromneo Jan 27, 2016

It works now. Awesome work, thanks Jakob!

fromneo commented Jan 27, 2016

It works now. Awesome work, thanks Jakob!

@jakob jakob added done and removed started labels Feb 5, 2016

@jakob

This comment has been minimized.

Show comment
Hide comment
@jakob

jakob Feb 25, 2016

Owner

This issue is resolved in Postico 1.0.4
Download here: https://eggerapps.at/postico/

Owner

jakob commented Feb 25, 2016

This issue is resolved in Postico 1.0.4
Download here: https://eggerapps.at/postico/

@jakob jakob closed this Feb 25, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment