Re: [GENERAL] Table with differerent Data Types

2008-04-23 Thread Klint Gore
xaviergxf wrote: Hi, I´m trying to do the follow: create a table like: create table t( cod serial, data_type char(10), value ??? ); I would like to do the follow the table would tell me what data type its the value. For instance: insert into t values(1, 'Integer', 12); insert into t

Re: [GENERAL] error connecting to database: could not open relation

2008-04-23 Thread Martijn van Oosterhout
On Thu, Apr 24, 2008 at 05:44:04AM +0100, "PontoSI - Consultoria, Informática e Serviços LDA" wrote: > > Hi, > I've had a server crash on a machine running FreeBSD 6 and PG 8.2.5. The > database was running at the time of the crash, and probably there was > some lost data. When I try to start P

Re: [GENERAL] WAL shipping with archive_timeout & pg_switch_xlog()

2008-04-23 Thread wstrzalka
I've just realized that I can call pg_switch_xlog() from cron or pgAgent instead of using archive_timeout, but the question is still open. Doing it internally in PG would be much more elegant. Thanks Wojtek Strzalka -- Sent via

[GENERAL] WAL shipping with archive_timeout & pg_switch_xlog()

2008-04-23 Thread wstrzalka
I have a question if it is possible that having archive_timeout set up it will behave like pg_switch_xlog() in the term of non creating new WAL when there are no changes in the database. archive_timeout is used for WAL shipping to standby server in my case (are there any other reasons?), but WAL i

Re: [GENERAL] Updating with a subselect

