How do I play with Lynda etc. Postgres example files on MAMP without screwing up my current local environment? (beginner here) - database

So my company installed PostgreSQL on my computer, which I use, rarely and without understanding, for one specific function.
I'm trying to follow Lynda etc. tutorials to understand (Postgres)SQL better, since that's what we use, but all the tutorials ask students to reconfigure certain aspects of their system in order to follow along with example files (which I would really like to do).
Since I've messed up my dev env once already, I'm hesitant to touch anything that will cause issues with the local versions of our project.
I know this is an extremely wide-angle question with no easy answer, but if anyone has any general advice for playing with sample databases in MAMP Pro (or anywhere else) using Postgres without interfering with the servers I'm currently running, it would be a huge help.

i would recommend you use Vagrant and set up a isolated postgresql instance. Here is a great wiki you can follow to do this.
UPDATE: Given your comment,An easy solution is to just backup your data and proceed trying out the the Postgres examples you can always restore your data after you are done..

Related

Move PostgreSQL databases to new Ubuntu machine

Unfortunately an Ubuntu machine I manage has stopped working, and after much work it seems like I'll have to reinstall the system. All the data from the old system is intact and backed up.
Among this data is a PostgreSQL installation with some databases (that was running isolated on this machine.) My goal is to move this data as is, and run it on the fresh install.
Since the old system is not running, I can't do a pg_dump.
According to this article it should be possible to mode the data folder, but there are two restrictions mentioned. What I do not fully understand is if this will be a problem for me?
I cant seem to find much information on this online, since all refer to the preferred pg_dump-method.
Any help would be highly appreciated.
As per the suggestions in the comments to the initial answer, the Postgres directories where copied to a new host and the database started without any problems.

There is a PL/pgSQL free environment to develop for PostgreSQL?

I want to know if there is a free environment to develop in PL/pgSQL.
Writing the code in Notepad++, replacing the function and running it turns the process slow. I'm using pgAdmin(only to replace and run the procedure) at the moment, but this is not what I want.
I know that there is one similar question here, but this is not duplicated. All the tools to develop are paid, I want to know if there is one free.
I am very happy with following environment.
I use a programmer editor like geany or similar and I edit a file with functions - I put related functions to one file - this is similar to modules from other environments.
I don't use a copy to pgAdmin - it is terrible work - and I don't think so pgAdmin is good tool for editing and maintaining more functions - it is good for ad hoc changes. The editor is not strong - it is simply, and you can't use a usual tools like git, cvs, .. More - you cannot to organize a related functions to one entity.
If I have a one or two files, then I have a opened console, and just import a file to postgres via \i command. If I have a more larger and complex project I use a makefiles - so it automatically import only modified and depended files. This is very good and very effective when you have a project with more then one hundred functions.
If you are looking for a debugger, check http://pgfoundry.org/projects/edb-debugger/ that can be included in pgAdmin. I have never seen any other tool that can debug plpgsql, only pgAdmin.
I had similar question and guys recommended me Toad Extension for Eclipse. You can see the discussion here: Development oriented PostgreSQL IDE

migrator.net vs fluentmigrator vs migsharp

