Re: [GENERAL] Open source database design tool , alternative to MicroOLDAP

2009-09-11 Thread Ivano Luberti
We used power architect but not really satisfied with it.
Currently using Mogwai ERDesigner but still early to make an evaluation
even if seems really promising.

http://mogwai.sourceforge.net/?Welcome:ERDesigner_NG

Peter Hunsberger ha scritto:
> Check out Power Architect. Pre-major release, it has some bugs, but
> generally works well.  It can also forward and reverse engineer.
>
> 2009/9/10 NTPT :
>   
>> Hi all. is there available some freeware and/or opensource visual database
>> design tool for postgresql ? Something like commercial microOLAP ?
>>
>> thanx for help
>>
>> --
>> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-general
>>
>> 
>
>
>
>   

-- 
==
dott. Ivano Mario Luberti
Archimede Informatica societa' cooperativa a r. l.
Sede Operativa
Via Gereschi 36 - 56126- Pisa
tel.: +39-050- 580959
tel/fax: +39-050-9711344
web: www.archicoop.it
==


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


Re: [GENERAL] Installing postgresql on Debian Lenny-->my /etc/apt/sources.list.

2009-09-11 Thread Richard Huxton
Ricky Tompu Breaky wrote:
> Dear my friends,
> 
> I want to install PostgreSQL in my Debian Lenny box.
> 
> I can't install PostgreSQL with aptitude:
> "
> aptitude install postgresql
> ".

What Peter said, but you might also want to do "aptitude search
postgresql". That should find packages including "postgresql",
"postgresql-client", "postgresql-8.3", "postgresql-client-8.3".

-- 
  Richard Huxton
  Archonet Ltd

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


Re: [GENERAL] quick survey on schema less database usage

2009-09-11 Thread Andreas Wenk

rr04 wrote:

I am an MIT student doing a project on schema-less database usage and would
greatly appreciate if you guys can fill out a quick survey on this (should
take < 5 mins)

http://bit.ly/nosqldb


Hi,

even when I think that most of the people on this list will answer the 
same way to your survey, I would be really interested in the results. 
Can you post a link?


Cheers

Andy

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


Re: [GENERAL] Getting Out Parameter in the application using libpq

2009-09-11 Thread Merlin Moncure
On Fri, Sep 11, 2009 at 12:31 AM, Ehsan Haq  wrote:
>
> Hi,
>    I am looking for a way to get the OUT parameters of a FUNCTION/PROCEDURE 
> in my application (C++) using C libpq library. I can get the result set of an 
> OUT parameter having REFCURSOR data type through an explicit FETCH ALL from 
> "" but for OUT parameter of type integer/varchar I dont have a clue. Can 
> anyone tell me how it is done or suggest any work around for this?

name your cursor:  also, remember that your cursor is only good for
duration of transaction.

> Using the following code I can get the refcursor.
>
> CREATE OR REPLACE
> Function getAddresses
> (
> pName IN varchar2, outCursor refcursor

outCursor := 'outcur';

[...]

FETCH all FROM outcur;


see:
http://www.postgresql.org/docs/8.4/interactive/plpgsql-cursors.html#PLPGSQL-CURSOR-USING

merlin

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


[GENERAL] constraint definition on an array column?

2009-09-11 Thread Gauthier, Dave
Hi:

Is it possible to define a constraint that checks all elements of an array type 
column?

Example...

create table foo (asset text, owner_uids text[]);

I also have a  plperlu function that checks to see if a given uid is valid 
(returns a 0/1).  It's called validate_uid(text),  This function could be 
modified to handle a list of uids if that was needed.

I want something like...

constraint validate_all_owner_uids check (select validate_uid(owner_uid) = 1)

...but owner_uid is an array, not any one distinct value.

1) Is there a way to pass in a list for the plperlu to evaluate (return 0 
if any uid is invalid)?
2) Is there some sort of syntactical support for defining constraints on 
array columns?

Thanks in Advance!


Re: [GENERAL] Open source database design tool , alternative to MicroOLDAP

2009-09-11 Thread Thomas Kellerer

NTPT wrote on 11.09.2009 03:06:
Hi all. is there available some freeware and/or opensource visual 
database design tool for postgresql ? Something like commercial microOLAP ?


