Re: [GENERAL] pg_buffercache's usage count

2010-02-24 Thread Greg Smith
Ben Chobot wrote: On Feb 23, 2010, at 3:06 PM, Ben Chobot wrote: I'm looking at the usage count column of pg_buffercache's info, and I'm confused. Several buffers that supposed have LRU values of 5 belong to non-unique indices which supposedly have never been used. As I understand

Re: [GENERAL] Not able to change the owner of function

2010-02-24 Thread Albe Laurenz
Jignesh Shah wrote: could you tell me what could be the issue in below command. I could see that there is an option for changing OWNER of function but not sure why it is giving this error. techdb=# ALTER FUNCTION test_create() SET OWNER TO masanip; ERROR: unrecognized configuration

Re: [GENERAL]

2010-02-24 Thread Albe Laurenz
Shu Ho wrote: do you clean up the server file by removing them use find $logfile -mtime +$NUMBER_DAYS_TO_KEEP -type f -print -exec rm -f {} \; in postgres ? I do it similarly, but I don't use -exec, I rather pipe the results of find into something like xargs rm -f for better

Re: [GENERAL] Explaining duplicate rows in spite of unique index

2010-02-24 Thread Albe Laurenz
I wrote: We recently found a couple of rows in a production database that had identical values in the columns constituting the primary key (The problem surfaced because a pg_dump could not be restored). Now I'm looking for explanations how this could happen. The rows originate from

[GENERAL] Transaction isolation when applying DDLs

2010-02-24 Thread Luigi Antognini
Hello, I'm considering to apply DDLs (such as altering columns or constraints) without stopping the application running against the database. This is quite unusual but could work under certain circumstances, because the application is aware of any change applied to the underlying database

Re: [GENERAL] make check failed on 8.4.2 install

