Re: [GENERAL] Best way to store case-insensitive data?

2010-06-10 Thread Adrian von Bidder
Heyho! On Thursday 10 June 2010 22.50:23 Mike Christensen wrote: > 2) Every time the user updates or saves their email, store it in > lowercase, and every time I lookup an email, pass in a lowercase > email. I'd do it this way. Plus either a CHECK condition on the table (email = lowercase(email

Re: [GENERAL] database response slows while pg_dump is running (8.4.2)

2010-06-10 Thread Adrian von Bidder
Heyho! On Thursday 10 June 2010 23.49:58 Aleksey Tsalolikhin wrote: > 3. We ARE disk bound. Disk utilization goes to 94% during > the dump. There is an order of magnitude more reads than > writes. Just speculation, I've not tried this. Perhaps pipe the output of pg_dump through a software tha

Re: [GENERAL] Best way to store case-insensitive data?

2010-06-10 Thread Scott Marlowe
On Thu, Jun 10, 2010 at 3:34 PM, Mike Christensen wrote: > From this site: > > http://developer.postgresql.org/pgdocs/postgres/citext.html > > I couldn't tell if you still had to create an index on the lower case > value.  It seems that it basically mimics the WHERE LOWER(email) = > LOWER(?) metho

Re: [GENERAL] Best way to store case-insensitive data?

2010-06-10 Thread Scott Marlowe
On Thu, Jun 10, 2010 at 3:16 PM, Mike Christensen wrote: > Where do I get info on installing this? Very much depends on OS and how you installed pgsql -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/p

Re: [GENERAL] Enforcing password standards

2010-06-10 Thread Stephen Frost
* DM (dm.a...@gmail.com) wrote: > How to force postgres users to follow password standards and renewal > policies? It's not trivial, sadly. Regarding renewal, you can use the 'valid until' role parameter to implement a "only good until" mechanism, and then update that using a security definer fun

Re: [GENERAL] database response slows while pg_dump is running (8.4.2)

2010-06-10 Thread Scott Marlowe
On Thu, Jun 10, 2010 at 3:22 PM, Andy Colson wrote: > On 6/10/2010 3:25 PM, Aleksey Tsalolikhin wrote: >> >> PostgreSQL 8.4.2 response time slows during pg_dump of a 14 GB database. >> >> Specifically, I am monitoring how long it takes to login to our Web >> app - usually under 2 seconds, but when

Re: [GENERAL] database response slows while pg_dump is running (8.4.2)

2010-06-10 Thread Greg Smith
Aleksey Tsalolikhin wrote: Is there any way I can keep my response fast but still get my pg_dump? http://wiki.postgresql.org/wiki/Priorities covers the usual techniques you might use to slow down your pg_dump to where it doesn't impact the main server as much. Or should I move my pg_dum

Re: [GENERAL] Best way to store case-insensitive data?

2010-06-10 Thread Mike Christensen
>From this site: http://developer.postgresql.org/pgdocs/postgres/citext.html I couldn't tell if you still had to create an index on the lower case value. It seems that it basically mimics the WHERE LOWER(email) = LOWER(?) method. Since this part is incredibly performance critical, maybe I'm bet

Re: [GENERAL] Enforcing password standards

2010-06-10 Thread Scott Marlowe
On Thu, Jun 10, 2010 at 7:01 PM, DM wrote: > How to force postgres users to follow password standards and renewal > policies? Use some form of external authentication. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgres

Re: [GENERAL] Postgresql packages in Solaris

2010-06-10 Thread Scott Marlowe
On Thu, Jun 10, 2010 at 9:46 AM, Paul Baker wrote: > > All, > > I received this question from a customer yesterday (below), and unfortunately > I do not have the answer. Please let us know if you know the answer, it > would be greatly appreciated... > > "What we are trying to figure out is if r

Re: [GENERAL] Cognitive dissonance

2010-06-10 Thread John Gage
Like all visitors from the Crab Nebula (except our leaders who are genetically separate) I qualify as a novice when it comes to Postgres. What is more, the people (humans, that is) who need the documentation the most are those who, well, need the documentation the most. Hence, if this we

Re: [GENERAL] database response slows while pg_dump is running (8.4.2)

2010-06-10 Thread Stephen Frost
* Aleksey Tsalolikhin (atsaloli.t...@gmail.com) wrote: > I am moving the pg_dump process to a Slony slave. Good idea. > Good point. I tried that, actually, but was still disk-bound. > (Mostly read activity.) You could maybe try ionice'ing the PG process that is the pg_dump connection... Identi

[GENERAL] Enforcing password standards