thanx for help

I like Power*Architect although it does have some quirks. 


I recently discovered another one, which also looks quite promising and a lot 
more mature than Power*Architect. It's called Open ModelSphere:
http://www.modelsphere.org/

Regards
Thomas




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


[GENERAL] return multiple rows

2009-09-11 Thread Rakotomandimby Mihamina

Hi all,
I have a FUNCTION queried like this:
  SELECT * FROM f_authorize_check_query2('%{SQL-User-Name}','%{User-Password}' 
[...];

Built this way:
  CREATE FUNCTION f_authorize_check_query2(...)  RETURNS radcheck
AS $_$
   DECLARE
   [...]
   v_ret radcheck%ROWTYPE;
   [...]
  SELECT  INTO v_ret '111',username,'Cleartext-Password',pwd,':=' FROM 
[...]
   RETURN v_ret;
   END;
  $_$
  LANGUAGE plpgsql;

It returns only one row, like this:
++--+++---+
| id | UserName | Attribute  | op | Value |
++--+++---+
| 1  | bartek   | Cleartext-Password | := | 1234  |
++--+++---+

I would like it to return
++--+++---+
| id | UserName | Attribute  | op | Value |
++--+++---+
| 1  | bartek   | Cleartext-Password | := | 1234  |
| 3  | bartek   | Simultaneous-Use   | := | 1 |
++--+++---+

*But*, I would like to _hardcode_ the "Simultaneous-Use" row.
If I use a FUNCTION to build the "Cleartext-Password" row, it's because the 
data structure
could not have been feetched simply.

Is SELECTing INTO a second time OK?

--
  Architecte Informatique chez Blueline/Gulfsat:
   Administration Systeme, Recherche & Developpement
   +261 34 29 155 34

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


Re: [GENERAL] return multiple rows

2009-09-11 Thread Rakotomandimby Mihamina

09/11/2009 05:53 PM, Rakotomandimby Mihamina:

Is SELECTing INTO a second time OK?


But I dont know how...
Any hint?

--
  Architecte Informatique chez Blueline/Gulfsat:
   Administration Systeme, Recherche & Developpement
   +261 34 29 155 34

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


Re: [GENERAL] return multiple rows

2009-09-11 Thread Raymond O'Donnell
On 11/09/2009 15:53, Rakotomandimby Mihamina wrote:
> 
> It returns only one row, like this:
> ++--+++---+
> | id | UserName | Attribute  | op | Value |
> ++--+++---+
> | 1  | bartek   | Cleartext-Password | := | 1234  |
> ++--+++---+
> 
> I would like it to return
> ++--+++---+
> | id | UserName | Attribute  | op | Value |
> ++--+++---+
> | 1  | bartek   | Cleartext-Password | := | 1234  |
> | 3  | bartek   | Simultaneous-Use   | := | 1 |
> ++--+++---+

You need to declare the function as returning SETOF radcheck, and then
use the RETURN NEXT construct - see the pl/pgsql docs here:

http://www.postgresql.org/docs/8.4/static/plpgsql-control-structures.html#PLPGSQL-STATEMENTS-RETURNING

There's an example here of how you do this.

> *But*, I would like to _hardcode_ the "Simultaneous-Use" row.
> If I use a FUNCTION to build the "Cleartext-Password" row, it's because
> the data structure
> could not have been feetched simply.

I'm not sure what you're getting at here.

Ray.


--
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
r...@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
--

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


Re: [GENERAL] constraint definition on an array column?

2009-09-11 Thread Merlin Moncure
On Fri, Sep 11, 2009 at 10:34 AM, Gauthier, Dave
 wrote:
> Hi:
>
> Is it possible to define a constraint that checks all elements of an array
> type column?
>
> Example...
>
>
>
> create table foo (asset text, owner_uids text[]);
>
>
>
> I also have a  plperlu function that checks to see if a given uid is valid
> (returns a 0/1).  It’s called validate_uid(text),  This function could be
> modified to handle a list of uids if that was needed.
>
>
>
> I want something like...
>
>
>
> constraint validate_all_owner_uids check (select validate_uid(owner_uid) =
> 1)
>
>
>
> ...but owner_uid is an array, not any one distinct value.
>
>
>
> 1) Is there a way to pass in a list for the plperlu to evaluate (return
> 0 if any uid is invalid)?
>
> 2) Is there some sort of syntactical support for defining constraints on
> array columns?

