[Leaplist] curious about mysql vs postgres...
John Simpson
jms1 at jms1.net
Sat Oct 4 13:01:33 EDT 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 2008-10-01, at 2245, tom foster wrote:
> On Wed, 01 Oct 2008 21:13:42 -0400 Fred Moore <fmoor at fmeco.com> wrote:
>
>> what do you want to do with it
>
> Not much. I'll probably be setting up some forums in the near future.
> I've tried postgres once, mysql more often, and even sqlite, but I
> thought postgres was the big dog on the street and wondered if I
> should
> inflict myself with learning it...
the core SQL language is pretty much the same no matter what server
you use. the differences are in the things which the SQL standard
doesn't cover.
one example is looking at the schema (table layouts) of what's already
in a database. mysql has "show tables" to see a list of the table
names, and "describe tablename" to see a list of the fields within a
particular table. postgresql's "psql" command-line program uses "\d"
and "\d tablename" for the same things, which i personally find easier
to deal with.
for comparison, microsoft sql provides a GUI to look at the structure,
but if you need it programmatically (i.e. by sending a query of some
kind) then you have to do a SELECT query against their hidden tables
which store the information about field types and sizes.
the other nice thing about postgresql, at least for my own purposes,
is that it has a built-in data type for representing an IP address or
a block of IP's, as well as built-in operators to do things with them
(i.e. "SELECT * FROM rbl WHERE block <<= '200.0.0.0/7'" shows all
blocks where the IP address starts with 200 or 201.)
- --------------------------------------------------------
| John M. Simpson -- KG4ZOW -- Programmer At Large |
| http://www.jms1.net/ <jms1 at jms1.net> |
- --------------------------------------------------------
| Hope for America -- http://www.ronpaul2008.com/ |
- --------------------------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
iEYEARECAAYFAkjnoW4ACgkQj42MmpAUrRqHIQCeJKYlv/L1gt/WuS8UK13FaIhA
z10An158rBWYvaWqQbcvRmGynwyU/J1q
=+TVu
-----END PGP SIGNATURE-----
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
More information about the Leaplist
mailing list