2008-04-23 Thread Leandro Casadei
On Wed, Apr 23, 2008 at 10:59 AM, Stephan Szabo < [EMAIL PROTECTED]> wrote: > On Tue, 22 Apr 2008, Leandro Casadei wrote: > > > Hi, I need to update a field from a table based in a count. > > > > This is the query: > > > > > > updateshops > > setitemsqty = > > ( > > select coun

[GENERAL] Best backup setup

2008-04-23 Thread Gabor Siklos
I need to back up our database off-site for disaster recovery. If I just back up the entire database data directory (i.e. /var/lib/pgsql/data) will I be able to restore from there? Or should I instead just dump the data, using pg_dump, and back up the dump? The advantage of the first method would

Re: [GENERAL] Bitmap Heap Scan takes a lot of time

2008-04-23 Thread mateo21
On 23 avr, 14:12, [EMAIL PROTECTED] (Gregory Stark) wrote: > <[EMAIL PROTECTED]> writes: > > This is the result of an EXPLAIN: > >... > > I suppose that the problem comes from the Bitmap Heap Scan which costs > > a lot, but I can't be totally sure. > > > Any idea on where I should be investigating

Re: [GENERAL] plpgsql and logical expression evaluation

2008-04-23 Thread wstrzalka
On 23 Kwi, 16:32, [EMAIL PROTECTED] (Tom Lane) wrote: > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > I think this business of non-shortcircuiting boolean operators is just > > an artifact of the fact that PL/pgSQL hands off expression to the SQL > > engine for evaluation. > > The complainant is n

[GENERAL] Re: Trouble running PostgreSQL server / Server must be started under certain locale.

2008-04-23 Thread cgastrell
Have you guys tried this? Solved a lot of problems for me running ubuntu... may be not permanent, but enough to get it running and get a dump... just maybe http://blog.andrewbeacock.com/2007/01/how-to-change-your-default-locale-on.html -- Sent via pgsql-general mailing list (pgsql-general@postgr

[GENERAL] Table with differerent Data Types

2008-04-23 Thread xaviergxf
Hi, I´m trying to do the follow: create a table like: create table t( cod serial, data_type char(10), value ??? ); I would like to do the follow the table would tell me what data type its the value. For instance: insert into t values(1, 'Integer', 12); insert into t values(2, 'String',

[GENERAL] error connecting to database: could not open relation

2008-04-23 Thread PontoSI - Consultoria, Informática e Serviços LDA
Hi, I've had a server crash on a machine running FreeBSD 6 and PG 8.2.5. The database was running at the time of the crash, and probably there was some lost data. When I try to start PG in single mode (and width -P) he complains that he "could not open relation with OID 2661". Because the fil

Re: [GENERAL] initdb in 8.3

2008-04-23 Thread Craig Ringer
Christopher Condit wrote: > I have a question related to this issue: > Now that the locale has changed, it seems that the planner no longer > wants to use the indexes for running LIKE queries on varchar columns > unless I specify varchar_pattern_ops when creating the index. And if I > create the in

Re: [GENERAL] Stored procedures in C

2008-04-23 Thread Andrej Ricnik-Bay
On 24/04/2008, Emiliano Moscato <[EMAIL PROTECTED]> wrote: > I have to do some stuff writing stored procedures for Postgres in C. I saw > the oficial documentation but it was hard for me to find out how to do a > simple function, let's call it "query()" , that receives a string and uses > this stri

Re: [GENERAL] Column order

2008-04-23 Thread Robert Treat
On Wednesday 23 April 2008 21:33, Vyacheslav Kalinin wrote: > Hello, > > It is often convenient to have columns of a table in certain order (as > shown by psql or most GUI database explorers, it also affects INSERT's > without columns specified behavior) so as to most significant columns > to > com

[GENERAL] Column order

2008-04-23 Thread Vyacheslav Kalinin
Hello, It is often convenient to have columns of a table in certain order (as shown by psql or most GUI database explorers, it also affects INSERT's without columns specified behavior) so as to most significant columns to come first, semantically close columns to be grouped etc, while the columns

Re: [GENERAL] Need to update all my 60 million rows at once without transactional integrity

2008-04-23 Thread Dann Corbit
> -Original Message- > From: [EMAIL PROTECTED] [mailto:pgsql-general- > [EMAIL PROTECTED] On Behalf Of Chris Browne > Sent: Wednesday, April 23, 2008 3:20 PM > To: pgsql-general@postgresql.org > Subject: Re: [GENERAL] Need to update all my 60 million rows at once > without transactional int

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-23 Thread brian
Scott Marlowe wrote: On Wed, Apr 23, 2008 at 12:10 PM, Karsten Hilbert <[EMAIL PROTECTED]> wrote: On Wed, Apr 23, 2008 at 12:38:48PM +0200, Andreas 'ads' Scherbaum wrote: > Yes. You should/can use ENUM for something like 'gender': > male, female, unknown. You don't need to add other values ev

Re: [GENERAL] Need to update all my 60 million rows at once without transactional integrity

2008-04-23 Thread Chris Browne
[EMAIL PROTECTED] writes: > How can I make a Update of a column in a very large table for all > rows without using the double amount of disc space and without any > need for atomic operation? You may need to redefine the problem. > I have a very large table with about 60 million rows. I sometimes

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-23 Thread Scott Marlowe
On Wed, Apr 23, 2008 at 12:10 PM, Karsten Hilbert <[EMAIL PROTECTED]> wrote: > On Wed, Apr 23, 2008 at 12:38:48PM +0200, Andreas 'ads' Scherbaum wrote: > > > Yes. You should/can use ENUM for something like 'gender': > > male, female, unknown. You don't need to add other values ever (yeah, i > >

Re: [GENERAL] Vacuuming Questions

2008-04-23 Thread John Gardner
Joshua D. Drake wrote: On Wed, 23 Apr 2008 16:27:33 +0100 John Gardner <[EMAIL PROTECTED]> wrote: We have two PostgreSQL servers (8.2) running in a cluster. Could you be a bit more specific about what you mean by: in a cluster? Well, we're using middleware technology to load balance and clu

Re: [GENERAL] initdb in 8.3

2008-04-23 Thread Tim Tassonis
Karsten Hilbert wrote: On Wed, Apr 23, 2008 at 11:46:35AM +0200, Tim Tassonis wrote: As you probably are all aware of, this results now in a cluster that will only allow you to create UTF-8 databases. I have read some posts regarding this topic where it is explained that allowing LATIN1 on a

Re: [GENERAL] Stored procedures in C

2008-04-23 Thread Martin Gainty
Emiliano and Mike The real challenge is trying to determine what a datatype is in cobol..for that matter what is stack variable or heap in Cobol? In the end you're better off writing this mess (preferably in Java).. unless of course you need the billable hours for the first rewrite to C then la

Re: [GENERAL] Need to update all my 60 million rows at once without transactional integrity

2008-04-23 Thread Alban Hertroys
On Apr 21, 2008, at 12:19 AM, [EMAIL PROTECTED] wrote: Hi! How can I make a Update of a column in a very large table for all rows without using the double amount of disc space and without any need for atomic operation? I have a very large table with about 60 million rows. I sometimes ne

Re: [GENERAL] Need to update all my 60 million rows at once without transactional integrity

2008-04-23 Thread Tom Allison
Far from being an expert on postgres, but there are two ideas-- assuming that you cannot afford the time it would take to simply UPDATE and wait... Write a script to update all the rows, one at a time. Lowest impact to operations but would take a very long time. Assuming you have a sequenc

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-23 Thread Rob Wultsch
On Wed, Apr 23, 2008 at 2:51 PM, Robert Treat <[EMAIL PROTECTED]> wrote: > On Wednesday 23 April 2008 14:10, Karsten Hilbert wrote: > > On Wed, Apr 23, 2008 at 12:38:48PM +0200, Andreas 'ads' Scherbaum wrote: > > > Yes. You should/can use ENUM for something like 'gender': > > > male, female, unk

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-23 Thread Robert Treat
On Wednesday 23 April 2008 14:10, Karsten Hilbert wrote: > On Wed, Apr 23, 2008 at 12:38:48PM +0200, Andreas 'ads' Scherbaum wrote: > > Yes. You should/can use ENUM for something like 'gender': > > male, female, unknown. You don't need to add other values ever (yeah, i > > skipped some special case

Re: [GENERAL] Create temporary function

2008-04-23 Thread Steve Crawford
Tom Lane wrote: Steve Crawford <[EMAIL PROTECTED]> writes: I have recently run across situations that might benefit from the ability to create a temporary function. You can do that today, as long as you don't mind schema-qualifying uses of the function: regression=# create function pg

Re: [GENERAL] query question really cant give a summary here so read the body ;-)

2008-04-23 Thread Colin Wetherbee
Roberts, Jon wrote: On 23/04/2008 20:33, Roberts, Jon wrote: create table ugly [...snip...] create or replace function fn_ugly() returns setof ugly as [...snip...] create temporary table temp_ugly [...snip...] select * from fn_ugly(); [...snip...] Heh heh - I think we get the point!

Re: [GENERAL] query question really cant give a summary here so read the body ;-)

2008-04-23 Thread Roberts, Jon
> On 23/04/2008 20:33, Roberts, Jon wrote: > > > create table ugly > > [...snip...] > > > create or replace function fn_ugly() returns setof ugly as > > [...snip...] > > > create temporary table temp_ugly > > [...snip...] > > > select * from fn_ugly(); > > [...snip...] > > Heh heh - I th

Re: [GENERAL] query performance

2008-04-23 Thread Tom Lane
Brian Cox <[EMAIL PROTECTED]> writes: > I have a largish (pg_dump output is 4G) database. The query: > select count(*) from some-table > was taking 120 secs to report that there were 151,000+ rows. > This seemed very slow. This db gets vacuum'd regularly (at least once > per day). I also did a manu

[GENERAL] query performance

2008-04-23 Thread Brian Cox
I have a largish (pg_dump output is 4G) database. The query: select count(*) from some-table was taking 120 secs to report that there were 151,000+ rows. This seemed very slow. This db gets vacuum'd regularly (at least once per day). I also did a manual 'vacuum analyze', but after it completed,

Re: [GENERAL] query question really cant give a summary here so read the body ;-)

2008-04-23 Thread Raymond O'Donnell
On 23/04/2008 20:33, Roberts, Jon wrote: create table ugly [...snip...] create or replace function fn_ugly() returns setof ugly as [...snip...] create temporary table temp_ugly [...snip...] select * from fn_ugly(); [...snip...] Heh heh - I think we get the point! LOL :-) Ray.

Re: [GENERAL] query question really cant give a summary here so read the body ;-)