2010-06-10 Thread DM
How to force postgres users to follow password standards and renewal policies? Thanks Deepak

Re: [GENERAL] database response slows while pg_dump is running (8.4.2)

2010-06-10 Thread Andy Colson
On 6/10/2010 4:28 PM, Scott Marlowe wrote: On Thu, Jun 10, 2010 at 3:22 PM, Andy Colson wrote: On 6/10/2010 3:25 PM, Aleksey Tsalolikhin wrote: PostgreSQL 8.4.2 response time slows during pg_dump of a 14 GB database. Specifically, I am monitoring how long it takes to login to our Web app - u

Re: [GENERAL] Postgresql packages in Solaris

2010-06-10 Thread Scott Marlowe
On Thu, Jun 10, 2010 at 3:29 PM, John R Pierce wrote: > Scott Marlowe wrote: >> >> On Thu, Jun 10, 2010 at 2:35 PM, John R Pierce >> wrote: >> >>> >>> It appears (using the public Sunsolve patchfinder) that the newest >>> version >>> of PostgreSQL 8.3 that Sun has a patch for is 8.3.9 (138826-06

Re: [GENERAL] Best way to store case-insensitive data?

2010-06-10 Thread Steve Atkins
On 6/10/2010 3:50 PM, Mike Christensen wrote: > I have a column called "email" that users login with, thus I need to > be able to lookup email very quickly. The problem is, emails are > case-insensitive. I want f...@bar.com to be able to login with > f...@bar.com as well. There's two ways of d

Re: [GENERAL] Postgresql packages in Solaris

2010-06-10 Thread John R Pierce
Scott Marlowe wrote: On Thu, Jun 10, 2010 at 2:35 PM, John R Pierce wrote: It appears (using the public Sunsolve patchfinder) that the newest version of PostgreSQL 8.3 that Sun has a patch for is 8.3.9 (138826-06 or 138827-06), while 8.3.11 has been out for about a month now, and fixes thes

Re: [GENERAL] PL/pgSQL nested functions

2010-06-10 Thread Scott Marlowe
On Thu, Jun 10, 2010 at 2:23 PM, wrote: > > Are there any plans to allow PL/pgSQL functions to be nested like Oracle > allows with PL/SQL procedures? > > If not, what are the best ways to convert PL/SQL nested procedures to > PL/pgSQL? Well you can call one function from another, so I'd do that.

Re: [GENERAL] Best way to store case-insensitive data?

2010-06-10 Thread Mike Christensen
Where do I get info on installing this? On Thu, Jun 10, 2010 at 2:15 PM, Scott Marlowe wrote: > On Thu, Jun 10, 2010 at 2:50 PM, Mike Christensen wrote: >> I have a column called "email" that users login with, thus I need to >> be able to lookup email very quickly.  The problem is, emails are >>

Re: [GENERAL] Re: Error on Windows server could not open relation base/xxx/xxx Permission denied

2010-06-10 Thread John T. Dow
Here's the current status. We installed postgres on an XP machine, 2002 SP3. (Same as my computer, which never has a problem.) We tried to do a backup of the database on the old computer, to copy the data to the new computer. The backup failed with the same problem mentioned in the subject lin

Re: [GENERAL] Postgresql packages in Solaris

2010-06-10 Thread John R Pierce
Paul Baker wrote: All, I received this question from a customer yesterday (below), and unfortunately I do not have the answer. Please let us know if you know the answer, it would be greatly appreciated... "What we are trying to figure out is if removing the packages SUNWpostgr-83-devel, SUN

[GENERAL] database response slows while pg_dump is running (8.4.2)

2010-06-10 Thread Aleksey Tsalolikhin
PostgreSQL 8.4.2 response time slows during pg_dump of a 14 GB database. Specifically, I am monitoring how long it takes to login to our Web app - usually under 2 seconds, but when pg_dump is running, that changes to 2 - 18 seconds. Is there any way I can keep my response fast but still get my pg

Re: [GENERAL] PL/pgSQL nested functions

2010-06-10 Thread Raymond O'Donnell
On 10/06/2010 21:23, jim.g...@bull.com wrote: > > Are there any plans to allow PL/pgSQL functions to be nested like Oracle > allows with PL/SQL procedures? I don't know the answer to your question, but I'm curious - why would you want to nest functions? Ray. -- Raymond O'Donnell :: Galway ::

[GENERAL] PL/pgSQL nested functions

2010-06-10 Thread Jim . Gray
Are there any plans to allow PL/pgSQL functions to be nested like Oracle allows with PL/SQL procedures? If not, what are the best ways to convert PL/SQL nested procedures to PL/pgSQL?

[GENERAL] Can ARRAY( ... ) generate text[][]?

2010-06-10 Thread J. Greg Davidson
Hi fellow PostgreSQL hackers! I tried to write an SQL glue function to turn an array of alternating key/value pairs into an array of arrays and got the message ERROR: 42704: could not find array type for data type text[] -- BEGIN CODE -- Here's a simplified example: CREATE OR REPLACE FUNCTION

Re: [GENERAL] database response slows while pg_dump is running (8.4.2)

2010-06-10 Thread Steve Crawford
On 06/10/2010 02:49 PM, Aleksey Tsalolikhin wrote: ... Is there any way I can keep my response fast but still get my pg_dump? Or should I move my pg_dump to a Slony-I slave? 1. We're not dumping across the network. The pg_dump process runs on the same physical server as Postgre

Re: [GENERAL] PL/pgSQL nested functions

2010-06-10 Thread Jim . Gray
>...why would you want to nest functions? I am not nesting the functions myself, but I am trying to convert existing PL/SQL code to PL/pgSQL. >From what I have seen, the nesting of functions is to modularize the code and share global variables within the same procedure. "Raymond O'Donnell"

Re: [GENERAL] server crash => libpq poll() hangs forever (Linux)

2010-06-10 Thread Marinos Yannikos
Am 09.06.2010 16:37, schrieb Tom Lane: Marinos Yannikos writes: It seems that poll() never receives a connection closed notification under Linux (https://lists.linux-foundation.org/pipermail/bugme-new/2003-April/008335.html - very old report, "very old report" is right. What makes you think

Re: [GENERAL] database response slows while pg_dump is running (8.4.2)

2010-06-10 Thread Aleksey Tsalolikhin
On Thu, Jun 10, 2010 at 3:41 PM, Steve Crawford wrote: > So are you writing the backup to the same disk(s) that support the db? What > happens if you do the dump from a different machine? You'll increase network > traffic, of course, but reduce your disk load. And you won't be keeping your > dump

Re: [GENERAL] Best way to store case-insensitive data?

2010-06-10 Thread Scott Marlowe
On Thu, Jun 10, 2010 at 2:50 PM, Mike Christensen wrote: > I have a column called "email" that users login with, thus I need to > be able to lookup email very quickly.  The problem is, emails are > case-insensitive.  I want f...@bar.com to be able to login with > f...@bar.com as well.  There's two

Re: [GENERAL] Best way to store case-insensitive data?

2010-06-10 Thread Scott Marlowe
On Thu, Jun 10, 2010 at 2:50 PM, Mike Christensen wrote: > I have a column called "email" that users login with, thus I need to > be able to lookup email very quickly.  The problem is, emails are > case-insensitive.  I want f...@bar.com to be able to login with > f...@bar.com as well.  There's two

Re: [GENERAL] pg/linux How much swap relative to physical memory is needed?

2010-06-10 Thread Cédric Villemain
2010/6/10 Alan Hodgson : > On Thursday, June 10, 2010, Kelly Burkhart wrote: >> Should I be concerned? >> >> Thanks, > > The default Linux kernel settings will tend to swap stuff out to make more > memory available for filesystem cache. You can lower the value set in > /proc/sys/vm/swappiness to d

Re: [GENERAL] Best way to store case-insensitive data?

2010-06-10 Thread Mike Christensen
Ah, I should probably upgrade to 8.4. However, I'll probably just wait for 9.0 to come out. So it seems like citext will be about the same as casting both sides to LOWER(), plus putting an index on the lowercase version of the text. I'd probably use that if it were out of the box, but I'm trying

Re: [GENERAL] database response slows while pg_dump is running (8.4.2)

2010-06-10 Thread Aleksey Tsalolikhin
On Thu, Jun 10, 2010 at 1:25 PM, Aleksey Tsalolikhin wrote: > PostgreSQL 8.4.2 response time slows during pg_dump of a 14 GB database. > ... > > Is there any way I can keep my response fast but still get my pg_dump? > Or should I move my pg_dump to a Slony-I slave? Thank you for your kind replie

Re: [GENERAL] Postgresql packages in Solaris

2010-06-10 Thread Scott Marlowe
On Thu, Jun 10, 2010 at 2:35 PM, John R Pierce wrote: > It appears (using the public Sunsolve patchfinder) that the newest version > of PostgreSQL 8.3 that Sun has a patch for is 8.3.9 (138826-06 or > 138827-06),  while 8.3.11 has been out for about a month now, and fixes > these CVEs. Note that

Re: [GENERAL] Best way to store case-insensitive data?

2010-06-10 Thread Andy Colson
On 6/10/2010 3:50 PM, Mike Christensen wrote: I have a column called "email" that users login with, thus I need to be able to lookup email very quickly. The problem is, emails are case-insensitive. I want f...@bar.com to be able to login with f...@bar.com as well. There's two ways of doing thi

[GENERAL] Postgresql packages in Solaris

2010-06-10 Thread Paul Baker
All, I received this question from a customer yesterday (below), and unfortunately I do not have the answer. Please let us know if you know the answer, it would be greatly appreciated...   "What we are trying to figure out is if removing the packages SUNWpostgr-83-devel, SUNWpostgr-83-pl, SUN

Re: [GENERAL] database response slows while pg_dump is running (8.4.2)

2010-06-10 Thread Andy Colson
On 6/10/2010 3:25 PM, Aleksey Tsalolikhin wrote: PostgreSQL 8.4.2 response time slows during pg_dump of a 14 GB database. Specifically, I am monitoring how long it takes to login to our Web app - usually under 2 seconds, but when pg_dump is running, that changes to 2 - 18 seconds. Is there any

Re: [GENERAL] Best way to store case-insensitive data?

2010-06-10 Thread Mike Christensen
Right now, I'm running 8.3.4 on Windows 2003, and I just used the MSI installer to install it. On Thu, Jun 10, 2010 at 2:18 PM, Scott Marlowe wrote: > On Thu, Jun 10, 2010 at 3:16 PM, Mike Christensen wrote: >> Where do I get info on installing this? > > Very much depends on OS and how you insta

[GENERAL] Best way to store case-insensitive data?

2010-06-10 Thread Mike Christensen
I have a column called "email" that users login with, thus I need to be able to lookup email very quickly. The problem is, emails are case-insensitive. I want f...@bar.com to be able to login with f...@bar.com as well. There's two ways of doing this, that I can see: 1) Every time I lookup an em

Re: [GENERAL] checkpoint spikes

2010-06-10 Thread Greg Smith
Janning wrote: 1. With raising checkpoint_timeout, is there any downgrade other than slower after-crash recovery? Checkpoint spikes happen when too much I/O has been saved up for checkpoint time than the server can handle. While this is normally handled by the checkpoint spreading logic,

Re: [GENERAL] database response slows while pg_dump is running (8.4.2)

2010-06-10 Thread Alan Hodgson
On Thursday, June 10, 2010, Aleksey Tsalolikhin wrote: > Thanks anyway - glad to hear dumping from a slave is > a popular approach, that's what we'll do. This is good, > it'll allow us to increase our pg_dumps from 1 a day to > as many as we want to feel safe. You should look into PITR backups.

Re: [GENERAL] pg/linux How much swap relative to physical memory is needed?

2010-06-10 Thread Alan Hodgson
On Thursday, June 10, 2010, Kelly Burkhart wrote: > Should I be concerned? > > Thanks, The default Linux kernel settings will tend to swap stuff out to make more memory available for filesystem cache. You can lower the value set in /proc/sys/vm/swappiness to decrease this tendency. I don't thi

Re: [GENERAL] pg/linux How much swap relative to physical memory is needed?

2010-06-10 Thread Vick Khera
On Thu, Jun 10, 2010 at 1:50 PM, Kelly Burkhart wrote: > Is there some minimum proportion of swap to physical memory that linux > or postgresql likes to have?  Is it OK for all > Dunno about linux, but the BSD types like to have swap = physical mem + delta. If a machine crashes and you want cras

[GENERAL] pg/linux How much swap relative to physical memory is needed?

2010-06-10 Thread Kelly Burkhart
We have an openSUSE 11.2 machine running PostgreSQL 8.4.2 that we recently upgraded from 24 to 74G RAM.  We have a single swap partition of 2G that free tells us is completely used.  I don't see any swap IO when I run vmstat at reasonably busy points in the day (although it must happen some time...

Re: [GENERAL] checkpoint spikes

2010-06-10 Thread Vick Khera
On Thu, Jun 10, 2010 at 12:49 PM, Janning wrote: > 1. With raising checkpoint_timeout, is there any downgrade other than slower > after-crash recovery? Depends on how busy your DB is, and how many checkpoint segments you have. All the timeout does is say, "if we have not done a checkpoint this l

Re: [GENERAL] checkpoint spikes

2010-06-10 Thread Janning
Hi again, nobody answered my question :-(, so i did some research. I was convinced to set: checkpoint_segments = 16 checkpoint_timeout = 60min and echo 2 > /proc/sys/vm/dirty_background_ratio this helped a lot. Our freeze time was reduced from 10 seconds to 5 seconds. But this is still way to

[GENERAL] Make & Install contrib/tablefunc Problems

2010-06-10 Thread Stefan Schwarzer
Hi there, strange thing, but every time I need to (re)install the tablefunc, I run into problems. I am using the Kyngchaos packages for Snow Leopard. Everything works smoothly, until I arrive at the additional, manual installation of tablefunc. I downloaded the correct version of the postgres

Re: [GENERAL] calculating distance between longitude and latitude

2010-06-10 Thread Merlin Moncure
On Wed, Jun 9, 2010 at 3:02 PM, Geoffrey wrote: > Does postgresql have functions to calculate the distance between two sets of > longitude and latitude. for posterity, if you are not: *) very interested in high performance (that is, ok w/sql implementation) *) needing super accurate results (ok w

Re: [GENERAL] Where has ms2pg gone?

2010-06-10 Thread Justin Graf
On 6/10/2010 4:12 AM, Thom Brown wrote: > Does anyone know if ms2pg is available from somewhere other than > http://edoceo.com/creo/ms2pg ? Attempts to download it result in "not > found". Unless someone knows of an alternative attempt to automate > migration of MSSQL to PostgreSQL? > > Thanks >

Re: [GENERAL] Cognitive dissonance

2010-06-10 Thread Leif Biberg Kristensen
On Thursday 10. June 2010 17.24.00 Tom Lane wrote: > Alvaro Herrera writes: > > Excerpts from Peter Eisentraut's message of jue jun 10 02:50:14 -0400 2010: > >> As I said back then, doing this is straightforward, but we kind of need > >> more than one user who asks for it before we make it part o

Re: [GENERAL] Cognitive dissonance

2010-06-10 Thread Tom Lane
Alvaro Herrera writes: > Excerpts from Peter Eisentraut's message of jue jun 10 02:50:14 -0400 2010: >> As I said back then, doing this is straightforward, but we kind of need >> more than one user who asks for it before we make it part of a regular >> service, which comes with maintenance costs.

Re: [GENERAL] Cognitive dissonance

2010-06-10 Thread Alvaro Herrera
Excerpts from Peter Eisentraut's message of jue jun 10 02:50:14 -0400 2010: > On tis, 2010-06-08 at 11:04 +0200, John Gage wrote: > > > > Yet, the only one file edition of the Postgres documentation is > > in...pdf format. Huh? > > > > I know. I know. I have already brought this up. And var

Re: [GENERAL] Make & Install contrib/tablefunc Problems

2010-06-10 Thread Tom Lane
Stefan Schwarzer writes: > I downloaded the correct version of the postgres package (8.4.3), and > followed the indicated guidelines: > > You can build extensions for Postgres without fully rebuilding Postgres. For > the "contrib" extensions in

[GENERAL] Make & Install contrib/tablefunc Problems

2010-06-10 Thread Stefan Schwarzer
Hi there, strange thing, but every time I need to (re)install the tablefunc, I run into problems. I am using the Kyngchaos packages for Snow Leopard. Everything works smoothly, until I arrive at the additional, manual installation of tablefunc. I downloaded the correct version of the postgres

[GENERAL] Linux kernel OOM killer rewrite

2010-06-10 Thread Craig Ringer
Hi folks It looks like there's a kernel OOM killer rewrite in progress. Perhaps there's a chance of finally getting some sane heuristics for shared memory in place? There's no indication that it's going to happen without intervention, but there's talk of rewriting the badness() function that

Re: [GENERAL] Variables in SQL scripts

2010-06-10 Thread Tim Landscheidt
"Machiel Richards" wrote: > [...] > I did some googling as well and found something I tested using > a simple method: > - I created an sql script to set the variable Name DB > o \set DB > o \c :DB > - I connected to postgresql using the postgres database a

[GENERAL] Where has ms2pg gone?

2010-06-10 Thread Thom Brown
Does anyone know if ms2pg is available from somewhere other than http://edoceo.com/creo/ms2pg ? Attempts to download it result in "not found". Unless someone knows of an alternative attempt to automate migration of MSSQL to PostgreSQL? Thanks Thom -- Sent via pgsql-general mailing list (pgsql

[GENERAL] Variables in SQL scripts

2010-06-10 Thread Machiel Richards
Good day all I have posted a query on the Postgresql novice mailing list, however I think it might be more suitable here. Please see my request and information below: I am looking for some more suggestions here on ways to use variables in sql scr