there doesn't have to be.  since a constraint can invoke a function
(preferably immutable), you can do anything you want regarding
validating the array.

merlin

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


[GENERAL] 8.3.7 server fails to start on Snow Leopard 10.6.1

2009-09-11 Thread erik
After updating to 10.6.1 this morning the postgresql 8.3 server (from
a macports installation) refuses to start.

It's stops with the message

"FATAL: incorrect checksum in control file"

Yesterday I was running postgresql server successfully the whole day
under 10.6 with no problems at all. I upgrade the postgresql
installation this morning to the 8.3. security update. This is all on
a MacBook5,1 which can only run the kernel in 32bit-mode.

Can it be that the Mac OS X 10.6.1 updated some library in the system
which caused an architecture change in postgres?

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


[GENERAL] Postgresql Hardware

2009-09-11 Thread Psicopunk
Hi,

We are developing a web application that will work on Postgresql. My
doubt is about the hardware that I can use for postgresql.

What HW is more important to postgresql performance?
Assuming that the database will have some load, what hardware must i
buy?


Thanks
Best regards

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


Re: [GENERAL] Postgresql Hardware

2009-09-11 Thread Vick Khera
On Fri, Sep 11, 2009 at 6:01 AM, Psicopunk  wrote:

> What HW is more important to postgresql performance?
> Assuming that the database will have some load, what hardware must i
> buy?


Generally, you put as much RAM as you can afford, and then buy the
fastest disks you can afford.

Any advice beyond that will depend on taking exact measurements of
your application load and finding the bottlenecks and then increasing
performance at those points.  Usually it is I/O that limits you, so
you can also optimize your application by adjusting your schema design
and your queries.

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


Re: [GENERAL] 8.3.7 server fails to start on Snow Leopard 10.6.1

2009-09-11 Thread Tom Lane
erik  writes:
> After updating to 10.6.1 this morning the postgresql 8.3 server (from
> a macports installation) refuses to start.

> It's stops with the message

> "FATAL: incorrect checksum in control file"

> Yesterday I was running postgresql server successfully the whole day
> under 10.6 with no problems at all. I upgrade the postgresql
> installation this morning to the 8.3. security update.

Well, you'd have to talk to whoever built the macports installation,
but it sure sounds like you got a 64-bit build of Postgres instead
of a 32-bit build, or perhaps vice versa.  "file" applied to the
postgres executable would tell you more.

> This is all on
> a MacBook5,1 which can only run the kernel in 32bit-mode.

32 vs 64 bit kernel has nothing to do with 32 vs 64 bit userland.

regards, tom lane

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


Re: [GENERAL] Postgresql Hardware

2009-09-11 Thread Bill Moran
In response to Vick Khera :

> On Fri, Sep 11, 2009 at 6:01 AM, Psicopunk  
> wrote:
> 
> > What HW is more important to postgresql performance?
> > Assuming that the database will have some load, what hardware must i
> > buy?
> 
> 
> Generally, you put as much RAM as you can afford, and then buy the
> fastest disks you can afford.

More specifically, for high loads, get fast SCSI or SAS disks, directly
attached, and arrange them in a RAID-10.

Whether or not such a setup is overkill (sometimes it is) depends on
how much load you're really generating.  But (as Vick stated) DB servers
are usually bottlenecked on how fast they can access the disks, not RAM
or CPU.

-- 
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

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


[GENERAL] Solaris 9 upgrade to Solaris 10

2009-09-11 Thread VANOLE, MICHAEL J (ATTSI)
Hi,

We are running Pg 8.2.6 on sparc-sun-solaris2.9 compiled by gcc 3.4.6.

We are planning a server software upgrade to Solaris 10 (binaries and
kernel, etc). 

Has anyone done this, and were there problems when trying to start up
postmaster after the upgrade?

Thank you in advance,
Mike
 

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


Re: [GENERAL] Postgresql Hardware