2008-04-23 Thread Roberts, Jon
You really don't have duplicate data and you should redesign your table structure. However, here is a way to do it. create table ugly (aid integer, bid integer); insert into ugly (aid, bid) values (1,5); insert into ugly (aid, bid) values (2,6); insert into ugly (aid, bid) values (3,7); insert

[GENERAL] Stored procedures in C

2008-04-23 Thread Emiliano Moscato
Hi all, I have to do some stuff writing stored procedures for Postgres in C. I saw the oficial documentation but it was hard for me to find out how to do a simple function, let's call it "query()" , that receives a string and uses this string to do a query and return the results. Has anyone some e

Re: [GENERAL] query question really cant give a summary here so read the body ;-)

2008-04-23 Thread James Strater
This works in oracle: SELECT aid, bid FROM aidbid WHERE aid < bid UNION SELECT bid, aid FROM aidbid WHERE bid < aid Rhys Stewart <[EMAIL PROTECTED]> wrote: Hi all, have the following table aid| bid -- 1|5 2|6 3|7 4|9 5|1 6|2 7|3

Re: [GENERAL] query question really cant give a summary here so read the body ;-)

2008-04-23 Thread Scott Marlowe
I'd say you need to rethink your schema. On Wed, Apr 23, 2008 at 12:11 PM, Rhys Stewart <[EMAIL PROTECTED]> wrote: > Hi all, > > have the following table > > aid| bid > -- > 1|5 > 2|6 > 3|7 > 4|9 > 5|1 > 6|2 > 7|3 > 8|10 > 9|4 > 10 |8 > both aid

Re: [GENERAL] Create temporary function

2008-04-23 Thread Tom Lane
Steve Crawford <[EMAIL PROTECTED]> writes: > I have recently run across situations that might benefit from the > ability to create a temporary function. You can do that today, as long as you don't mind schema-qualifying uses of the function: regression=# create function pg_temp.tfunc(int) return

[GENERAL] Create temporary function

2008-04-23 Thread Steve Crawford
I have recently run across situations that might benefit from the ability to create a temporary function. One situation is where periodic processing would benefit from server-side functions but the processing is run rarely (say monthly or annually) and the requirements for the function may cha

