Re: [GENERAL] Pet Peeves?

2009-02-04 Thread Simon Riggs
On Wed, 2009-02-04 at 03:00 +, Greg Stark wrote: We already have autovacuum, which runs VACUUM and ANALYZE to a set schedule. We could have kept that outside core, but didn't. It's not too big a stretch to imagine we could redesign autovacuum as a GP scheduler, with autovacuum as

Re: [GENERAL] Pet Peeves?

2009-02-04 Thread Simon Riggs
On Wed, 2009-02-04 at 02:39 +, Greg Stark wrote: On Tue, Feb 3, 2009 at 10:06 PM, Simon Riggs si...@2ndquadrant.com wrote: On Tue, 2009-02-03 at 15:03 -0500, Chris Mayfield wrote: 1. Having to rewrite entire tables out to disk the first time I scan them, for example: CREATE

Re: [GENERAL] Pet Peeves?

2009-02-04 Thread Karsten Hilbert
Craig, what kind of events are you thinking about? Triggers are already pieces of code that run upon certain events, namely insert, update or delete events. What others do you have in mind? That's a good point, actually. I can't think of much you can't do with a trigger (SECURITY

Re: [GENERAL] Pet Peeves?

2009-02-04 Thread Richard Huxton
Gregory Stark wrote: Steve Crawford scrawf...@pinpointresearch.com writes: 3. Date handling Sometimes I've got data with invalid dates and it would be great if it could replace all the bad ones with, say -00-00. Oh dear $DEITY, no. I think it would be best if we limited

[GENERAL] installation

2009-02-04 Thread Kusuma Pabba
Hello all, i am new to postgresql, i want to create tables in this i have followed 10 Steps to Installing PostgreSQL which is chapter two of installing postgresql i could follow upto step no 7 but i am getting errors from step 8 while following the steps i got message like

[GENERAL] field with Password

2009-02-04 Thread Iñigo Barandiaran
Hi. I would like to create a new table where one of the field would be a user password. Is there any data type for supporting this functionality? Something like Password DataType. I've taken a look of the available data types in PgAdmin Application and there is nothing similar to this.

Re: [GENERAL] field with Password

2009-02-04 Thread Thomas Markus
what do you expect from such type? try to use a text field for plain passwords or better store only hashvalues. see md5() regards thomas Iñigo Barandiaran schrieb: Hi. I would like to create a new table where one of the field would be a user password. Is there any data type for supporting

Re: [GENERAL] Connecting to old 7.1 Database

2009-02-04 Thread Schwaighofer Clemens
On Tue, Nov 18, 2008 at 18:34, Andy Greensted ajg...@ohm.york.ac.uk wrote: So, two questions: - Is there anyway to run a newer version (8.3.5) of psql in some sort of 'backwards compatible' mode? - Do you have any tips on making 7.1.3 compile on a newer system? The last time I had to

Re: [GENERAL] field with Password

2009-02-04 Thread Adam Rich
I would like to create a new table where one of the field would be a user password. Is there any data type for supporting this functionality? Something like Password DataType. I've taken a look of the available data types in PgAdmin Application and there is nothing similar to this.

[GENERAL] Crash of Postgresql on Windows

2009-02-04 Thread Emilie Laffray
Hello, I am sending this email since I am hitting a snag with postgresql. I am currently running the following version of postgresql: Postgresql 8.3.5 on Windows XP Pro 32bits I am getting a crash whenever I try to perform an update on some rows. More precisely, I have recently imported a