2009-09-11 Thread Ben Chobot
How much reading? Writing? Concurrent transactions? How much data will 
you have? These are some of the things you need to provide to get a 
reasonable answer.


Psicopunk wrote:

Hi,

We are developing a web application that will work on Postgresql. My
doubt is about the hardware that I can use for postgresql.

What HW is more important to postgresql performance?
Assuming that the database will have some load, what hardware must i
buy?


Thanks
Best regards

  


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


Re: [GENERAL] Postgresql Hardware

2009-09-11 Thread Psicopunk
On 11 Set, 17:59, vi...@khera.org (Vick Khera) wrote:
> On Fri, Sep 11, 2009 at 6:01 AM, Psicopunk  
> wrote:
> > What HW is more important to postgresql performance?
> > Assuming that the database will have some load, what hardware must i
> > buy?
>
> Generally, you put as much RAM as you can afford, and then buy the
> fastest disks you can afford.
>
> Any advice beyond that will depend on taking exact measurements of
> your application load and finding the bottlenecks and then increasing
> performance at those points.  Usually it is I/O that limits you, so
> you can also optimize your application by adjusting your schema design
> and your queries.
>
> --
> Sent via pgsql-general mailing list (pgsql-gene...@postgresql.org)
> To make changes to your 
> subscription:http://www.postgresql.org/mailpref/pgsql-general



How can i take some measurements to understand what bottlenecks will
appear?

This application will be always writing to database. How can i measure
the load at the database?
Can i tune the database depending on the hardware that i will buy?

Thanks for your help.
Best regards.

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


Re: [GENERAL] Postgresql Hardware

2009-09-11 Thread Alan McKay
> How can i take some measurements to understand what bottlenecks will
> appear?

For long-term / ongoing I'm very happy so far with a package called
munin.  Google it and join their mailing list for help setting it up.

But it takes snapshots at 5 minute intervals and this is not configurable.

For immediate-term and for doing load tests, I've been very happy with
sar/sadc from the "sysstat" package that you can get from yum.  And
also a package called ksar that you can google and download.

From our wiki :

---snip---

Before starting your load test, start this command on all boxes you
want to monitor

 /usr/lib/sa/sadc -d -I -F 2 /var/log/foo/bar

or on a 64 bit box

 /usr/lib64/sa/sadc -d -I -F 2 /var/log/foo/bar

It will log system stats at 2 second intervals, until you control-C it.

Then you can view the file in kSar.

   * go to "File" then "New Window"
   * from the new window go to "Data", "Local Command"
   * enter the command sar -A -f /var/log/foo/bar

That's it! Now you will have some pretty graphs to look at!

-- 
“Don't eat anything you've ever seen advertised on TV”
 - Michael Pollan, author of "In Defense of Food"

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


Re: [GENERAL] Postgresql Hardware

2009-09-11 Thread Chris Barnes

 

 

Purchase solid equipment and fairly current machines.

We buy referbished system at a fraction of the cost of new.

 

For example;

IBM 3650 with 8 x 300g SAS drives and controller, 4 slot dual with the 
following specs. 16 gb memory.

model name  : Intel(R) Xeon(R) CPU   E5345  @ 2.33GHz
cache size  : 4096 KB

 

This will probably cost ~  between $5000 & $8000

 

Set the drives up raid 1 and 5 for os/logs and data and global hotspare. Some 
prefer raid 10 if you have lots of drives.

 

This should give you 300g for os/logs and 600g for data.

 

Chris

 
> From: gil.nunes.rese...@gmail.com
> Subject: [GENERAL] Postgresql Hardware
> Date: Fri, 11 Sep 2009 03:01:29 -0700
> To: pgsql-general@postgresql.org
> 
> Hi,
> 
> We are developing a web application that will work on Postgresql. My
> doubt is about the hardware that I can use for postgresql.
> 
> What HW is more important to postgresql performance?
> Assuming that the database will have some load, what hardware must i
> buy?
> 
> 
> Thanks
> Best regards
> 
> -- 
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

_
Click less, chat more: Messenger on MSN.ca
http://go.microsoft.com/?linkid=9677404

Re: [GENERAL] Installing postgresql on Debian Lenny-->my /etc/apt/sources.list.

