#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    6
    Rep Power
    0

    Database scripts in pgSql or in pgScript?


    If i need some procedural script to be run in Oracle datbase, then i just write code with PLSQL and execute it with any Oracle client program/IDE. With Sql Server the same is done with T-SQL. What language do you suggest for Postgre database such scripts? The pgScript works only in program pgAdmin, other IDe's does not support this syntax, right? And pgSQL does not allow to write anonymous script blocks, right? It inly allows to write functions, triggers basically, but not script blocks, right?
    So, both pgScript and plSql are bad choices for scripts, right? what else to use then? Or how is the proper way to do? Maybe optimal way is to use only plSql for all scripts and developing, and just write lot of functions for each script you want and execute the functions in pgAdmin or any IDE/tool once and deleting the function immediately after.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,785
    Rep Power
    348
    Originally Posted by applefarm
    And pgSQL does not allow to write anonymous script blocks, right?
    http://www.postgresql.org/docs/current/static/sql-do.html

    Comments on this post

    • applefarm agrees
    I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags.
    http://forums.devshed.com/misc.php?do=bbcode#code

    Tips on how to ask better questions:
    http://tkyte.blogspot.de/2005/06/how-to-ask-questions.html
    http://wiki.postgresql.org/wiki/SlowQueryQuestions
    http://catb.org/esr/faqs/smart-questions.html
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2013
    Posts
    6
    Rep Power
    0
    Thx.
    Seems really one can use DO-block and forger about the pgScript.

IMN logo majestic logo threadwatch logo seochat tools logo