Re: [GENERAL] Need to update all my 60 million rows at once without transactional integrity

2008-04-23 Thread Simon Riggs
On Mon, 2008-04-21 at 00:19 +0200, [EMAIL PROTECTED] wrote: > How can I make a Update of a column in a very large table for all rows > without using the double amount of disc space and without any need for > atomic operation? > > I have a very large table with about 60 million rows. I sometimes n

Re: [GENERAL] initdb in 8.3

2008-04-23 Thread Christopher Condit
I have a question related to this issue: Now that the locale has changed, it seems that the planner no longer wants to use the indexes for running LIKE queries on varchar columns unless I specify varchar_pattern_ops when creating the index. And if I create the index with varchar_pattern_ops, then

Re: [GENERAL] initdb in 8.3

2008-04-23 Thread Karsten Hilbert
On Wed, Apr 23, 2008 at 11:46:35AM +0200, Tim Tassonis wrote: > As you probably are all aware of, this results now in a cluster that > will only allow you to create UTF-8 databases. I have read some posts > regarding this topic where it is explained that allowing LATIN1 on a > cluster initia

[GENERAL] query question really cant give a summary here so read the body ;-)

2008-04-23 Thread Rhys Stewart
Hi all, have the following table aid| bid -- 1|5 2|6 3|7 4|9 5|1 6|2 7|3 8|10 9|4 10 |8 both aid & bid represent the same data in another table, but the table has duplicate data and i did a self-join to get the id's out. The question is how do

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-23 Thread Karsten Hilbert
On Wed, Apr 23, 2008 at 12:38:48PM +0200, Andreas 'ads' Scherbaum wrote: > Yes. You should/can use ENUM for something like 'gender': > male, female, unknown. You don't need to add other values ever (yeah, i > skipped some special cases). I was gonna say ! :-) Add hermaphrodite transgender with

[GENERAL] ROLAP visualization tool recommendations

2008-04-23 Thread Roberts, Jon
I'm looking for a good BI tool to query data in PostgreSQL. I'm not looking for a "pixel perfect" reporting tool but a tool that supports things like: * Star Schema * Drill up/down with hierarchies defined in metadata * Self service * Graphing * Scheduling In other words, I want a ROLAP visualiz

Re: [GENERAL] PG Yum Repo - can't Find Slony1

2008-04-23 Thread Devrim GÜNDÜZ
Hi, On Wed, 2008-04-23 at 17:10 +0800, Ow Mun Heng wrote: > This question, I think is directed at Devrim, but if anyone else can > answer it would be great as well. > > I saw from the site that states that slony1 packages are available. > However, I can't find it from the yum archives. This is fo

Re: [GENERAL] Need to update all my 60 million rows at once without transactional integrity

2008-04-23 Thread Steve Crawford
[EMAIL PROTECTED] wrote: Hi! How can I make a Update of a column in a very large table for all rows without using the double amount of disc space and without any need for atomic operation? I have a very large table with about 60 million rows. I sometimes need to do a simple update to ALL rows

Re: [GENERAL] initdb in 8.3

2008-04-23 Thread Tim Tassonis
Martijn van Oosterhout wrote: On Wed, Apr 23, 2008 at 04:35:04PM +0200, Tim Tassonis wrote: If specifying a characterset different from the default locale for a database is such a bad idea, why is it possible at all? It isn't possible, that's the point. What is possible is that client can us

Re: [GENERAL] Vacuuming Questions

2008-04-23 Thread Scott Marlowe
On Wed, Apr 23, 2008 at 9:27 AM, John Gardner <[EMAIL PROTECTED]> wrote: > We have two PostgreSQL servers (8.2) running in a cluster. > > We have autovacuum switched on on both servers and also we are running the > following as a cron job; > > Server 1: > 30 0,2,4,6,8,10,12,14,16,18,20,22 * * *

Re: [GENERAL] Updating with a subselect

2008-04-23 Thread Stephan Szabo
On Wed, 23 Apr 2008, Leandro Casadei wrote: > On Wed, Apr 23, 2008 at 10:59 AM, Stephan Szabo < > [EMAIL PROTECTED]> wrote: > > > On Tue, 22 Apr 2008, Leandro Casadei wrote: > > > > > Hi, I need to update a field from a table based in a count. > > > > > > This is the query: > > > > > > > > > upda

Re: [GENERAL] initdb in 8.3

2008-04-23 Thread Peter Eisentraut
Am Mittwoch, 23. April 2008 schrieb Tim Tassonis: > If specifying a characterset different from the default locale for a > database is such a bad idea, why is it possible at all? Because Japanese users need this functionality. Aside from spectacularly bizarre niche applications, that is really t

Re: [GENERAL] initdb in 8.3