2009-09-11 Thread Ricky Tompu Breaky
Dear Peter Eisentraut.

My aptitude still can not find it.

Please keep telling me.

Thank you very much in advance.

Here is the output of my postgres installation attempt with aptitude and
my current '/etc/apt/sources.list':
"
lenny:/etc/apt# dpkg-reconfigure gforge-db-postgresql
lenny:/etc/apt# aptitude install postgresql-8.3 postgresql-client-8.3
postgresql-client Reading package lists... Done
Building dependency tree   
Reading state information... Done
Reading extended state information  
Initializing package states... Done
Reading task descriptions... Done  
The following partially installed packages will be configured:
  gforge-web-apache2 
0 packages upgraded, 0 newly installed, 0 to remove and 199 not
upgraded. Need to get 0B of archives. After unpacking 0B will be used.
Writing extended state information... Done
Setting up gforge-web-apache2 (4.7~rc2-7lenny1) ...
Calculating defaults
Reading defaults from /etc/gforge/gforge.conf
Creating /etc/gforge/gforge.conf
SSL Enabled
Creating /etc/gforge/httpd.conf
Creating /etc/gforge/httpd.secrets
Creating /etc/gforge/local.inc
Creating other includes
DBI connect('dbname=gforge','gforge',...) failed: could not connect to
server: No such file or directory Is the server running locally and
accepting connections on Unix domain socket
"/var/run/postgresql/.s.PGSQL.5432"? at /usr/lib/gforge/lib/include.pl
line 37 Error while connecting to database:
at /usr/lib/gforge/lib/include.pl line 39. dpkg: error processing
gforge-web-apache2 (--configure): subprocess post-installation script
returned error exit status 255 Errors were encountered while
processing: gforge-web-apache2 E: Sub-process /usr/bin/dpkg returned an
error code (1) A package failed to install.  Trying to recover:
Reading package lists... Done 
Building dependency tree   
Reading state information... Done
Reading extended state information  
Initializing package states... Done
Reading task descriptions... Done  

lenny:/etc/apt# 
"

my '/etc/apt/sources.list':
# 
# deb cdrom:[Debian GNU/Linux 5.0.2 _Lenny_ - Official i386 NETINST
Binary-1 20090629-11:06]/ lenny main

#deb cdrom:[Debian GNU/Linux 5.0.2 _Lenny_ - Official i386 NETINST
Binary-1 20090629-11:06]/ lenny main

deb http://ftp.de.debian.org/debian/ lenny main
deb-src http://ftp.de.debian.org/debian/ lenny main

deb http://security.debian.org/ lenny/updates main
deb-src http://security.debian.org/ lenny/updates main

deb http://volatile.debian.org/debian-volatile lenny/volatile main
deb-src http://volatile.debian.org/debian-volatile lenny/volatile main

deb http://ftp2.de.debian.org/debian/ lenny main non-free
deb-src http://ftp2.de.debian.org/debian/ lenny main non-free

deb http://security.debian.org/ lenny/updates main non-free
deb-src http://security.debian.org/ lenny/updates main non-free

deb http://www.lamaresh.net/apt lenny main

deb http://dl.google.com/linux/deb/ stable non-free

deb http://download.skype.com/linux/repos/debian/ stable non-free

deb ftp://ftp.it.debian.org/debian/ lenny main contrib non-free
deb-src ftp://ftp.it.debian.org/debian/ lenny main contrib non-free
deb ftp://ftp.it.debian.org/debian/ lenny-proposed-updates main contrib
non-free deb-src ftp://ftp.it.debian.org/debian/ lenny-proposed-updates
main contrib non-free

deb http://deb.opera.com/opera/ stable non-free

deb http://pkg-voip.buildserver.net/debian etch main

deb http://mirror.noreply.org/pub/tor lenny main
deb-src http://mirror.noreply.org/pub/tor lenny main

deb http://javadesktop.org/lg3d/debian stable contrib
deb http://ftp.bononia.it/debian lenny main contrib non-free
deb http://ftp.bononia.it/debian lenny-proposed-updates main contrib
non-free

deb http://ftp.debian.org/debian/ lenny main contrib non-free

===
On Fri, 11 Sep 2009 09:56:33 +0300
Peter Eisentraut  wrote:

