Jump to content

PostgreSQL


PYO

Recommended Posts

I'm sorry, but I don't believe that cPanel provides that feature. I don't know much about PgSQL, but my guess is that that language is potentially dangerous.

 

Bad. It's not dangerous at all. I need some of them to make triggers (i.e. when you add record in one table the trigger adds record to another table).

Thi is from PgSQL docs:

Chapter 34. Triggers

Trigger functions can be written in most of the available procedural languages, including PL/pgSQL, PL/Tcl, PL/Perl, and PL/Python.

It is not currently possible to write a trigger function in the plain SQL function language.

 

Any help?

Link to comment
Share on other sites

My research shows thet only on PostreSQL 8.1 or higher it is possible to use

CREATE LANGUAGE plpgsql;

to make it enabled for a db. In other versions you can only ask admin to make it availible. :(

 

Will you ever upgrade to 8.1+ ver?

Link to comment
Share on other sites

The problem with Triggers is that people can make an infinite loop with them, effectively locking a table. Hackers have been known to do that...

 

Well...

1. I will not lock my table if I'll use it.

2. There is many other ways to abuse db server: for example expensive SQL queries.

 

Link to comment
Share on other sites

What exactly are you trying to do? A mass join or mass update perhaps?

 

No. Some are simple db driven user access control. Other autocount updates, so I don't need to have use 'count(...)' sql command.

Abuses to server are:

- more memory needed for executing php script,

- more sql commands and results passing between script and db.

They are not very big, but...

Link to comment
Share on other sites

  • 2 years later...
Can I use 'plpgsql' language in my PostgreSQL?

In phpPgAdmin I didn't find it. I need it for some triggers in db.

It can be done in psql by command:

createlang plpgsql pyohost_ph;

Thanks.

 

Any news about this issue? I would like to be able to access plpgslq, because PostGIS functions use this language. It is possible to create a function to enable PL language, but it must be known the location of plpgsql.so file, usually something like /usr/local/pgsql/lib. Another way is to simply provide users database templates to use with plsql language enabled.

Please more info about this and it wrong to think that plpgsql is a bad thing. Simple SQL can do a lot of harm...

 

Cheers!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...