2008-04-23 Thread Martijn van Oosterhout
On Wed, Apr 23, 2008 at 04:35:04PM +0200, Tim Tassonis wrote: > Ok, let me put it in another way. If UTF-8 is chosen at initdb, only > UTF-8 databases can be created, if C is chosen, you can specify > different encodings (UTF-8, LATIN1 etc) for each database. > > As I understood now, sorting wil

Re: [GENERAL] Vacuuming Questions

2008-04-23 Thread Joshua D. Drake
On Wed, 23 Apr 2008 16:27:33 +0100 John Gardner <[EMAIL PROTECTED]> wrote: > We have two PostgreSQL servers (8.2) running in a cluster. Could you be a bit more specific about what you mean by: in a cluster? > Now, we're not seeing any problems with performance and we're not > seeing any bloat bu

Re: [GENERAL] Debian etch, backport postgresql 8.3 experiences?

2008-04-23 Thread Martijn van Oosterhout
On Wed, Apr 23, 2008 at 02:34:38PM +0200, Ivan Sergio Borgonovo wrote: > plain etch. pg 8.1 client, server and contrib + php5-pgsql > > My "dream" upgrade would be: I don't know about dream upgrade, but this should work (assuming you're currently running a debian postgresql installation): 1. ins

[GENERAL] Vacuuming Questions

2008-04-23 Thread John Gardner
We have two PostgreSQL servers (8.2) running in a cluster. We have autovacuum switched on on both servers and also we are running the following as a cron job; Server 1: 30 0,2,4,6,8,10,12,14,16,18,20,22 * * * /usr/bin/vacuumdb --all --analyze Server 2: 30 1,3,5,7,9,11,13,15,17,19,21,23 * * *

Re: [GENERAL] Need to update all my 60 million rows at once without transactional integrity

2008-04-23 Thread Pavan Deolasee
On Mon, Apr 21, 2008 at 3:49 AM, <[EMAIL PROTECTED]> wrote: > > Could I use that to hack my way around transactions? > Since you are asking for trouble, may there is something you can do with Before UPDATE Triggers and heap_inplace_update(). Before you try this out: I must say, *I have no idea

Re: [GENERAL] Backup setup

2008-04-23 Thread Alan Hodgson
On Wednesday 23 April 2008, "Gabor Siklos" <[EMAIL PROTECTED]> wrote: > I need to back up our database off-site for disaster recovery. If I just > back up the entire database data directory (i.e. /var/lib/pgsql/data) > will I be able to restore from there? Technically you can do this, if you do it

Re: [GENERAL] Backup setup

2008-04-23 Thread Christophe
For a database that big, you might consider using the WAL archiving strategy and shipping the WAL files offsite: http://www.postgresql.org/docs/8.3/interactive/continuous- archiving.html On Apr 23, 2008, at 8:14 AM, Gabor Siklos wrote: I need to back up our database off-site for disaster r

Re: [GENERAL] Backup setup

2008-04-23 Thread Tom Lane
"Gabor Siklos" <[EMAIL PROTECTED]> writes: > I need to back up our database off-site for disaster recovery. If I just > back up the entire database data directory (i.e. /var/lib/pgsql/data) will I > be able to restore from there? This will not work. Please read http://www.postgresql.org/docs/8.3/

Re: [GENERAL] Need to update all my 60 million rows at once without transactional integrity

2008-04-23 Thread Merlin Moncure
On Wed, Apr 23, 2008 at 9:04 AM, Alvaro Herrera <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > > How can I make a Update of a column in a very large table for all rows > > without using the double amount of disc space and without any need for > > atomic operation? > > > > I have a

Re: [GENERAL] Debian etch, backport postgresql 8.3 experiences?

2008-04-23 Thread Greg Smith
I collected up links to the best of the information I found out there on this topic and dumped them into http://wiki.postgresql.org/wiki/Detailed_installation_guides One of those is a walkthrough of an upgrade, it looked straightforward. -- * Greg Smith [EMAIL PROTECTED] http://www.gregsmith.c

Re: [GENERAL] Backup setup

2008-04-23 Thread Terry Lee Tucker
On Wednesday 23 April 2008 11:14, Gabor Siklos wrote: > I need to back up our database off-site for disaster recovery. If I just > back up the entire database data directory (i.e. /var/lib/pgsql/data) will > I be able to restore from there? Or should I instead just dump the data, > using pg_dump, a

[GENERAL] Backup setup

2008-04-23 Thread Gabor Siklos
I need to back up our database off-site for disaster recovery. If I just back up the entire database data directory (i.e. /var/lib/pgsql/data) will I be able to restore from there? Or should I instead just dump the data, using pg_dump, and back up the dump? The advantage of the first method would b

Re: [GENERAL] Deny creation of tables for a user

2008-04-23 Thread Tom Lane
"Roberts, Jon" <[EMAIL PROTECTED]> writes: > You probably want to also "REVOKE ALL ON SCHEMA public FROM public;" so > users can't create objects in that schema. More like REVOKE CREATE ..., unless your intent is also to deny access to existing stuff in the public schema. You'd also want to make