> On Fri, 2009-09-11 at 13:17 +0700, Ricky Tompu Breaky wrote:
> > It seems that the aptitude can not find the postgresql.
> 
> Please post the exact output from the screen.
> 
> 
> 


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


Re: [GENERAL] Postgresql Hardware

2009-09-11 Thread Scott Marlowe
On Fri, Sep 11, 2009 at 12:35 PM, Chris Barnes
 wrote:
>
>
> Purchase solid equipment and fairly current machines.
> We buy referbished system at a fraction of the cost of new.
>
> For example;
> IBM 3650 with 8 x 300g SAS drives and controller, 4 slot dual with the
> following specs. 16 gb memory.
> model name  : Intel(R) Xeon(R) CPU   E5345  @ 2.33GHz
> cache size  : 4096 KB
>
> This will probably cost ~  between $5000 & $8000

I can get that new with a 5 year warranty for about $7000 from
Aberdeen.  That's with a $1,000 RAID controller thrown in the mix.
dual QC opties or xeons.

> Set the drives up raid 1 and 5 for os/logs and data and global
> hotspare. Some prefer raid 10 if you have lots of drives.

Never RAID-5.  never. A big single RAID-10 on a good battery backed
caching controller will stomp any combination with RAID-5 into the
ground.  On a machine with

Note that on an 8 drive machine, I make one big RAID-10 out of 6 for
everything, and have 2 hot spares for redundancy.That gives 900G
total to play around with if you have 300G SAS drives.

For about $8000 more you can get a 16 drive machine with 146G drives
and same basic setup, which I would recommend over the 8 drive
machine.  With 2 hot spares, and 2 in a mirror for the OS/xlog you
still have 12 drives for a RAID-10 of nothing but the db, and that
makes a huge difference.

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


Re: [GENERAL] Postgresql Hardware

2009-09-11 Thread Scott Marlowe
On Fri, Sep 11, 2009 at 3:53 PM, Scott Marlowe  wrote:
> For about $8000 more you can get a 16 drive machine with 146G drives
> and same basic setup, which I would recommend over the 8 drive
> machine.  With 2 hot spares, and 2 in a mirror for the OS/xlog you
> still have 12 drives for a RAID-10 of nothing but the db, and that
> makes a huge difference.

remove the more up there, just for $8000, you can get...

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


[GENERAL] Loop

2009-09-11 Thread db . subscriptions

Hi,

I have a loop of the form:

	FOR rec IN SELECT code FROM staff WHERE shiftgroup = NEW.groupe ORDER  
BY code LOOP

WHILE sdate <= NEW.todate LOOP
			SELECT INTO starty,endy,nday resumetime,closetime,nextday FROM  
shifts WHERE shift = NEW.shift;

restime := sdate + starty;

IF nday = true THEN
clstime := sdate + interval '1 day' + endy;
ELSE
clstime := sdate + endy;
END IF;

			INSERT INTO shiftsexp(id,staff,resumetime,closetime)  
VALUES(NEW.id,rec.code,restime,clstime);

sdate := sdate + interval '1 day';
END LOOP;
END LOOP;

Surprisingly, the outer loop (For .. Loop) does not loop while only  
the WHILE ... Loop works.


Any hint would be appreciated.

Regards,
Chris.

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


[GENERAL] Issue regarding permissions on Windows 2003 server

2009-09-11 Thread Vikram Patil
Hello Folks,

 

On windows 2003 server , if I try to run initdb with -D , -U ,
-A password & --pwfile = password file options it fails.At the time of
try , I was logged in as Domain \ username .  My aim is to initialize db
with using same domain user which is currently logged in.  Same attempt
on Windows XP went through without any problem. I even tried to create
data directory separately and then tried to use it as argument to
initdb. But it failed too .Is there anything changed security point of
view  between Windows XP and Windows 2003 Server ? Please provide me
some idea on this. 

 

 

Thanks & Regards,

Vikram



Re: [GENERAL] Getting Out Parameter in the application using libpq

2009-09-11 Thread Ehsan Haq
Hi,

   I still don't get. How can I get the varchar OUT parameter in the 
application? For Example



CREATE OR REPLACE

