<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="http://www.designmagick.com/templates/newdesign/rssdisplay.xslt" type="text/xsl" ?>
<rss version="2.0">
  <channel>
	<title>PostgreSQL &amp; PHP Tutorials - Rss Feeds</title>
	<link>http://www.designmagick.com/rss.php</link>
	<description />
	<language>en-us</language>
	<generator>MyCMS (copyright DesignMagick)</generator>
	<webMaster>chris@designmagick.com</webMaster>
	<lastBuildDate>Tue, 09 Feb 2010 01:01:18 -0500</lastBuildDate>
	<ttl>20</ttl>

	<item>
  <title>Database Design Issues</title>
  <link>http://www.designmagick.com/blogs/37/Database-Design-Issues</link>
  <description>Creating a good database design takes some thought. Sometimes, a normalized database won't perform the way you want it. Using some features of postgresql, you could get your performance back.&lt;br /&gt;
&lt;br /&gt;
I decided to use some functions and triggers to keep queries nice and simple, but not lose any functionality and keep data redundancy to a minimum.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.designmagick.com/article/36/Forum-Project/Database-Design-Issues&quot; target=&quot;_blank&quot;&gt;Read more..&lt;/a&gt;&lt;br /&gt;
</description>
  <pubDate>Thu, 20 Apr 2006 10:15:52 -0400</pubDate>
  <author>chris@designmagick.com (Chris Smith)</author>
  <guid>http://www.designmagick.com/blogs/37/Database-Design-Issues</guid>
</item>
<item>
  <title>Introduction to Database Joins</title>
  <link>http://www.designmagick.com/article/32/Introduction-to-Database-Joins</link>
  <description>Database joins are an essential skill to learn, whether it's using PostgreSQL or any other database management system.</description>
  <pubDate>Sun, 02 Apr 2006 08:34:24 -0400</pubDate>
  <author>chris@designmagick.com (Chris Smith)</author>
  <guid>http://www.designmagick.com/article/32/Introduction-to-Database-Joins</guid>
</item>
<item>
  <title>PostgreSQL Enum Types</title>
  <link>http://www.designmagick.com/article/29/PostgreSQL-Enum-Types</link>
  <description>An enum datatype allows only certain values to be entered into a particular field (for example - 'red', 'blue', 'yellow', 'purple' for favourite colours).&lt;br /&gt;
&lt;br /&gt;
Postgresql doesn't have an enum datatype, but we can emulate it quickly and easily.&lt;br /&gt;
&lt;br /&gt;
Instead of an enum type we can set up a CHECK CONSTRAINT - this tells postgresql to make sure that the value we are entering is valid.&lt;br /&gt;
&lt;br /&gt;
CREATE TABLE person (&lt;br /&gt;
  personid int not null primary key,&lt;br /&gt;
  favourite_colour varchar(255) NOT NULL,&lt;br /&gt;
  CHECK (favourite_colour IN ('red', 'blue', 'yellow', 'purple'))&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
Now that's done, let's check it works:&lt;br /&gt;
&lt;br /&gt;
test=# insert into person(personid, favourite_colour) values (1, 'red');&lt;br /&gt;
INSERT 0 1&lt;br /&gt;
&lt;br /&gt;
Now for something not in the list:&lt;br /&gt;
&lt;br /&gt;
test=# insert into person(personid, favourite_colour) values (2, 'green');&lt;br /&gt;
ERROR:  new row for relation &quot;person&quot; violates check constraint &quot;person_favourite_colour_check&quot;&lt;br /&gt;
&lt;br /&gt;
Done! Nice and easy!</description>
  <pubDate>Sun, 26 Mar 2006 07:22:55 -0500</pubDate>
  <author>chris@designmagick.com (Chris Smith)</author>
  <guid>http://www.designmagick.com/article/29/PostgreSQL-Enum-Types</guid>
</item>
<item>
  <title>Introduction to Full Text Indexing</title>
  <link>http://www.designmagick.com/article/27/Introduction-to-Full-Text-Indexing</link>
  <description>Full text indexing in postgresql is a little more complicated to set up compared to other databases.&lt;br /&gt;
&lt;br /&gt;
This is a quick introduction on how to install it, how to set it up and how to keep it up to date.&lt;br /&gt;
</description>
  <pubDate>Sun, 26 Mar 2006 07:00:14 -0500</pubDate>
  <author>chris@designmagick.com (Chris Smith)</author>
  <guid>http://www.designmagick.com/article/27/Introduction-to-Full-Text-Indexing</guid>
</item>
<item>
  <title>Using Explain</title>
  <link>http://www.designmagick.com/article/23/Using-Explain</link>
  <description>Now that you've set up a database, you need to check it's being utilized properly.&lt;br /&gt;
&lt;br /&gt;
Using 'Explain' to check your queries are using an index is a good way to do it. Here's a quick introduction in to reading the output.&lt;br /&gt;
</description>
  <pubDate>Sun, 05 Mar 2006 07:31:47 -0500</pubDate>
  <author>chris@designmagick.com (Chris Smith)</author>
  <guid>http://www.designmagick.com/article/23/Using-Explain</guid>
</item>
<item>
  <title>Calculating database size</title>
  <link>http://www.designmagick.com/article/19/Calculating-database-size</link>
  <description>Postgresql creates directories to keep each database in. These directories aren't names, they are kept as the 'OID's of each database (oid's are &quot;object identifiers&quot;). This saves issues when you rename databases etc.&lt;br /&gt;