Re: [GENERAL] Vacuums taking forever :(

2009-02-04 Thread Gregory Stark
Phoenix Kiula phoenix.ki...@gmail.com writes: Thanks, Gregory and Simon, for the very useful posts. I have increased the vacuum_cost_limit to 2000 for now, just to see if that has an impact. Hopefully positive. Note that that was offhand speculation. Conventional wisdom is that it should

[GENERAL] PGAdmin and records as inserts (like in SQLyog)

2009-02-04 Thread durumdara
Hi! I wanna ask, that have the PGAdmin same possibility (like in SQLyog) to copy records (from the Query, from the Table View) to clipboard in the INSERT SQL format? This can speed up the work, and I can insert the record to another table that have similar (but a little different) format

Re: [GENERAL] PGAdmin and user privileges - what I do wrong?

2009-02-04 Thread Raymond O'Donnell
On 04/02/2009 12:40, durumdara wrote: When I want to manually assign this user to a table, I have problem in the PGAdmin's Privilege tab. The privileges GroupBox have a ComboBox, named Role. This ComboBox is not containing the zx user in it's list. By default, that combo box shows only group

Re: [GENERAL] PGAdmin and user privileges - what I do wrong?

2009-02-04 Thread Dave Page
On Wed, Feb 4, 2009 at 12:40 PM, durumdara durumd...@gmail.com wrote: Hi! Please help me a little. I used PGAdmin to administrate my databases. I created a new user named zx. CREATE ROLE zx LOGIN ENCRYPTED PASSWORD '*' NOSUPERUSER NOINHERIT NOCREATEDB NOCREATEROLE; When I want to

Re: [GENERAL] C function question

2009-02-04 Thread Gregory Stark
Tom Lane t...@sss.pgh.pa.us writes: Alvaro Herrera alvhe...@alvh.no-ip.org writes: Grzegorz Jaśkiewicz wrote: looks like it really has to be defined with char in double quotes. I thought just char is enough... They're different types. You know, maybe we should stop holding our noses and

Re: [GENERAL] Crash of Postgresql on Windows

2009-02-04 Thread Emilie Laffray
Hello, 1) I can perform a query on the rows that I am trying to update. I have also successfully updated rows before in the same table and also after. 2) I have no reason to believe that the filesystem got corrupted. I have started a scan before you asked the question wondering if it could

Re: [GENERAL] Crash of Postgresql on Windows

2009-02-04 Thread Richard Huxton
Andrew Gould wrote: On Wed, Feb 4, 2009 at 6:18 AM, Emilie Laffray emilie.laff...@gmail.comwrote: UPDATE gtable AS g SET code = '00' -- 04 WHERE g.code = '04' AND g.cc = 'TW'; What does '--' do? It's a comment delimeter -- Richard Huxton Archonet Ltd

Re: [GENERAL] field with Password

2009-02-04 Thread Iñigo Barandiaran
Thanks! Ok. I've found http://256.com/sources/md5/ library. So the idea is to define in the dataBase a Field of PlainText type. When I want to insert a new user, I define a password, convert to MD5 hash with the library and store it in the DataBase. Afterwards, any user check should get the

Re: [GENERAL] Crash of Postgresql on Windows

2009-02-04 Thread Richard Huxton
Emilie Laffray wrote: 3) I have an antivirus running, but again this antivirus has been running for months and I have worked on postgresql also for months. There has been an update yesterday to that antivirus, but I don't think it had an impact. I tried also in the meantime to run a vacuum,

Re: [GENERAL] C function question

2009-02-04 Thread Merlin Moncure
On Tue, Feb 3, 2009 at 6:16 PM, Tom Lane t...@sss.pgh.pa.us wrote: Merlin Moncure mmonc...@gmail.com writes: On Tue, Feb 3, 2009 at 4:28 PM, Tom Lane t...@sss.pgh.pa.us wrote: You know, maybe we should stop holding our noses and do something about this old gotcha. That type's not going away

Re: [GENERAL] field with Password

2009-02-04 Thread Raymond C. Rodgers
Iñigo Barandiaran wrote: Thanks! Ok. I've found http://256.com/sources/md5/ library. So the idea is to define in the dataBase a Field of PlainText type. When I want to insert a new user, I define a password, convert to MD5 hash with the library and store it in the DataBase. Afterwards, any

Re: [GENERAL] Crash of Postgresql on Windows

2009-02-04 Thread Emilie Laffray
Hello, well Icouldn't turn off my antivirus since it is controlled by our IT management team. However, since I rebuilt the indexes, the query has been running fine. I don't understand what happpened. Before asking for help, I made sure I could repeat the problem over several reboots. Emilie

Re: [GENERAL] Crash of Postgresql on Windows

2009-02-04 Thread Richard Huxton
Emilie Laffray wrote: Hello, well Icouldn't turn off my antivirus since it is controlled by our IT management team. However, since I rebuilt the indexes, the query has been running fine. I don't understand what happpened. Before asking for help, I made sure I could repeat the problem over

