Permission denied for relation in PostgreSQL

GRANT on the database is not what you need. Grant on the tables directly. Granting privileges on the database mostly is used to grant or revoke connect privileges. This allows you to specify who may do stuff in the database if they have sufficient other permissions. You want instead: GRANT ALL PRIVILEGES ON TABLE side_adzone … Read more

How can I tell if my process is running as Administrator?

Technically, if you want to see if the member is the local administrator account, then you can get the security identifier (SID) of the current user through the User property on the WindowsIdentity class, like so (the static GetCurrent method gets the current Windows user): WindowsIdentity windowsIdentity = WindowsIdentity.GetCurrent(); string sid = windowsIdentity.User.ToString(); The User … Read more

Make Inno Setup installer request privileges elevation only when needed

Inno Setup 6 has a built-in support for non-administrative install mode. Basically, you can simply set PrivilegesRequiredOverridesAllowed: [Setup] PrivilegesRequiredOverridesAllowed=dialog Additionally, you will likely want to use the auto* variants of the constants. Notably the {autopf} for the DefaultDirName. [Setup] DefaultDirName={autopf}\My Program The following is my (now obsolete) solution for Inno Setup 5, based on @TLama’s … Read more

Ansible non-root sudo user and “become” privilege escalation

Why am I getting permission denied? Because APT requires root permissions (see the error: are you root?) and you are running the tasks as david. Per these settings: become: true become_user: david become_method: sudo Ansible becomes david using sudo method. It basically runs its Python script with sudo david in front. the user ‘david’ on … Read more

Why is window.showModalDialog deprecated? What to use instead?

Why is window.showModalDialog deprecated? From http://tjvantoll.com/2012/05/02/showmodaldialog-what-it-is-and-why-you-should-never-use-it/, In general the idea of putting a native dialog implementation into the browser was a really good idea, but window.showModalDialog was a bad implementation that is riddled with issues and poor browser support. (…) Note that (…) [a modal dialog using showModalDialog] is a full HTML document, not a … Read more

Can’t execute a MySQL stored procedure from Java

There are two ways to solve this: set the connection’s noAccessToProcedureBodies=true property For example as part of the connection string: jdbc:mysql://ipaddress:3306/test?noAccessToProcedureBodies=true The JDBC driver will then create “INOUT” strings for the arguments without requiring meta data like the exception says. Grant SELECT privileges on mysql.proc to the database user For example in the mysql prompt: … Read more

Display default access privileges for relations, sequences and functions in Postgres

Using the psql(1) interactive terminal There is another way, at least in recent Postgres versions. Use the \ddp command Default access privileges Owner | Schema | Type | Access privileges —————-+——–+———-+——————- role_x | | function | =X/role_x role_x | | sequence | role_x | | table | role_x | | type | =U/role_x Read more … Read more