Thread: Trying to learn the PL/pgsql procedural language

Trying to learn the PL/pgsql procedural language

From
"John R. Sowden"
Date:
I have been a foxpro/dos programmer for my small business for about 35
years.  I use linux for all but database stuff.  For db I use
foxpro/dosemu.  It looks like pg is my best bet for linux/sql. After
reading an o'reilly book on pg (_practical postgresql_), not one word
was mentioned in the procedural language chapter about displaying text.
  I write complete applications (in foxpro), not just queries and forms.

What am I missing here?  I am not interested in trying to learn C, C++,
Java, or Perl in order to read sql databases.

tia,


John


Re: Trying to learn the PL/pgsql procedural language

From
David G Johnston
Date:
John R. Sowden wrote
> I have been a foxpro/dos programmer for my small business for about 35
> years.  I use linux for all but database stuff.  For db I use
> foxpro/dosemu.  It looks like pg is my best bet for linux/sql. After
> reading an o'reilly book on pg (_practical postgresql_), not one word
> was mentioned in the procedural language chapter about displaying text.
>   I write complete applications (in foxpro), not just queries and forms.
>
> What am I missing here?  I am not interested in trying to learn C, C++,
> Java, or Perl in order to read sql databases.

Unlike FoxPro, PostgreSQL does not have any kind of user interface
development layer built in.  PL/pgsql is intended to allow you to process
data using procedural logic instead of just a sequence of SQL set-based
statements.  There is no way to write an entire user application purely with
PL/pgsql - the functions you write end up performing specific data
manipulation tasks that are glued together by the caller using a more full
featured programming language.

The book you chose to read is 12 YEARS old; you will find much is not
covered there (or is outright wrong) simply because things have changed
considerably in that time period.

You will have to choose a language to develop your application in and then
use an appropriate database driver for that language to connect to your
PostgreSQL instance.  It is quite probable you could even continue using
Foxpro and simply connect to PostgreSQL via ODBC.

I would suggest you first read large portions of the current documentation -
you will find that few introductory books on PostgreSQL exist because the
documentation itself is well written.  That is not to say that newer books
targeting newcomers do not exist...

David J.




--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Trying-to-learn-the-PL-pgsql-procedural-language-tp5824353p5824361.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.


Re: Trying to learn the PL/pgsql procedural language

From
Keith
Date:
This is actually a great introductory book and only 2 years old.

http://shop.oreilly.com/product/0636920025061.do

It's short and not heavy on details, but I found it covers a vast majority of the questions I see people new to postgresql often ask. Once you're done that, as David said, the documentation is very good. You just have to get used to where everything is and know what you're looking for.

On Sun, Oct 26, 2014 at 11:53 PM, David G Johnston <david.g.johnston@gmail.com> wrote:
John R. Sowden wrote
> I have been a foxpro/dos programmer for my small business for about 35
> years.  I use linux for all but database stuff.  For db I use
> foxpro/dosemu.  It looks like pg is my best bet for linux/sql. After
> reading an o'reilly book on pg (_practical postgresql_), not one word
> was mentioned in the procedural language chapter about displaying text.
>   I write complete applications (in foxpro), not just queries and forms.
>
> What am I missing here?  I am not interested in trying to learn C, C++,
> Java, or Perl in order to read sql databases.

Unlike FoxPro, PostgreSQL does not have any kind of user interface
development layer built in.  PL/pgsql is intended to allow you to process
data using procedural logic instead of just a sequence of SQL set-based
statements.  There is no way to write an entire user application purely with
PL/pgsql - the functions you write end up performing specific data
manipulation tasks that are glued together by the caller using a more full
featured programming language.

The book you chose to read is 12 YEARS old; you will find much is not
covered there (or is outright wrong) simply because things have changed
considerably in that time period.

You will have to choose a language to develop your application in and then
use an appropriate database driver for that language to connect to your
PostgreSQL instance.  It is quite probable you could even continue using
Foxpro and simply connect to PostgreSQL via ODBC.

I would suggest you first read large portions of the current documentation -
you will find that few introductory books on PostgreSQL exist because the
documentation itself is well written.  That is not to say that newer books
targeting newcomers do not exist...

David J.




--
View this message in context: http://postgresql.1045698.n5.nabble.com/Trying-to-learn-the-PL-pgsql-procedural-language-tp5824353p5824361.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.


--
Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice

Re: Trying to learn the PL/pgsql procedural language