Re: [GENERAL] ramblings about password exposure (WAS: field with Password)

2009-02-04 Thread Sam Mason
On Wed, Feb 04, 2009 at 09:34:56AM -0500, Raymond C. Rodgers wrote: You don't need to depend on an external library for this functionality; it's built right into Postgres. Personally, in my own apps I write in PHP, I use a combination of sha1 and md5 to hash user passwords, without

Re: [GENERAL] PGAdmin and records as inserts (like in SQLyog)

2009-02-04 Thread Raymond O'Donnell
On 04/02/2009 12:31, durumdara wrote: I wanna ask, that have the PGAdmin same possibility (like in SQLyog) to copy records (from the Query, from the Table View) to clipboard in the INSERT SQL format? This can speed up the work, and I can insert the record to another table that have similar

Re: [GENERAL] Crash of Postgresql on Windows

2009-02-04 Thread Richard Huxton
Emilie Laffray wrote: Hello, I am sending this email since I am hitting a snag with postgresql. I am currently running the following version of postgresql: Postgresql 8.3.5 on Windows XP Pro 32bits I am getting a crash whenever I try to perform an update on some rows. More precisely, I

Re: [GENERAL] field with Password

2009-02-04 Thread Iñigo Barandiaran
Thanks for your answers. Sorry for the questions but I'm new to Postgre :) The problem with a plain text password is that a user can see it by looking at the user table. Both suggest to use MD5. How can i use it? Any link, example about this would be very appreciated. Thanks in advance!

[GENERAL] Sort method: external merge

2009-02-04 Thread wstrzalka
It's kind of lame questions, possibly I'm missing something but my doubts are as follow: When planner/executor needs to sort rowsit sorts whole records (i think so). So in the case when there are many wide columns it takes quite a lot of memory and sort goes out to the disk because it excess the

Re: [GENERAL] Crash of Postgresql on Windows

2009-02-04 Thread Grzegorz Jaśkiewicz
what about free disc space ? aren't you running out of ? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Which is best, timestamp as float or integer ?