Re: [GENERAL] tsearch2 problem

2008-04-23 Thread Tom Lane
Craig Ringer <[EMAIL PROTECTED]> writes: > Is there any chance your contrib package does not match the core > PostgreSQL version or is from a different source? qsort_arg was added in 8.2, so it seems certain he's trying to load an 8.2 tsearch2 into his 8.1 engine. regards,

Re: [GENERAL] initdb in 8.3

2008-04-23 Thread Tim Tassonis
Peter Eisentraut wrote: Am Mittwoch, 23. April 2008 schrieb Tim Tassonis: My question is: Why then is --locale=C not the default for initdb, as I do regard it as a rather big annoyance that a default installation on probably almost any modern linux distribution results in a UTF-8 only cluster, f

Re: [GENERAL] plpgsql and logical expression evaluation

2008-04-23 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > I think this business of non-shortcircuiting boolean operators is just > an artifact of the fact that PL/pgSQL hands off expression to the SQL > engine for evaluation. The complainant is not actually complaining about non-shortcircuiting boolean operato

Re: [GENERAL] Qty of WAL files

2008-04-23 Thread Tom Lane
Glyn Astill <[EMAIL PROTECTED]> writes: > I've set the checkpoint_segments on our system to 20 in anticipation of our > system being quite write heavy, and I was wondering if someone could give me > the lowdown on the amount of WAL files created and how they're re-used. http://www.postgresql.org

Re: [GENERAL] Deny creation of tables for a user

2008-04-23 Thread Albe Laurenz
Pascal Cohen wrote: > I am playing with security in Postgres > And I would like to have a database that can be managed by a given user > that could do almost anything but I would also have a user that can just > handle what is created. > I mean she could insert, update delete rows but not create

Re: [GENERAL] Updating with a subselect