From
"John R. Sowden"
Date:
On 10/26/2014 08:53 PM, David G Johnston wrote:
> John R. Sowden wrote
>> I have been a foxpro/dos programmer for my small business for about 35
>> years.  I use linux for all but database stuff.  For db I use
>> foxpro/dosemu.  It looks like pg is my best bet for linux/sql. After
>> reading an o'reilly book on pg (_practical postgresql_), not one word
>> was mentioned in the procedural language chapter about displaying text.
>>    I write complete applications (in foxpro), not just queries and forms.
>>
>> What am I missing here?  I am not interested in trying to learn C, C++,
>> Java, or Perl in order to read sql databases.
>
> Unlike FoxPro, PostgreSQL does not have any kind of user interface
> development layer built in.  PL/pgsql is intended to allow you to process
> data using procedural logic instead of just a sequence of SQL set-based
> statements.  There is no way to write an entire user application purely with
> PL/pgsql - the functions you write end up performing specific data
> manipulation tasks that are glued together by the caller using a more full
> featured programming language.
>
> The book you chose to read is 12 YEARS old; you will find much is not
> covered there (or is outright wrong) simply because things have changed
> considerably in that time period.
>
> You will have to choose a language to develop your application in and then
> use an appropriate database driver for that language to connect to your
> PostgreSQL instance.  It is quite probable you could even continue using
> Foxpro and simply connect to PostgreSQL via ODBC.
>
> I would suggest you first read large portions of the current documentation -
> you will find that few introductory books on PostgreSQL exist because the
> documentation itself is well written.  That is not to say that newer books
> targeting newcomers do not exist...
>
> David J.
>
>
>
>
> --
> View this message in context:
http://postgresql.1045698.n5.nabble.com/Trying-to-learn-the-PL-pgsql-procedural-language-tp5824353p5824361.html
> Sent from the PostgreSQL - novice mailing list archive at Nabble.com.
>
>
Thank you both for your response.  This does not sound good.  It looks
like I am going to have to find a linux language that I can embed sql
commands to talk to pg.

John





Re: Trying to learn the PL/pgsql procedural language

From
David G Johnston
Date:
On Sunday, October 26, 2014, John R. Sowden [via PostgreSQL] <[hidden email]> wrote:
On 10/26/2014 08:53 PM, David G Johnston wrote:
>

> You will have to choose a language to develop your application in and then
> use an appropriate database driver for that language to connect to your
> PostgreSQL instance.  It is quite probable you could even continue using
> Foxpro and simply connect to PostgreSQL via ODBC.
>
> I would suggest you first read large portions of the current documentation -
> you will find that few introductory books on PostgreSQL exist because the
> documentation itself is well written.  That is not to say that newer books
> targeting newcomers do not exist...
>
Thank you both for your response.  This does not sound good.  It looks
like I am going to have to find a linux language that I can embed sql
commands to talk to pg.


Welcome to programming in the 21st century :) 

David J.


View this message in context: Re: Trying to learn the PL/pgsql procedural language
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.

Re: Trying to learn the PL/pgsql procedural language