&lt;br /&gt;
How then do you find out a databases size?&lt;br /&gt;
&lt;br /&gt;
There is a &quot;contrib&quot; module called 'dbsize' which can do it for you. These modules don't get installed by default but allow extra functionality quite easily.&lt;br /&gt;
&lt;br /&gt;
See the documentation for details on how to use it.&lt;br /&gt;
</description>
  <pubDate>Sat, 25 Feb 2006 02:57:40 -0500</pubDate>
  <author>chris@designmagick.com (Chris Smith)</author>
  <guid>http://www.designmagick.com/article/19/Calculating-database-size</guid>
</item>
<item>
  <title>How to index a database</title>
  <link>http://www.designmagick.com/article/16/How-to-index-a-database</link>
  <description>Database indexing can be quite tricky. Here is a basic guide on how to get started with it, when you should index and when you shouldn't.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Written for &lt;a href=&quot;http://www.interspire.com&quot; target=&quot;_blank&quot;&gt;Interspire&lt;/a&gt;</description>
  <pubDate>Wed, 15 Feb 2006 04:17:23 -0500</pubDate>
  <author>chris@designmagick.com (Chris Smith)</author>
  <guid>http://www.designmagick.com/article/16/How-to-index-a-database</guid>
</item>
<item>
  <title>Showing Running Queries</title>
  <link>http://www.designmagick.com/article/15/Showing-Running-Queries</link>
  <description>Newer versions of PostgreSQL have a 'pg_stat_activity' view to show you who is currently connected to your database system.&lt;br /&gt;
&lt;br /&gt;
By default, this doesn't show you the queries being run.&lt;br /&gt;
&lt;br /&gt;
How do you show that?&lt;br /&gt;
&lt;br /&gt;
Edit your postgresql.conf file and add (or uncomment):&lt;br /&gt;
&lt;br /&gt;
stats_command_string = true&lt;br /&gt;
&lt;br /&gt;
and restart postgresql.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
See &lt;a href=&quot;http://www.postgresql.org/docs/current/static/runtime-config-statistics.html&quot; target=&quot;_blank&quot;&gt;official documentation&lt;/a&gt; for more information.&lt;br /&gt;
&lt;br /&gt;
(This is practically equivalent to the mysql 'show processlist' command).&lt;br /&gt;
</description>
  <pubDate>Wed, 15 Feb 2006 01:11:33 -0500</pubDate>
  <author>chris@designmagick.com (Chris Smith)</author>
  <guid>http://www.designmagick.com/article/15/Showing-Running-Queries</guid>
</item>
<item>
  <title>PostgreSQL Query Timing</title>
  <link>http://www.designmagick.com/article/14/PostgreSQL-Query-Timing</link>
  <description>How do you know how long a query took?&lt;br /&gt;
&lt;br /&gt;
PostgreSQL lets you time the queries and print the output in your psql session.&lt;br /&gt;
&lt;br /&gt;
Create a $HOME/.psqlrc file with:&lt;br /&gt;
&lt;br /&gt;
\timing&lt;br /&gt;
&lt;br /&gt;
in it and next time you log in to a psql session, PostgreSQL will show you how long the query took!&lt;br /&gt;
&lt;br /&gt;
Doing it this way means every time you log in, it will happen.&lt;br /&gt;
&lt;br /&gt;
To turn it off, at the psql prompt, type it again:&lt;br /&gt;
&lt;br /&gt;
testing=&gt; \timing&lt;br /&gt;
Timing is off.&lt;br /&gt;
&lt;br /&gt;
or remove it from your $HOME/.psqlrc file.&lt;br /&gt;
</description>
  <pubDate>Wed, 15 Feb 2006 01:06:27 -0500</pubDate>
  <author>chris@designmagick.com (Chris Smith)</author>
  <guid>http://www.designmagick.com/article/14/PostgreSQL-Query-Timing</guid>
</item>
<item>
  <title>Introduction to Database Datatypes</title>
  <link>http://www.designmagick.com/article/8/Introduction-to-Database-Datatypes</link>
  <description>Databases can store lots of different data in quite a few different ways. This guide shows some of the basic and common types you'll run across and how to pick which type is the right one to use.&lt;br /&gt;
&lt;br /&gt;
Written for &lt;a href=&quot;http://www.interspire.com&quot; target=&quot;_blank&quot;&gt;Interspire&lt;/a&gt;</description>
  <pubDate>Tue, 07 Feb 2006 05:31:58 -0500</pubDate>
  <author>chris@designmagick.com (Chris Smith)</author>
  <guid>http://www.designmagick.com/article/8/Introduction-to-Database-Datatypes</guid>
</item>


  </channel>
</rss>