2008-04-23 Thread Stephan Szabo
On Tue, 22 Apr 2008, Leandro Casadei wrote: > Hi, I need to update a field from a table based in a count. > > This is the query: > > > updateshops > setitemsqty = > ( > select count(*) > from items i1 > join shops s1 on i1.shopid = s1.shopid > where s1.sh

Re: FW: Re: [GENERAL] create temp in function

2008-04-23 Thread Kerri Reno
Thanks for all who helped me with this. I just upgraded our one remaining database to 8.2 and EXECUTE INTO worked great. THANKS! Kerri On 4/22/08, Klint Gore <[EMAIL PROTECTED]> wrote: > > Kerri Reno wrote: > > > So the reason I'm getting the error is that I'm running it in 8.0. > > Thanks so m

[GENERAL] Qty of WAL files

2008-04-23 Thread Glyn Astill
Hi chaps, I've set the checkpoint_segments on our system to 20 in anticipation of our system being quite write heavy, and I was wondering if someone could give me the lowdown on the amount of WAL files created and how they're re-used. I've just read in a large amount of data into the database a

[GENERAL] Qty of WAL files

2008-04-23 Thread Glyn Astill
Hi chaps, I've set the checkpoint_segments on our system to 20 in anticipation of our system being quite write heavy, and I was wondering if someone could give me the lowdown on the amount of WAL files created and how they're re-used. I've just read in a large amount of data into the database a

Re: [GENERAL] Need to update all my 60 million rows at once without transactional integrity

2008-04-23 Thread Alvaro Herrera
[EMAIL PROTECTED] wrote: > How can I make a Update of a column in a very large table for all rows > without using the double amount of disc space and without any need for > atomic operation? > > I have a very large table with about 60 million rows. I sometimes need > to do a simple update to ALL

Re: [GENERAL] plpgsql and logical expression evaluation

2008-04-23 Thread Alvaro Herrera
Martijn van Oosterhout escribió: > On Tue, Apr 22, 2008 at 02:41:50AM -0700, wstrzalka wrote: > > One of the annoying things in plpgsql is logical expression > > evaluation. > > > > In most (all??) languages I know, logical expression like: > > > > if ( [A_true_expression] or [B_false_expres

Re: [GENERAL] Deny creation of tables for a user

2008-04-23 Thread Roberts, Jon
> Terry Lee Tucker wrote: > > On Wednesday 23 April 2008 06:46, Pascal Cohen wrote: > > > >> Hello > >> I am playing with security in Postgres > >> And I would like to have a database that can be managed by a given user > >> that could do almost anything but I would also have a user that can > jus

Re: [GENERAL] Debian etch, backport postgresql 8.3 experiences?

2008-04-23 Thread Ivan Sergio Borgonovo
On Wed, 23 Apr 2008 12:04:08 +0200 Peter Eisentraut <[EMAIL PROTECTED]> wrote: > Am Mittwoch, 23. April 2008 schrieb Ivan Sergio Borgonovo: > > I'd like to know if anyone has experience in using postgresql 8.3 > > for amd64. > > There are probably thousands of people with that experience. I'd li

Re: [GENERAL] Bitmap Heap Scan takes a lot of time

2008-04-23 Thread Gregory Stark
<[EMAIL PROTECTED]> writes: > This is the result of an EXPLAIN: >... > I suppose that the problem comes from the Bitmap Heap Scan which costs > a lot, but I can't be totally sure. > > Any idea on where I should be investigating ? Try posting an EXPLAIN ANALYZE which will actually run the query an

[GENERAL] Re: Need to update all my 60 million rows at once without transactional integrity

2008-04-23 Thread Tomasz Ostrowski
On 2008-04-21 00:19, [EMAIL PROTECTED] wrote: > I have a very large table with about 60 million rows. I sometimes > need to do a simple update to ALL rows that resets a status-flag to > zero. > UPDATE table SET flag=0; First optimization: UPDATE table SET flag=0 where flag!=0; Second optimi

Re: [GENERAL] Deny creation of tables for a user

2008-04-23 Thread Pascal Cohen
Terry Lee Tucker wrote: On Wednesday 23 April 2008 06:46, Pascal Cohen wrote: Hello I am playing with security in Postgres And I would like to have a database that can be managed by a given user that could do almost anything but I would also have a user that can just handle what is created. I

Re: [GENERAL] initdb in 8.3

2008-04-23 Thread Peter Eisentraut
Am Mittwoch, 23. April 2008 schrieb Tim Tassonis: > My question is: Why then is --locale=C not the default for initdb, as I > do regard it as a rather big annoyance that a default installation on > probably almost any modern linux distribution results in a UTF-8 only > cluster, fixable only by drop

Re: [GENERAL] Deny creation of tables for a user

2008-04-23 Thread Terry Lee Tucker
On Wednesday 23 April 2008 06:46, Pascal Cohen wrote: > Hello > I am playing with security in Postgres > And I would like to have a database that can be managed by a given user > that could do almost anything but I would also have a user that can just > handle what is created. > I mean she could in

Re: [GENERAL] Rapidly decaying performance repopulating a large table

2008-04-23 Thread Tomasz Ostrowski
On 2008-04-22 23:46, David Wilson wrote: > Upping the segments to 50, timeout to 30m and completion target to > 0.9 has improved average copy time to between 2 and 10 seconds, which > is definitely an improvement. I'd up them to 128 (or even 256) and set completion target back to 0.5. But make su

[GENERAL] Deny creation of tables for a user

2008-04-23 Thread Pascal Cohen
Hello I am playing with security in Postgres And I would like to have a database that can be managed by a given user that could do almost anything but I would also have a user that can just handle what is created. I mean she could insert, update delete rows but not create tables. I did not fin

Re: [GENERAL] Need to update all my 60 million rows at once without transactional integrity

2008-04-23 Thread Pavan Deolasee
On Wed, Apr 23, 2008 at 1:52 PM, A. Kretschmer <[EMAIL PROTECTED]> wrote: > am Mon, dem 21.04.2008, um 0:19:34 +0200 mailte [EMAIL PROTECTED] folgendes: > > > > > If I do a batched loop like this: > > UPDATE table SET flag=0 where id>=0 and id <200; > > UPDATE table SET flag=0 where id>=200 a

Re: [GENERAL] initdb in 8.3

2008-04-23 Thread Richard Huxton
Tim Tassonis wrote: Hi I just recently compiled and installed 8.3.1 on a System that has UTF-8 as the default characterset in the environment. Copied the binaries, run initdb without parameters, the usual stuff. As you probably are all aware of, this results now in a cluster that will only

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-23 Thread Andreas 'ads' Scherbaum
On Tue, 22 Apr 2008 15:45:39 -0500 D. Dante Lorenso wrote: > Andreas 'ads' Scherbaum wrote: > > So, the advice here is "don't use ENUM"? Yes. You should/can use ENUM for something like 'gender': male, female, unknown. You don't need to add other values ever (yeah, i skipped some special cases).

[GENERAL] initdb in 8.3

2008-04-23 Thread Tim Tassonis
Hi I just recently compiled and installed 8.3.1 on a System that has UTF-8 as the default characterset in the environment. Copied the binaries, run initdb without parameters, the usual stuff. As you probably are all aware of, this results now in a cluster that will only allow you to create U

Re: [GENERAL] Debian etch, backport postgresql 8.3 experiences?

2008-04-23 Thread Peter Eisentraut
Am Mittwoch, 23. April 2008 schrieb Ivan Sergio Borgonovo: > I'd like to know if anyone has experience in using postgresql 8.3 for > amd64. There are probably thousands of people with that experience. > How did you set up your apt config/source.list to just install the > minimum required to insta

Re: [GENERAL] Rapidly decaying performance repopulating a large table

2008-04-23 Thread Simon Riggs
On Tue, 2008-04-22 at 18:46 -0400, David Wilson wrote: > I certainly expect some slowdown, given that I have indices that I > can't drop (as you indicate above). Having been watching it now for a > bit, I believe that the checkpoint settings were the major cause of > the problem, however. Changing

[GENERAL] Debian etch, backport postgresql 8.3 experiences?

2008-04-23 Thread Ivan Sergio Borgonovo
Hi, I'd like to know if anyone has experience in using postgresql 8.3 for amd64. How did you set up your apt config/source.list to just install the minimum required to install 8.3 and php drivers? Considering I'm not concerned of a "short" downtime and the DB is pretty small what were your steps

[GENERAL] PG Yum Repo - can't Find Slony1

2008-04-23 Thread Ow Mun Heng
This question, I think is directed at Devrim, but if anyone else can answer it would be great as well. I saw from the site that states that slony1 packages are available. However, I can't find it from the yum archives. This is for Centos 5. Does anyone know? muchos gracias. -- Sent via pgsql-g

Re: [GENERAL] Postgresql Help

2008-04-23 Thread Aarni Ruuhimäki
On Monday 21 April 2008 12:08, Monalee Bhandge wrote: > pg_ctl start -D /var/lib/pgsql/data > then error is-> > postmaster started. > Could not open directory "base" No such file or > directory. Hi, Did you initdb in that location ? Best regards, -- Aarni Ruuhimäki --- Burglar

Re: [GENERAL] Updating with a subselect

2008-04-23 Thread Martijn van Oosterhout
On Tue, Apr 22, 2008 at 01:17:42PM -0300, Leandro Casadei wrote: > Hi, I need to update a field from a table based in a count. > > This is the query: I don't know why your given query doesn't work, but you could simplify it which may help. > updateshops > setitemsqty = > ( > sele

Re: [GENERAL] plpgsql and logical expression evaluation

2008-04-23 Thread Martijn van Oosterhout
On Tue, Apr 22, 2008 at 02:41:50AM -0700, wstrzalka wrote: > One of the annoying things in plpgsql is logical expression > evaluation. > > In most (all??) languages I know, logical expression like: > > if ( [A_true_expression] or [B_false_expression] ) then > > will stop evaluating when the

Re: [GENERAL] Updating with a subselect

2008-04-23 Thread A. Kretschmer
am Tue, dem 22.04.2008, um 13:17:42 -0300 mailte Leandro Casadei folgendes: > Hi, I need to update a field from a table based in a count. > > This is the query: > > > updateshops > setitemsqty = > ( > select count(*) > from items i1 > join shops s1 on i1.sho

Re: [GENERAL] Need to update all my 60 million rows at once without transactional integrity

2008-04-23 Thread A. Kretschmer
am Mon, dem 21.04.2008, um 0:19:34 +0200 mailte [EMAIL PROTECTED] folgendes: > Hi! > > How can I make a Update of a column in a very large table for all rows > without using the double amount of disc space and without any need for atomic > operation? > > I have a very large table with about 6

Re: [GENERAL] tsearch2 problem

2008-04-23 Thread Craig Ringer
Corin Schedler wrote: > Hi all, > > I'm having some trouble installing tsearch2 in to my database. I'm > running 8.1.11 on CentOS 5. Where did the packages come from? Where they part of CentOS / RHEL, or are they obtained from somewhere else? Is there any chance your contrib package does not mat

Re: [GENERAL] Postgresql Help

2008-04-23 Thread Craig Ringer
Monalee Bhandge wrote: > Dear Sir, > I am thinking to shift my software Axbo7.1 (see > http://axbo.co.in/ ) > to postgresql from mysql. > I have Suse 10.2 operating system in my organization.I > install version 8.1.5-13 successfuly. > but when I start server as> > pg_ctl start -D /var/

Re: [GENERAL] help with "plpgsql"

2008-04-23 Thread A. Kretschmer
am Mon, dem 21.04.2008, um 17:46:49 +0200 mailte Pau Marc Munoz Torres folgendes: > Hi everybody > > I trying to upload some plpsql functions to postgresql database using a perl > script and i get the following error > > > psql:/usr/local/Make2D-DB_II/pgsql/make2db_functions.pgsql:85: ERROR:

Re: [GENERAL] Changed Hosts, Lots of Errors in PostgreSQL - Help Please!

2008-04-23 Thread BLazeD
Hey there Yup it went from 8.1.9 to 8.3 Adrian Klaver wrote: > > On Friday 18 April 2008 8:27 pm, BLazeD wrote: >> Hi All >> >> I recently changed hosts for my PHP/PostgreSQL site and have been seeing >> alot of errors in the errors logs and also some on the site. >> >> [quote]PHP Warning: p

  1   2   >