Function getOutVarchar(outvarchar OUT varchar2) RETURN NUMBER

IS

BEGIN

   outvarchar:='This is Out String';

   RETURN 1;

END getOutVarchar;



iris=> SELECT getOutVarchar('outVar');

 getoutvarchar

---

 1

(1 row)


My question is how can I Select "outVar" so that it is available in my 
application as a resultset.



Thanks

Ehsan



--- On Fri, 9/11/09, Merlin Moncure  wrote:

From: Merlin Moncure 
Subject: Re: [GENERAL] Getting Out Parameter in the application using libpq
To: "Ehsan Haq" 
Cc: pgsql-general@postgresql.org
Date: Friday, September 11, 2009, 12:08 PM

On Fri, Sep 11, 2009 at 12:31 AM, Ehsan Haq  wrote:
>
> Hi,
>    I am looking for a way to get the OUT parameters of a FUNCTION/PROCEDURE 
> in my application (C++) using C libpq library. I can get the result set of an 
> OUT parameter having REFCURSOR data type through an explicit FETCH ALL from 
> "" but for OUT parameter of type integer/varchar I dont have a clue. Can 
> anyone tell me how it is done or suggest any work around for this?

name your cursor:  also, remember that your cursor is only good for
duration of transaction.

> Using the following code I can get the refcursor.
>
> CREATE OR REPLACE
> Function getAddresses
> (
> pName IN varchar2, outCursor refcursor

outCursor := 'outcur';

[...]

FETCH all FROM outcur;


see:
http://www.postgresql.org/docs/8.4/interactive/plpgsql-cursors.html#PLPGSQL-CURSOR-USING

merlin

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



  

[GENERAL] Regarding initdb & pg_ctl

2009-09-11 Thread Vikram Patil
Hello Folks,

 

   So I have following problem as I logged in Windows 2003 with
domain\user. I am basically trying to create installer for postgres. So
I need to keep in mind that  person who is going to install can be the
one who is currently logged in. 

 

So I tried to change permissions on data directory so that initdb will
run fine. I changed creator owner privileges to be read and execute
using XACLS then ran initdb. It populated directory correctly  But when
I used pg_ctl to start up service it failed saying 

"FATAL:  XX000: C:/Program Files/PostgreSQL/8.4/bin/postgres.exe: could
not locate matching postgres executable

, .\src\backend\postmaster\postmaster.c:1070 ..."

 

Please provide some inputs how to tackle with this permission issues.
Thanks in advance

 

Thanks & Regards,

Vikram



[GENERAL] Alternative to temp tables?

2009-09-11 Thread Postgres User
Hi,

I have a simple function that returns a set of rows:

CREATE OR REPLACE FUNCTION foo()
  RETURNS SETOF record AS
$$
BEGIN
RETURN QUERY SELECT * FROM people WHERE last_name = 'jones';
END
$$
LANGUAGE 'plpgsql'

In a separate function, I call the function and store the results in a
temp table using this syntax:

INSERT INTO tmp_tbl SELECT * FROM foo()


This works, but I'd like to know if there's another way to hold the
results.  Can I get the results from foo() and store those in a local
var such as

recs record[]   OR
recs people[]

Or are temp tables the only way to hold table-based results?

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


Re: [GENERAL] Alternative to temp tables?

2009-09-11 Thread Scott Marlowe
On Sat, Sep 12, 2009 at 12:51 AM, Postgres User
 wrote:
> Hi,
>
> I have a simple function that returns a set of rows:
>
> CREATE OR REPLACE FUNCTION foo()
>  RETURNS SETOF record AS
> $$
> BEGIN
>    RETURN QUERY SELECT * FROM people WHERE last_name = 'jones';
> END
> $$
> LANGUAGE 'plpgsql'
>
> In a separate function, I call the function and store the results in a
> temp table using this syntax:
>
> INSERT INTO tmp_tbl SELECT * FROM foo()
>
>
> This works, but I'd like to know if there's another way to hold the
> results.  Can I get the results from foo() and store those in a local
> var such as
>
> recs record[]   OR
> recs people[]
>
> Or are temp tables the only way to hold table-based results?

Nope, starting with pg 8.4 you can create temp result sets with the
WITH keyword.

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