Write in PostgreSQL views.

dBase, Calc, CSV, MS ACCESS, MySQL, PostgrSQL, OTHER
Post Reply
JuliusMax
Posts: 1
Joined: Fri Dec 10, 2010 9:24 pm

Write in PostgreSQL views.

Post by JuliusMax »

I'm currently using a database under PostgreSQL massively using views to access my data.
These views include rules allowing me to update data directly by executing request on the view.

I'd like to interface it using Open Office but OO Base locks by default insert, update and delete attempts on views.
I can't find where to deactivate that or if it's event possible.

Anyone can enlighten me?
Ubuntu 10.10
Open Office 3.2.1
PostgreSQL 8.4
User avatar
r4zoli
Volunteer
Posts: 2882
Joined: Mon Nov 19, 2007 8:23 pm
Location: Budapest, Hungary

Re: Write in PostgreSQL views.

Post by r4zoli »

OOo Base UI only supports SELECTs in queries, no insert, update, and delete allowed. Only in Tools>SQL... command window you can use for scripts, you could not check it in interactive mode.
This is true not only for queries, but for views, too.
If you want to use views update, the Base not right tool for you.

May be some coding could help you, but it's out of my knowledge.
AOO 4.0 and LibO 4 on Win 8
Hungarian forum co-admin
User avatar
peterdines
Posts: 42
Joined: Thu Nov 06, 2008 9:06 am

Re: Write in PostgreSQL views.

Post by peterdines »

JuliusMax wrote:I'd like to interface it using Open Office but OO Base locks by default insert, update and delete attempts on views.
I can't find where to deactivate that or if it's event possible.
You mean using a form? I'm 99.999% sure Base can't do that at the moment. What I do is attach a main table to the form, then attach small related views as subforms for calculations and such. You can attach subforms with constraints (cascade on update / delete), so I think you could get most of the same functionality this way.

You can also run arbitrary SQL by using a macro connected to a form element like a button. But I shudder to think of the amount of work it'd take to hack in view writability.
OOo 3.3 / Mysql / Postgres / OS X 10.6.5
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Write in PostgreSQL views.

Post by Villeroy »

All views are read-only, even SELECT views in the "native" type of database. "Action queries" (insert, delete, update) can be triggered by macros.
Don't ask me why, why, why.
Base is the worst database tool on this planet. Before you start coding macros you should consider something else.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
peterdines
Posts: 42
Joined: Thu Nov 06, 2008 9:06 am

Re: Write in PostgreSQL views.

Post by peterdines »

Oh well. Now that I know Base's limitations and some workarounds for them I quite like it. I've coded two billing systems on it with a MySQL back end and I'm about to start something more ambitious. But yeah, the macro API is an abomination spawned by the Elder Gods. I avoid macros whenever possible; I have 5 or 6 simple ones to do small tricks and that's about as far as I want to take it.
OOo 3.3 / Mysql / Postgres / OS X 10.6.5
Post Reply