I am currently investigating possible options of a migration framework/tool. I like the idea of ruby migrations on which the above frameworks are based.
So I am asking for your experience, opinions and maybe a comparison between them. Are you using them in production?
thanks for responses. The goal of this question was to get a feeling about which tools is used most in the developer community but it seems that migrations are not a hot topic here.
Anyway, I have decided to go with MigSharp as the codebase seem to be pretty clean and it is quite easy to handle and had build in support for MS SQL CE. Second runner up would have been FluentMigrator where I was not able to produce a working example for compact edition.
Cheers
I use FluentMigrator in production, and am a longtime contributor to FM. I think your question is to general; be more specific. Also, FM has a google group which is fairly active if you want FM information.
FM is derived from migrator.net, as I recall. It uses a fluent-syntax, and supports multiple databases. We have taken some inspiration from rails migrations, but it's definitely not a port. Worth checking out.
One thing I've learned is not to put your migrations in the same assembly as you app code. Separate them into a migration assembly, and use that for migrating your databases.
Also, you should always work on multiple environments to avoid problems with migrations run straight against production. I always have at least a development and production environment, and most of the time there is a testing environment as well.
I use mig#.
It works well, but you will need to have some guidelines for usage - as migrations can get complicated.
We use sequence number on the end of our migrations rather than a date-time stamp. This is because we don't know when the date time stamp was set (when they begun the source code change-set; just before committing; some time inbetween) different developers could use different approaches.
Names such as Migration_0000034.cs give you plenty of space.
At this point, I would stick with migrator.net. I like the promise of FluentMigrator, but it seems to not have any better active development than migrator.net (see the issues and pull requests that have languished on their github site).
There is also no easy way to do an ExecuteScalar(). I'd add it, but I don't want to create my own fork, and I see no reason that a pull request would actually land in the master. (Execute.WithConnection is an Action so it will fire on demand rather than when I need it to fire)
So for me, I'm heading back to migrator.net.

Advice on learning about web applications

I know how to write programs in Java and C++, and would like to learn how servers, databases and Internet based applications work so I could start developing them.
Where should I start? What should I learn first? What books would you recommend for me?
Thank you, in advance :)
I would start by either trying Tomcat which would let you create fairly basic web applications. I would start by playing around with either servlettes or JSPs. There is a lot documentation and examples.
Or you could start by downloading and playing around with a database. PostgreSQL is really good. It is free and they have a tool called pgadmin which is a really good ide.
Once you have been able to get these set up and working I would then start taking a look at some various frameworks that exist to make using these tools a lot easier. For example, you could take a look at Guice or Spring for dependency injection or a range of other tools. This is a comparison of each.
You will also probably want to also look into Velocity, Freemarker, or struts, or something similar. These will make your life a lot easier.
For the database you could look at: Hibernate or MyBatis, both are really good and function slightly differentially. Hibernate is very commonly used and they cache objects very efficiently.
I don't know what you mean by "cells", anyway you may start from open source technologies and their online docs, like Apache, MySQL, and PHP.

Simple standalone website checking tool

Background:
We run a content management platform that hosts 20+ separate websites - some intranets and some internet sites - so that have different end points routed for internal or external access.
We are currently upgrading our infrastructure - including software versions, hardware, changes of IP/VIP/DNS entries etc which affects all of the sites.
I want to be able to run a repeatable site test against all sites check everything is working fine and I'd like to do it from different end points (locally on each box in the cluster, from the cluster level, from the internet, from the intranet extra.
Anyone know of a simple tool that requires no sofware to install to run a repeatable regression test against a whole bunch of defined URL's?
I was thinking of a HTML page that I can run from different locations that is essentially a link checker.
Can anyone recommend a simple way to provide a level of automatic testing of our sites (in addition to our manual verification.
Thanks
Sounds like you're looking for Selenium: http://seleniumhq.org/
Edit
Wait, I think you mean 'Testing' them as in, check to see if they're online and reachable? Then I might just automate a series of ping or telnet commands, and check appropriate things. Would take a matter of minutes to write a little app in any language to do this.
There is all sorts of web site monitoring software available (check google, or ask for recos here). That's what you're looking for. There is a whole range from free to very expensive that monitor and stress your site from around the world.
Or you can write simple shell scripts that do what you want.
>> 'Testing' them as in, check to see if they're online and reachable?
Yes that's exactly it!! I was thinking the same - I could script something up but I thought I'd check first to see if someone has already done this - I guess not!
Thanks
Doesn't fit the "requires no sofware to install to run" part, and it's not necessarily super-cheap, but we've had great results with Radar Website Monitor for this kind of thing.

Resources