2009-02-04 Thread A B
Hi. From the manual I read that timestamps are stored as double but they can also be stored as 8 byte integers. I understand the precision problem with floats and the limited range of the integers and I feel confident that I should not worry about the Year 294276 or Year 5874897 problems (highest

Re: [GENERAL] field with Password

2009-02-04 Thread hubert depesz lubaczewski
On Wed, Feb 04, 2009 at 11:09:51AM +0100, Iñigo Barandiaran wrote: I would like to create a new table where one of the field would be a user password. Is there any data type for supporting this functionality? Something like Password DataType. I've taken a look of the available data types

Re: [GENERAL] Pet Peeves?

2009-02-04 Thread A.M.
On Feb 3, 2009, at 11:55 PM, Guy Rouillier wrote: Craig Ringer wrote: An internal job scheduler with the ability to fire jobs on certain events as well as on a fixed schedule could be particularly handy in conjunction with true stored procedures that could explicitly manage transactions.

Re: [GENERAL] field with Password

2009-02-04 Thread John R Pierce
Iñigo Barandiaran wrote: Hi. I would like to create a new table where one of the field would be a user password. Is there any data type for supporting this functionality? Something like Password DataType. I've taken a look of the available data types in PgAdmin Application and there is

Re: [GENERAL] field with Password

2009-02-04 Thread A. Kretschmer
In response to Iñigo Barandiaran : Hi. I would like to create a new table where one of the field would be a user password. Is there any data type for supporting this functionality? Something like Password DataType. I've taken a look of the available data types in PgAdmin Application

Re: [GENERAL] field with Password

2009-02-04 Thread Iñigo Barandiaran
Thanks! This is great. I'm now implementing this functionality. Thank you all. You are great! Best, You should always salt your password hashes. Ie randomly generate a salt string, the store this and the password hash: insert into auth (user_id, salt, password)

Re: [GENERAL] field with Password

2009-02-04 Thread Iñigo Barandiaran
Thanks Raymond That is something I wanted! It's Great if it is already integrated in Postgre! Superb. This is much more easy. Thank you All. Best, Iigo Barandiaran wrote: Well, you can use the built-in md5 function for this purpose. For instance, you could

Re: [GENERAL] Crash of Postgresql on Windows

2009-02-04 Thread Tommy Gildseth
Andrew Gould wrote: What does '--' do? -- Is an SQL comment -- Tommy Gildseth DBA, Gruppe for databasedrift Universitetet i Oslo, USIT m: +47 45 86 38 50 t: +47 22 85 29 39 -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription:

Re: [GENERAL] field with Password

2009-02-04 Thread Chris . Ellis
You should always salt your password hashes. Ie randomly generate a salt string, the store this and the password hash: insert into auth (user_id, salt, password) values (1,'blah',md5('blah' + 'test')) ; then to check the password select true from auth where user_id = 1 and

Re: [GENERAL] Crash of Postgresql on Windows

2009-02-04 Thread Andrew Gould
On Wed, Feb 4, 2009 at 6:18 AM, Emilie Laffray emilie.laff...@gmail.comwrote: Hello, I am sending this email since I am hitting a snag with postgresql. I am currently running the following version of postgresql: Postgresql 8.3.5 on Windows XP Pro 32bits I am getting a crash whenever I try

Re: [GENERAL] installation

2009-02-04 Thread Grzegorz Jaśkiewicz
On Wed, Feb 4, 2009 at 9:09 AM, Kusuma Pabba kusu...@ncoretech.com wrote: Hello all, i am new to postgresql, i want to create tables in this i have followed 10 Steps to Installing PostgreSQL which is chapter two of installing postgresql i could follow upto step no 7 but i am getting

[GENERAL] PGAdmin and user privileges - what I do wrong?

2009-02-04 Thread durumdara
Hi! Please help me a little. I used PGAdmin to administrate my databases. I created a new user named zx. CREATE ROLE zx LOGIN ENCRYPTED PASSWORD '*' NOSUPERUSER NOINHERIT NOCREATEDB NOCREATEROLE; When I want to manually assign this user to a table, I have problem in the PGAdmin's

Re: [GENERAL] field with Password

2009-02-04 Thread John R Pierce
Iñigo Barandiaran wrote: Thanks for your answers. Sorry for the questions but I'm new to Postgre :) The problem with a plain text password is that a user can see it by looking at the user table. Both suggest to use MD5. How can i use it? Any link, example about this would be very

Re: [GENERAL] field with Password

2009-02-04 Thread Iñigo Barandiaran
Thanks Raymond That is something I wanted! It's Great if it is already integrated in Postgre! Superb. This is much more easy. Thank you All. Best, Iigo Barandiaran wrote: Thanks! Ok. I've found http://256.com/sources/md5/ library. So the idea is to define in the

Re: [GENERAL] Pet Peeves?

2009-02-04 Thread Guy Rouillier
Karsten Hilbert wrote: Craig, what kind of events are you thinking about? Triggers are already pieces of code that run upon certain events, namely insert, update or delete events. What others do you have in mind? That's a good point, actually. I can't think of much you can't do with a

Re: [GENERAL] Pet Peeves?

2009-02-04 Thread John DeSoi
On Feb 3, 2009, at 3:41 PM, Peter Geoghegan wrote: What about postgreSQL's inability to re-order columns? Please don't point out that I shouldn't rely on things being in a certain order when I SELECT * FROM table. I'm well aware of that, I just generally have an aesthetic preference for a

Re: [GENERAL] Pet Peeves?

2009-02-04 Thread Karsten Hilbert
On Wed, Feb 04, 2009 at 12:37:31PM -0500, Guy Rouillier wrote: Karsten Hilbert wrote: Craig, what kind of events are you thinking about? Triggers are already pieces of code that run upon certain events, namely insert, update or delete events. What others do you have in mind? That's a

Re: [GENERAL] Pet Peeves?

2009-02-04 Thread Grzegorz Jaśkiewicz
I dream about db wide checks on tables, without need to write expensive triggers. Basically, something that would run a select query after insert/update/delete and based on result commit or rollback. unless there's something like that already in SQL (I am not aware of all features in sql2008

Re: [GENERAL] field with Password

2009-02-04 Thread Sam Mason
On Wed, Feb 04, 2009 at 04:42:05PM +, chris.el...@shropshire.gov.uk wrote: If you want to be really secure, use both a md5 and sha1 hash, snice it has been proved you can generate hash collisions so you could use: insert into auth (user_id, salt, password) values

Re: [GENERAL] Pet Peeves?

2009-02-04 Thread Simon Riggs
On Wed, 2009-02-04 at 14:09 +0900, Craig Ringer wrote: Guy Rouillier wrote: Craig Ringer wrote: An internal job scheduler with the ability to fire jobs on certain events as well as on a fixed schedule could be particularly handy in conjunction with true stored procedures that could

Re: [GENERAL] Pet Peeves?

2009-02-04 Thread Mark Roberts
On Thu, 2009-01-29 at 13:16 +, Gregory Stark wrote: I'm putting together a talk on PostgreSQL Pet Peeves for discussion at FOSDEM 2009 this year. I have a pretty good idea what some them are of course, but I would be interested to hear if people have any complaints from personal

Re: [GENERAL] Pet Peeves?

2009-02-04 Thread Merlin Moncure
On Mon, Feb 2, 2009 at 4:54 PM, Christopher Browne cbbro...@gmail.com wrote: - Stored procedures that can manage transactions (e.g. - contrast with present stored functions that forcibly live *inside* a transaction context; the point isn't functions vs procedures, but rather to have something

[GENERAL] case sensitive db name?

2009-02-04 Thread Thomas Finneid
I have a case sensitivity problem I dont understand. On a Solaris 10 with pg 8.2.6 (Sun build) I get problems when I do a CREATE DATABASE with a db name with case. On a Kubuntu machine with pg 8.2.7 it is not a problem. More specifically the problem arises after the CREATE DATABASE, it occurs

[GENERAL] Array, bytea and large objects

2009-02-04 Thread David Wall
I am trying to assess the db issues surrounding several constructs allowed in PG 8.3, including ARRAY, BYTEA and large objects (LO). We store a lot of data as encrypted XML structures (name-value pairs mostly) that can be updated many times during its lifetime (most updates occur over several

[GENERAL] SELECT on a table with Time values

2009-02-04 Thread Anderson dos Santos Donda
Hi all!! I have a simple table with two column. The first column is a time type and the other is a integer type. This table have datas from each minute of day. Example : 15:00:00, 15:01:00, 15:02:00 etc... I want a SELECT command wich return for me the datas from each five minutes of day.

Re: [GENERAL] SELECT on a table with Time values

2009-02-04 Thread Dann Corbit
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Anderson dos Santos Donda Sent: Wednesday, February 04, 2009 12:05 PM To: pgsql-general@postgresql.org Subject: [GENERAL] SELECT on a table with Time values Hi all!! I have a simple table with

Re: [GENERAL] case sensitive db name?

2009-02-04 Thread Richard Huxton
Thomas Finneid wrote: I have a case sensitivity problem I dont understand. On a Solaris 10 with pg 8.2.6 (Sun build) I get problems when I do a CREATE DATABASE with a db name with case. On a Kubuntu machine with pg 8.2.7 it is not a problem. More specifically the problem arises after

Re: [GENERAL] Pet Peeves?

2009-02-04 Thread Peter Eisentraut
On Wednesday 04 February 2009 20:36:24 Grzegorz Jaśkiewicz wrote: I dream about db wide checks on tables, without need to write expensive triggers. Basically, something that would run a select query after insert/update/delete and based on result commit or rollback. unless there's something

Re: [GENERAL] Pet Peeves?

2009-02-04 Thread Peter Eisentraut
On Wednesday 04 February 2009 19:39:42 John DeSoi wrote: Somewhat related, it would be nice if columns had a unique identifier in the catalog rather than just a sequence number for the table. This would make it possible to distinguish between altering a column versus dropping/adding when

Re: [GENERAL] Which is best, timestamp as float or integer ?

2009-02-04 Thread Peter Eisentraut
On Wednesday 04 February 2009 15:48:41 A B wrote: From the manual I read that timestamps are stored as double but they can also be stored as 8 byte integers. The advantage of the integer storage is mainly that calculations and comparisons have a predictable error and don't suffer from some of

[GENERAL] Elapsed time between timestamp variables in Function

2009-02-04 Thread Nico Callewaert
Hi ! I saw previous postings about elapsed time between 2 timestamps, using SELECT EXTRACT... I have similar question, but it's not in a select statement, but between 2 variables in a function. To keep it simple, I have 2 variables, let's say A and B, both TimeStamp. Now I would like to know

Re: [GENERAL] ramblings about password exposure (WAS: field with Password)

2009-02-04 Thread Adam Rich
On Wed, Feb 04, 2009 at 09:34:56AM -0500, Raymond C. Rodgers wrote: You don't need to depend on an external library for this functionality; it's built right into Postgres. Personally, in my own apps I write in PHP, I use a combination of sha1 and md5 to hash user passwords, without

Re: [GENERAL] Elapsed time between timestamp variables in Function

2009-02-04 Thread Raymond O'Donnell
On 04/02/2009 21:59, Nico Callewaert wrote: To keep it simple, I have 2 variables, let's say A and B, both TimeStamp. Now I would like to know the absolute value of elapsed seconds between the 2 timestamps. Has to be absolute value, because can be positive or negative, depends if A B or A

Re: [GENERAL] Pet Peeves?

2009-02-04 Thread Grant Allen
Mark Roberts wrote: - It'd be nice if the query planner was more stable - sometimes the queries run fast, and then sometimes they randomly take 2 hours for a delete that normally runs in a couple of minutes. I was going to stay silent, because my pet peeves were already covered or had been

Re: [GENERAL] Sort method: external merge

2009-02-04 Thread Jeff Davis
On Wed, 2009-02-04 at 02:15 -0800, wstrzalka wrote: Isn't it possible to sort only fields that order matters some row identifier/position (don't really know what - oid/ctid are tight to table but something temporary tight to 'resultset')? It would take much less memory and could be processed

[GENERAL] debugging plpgsql functions

2009-02-04 Thread Chris
Hi all, I have a few plpgsql functions to debug to see why they are slow. They consist of a bunch of sql statements using new.* / old.* variables (ie not using EXECUTE, the sql is being called directly). Is there a way to capture the actual sql that's being executed with variables

Re: [GENERAL] Elapsed time between timestamp variables in Function

2009-02-04 Thread Osvaldo Kussama
2009/2/4 Nico Callewaert callewaert.n...@telenet.be: Hi ! I saw previous postings about elapsed time between 2 timestamps, using SELECT EXTRACT... I have similar question, but it's not in a select statement, but between 2 variables in a function. To keep it simple, I have 2 variables,

Re: [GENERAL] debugging plpgsql functions

2009-02-04 Thread justin
Chris wrote: Hi all, I have a few plpgsql functions to debug to see why they are slow. They consist of a bunch of sql statements using new.* / old.* variables (ie not using EXECUTE, the sql is being called directly). Is there a way to capture the actual sql that's being executed with

[GENERAL] running postgres

2009-02-04 Thread Kusuma Pabba
may this be a silly doubts but , i am new to postgres, please answer to these:: /usr/local/pgsql/bin/psql test test=# sudo su postgres -c psql template1 template=# what is the difference between the above two and, why is the path different in both cases which should i use now how can i

Re: [GENERAL] running postgres

2009-02-04 Thread Schwaighofer Clemens
On Thu, Feb 5, 2009 at 15:35, Kusuma Pabba kusu...@ncoretech.com wrote: may this be a silly doubts but , i am new to postgres, please answer to these:: /usr/local/pgsql/bin/psql test test=# sudo su postgres -c psql template1 template=# what is the difference between the above two and,

Re: (Questioning the planner's mind) - was Re: [GENERAL] Fastest way to drop an index?

2009-02-04 Thread Alban Hertroys
On Feb 4, 2009, at 5:23 AM, Phoenix Kiula wrote: On Wed, Feb 4, 2009 at 5:13 AM, Tom Lane t...@sss.pgh.pa.us wrote: Phoenix Kiula phoenix.ki...@gmail.com writes: Index Scan using new_idx_testimonials_userid on testimonials (cost=0.00..157.78 rows=1 width=9) (actual time=8809.715..8809.715