From
Gavin Flower
Date:
On 27/10/14 18:15, John R. Sowden wrote:
> On 10/26/2014 08:53 PM, David G Johnston wrote:
>> John R. Sowden wrote
>>> I have been a foxpro/dos programmer for my small business for about 35
>>> years.  I use linux for all but database stuff.  For db I use
>>> foxpro/dosemu.  It looks like pg is my best bet for linux/sql. After
>>> reading an o'reilly book on pg (_practical postgresql_), not one word
>>> was mentioned in the procedural language chapter about displaying text.
>>>    I write complete applications (in foxpro), not just queries and
>>> forms.
>>>
>>> What am I missing here?  I am not interested in trying to learn C, C++,
>>> Java, or Perl in order to read sql databases.
>>
>> Unlike FoxPro, PostgreSQL does not have any kind of user interface
>> development layer built in.  PL/pgsql is intended to allow you to
>> process
>> data using procedural logic instead of just a sequence of SQL set-based
>> statements.  There is no way to write an entire user application
>> purely with
>> PL/pgsql - the functions you write end up performing specific data
>> manipulation tasks that are glued together by the caller using a more
>> full
>> featured programming language.
>>
>> The book you chose to read is 12 YEARS old; you will find much is not
>> covered there (or is outright wrong) simply because things have changed
>> considerably in that time period.
>>
>> You will have to choose a language to develop your application in and
>> then
>> use an appropriate database driver for that language to connect to your
>> PostgreSQL instance.  It is quite probable you could even continue using
>> Foxpro and simply connect to PostgreSQL via ODBC.
>>
>> I would suggest you first read large portions of the current
>> documentation -
>> you will find that few introductory books on PostgreSQL exist because
>> the
>> documentation itself is well written.  That is not to say that newer
>> books
>> targeting newcomers do not exist...
>>
>> David J.
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://postgresql.1045698.n5.nabble.com/Trying-to-learn-the-PL-pgsql-procedural-language-tp5824353p5824361.html
>> Sent from the PostgreSQL - novice mailing list archive at Nabble.com.
>>
>>
> Thank you both for your response.  This does not sound good.  It looks
> like I am going to have to find a linux language that I can embed sql
> commands to talk to pg.
>
> John
>
>
>
>
>
I am now mainly a Java developer, but I started with FORTRAN & COBOL
(I'm ancient), with a sideline of teaching C to experienced programmers.

I suggest that Python or Java are probably the best languages for you, I
think.

Java is more cumbersome to learn than Python, but scales well to deal
with complicated systems and enterprise heavy loads.  I looked at
Python, and liked what I saw, but it was not a good fit for me.

C++ is quite heavily used, and is likely to keep growing, but is
probably harder to gain competence in than Java.


Cheers,
Gavin


Cheers,
Gavin



Re: Trying to learn the PL/pgsql procedural language

From
Merlin Moncure
Date:
On Sun, Oct 26, 2014 at 7:10 PM, John R. Sowden
<jsowden@americansentry.net> wrote:
> I have been a foxpro/dos programmer for my small business for about 35
> years.  I use linux for all but database stuff.  For db I use foxpro/dosemu.
> It looks like pg is my best bet for linux/sql. After reading an o'reilly
> book on pg (_practical postgresql_), not one word was mentioned in the
> procedural language chapter about displaying text.  I write complete
> applications (in foxpro), not just queries and forms.
>
> What am I missing here?  I am not interested in trying to learn C, C++,
> Java, or Perl in order to read sql databases.

I feel your pain.  Being a foxpro expat myself, I understand the
simplicity of having a single environment to handle writing basic
business applications quickly and am equally bewildered as to why
rapid development platforms seemed to have fallen away.

Well, here's the bad news: for various reasons (some good, some bad)
the market has moved away from this model pretty much for good.  I
used to hang on the hope that delphi would carry the torch for a while
but that ship has also sailed, sadly.

The good news is that you've come to the right place.  postgres it the
only choice that will meet your requirements.  Coming from foxpro it's
the only thing that is both powerful enough and not very expensive.
For the most part, the data processing you've done will drop in
cleanly and pl/pgsql will work well for that.  But what about UI
design?

For my part the recommendation is going to be to jump in and learn
javascript.  I'm not going to sugar coat it: it's going to suck but
with the proliferation of so many javascript frameworks and libraries
once you've got it under your belt you should be in a better place for
writing applications.

For middleware/web server development, it's a lot more complicated
situation.  I happen to like node.js and think it's a good place to go
for application development writing but it's very much a personal
preference thing.  I do not recommend the 'enterprise stacks' -- java,
c++, .net.  Stay with the stuff that's geared towards web development
(if not node.js, php, ruby, python, perl are all reasonable choices).

merlin


Re: Trying to learn the PL/pgsql procedural language

From
Gavin Flower
Date:
On 28/10/14 07:49, Merlin Moncure wrote:
> On Sun, Oct 26, 2014 at 7:10 PM, John R. Sowden
> <jsowden@americansentry.net> wrote:
>> I have been a foxpro/dos programmer for my small business for about 35
>> years.  I use linux for all but database stuff.  For db I use foxpro/dosemu.
>> It looks like pg is my best bet for linux/sql. After reading an o'reilly
>> book on pg (_practical postgresql_), not one word was mentioned in the
>> procedural language chapter about displaying text.  I write complete
>> applications (in foxpro), not just queries and forms.
>>
>> What am I missing here?  I am not interested in trying to learn C, C++,
>> Java, or Perl in order to read sql databases.
> I feel your pain.  Being a foxpro expat myself, I understand the
> simplicity of having a single environment to handle writing basic
> business applications quickly and am equally bewildered as to why
> rapid development platforms seemed to have fallen away.
>
> Well, here's the bad news: for various reasons (some good, some bad)
> the market has moved away from this model pretty much for good.  I
> used to hang on the hope that delphi would carry the torch for a while
> but that ship has also sailed, sadly.
>
> The good news is that you've come to the right place.  postgres it the
> only choice that will meet your requirements.  Coming from foxpro it's
> the only thing that is both powerful enough and not very expensive.
> For the most part, the data processing you've done will drop in
> cleanly and pl/pgsql will work well for that.  But what about UI
> design?
>
> For my part the recommendation is going to be to jump in and learn
> javascript.  I'm not going to sugar coat it: it's going to suck but
> with the proliferation of so many javascript frameworks and libraries
> once you've got it under your belt you should be in a better place for
> writing applications.
>
> For middleware/web server development, it's a lot more complicated
> situation.  I happen to like node.js and think it's a good place to go
> for application development writing but it's very much a personal
> preference thing.  I do not recommend the 'enterprise stacks' -- java,
> c++, .net.  Stay with the stuff that's geared towards web development
> (if not node.js, php, ruby, python, perl are all reasonable choices).
>
> merlin
>
>
If you do go for Java middleware, then I recommend WildFly
(http://wildfly.org) as the AppServer, it is free and very powerful.
But this route is not for the faint of heart!

AngularJS (https://angularjs.org) is a very good JavaScript framework.
Warning, JavaScript frameworks provoke strong passions and fierce
partisanship!

You may also want to consider upgrading your users to Linux in the
longer term.


Cheers,
Gavin


Re: Trying to learn the PL/pgsql procedural language

From
Andrej
Date:
On 27 October 2014 18:15, John R. Sowden <jsowden@americansentry.net> wrote:

Hi John,

> Thank you both for your response.  This does not sound good.  It looks like
> I am going to have to find a linux language that I can embed sql commands to
> talk to pg.

Others have suggested python, you're talking about an all-in-one approach.
Have you considered PyQt or PySide?


> John

Cheers,
Andrej