# how do you think to use PostgreSQL in the FreeBSD?



## linux-fox (Nov 27, 2008)

i am going to use PostgreSQL in the FreeBSD , who using it in the FreeBSD? how do you think it ?


----------



## Djn (Nov 27, 2008)

I've got 45 GB of data in PostgreSQL 8.2.9 at the moment, no problems.
Granted, it's got just one user (me), so this might not say much.


----------



## robbak (Nov 27, 2008)

Postgresql is the best SQL database available at present - certainly the best Open Source one, anyway.  With the current state of MySQL, i don't expect that to change any time soon. You've made the best choice.
The only reason to choose MySQL is if your application does not support postgres - and even then, you should consider changing your application, IMHO.

(Caution: we are in Holy War Territory here, and this post could be (miss?)construed as a 'first shot'. Beware: Here be Dragons!)


----------



## Djn (Nov 27, 2008)

More to the point, I seem to remember that Postgre runs quite well on FreeBSD. I don't have any numbers, but I'd be surprised if it was so far behind linux it was a problem.


----------



## alvis (Nov 27, 2008)

I read about
It has more than 15 years of active development.


----------



## susanth (Nov 27, 2008)

linux-fox said:
			
		

> i am going to use PostgreSQL...


This links may help you:
http://www-css.fnal.gov/dsg/external/freeware/pgsql-vs-mysql.html
http://phoemix.harmless.hu/dbtests/ (scroll down; there is a PostgreSQL test)


----------



## linux-fox (Dec 1, 2008)

thanks , everyone !


----------



## tomh009 (Dec 1, 2008)

robbak said:
			
		

> Postgresql is the best SQL database available at present - certainly the best Open Source one, anyway.  With the current state of MySQL, i don't expect that to change any time soon. You've made the best choice.
> 
> *The only reason to choose MySQL is if your application does not support postgres - and even then, you should consider changing your application, IMHO.*



If all you have is a hammer, everything tends to look like a nail.

There are countless applications for a relational database, and  saying that *any* single database is the "best" for them all demonstrates either naivetÃ© or a devotion on par with religion.

Understand your application, and evaluate your options in the context of your application requirements and behaviour.  Which admittedly may well be what the OP did prior to choosing PostgreSQL.


----------



## lyuts (Dec 7, 2008)

I prefer PostgreSQL to any other RDBMS. I have been using it for several years and had no problems. Great performance


----------



## hark (Dec 8, 2008)

The only problem I've had with PostGRES on FreeBSD is that PostGRES uses SysV IPC stuff, which gets disabled by default within a jail (since enabling it gives direct access to system memory, IIRC) -- so to run PostGRES inside a jail you effectively have to open up a fairly large security hole.

It's an acceptable solution for me since I'm using jails simply to isolate software packages (to keep machine maintenance sane) rather than for security reasons. Would be nice if there was an alternative solution though.


----------



## trasz@ (Dec 16, 2008)

hark said:
			
		

> The only problem I've had with PostGRES on FreeBSD is that PostGRES uses SysV IPC stuff, which gets disabled by default within a jail (since enabling it gives direct access to system memory, IIRC) -- so to run PostGRES inside a jail you effectively have to open up a fairly large security hole.



No, SysV IPC doesn't give access to the system memory.  It's just that for a long time it wasn't "jailed", i.e. the shared memory segments from the "unjailed" environment would be visible in all the jails, and this was worked around by disabling Sys5 IPC in jails.

I seem to remember that this was fixed some time ago.  Could you verify?  Just compare "ipcs" output inside the jail and outside.  Can you see the segments created outside (i.e. the ones belonging to the xserver) from inside the jail?


----------



## hark (Dec 16, 2008)

trasz@ said:
			
		

> I seem to remember that this was fixed some time ago.  Could you verify?  Just compare "ipcs" output inside the jail and outside.  Can you see the segments created outside (i.e. the ones belonging to the xserver) from inside the jail?


From within the PostGRES jail or the host machine --

```
Message Queues:
T           ID          KEY MODE        OWNER    GROUP   

Shared Memory:
T           ID          KEY MODE        OWNER    GROUP   
m      2293760      5432001 --rw------- pgsql    pgsql   

Semaphores:
T           ID          KEY MODE        OWNER    GROUP   
s      2293760      5432001 --rw------- pgsql    pgsql   
s      2293761      5432002 --rw------- pgsql    pgsql
```

From within an empty jail --

```
Message Queues:
T           ID          KEY MODE        OWNER    GROUP   

Shared Memory:
T           ID          KEY MODE        OWNER    GROUP   
m      2293760      5432001 --rw------- 70       70      

Semaphores:
T           ID          KEY MODE        OWNER    GROUP   
s      2293760      5432001 --rw------- 70       70      
s      2293761      5432002 --rw------- 70       70
```


```
hark@berrybell> uname -a
FreeBSD berrybell 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #0: Thu Nov 27 19:55:39 UTC 2008     hark@kirakishou.desudesudesu.org:/usr/obj/usr/src/sys/KIRAKISHOU  amd64
```

It doesn't look like it's fixed in RELENG_7_1 yet, at least. I don't think it's that big of a deal in most situations -- and it certainly doesn't matter in mine.


----------