2010-02-24 Thread adam_pgsql
On 23 Feb 2010, at 21:34, Tom Lane wrote: adam_pgsql adam_pg...@witneyweb.org writes: On 23 Feb 2010, at 17:41, Tom Lane wrote: That's very peculiar. It looks more like dynamic linker breakage than Postgres' fault, though. What platform is this (no, the kernel version doesn't do it for

Re: [GENERAL] make check failed on 8.4.2 install

2010-02-24 Thread Daniel Verite
adam_pgsql wrote: This is gcc version 2.95.4 if that helps? It's a very old version of gcc, and also one that has never been officially released, according to the release notes. Run aptitude show gcc-2.95 and see the description of the package. You don't want to use that as your

[GENERAL] Curious plperl behavior

2010-02-24 Thread Jeff
Ran into this switching a DBI based thing into a plperl function. The root cause is probably a perl variable scope thing, but still this is very interesting behavior and may trip up others. Given code such as this: create or replace function plperlhell() returns int as $$ # prepare a plan,

Re: [GENERAL] pg_buffercache's usage count

2010-02-24 Thread Alvaro Herrera
Greg Smith wrote: Ben Chobot wrote: On Feb 23, 2010, at 3:06 PM, Ben Chobot wrote: I'm looking at the usage count column of pg_buffercache's info, and I'm confused. Several buffers that supposed have LRU values of 5 belong to non-unique indices which supposedly have never been used. As I

Re: [GENERAL] Row ordering after CREATE TABLE AS...SELECT regexp_split_to_table(source_text, regexp) AS new_column

2010-02-24 Thread Alvaro Herrera
John Gage wrote: Unfortunately, it prompts a new question. I am using 8.4.2 which I assume is new enough to trigger a yes response to If you have a version new enough to have synchronize_seqscans I have absolutely no idea how to turn that off. Perhaps the best thing would be to direct

[GENERAL] PostgreSQL install fails with 1603 error

2010-02-24 Thread Mitesh Patel
PostgreSQL version: 8.2.15 Operating system: Windows 2003 PostgreSQL 8.2 install fails with exit code 1603. Any idea?? what could be wrong. I am running install from console. I mean no RDP and using administrator AD account.

Re: [GENERAL] PostgreSQL install fails with 1603 error

2010-02-24 Thread A. Kretschmer
In response to Mitesh Patel : PostgreSQL version: 8.2.15 Operating system: Windows 2003 PostgreSQL 8.2 install fails with exit code 1603. Any idea?? what could be wrong. I am running install from console. I mean no RDP and using administrator AD account. I can't help you, i'm not

Re: [GENERAL] select t.name from tbl t (where name is not a column name)

2010-02-24 Thread Igor Neyman
Joe, What PG version are running? 8.2 here complains when running your example: ERROR: column foo.name does not exist LINE 6: select foo.name from foo; ^ ** Error ** ERROR: column foo.name does not exist SQL state: 42703 Igor Neyman -Original

[GENERAL] archive_timeout in postgresql.conf

2010-02-24 Thread akp geek
Hi All - I am trying to set up the PG_STANDBY on our database setup. our requirement is, In case of disaster we should be able to bring up standby, the lag time allowed in our setup is up to 2 hours. The question I have is, what should be the value I

[GENERAL] C function manipulating tsquery doesn't work with -O2

2010-02-24 Thread Ivan Sergio Borgonovo
http://psql.privatepaste.com/53cde5e24a I've the above function. Output is something like: '9788876412646':A | ( '8876412646':A | ( 'edizioni':D | ( 'quasi':B | ( 'estat':B | ( 'levi':C | ( 'lia':C | ( 'e/o':D | 'un':B ) ) ) ) ) ) ) It seems it always work with -O0 I can make it work with -O2

Re: [GENERAL] select t.name from tbl t (where name is not a column name)

2010-02-24 Thread Joe Conway
On 02/24/2010 07:16 AM, Igor Neyman wrote: Joe, What PG version are running? 8.2 here complains when running your example: ERROR: column foo.name does not exist LINE 6: select foo.name from foo; ^ ** Error ** ERROR: column foo.name does not exist

[GENERAL] bugs reporting

2010-02-24 Thread Mitesh Patel
Hello Admin, Can you please grant me access to post a bug report on pgsql-general section?? Thanks, Mitesh

Re: [GENERAL] how to clear server log

2010-02-24 Thread Amy Smith
this is the server log file, how many days server log files need to be keep as a mimumum ? thanks On Tue, Feb 23, 2010 at 1:49 PM, Amy Smith vah...@gmail.com wrote: All do you clean up the server file by removing them use find $logfile -mtime +$NUMBER_DAYS_TO_KEEP -type f -print -exec rm

Re: [GENERAL] Npgsql connection string editor?

2010-02-24 Thread Francisco Figueiredo Jr.
Hi! This code is for initial design time support on VS.net 2003. We are still working to get vs.net 2005 design time support as the code to support it changed completely. Sorry for this confusion. I'll check the docs to clarify this. On Tue, Feb 23, 2010 at 17:00, Radcon Entec

Re: [GENERAL] bugs reporting

2010-02-24 Thread Raymond O'Donnell
On 24/02/2010 14:20, Mitesh Patel wrote: Can you please grant me access to post a bug report on pgsql-general section?? You don't need any special access - have a look at this page: http://www.postgresql.org/support/submitbug Or you could just post to this list about your problem - feedback

Re: [GENERAL] pg_buffercache's usage count

2010-02-24 Thread Greg Smith
Alvaro Herrera wrote: BTW the only reason you don't see buffers having a larger usage is that the counters are capped at that value. Right, the usage count is limited to 5 for no reason besides that seems like a good number. We keep hoping to come across a data set and application with a

[GENERAL] Cast char to number

2010-02-24 Thread Christine Penner
I have a character field I want to change to a number. The values in that field are all numbers that may or may not be padded with spaces or 0's. What is the best way to do that? Christine Penner Ingenious Software 250-352-9495 christ...@ingenioussoftware.com -- Sent via pgsql-general

Re: [GENERAL] Cast char to number

2010-02-24 Thread Bill Moran
In response to Christine Penner christ...@ingenioussoftware.com: I have a character field I want to change to a number. The values in that field are all numbers that may or may not be padded with spaces or 0's. What is the best way to do that? Put the values in numeric fields to begin with

Re: [GENERAL] Cast char to number

2010-02-24 Thread Christine Penner
I don't understand what you mean. This is a column in a table that is already a char and has numbers in it. I want it to be a number field not character. How can I change the data type of that column without loosing the data I have in it? Christine At 11:38 AM 24/02/2010, you wrote: In

Re: [GENERAL] Cast char to number

2010-02-24 Thread Raymond O'Donnell
On 24/02/2010 19:53, Christine Penner wrote: I don't understand what you mean. This is a column in a table that is already a char and has numbers in it. I want it to be a number field not character. How can I change the data type of that column without loosing the data I have in it?

Re: [GENERAL] Cast char to number

2010-02-24 Thread Richard Huxton
On 24/02/10 20:06, Raymond O'Donnell wrote: However, to address your immediate problem, you could try something like this: (i) Create a new column of type numeric or integer as appropriate. (ii) update your_table set new_column = CAST(trim(both ' 0' from old_column) as numeric) (iii) Drop

Re: [GENERAL] Cast char to number

2010-02-24 Thread Daniel Verite
Raymond O'Donnell wrote: (i) Create a new column of type numeric or integer as appropriate. (ii) update your_table set new_column = CAST(trim(both ' 0' from old_column) as numeric) (iii) Drop the old column, as well as any constraints depending on it. (iv) Rename the new column

Re: [GENERAL] Cast char to number

2010-02-24 Thread Joshua D. Drake
On Wed, 2010-02-24 at 20:22 +, Richard Huxton wrote: On 24/02/10 20:06, Raymond O'Donnell wrote: However, to address your immediate problem, you could try something like this: (i) Create a new column of type numeric or integer as appropriate. (ii) update your_table set new_column

Re: [GENERAL] Cast char to number

2010-02-24 Thread Bill Moran
In response to Raymond O'Donnell r...@iol.ie: On 24/02/2010 19:53, Christine Penner wrote: At 11:38 AM 24/02/2010, you wrote: In response to Christine Penner christ...@ingenioussoftware.com: I have a character field I want to change to a number. The values in that field are all

Re: [GENERAL] Cast char to number

2010-02-24 Thread Bill Moran
In response to Joshua D. Drake j...@commandprompt.com: On Wed, 2010-02-24 at 20:22 +, Richard Huxton wrote: On 24/02/10 20:06, Raymond O'Donnell wrote: However, to address your immediate problem, you could try something like this: (i) Create a new column of type numeric or

Re: [GENERAL] Cast char to number

2010-02-24 Thread Scott Marlowe
On Wed, Feb 24, 2010 at 1:27 PM, Joshua D. Drake j...@commandprompt.com wrote: On Wed, 2010-02-24 at 20:22 +, Richard Huxton wrote: On 24/02/10 20:06, Raymond O'Donnell wrote: However, to address your immediate problem, you could try something like this: (i)   Create a new column of

Re: [GENERAL] Cast char to number

2010-02-24 Thread Richard Huxton
On 24/02/10 20:27, Joshua D. Drake wrote: On Wed, 2010-02-24 at 20:22 +, Richard Huxton wrote: On 24/02/10 20:06, Raymond O'Donnell wrote: However, to address your immediate problem, you could try something like this: (i) Create a new column of type numeric or integer as appropriate.

Re: [GENERAL] Curious plperl behavior

2010-02-24 Thread Jeff
On Feb 24, 2010, at 8:44 AM, Jeff wrote: Notice on the second run the plan is still beef when it was set to 49abf0 (which when passed as the arg is correct) Any perl gurus have any further info on this? It was a bit surprising to encounter this. I'm guessing it has something to do with

Re: [GENERAL] Cast char to number

2010-02-24 Thread Joshua D. Drake
On Wed, 2010-02-24 at 13:35 -0700, Scott Marlowe wrote: You might want to clean up the values before doing this. That won't work in this case. char() can't be cast to int/numeric. Not only that it isn't possible to clean up the data in table because char automatically pads.

Re: [GENERAL] Cast char to number

2010-02-24 Thread Tom Lane
Joshua D. Drake j...@commandprompt.com writes: On Wed, 2010-02-24 at 20:22 +, Richard Huxton wrote: ALTER TABLE t ALTER COLUMN c TYPE integer USING c::integer; That won't work in this case. char() can't be cast to int/numeric. Not only that it isn't possible to clean up the data in table

Re: [GENERAL] Cast char to number

2010-02-24 Thread Scott Marlowe
On Wed, Feb 24, 2010 at 1:43 PM, Tom Lane t...@sss.pgh.pa.us wrote: Joshua D. Drake j...@commandprompt.com writes: On Wed, 2010-02-24 at 20:22 +, Richard Huxton wrote: ALTER TABLE t ALTER COLUMN c TYPE integer USING c::integer; That won't work in this case. char() can't be cast to

Re: [GENERAL] Curious plperl behavior

2010-02-24 Thread Tom Lane
Jeff thres...@threshar.is-a-geek.com writes: [ oracular excerpt from perlref ] So is this just a dark corner of Perl, or is plperl doing something to help you get confused? In particular, do we need to add anything to the plperl documentation? We're not trying to explain Perl to people, but if

Re: [GENERAL] Curious plperl behavior

2010-02-24 Thread Richard Huxton
On 24/02/10 20:55, Tom Lane wrote: Jeffthres...@threshar.is-a-geek.com writes: [ oracular excerpt from perlref ] So is this just a dark corner of Perl, or is plperl doing something to help you get confused? In particular, do we need to add anything to the plperl documentation? We're not

Re: [GENERAL] Curious plperl behavior

2010-02-24 Thread Tom Lane
Richard Huxton d...@archonet.com writes: On 24/02/10 20:55, Tom Lane wrote: but if plperl is doing something that contributes to this, maybe it requires documentation. It is documented. http://www.postgresql.org/docs/8.4/static/plperl-funcs.html Note: The use of named nested

Re: [GENERAL] Cast char to number

2010-02-24 Thread Christine Penner
This is what I did. set all blank columns to '0' because they were causing errors. alter table T alter column a type integer using a::integer That worked perfectly. Thanks everyone for the help. Christine At 12:46 PM 24/02/2010, Scott Marlowe wrote: On Wed, Feb 24, 2010 at 1:43 PM, Tom Lane

Re: [GENERAL] Curious plperl behavior

2010-02-24 Thread Richard Huxton
On 24/02/10 21:34, Tom Lane wrote: Richard Huxtond...@archonet.com writes: On 24/02/10 20:55, Tom Lane wrote: but if plperl is doing something that contributes to this, maybe it requires documentation. It is documented. http://www.postgresql.org/docs/8.4/static/plperl-funcs.html Hmm.

Re: [GENERAL] Cast char to number

2010-02-24 Thread Raymond O'Donnell
On 24/02/2010 21:42, Christine Penner wrote: This is what I did. set all blank columns to '0' because they were causing errors. alter table T alter column a type integer using a::integer That worked perfectly. Glad you got sorted. Bill's advice upthread is worth taking on board - if

Re: [GENERAL] Cast char to number

2010-02-24 Thread Bill Moran
In response to Raymond O'Donnell r...@iol.ie: On 24/02/2010 21:42, Christine Penner wrote: This is what I did. set all blank columns to '0' because they were causing errors. alter table T alter column a type integer using a::integer That worked perfectly. Glad you got sorted.

Re: [GENERAL] Curious plperl behavior

2010-02-24 Thread Tom Lane
Richard Huxton d...@archonet.com writes: On 24/02/10 21:34, Tom Lane wrote: Hmm. Jeff found some relevant material on perlref. Should that link be added? Should the link(s) be more specific than telling you to read the whole d*mn man page? Neither of those pages are short, and each

Re: [GENERAL] Cast char to number

2010-02-24 Thread Richard Huxton
On 24/02/10 22:03, Bill Moran wrote: Then, a year later you find out that the serial number is really just a number, and you actually want to be able to do math on it because you can find out the year the part was designed by dividing by 1000 or something. You make the best decisions you can

[GENERAL] Performance comparison

2010-02-24 Thread Martijn van Oosterhout
Hoi, I remember a while back someone posted a graphs showing a scalability of postgresql for various versions (I think 8.0 to 8.4). I've tried to find this image again but havn't been able to locate it. Does anyone here remember? Mvg, -- Martijn van Oosterhout klep...@svana.org

Re: [GENERAL] pg_buffercache's usage count

2010-02-24 Thread Ben Chobot
On Feb 24, 2010, at 11:09 AM, Greg Smith wrote: Alvaro Herrera wrote: BTW the only reason you don't see buffers having a larger usage is that the counters are capped at that value. Right, the usage count is limited to 5 for no reason besides that seems like a good number. We keep

Re: [GENERAL] how to clear server log

2010-02-24 Thread Ben Chobot
On Feb 24, 2010, at 7:57 AM, Amy Smith wrote: this is the server log file, how many days server log files need to be keep as a mimumum ? thanks That question is up to you to answer. How far back do you want to be able to look? What do you do with your log files? As you no doubt have

Re: [GENERAL] How to get the permissions assigned to user?

2010-02-24 Thread Alex Hunsaker
On Tue, Feb 23, 2010 at 23:22, Jignesh Shah jignesh.shah1...@gmail.com wrote: Hi, Is there any way to get the set of permissions list assigned to user? I want to know whether user has create table permissions on particular schema or not? See

Re: [GENERAL] Performance comparison

2010-02-24 Thread Greg Smith
Martijn van Oosterhout wrote: I remember a while back someone posted a graphs showing a scalability of postgresql for various versions (I think 8.0 to 8.4). I've tried to find this image again but havn't been able to locate it. Does anyone here remember?

Re: [GENERAL] Possible causes for database corruption and solutions

2010-02-24 Thread Greg Smith
Bruce Momjian wrote: Is changing the OS/X wal_sync_method default something we should consider? It's certainly reasonable to consider changing both OS X and Windows so wal_sync_method defaulted to fsync_writethrough, and provide safer operation by default on both those platforms. It

Re: [GENERAL] Missing clog, PITR

2010-02-24 Thread Greg Smith
Patryk Sidzina wrote: 1) how do the clogs relate to wal shipping based replication? Clearly the master doesn't need that clog but the slave does. They should just be kept in sync. There's some useful background on this topic at

Re: [GENERAL] archive_timeout in postgresql.conf

2010-02-24 Thread Greg Smith
akp geek wrote: I am trying to set up the PG_STANDBY on our database setup. our requirement is, In case of disaster we should be able to bring up standby, the lag time allowed in our setup is up to 2 hours. The question I have is, what should be the

[GENERAL] select issue with order v8.1

2010-02-24 Thread Terry
Hello, I have an application that is doing something stupid in that it is tacking on its own order clause at the end of the statement I am providing. For example, I am putting this statement in: select ev_id,type,ev_time,category,error,ev_text,userid,ex_long,client_ex_long,ex_text from

Re: [GENERAL] select issue with order v8.1

2010-02-24 Thread Tom Lane
Terry td3...@gmail.com writes: I have an application that is doing something stupid in that it is tacking on its own order clause at the end of the statement I am providing. For example, I am putting this statement in: select

Re: [GENERAL] select issue with order v8.1

2010-02-24 Thread Scott Marlowe
On Wed, Feb 24, 2010 at 8:50 PM, Terry td3...@gmail.com wrote: Hello, I have an application that is doing something stupid in that it is tacking on its own order clause at the end of the statement I am providing. For example, I am putting this statement in: select