Re: [GENERAL] [Plproxy-users] A complex plproxy query

2009-01-22 Thread Igor Katson
Hannu Krosing wrote: On Thu, 2009-01-22 at 02:33 +0300, Igor Katson wrote: So to say, give me the list of friends (not only their ID's, but all the needed columns!) of given individual, which are in a given group. That seems ok without plproxy, but with using it, I can't imagine how can I

[GENERAL] conditional execution of insert/update-s

2009-01-22 Thread Dmitry Teslenko
Hello! Question is what's the easiest way to implement conditional execution of insert/update-s via psql interface? As far as I know there's following options: 1) create function in procedural language (plpgsql, for example); then call that function 2) update ... where ; insert ... (select ... whe

[GENERAL] how to specify the locale that psql uses

2009-01-22 Thread Kent Tong
Hi, I am running a Chinese edition of XP. When I start psql, it is probably trying to display Chinese and maybe it gets the encoding wrong, it displays garbage in its console. Is there any way to tell it to just use English instead? In Linux, one can do something like "LC_ALL=en psql" but it do

Re: [GENERAL] how to specify the locale that psql uses

2009-01-22 Thread Reg Me Please
On Thursday 22 January 2009 09:36:53 Kent Tong wrote: > Hi, > > I am running a Chinese edition of XP. When I start psql, it is probably > trying to display Chinese and > maybe it gets the encoding wrong, it displays garbage in its console. Is > there any way to tell it to > just use English instead

Re: [GENERAL] how to specify the locale that psql uses

2009-01-22 Thread Kent Tong
Reg Me Please wrote: > > psql --help ? > which option you're referring to? I tried --locale but it had no effect. - -- Kent Tong Wicket tutorials freely available at http://www.agileskills2.org/EWDW Axis2 tutorials freely available at http://www.agileskills2.org/DWSAA -- View this mess

Re: [GENERAL] autovacuum daemon

2009-01-22 Thread Raymond O'Donnell
On 22/01/2009 07:15, Abdul Rahman wrote: > Your solution of using ps command is for Linux but I am using WinXp. > That is why it confused me. No problem! :-) It occurred to me after I sent the email that you might not be on Linux It's a good idea, when posting questions, to include as much b

Re: [ADMIN] [GENERAL] bytea size limit?

2009-01-22 Thread Albe Laurenz
Please don't top post. paulo matadr wrote: >>> My aplication return erro: >>> >>> 2009-01-20 10:22:03,264 INFO [STDOUT] Caused by: org.postgresql.util. >>> PSQLException: ERROR: invalid memory alloc request size 1705447581 >> >> What are you doing in terms of SQL? >> INSERT, UPDATE, DELETE? >>

Re: [GENERAL] how to specify the locale that psql uses

2009-01-22 Thread Reg Me Please
On Thursday 22 January 2009 10:04:58 Kent Tong wrote: > Reg Me Please wrote: > > psql --help ? > > which option you're referring to? I tried --locale but it had no effect. > > > - > -- > Kent Tong > Wicket tutorials freely available at http://www.agileskills2.org/EWDW > Axis2 tutorials freely a

Re: [GENERAL] how to specify the locale that psql uses

2009-01-22 Thread Kent Tong
Reg Me Please wrote: > > Weel, you have two locales: one on the client and one the server. > The former is needed for "translations" to the server whenver the two > don't > match. > The latter is chosen at the CREATE DATABASE ENCODING . > I am referring to the locale on the client that dete

[GENERAL] how to avoid that a postgres session eats up all the memory

2009-01-22 Thread Clemens Schwaighofer
Hi, I just literally trashed my test server with one delete statement because the psql used up all its memory and started to swap like crazy. my delete looked like this DELETE FROM table_foo WHERE bar_id IN (SELECT DISTINCT bar_id FROM bar LEFT JOIN ... LEFT JOIN ... LEFT JOIN WHERE table.

Re: [GENERAL] how to avoid that a postgres session eats up all the memory

2009-01-22 Thread Richard Huxton
Clemens Schwaighofer wrote: > Hi, > > I just literally trashed my test server with one delete statement > because the psql used up all its memory and started to swap like crazy. > > my delete looked like this > > DELETE FROM table_foo WHERE bar_id IN (SELECT DISTINCT bar_id FROM bar > LEFT JOIN

Re: [GENERAL] how to avoid that a postgres session eats up all the memory

2009-01-22 Thread Grzegorz Jaśkiewicz
try making it in two steps,using temp table maybe. how many rows does the subselect generate ? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] [Plproxy-users] A complex plproxy query

2009-01-22 Thread Marko Kreen
On 1/22/09, Igor Katson wrote: > Hannu Krosing wrote: > > On Thu, 2009-01-22 at 02:33 +0300, Igor Katson wrote: > > > > > >> So to say, give me the list of friends (not only their ID's, but all the > >> needed columns!) of given individual, which are in a given group. That > >> seems ok with

Re: [GENERAL] how to specify the locale that psql uses

2009-01-22 Thread Reg Me Please
On Thursday 22 January 2009 10:51:41 Kent Tong wrote: > Reg Me Please wrote: > > Weel, you have two locales: one on the client and one the server. > > The former is needed for "translations" to the server whenver the two > > don't > > match. > > The latter is chosen at the CREATE DATABASE ENCODING

Re: [GENERAL] [Plproxy-users] A complex plproxy query

2009-01-22 Thread Igor Katson
Marko Kreen wrote: On 1/22/09, Igor Katson wrote: Hannu Krosing wrote: > On Thu, 2009-01-22 at 02:33 +0300, Igor Katson wrote: > > >> So to say, give me the list of friends (not only their ID's, but all the >> needed columns!) of given individual, which are in a given group. That >> se

Res: [ADMIN] [GENERAL] bytea size limit?

2009-01-22 Thread paulo matadr
I think identified the problem lts's check log below: Query: SELECTSTATEMENT: select relatorios0_.fuin_id as fuin5_1_, relatorios0_.rege_id as rege1_1_, relatorios0_.rege_id as r ege1_624_0_, relatorios0_.rege_tmultimaalteracao as rege2_624_0_, relatorios0_.rege_nnpaginas as rege3_624_0_, rel

Re: [ADMIN] [GENERAL] bytea size limit?

2009-01-22 Thread Grzegorz Jaśkiewicz
checkpoints don't have anything to do with it. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] difference between current_timestamp and now() in quotes

2009-01-22 Thread Grzegorz Jaśkiewicz
test2=# create table dupa(a timestamp, b serial); NOTICE: CREATE TABLE will create implicit sequence "dupa_b_seq" for serial column "dupa.b" CREATE TABLE test2=# insert into dupa(a) select current_timestamp from generate_series(1,100); INSERT 0 100 test2=# insert into dupa(a) select 'current_ti

Re: [GENERAL] [Plproxy-users] A complex plproxy query

2009-01-22 Thread Hannu Krosing
On Thu, 2009-01-22 at 15:10 +0300, Igor Katson wrote: > Ok, thank you, guys. What is the best way to make an array out of a > column? I didn't make up anything better then writing a function: > > CREATE OR REPLACE FUNCTION int_column_to_array(query text) RETURNS int[] > AS $$ > DECLARE >

Re: [GENERAL] [Plproxy-users] A complex plproxy query

2009-01-22 Thread Igor Katson
Hannu Krosing wrote: On Thu, 2009-01-22 at 15:10 +0300, Igor Katson wrote: Ok, thank you, guys. What is the best way to make an array out of a column? I didn't make up anything better then writing a function: CREATE OR REPLACE FUNCTION int_column_to_array(query text) RETURNS int[] AS $$

Re: [GENERAL] [Plproxy-users] A complex plproxy query

2009-01-22 Thread Hannu Krosing
On Thu, 2009-01-22 at 16:13 +0200, Hannu Krosing wrote: > On Thu, 2009-01-22 at 15:10 +0300, Igor Katson wrote: > > > Ok, thank you, guys. What is the best way to make an array out of a > > column? I didn't make up anything better then writing a function: > > > > CREATE OR REPLACE FUNCTION int_c

Re: [GENERAL] [Plproxy-users] A complex plproxy query

2009-01-22 Thread Igor Katson
Hannu Krosing wrote: On Thu, 2009-01-22 at 16:13 +0200, Hannu Krosing wrote: On Thu, 2009-01-22 at 15:10 +0300, Igor Katson wrote: Ok, thank you, guys. What is the best way to make an array out of a column? I didn't make up anything better then writing a function: CREATE OR REPLACE F

Re: [GENERAL] Slow update

2009-01-22 Thread Marc Mamin
> I don't see why it would This may reduce I/O activity and reduce the vacuum activity on this table. Here a small example: insert into update_test select * from generate_series (1,10) vacuum full verbose update_test -> INFO: "update_test": found 0 removable, 10 nonremovable row versi

Re: [GENERAL] how to specify the locale that psql uses

2009-01-22 Thread Kent Tong
Reg Me Please wrote: > > In general, refer to "8.13.2. Encoding Handling" and "Chapter 22. > Localization" on v8.3.5 documentation. > Thanks for your replies. However, as I said before, I am asking for the locale controlling the text prompts printed by psql. I've read the chapter you quoted b

Re: [GENERAL] how to specify the locale that psql uses

2009-01-22 Thread Albe Laurenz
Kent Tong wrote: > I am referring to the locale on the client that determines the text prompts > it outputs. I think "Reg me Please" got you wrong, here's the answer: To set the locale for server messages, set the server configuration parameter "lc_messages" to the appropriate value. You can ei

Re: [GENERAL] difference between current_timestamp and now() in quotes

2009-01-22 Thread Raymond O'Donnell
On 22/01/2009 13:52, Grzegorz Jaśkiewicz wrote: > test2=# insert into dupa(a) select 'current_timestamp' from > generate_series(1,100); > ERROR: date/time value "current" is no longer supported This doesn't answer your question, but you use current_timestamp without the quotes, thus - insert

Re: [ADMIN] [GENERAL] bytea size limit?

2009-01-22 Thread Albe Laurenz
Please don't top post. paulo matadr wrote: > I think identified the problem > lts's check log below: > > Query: > SELECTSTATEMENT: select relatorios0_.fuin_id as fuin5_1_, > relatorios0_.rege_id as rege1_1_, relatorios0_.rege_id as r > ege1_624_0_, relatorios0_.rege_tmultimaalteracao as rege2_6

Re: [GENERAL] difference between current_timestamp and now() in quotes

2009-01-22 Thread Alvaro Herrera
Grzegorz Jaśkiewicz escribió: > test2=# insert into dupa(a) select 'current_timestamp' from > generate_series(1,100); > ERROR: date/time value "current" is no longer supported > LINE 1: insert into dupa(a) select 'current_timestamp' from generate... >^ > test2=

Re: [GENERAL] difference between current_timestamp and now() in quotes

2009-01-22 Thread Adrian Klaver
On Thursday 22 January 2009 8:16:46 am Alvaro Herrera wrote: > Grzegorz Jaśkiewicz escribió: > > test2=# insert into dupa(a) select 'current_timestamp' from > > generate_series(1,100); > > ERROR: date/time value "current" is no longer supported > > LINE 1: insert into dupa(a) select 'current_times

Re: [GENERAL] difference between current_timestamp and now() in quotes

2009-01-22 Thread Jason Long
Adrian Klaver wrote: On Thursday 22 January 2009 8:16:46 am Alvaro Herrera wrote: Grzegorz Jaśkiewicz escribió: test2=# insert into dupa(a) select 'current_timestamp' from generate_series(1,100); ERROR: date/time value "current" is no longer supported LINE 1: insert into dupa(a) select

Re: [GENERAL] difference between current_timestamp and now() in quotes

2009-01-22 Thread Adrian Klaver
On Thursday 22 January 2009 9:07:37 am Jason Long wrote: > Adrian Klaver wrote: > > On Thursday 22 January 2009 8:16:46 am Alvaro Herrera wrote: > >> Grzegorz Jaśkiewicz escribió: > >>> test2=# insert into dupa(a) select 'current_timestamp' from > >>> generate_series(1,100); > >>> ERROR: date/time

Re: [GENERAL] difference between current_timestamp and now() in quotes

2009-01-22 Thread Grzegorz Jaśkiewicz
well, I am asking that - for pure curiosity reason. I got a function in C, that automagically puts all data in quotes, and that's how I came across that strange difference between current_time and now(). Funny enough, pg will translate first one to latter in domains, for instance. -- Sent via pgs

[GENERAL] problem converting database to UTF-8

2009-01-22 Thread David Goodenough
I have a database which was created as LATIN1 (the machine has the wrong locales installed when I set up PG). It is running 8.3. So I found various places which said the way to do this was to do a pg_dumpall -f dump_file, get rid of the entire database, init_db -E UTF-8, and then psql -f dumpfi

Resp.: [GENERAL] difference between current_timestamp and now() in quotes

2009-01-22 Thread Osvaldo Kussama
2009/1/22, Adrian Klaver : > On Thursday 22 January 2009 8:16:46 am Alvaro Herrera wrote: >> Grzegorz Jaśkiewicz escribió: >> > test2=# insert into dupa(a) select 'current_timestamp' from >> > generate_series(1,100); >> > ERROR: date/time value "current" is no longer supported >> > LINE 1: insert

Re: Resp.: [GENERAL] difference between current_timestamp and now() in quotes

2009-01-22 Thread Reg Me Please
On Thursday 22 January 2009 18:57:16 Osvaldo Kussama wrote: > 2009/1/22, Adrian Klaver : > > On Thursday 22 January 2009 8:16:46 am Alvaro Herrera wrote: > >> Grzegorz Jaśkiewicz escribió: > >> > test2=# insert into dupa(a) select 'current_timestamp' from > >> > generate_series(1,100); > >> > ERROR

Re: [GENERAL] difference between current_timestamp and now() in quotes

2009-01-22 Thread Alvaro Herrera
Adrian Klaver escribió: > At least on 8.2 'now()' does not work either at least not in the way I think > you want. I get: > > test=# SELECT 'now()'; > ?column? > -- > now() > (1 row) alvherre=# select 'now()'::unknown::timestamptz; timestamptz

Re: [GENERAL] difference between current_timestamp and now() in quotes

2009-01-22 Thread Adrian Klaver
On Thursday 22 January 2009 10:04:05 am Alvaro Herrera wrote: > Adrian Klaver escribió: > > At least on 8.2 'now()' does not work either at least not in the way I > > think you want. I get: > > > > test=# SELECT 'now()'; > > ?column? > > -- > > now() > > (1 row) > > alvherre=# select 'no

[GENERAL] can't duplicate an error in a restored DB

2009-01-22 Thread Stefan Murphy
Postgres 8.1.11 I'm getting an error when trying to drop a primary key from a table because of foreign key constraints. This is OK, not worried about that. I am worried that I can't duplicate the problem in a DB created from a backup of my primary DB. The error happens in my primary production

Re: [GENERAL] How to find how much postgresql use the memory?

2009-01-22 Thread Scott Marlowe
On Wed, Jan 21, 2009 at 10:15 AM, Albe Laurenz wrote: > > Tom Lane suggested in > http://archives.postgresql.org/pgsql-general/2004-02/msg00471.php > that it might be better to set shared_buffers "relatively > small" and let the filesystem cache do the buffering, so that's > another way you can go

Re: [GENERAL] problem converting database to UTF-8

2009-01-22 Thread Vladimir Konrad
> Is there a definative HOWTO that I can follow, if not does someone > have a set of instructions that will work? What about running "iconv" command on the dumped .sql file and transform it to the utf8? Vlad PS: man iconv for manual -- Sent via pgsql-general mailing list (pgsql-general@postgre

Re: [GENERAL] problem converting database to UTF-8

2009-01-22 Thread David Goodenough
On Thursday 22 January 2009, Vladimir Konrad wrote: > > Is there a definative HOWTO that I can follow, if not does someone > > have a set of instructions that will work? > > What about running "iconv" command on the dumped .sql file and transform > it to the utf8? > > Vlad > > PS: man iconv for man

Re: [GENERAL] problem converting database to UTF-8

2009-01-22 Thread Vladimir Konrad
> iconv does not change the database encodings embedded in the file > (and it is quite large). Have you read the manual? file A pathname of an input file. If no file operands are specified, or if a file operand is '-', the standard input shall be used. cat the-source-dump

Re: [GENERAL] problem converting database to UTF-8

2009-01-22 Thread Alan Hodgson
On Thursday 22 January 2009, Vladimir Konrad wrote: > > iconv does not change the database encodings embedded in the file > > (and it is quite large). > > Have you read the manual? > >file A pathname of an input file. If no file operands are >specified, or if a file operand is '-

Re: [GENERAL] problem converting database to UTF-8

2009-01-22 Thread David Goodenough
On Thursday 22 January 2009, Vladimir Konrad wrote: > > iconv does not change the database encodings embedded in the file > > (and it is quite large). > > Have you read the manual? > >file A pathname of an input file. If no file operands are >specified, or if a file operand is '-'

Re: [GENERAL] problem converting database to UTF-8

2009-01-22 Thread Vladimir Konrad
> You have not understood what I said. I ran iconv, and it changes the > encoding of the data, but not the ENCODING= statements that are > embedded in the datastream. Yes I can change those with sed, but > I do not know what else I need to change. There must be an easier > way. Oops, please a

Re: [GENERAL] problem converting database to UTF-8

2009-01-22 Thread Alan Hodgson
On Thursday 22 January 2009, David Goodenough wrote: > > You have not understood what I said. I ran iconv, and it changes the > encoding of the data, but not the ENCODING= statements that are > embedded in the datastream. Yes I can change those with sed, but > I do not know what else I need to

Re: [GENERAL] problem converting database to UTF-8

2009-01-22 Thread Daniel Verite
Alan Hodgson wrote: Yeah it does. iconv buffers everything in memory, as I recall. However, you can "split" the file into manageable pieces, run each through iconv, and recombine afterwards. Another way is to just use GNU recode for large files instead of iconv. It's slower but do

Re: [GENERAL] problem converting database to UTF-8

2009-01-22 Thread Vladimir Konrad
> > cat the-source-dump.sql | iconv -t utf8 - > my-converted.sql > > > > Size should not matter in this case... > > Yeah it does. iconv buffers everything in memory, as I recall. Just found an alternative - "uconv" command (part of ICU project): http://www.icu-project.org/userguide/intro.html

[GENERAL] very long update gin index troubles back?

2009-01-22 Thread Ivan Sergio Borgonovo
I've a table that contain a tsvector that is indexed (gin) and triggers to update the tsvector that should then update the index. This gin index has always been problematic. Recreation and updates were very slow. Now I had to update 1M rows of that table but for columns that doesn't involve the t

Re: [GENERAL] how to avoid that a postgres session eats up all the memory

2009-01-22 Thread Clemens Schwaighofer
On 01/22/2009 07:11 PM, Richard Huxton wrote: > Clemens Schwaighofer wrote: >> Hi, >> >> I just literally trashed my test server with one delete statement >> because the psql used up all its memory and started to swap like crazy. >> >> my delete looked like this >> >> DELETE FROM table_foo WHERE ba

Re: [GENERAL] how to avoid that a postgres session eats up all the memory

2009-01-22 Thread Clemens Schwaighofer
On 01/22/2009 07:19 PM, Grzegorz Jaśkiewicz wrote: > try making it in two steps,using temp table maybe. > how many rows does the subselect generate ? the subselect returns 57.000 rows. -- [ Clemens Schwaighofer -=:~ ] [ IT Engineer/Web Producer/Planning/Manager

Re: [GENERAL] Slow update

2009-01-22 Thread Scott Marlowe
On Wed, Jan 21, 2009 at 9:36 AM, Herouth Maoz wrote: > I have a test machine - but the data in there is test data, and it's a > slower machine. A testing environment is good for development, but can > hardly be used to really simulate the production machine for performance. > What the other poste

[GENERAL] Segmentation fault in backend/access/heap/pruneheap.c: heap_page_prune_opt() calling PageIsPrunable () with NULL page on FreeBSD / PowerPC

2009-01-22 Thread Nick Withers
Hi y'all, I've been experiencing segfaults of PostgreSQL for quite a quite now (since July 2008, PostgreSQL 8.3.3, perhaps?) on a FreeBSD 7 PowerPC (7400) system (not sure if anyone really cares about this particular platform, but I'll try :-)): internal# gdb postgres postgres.core GNU gdb 6

Re: [GENERAL] Segmentation fault in backend/access/heap/pruneheap.c: heap_page_prune_opt() calling PageIsPrunable () with NULL page on FreeBSD / PowerPC

2009-01-22 Thread Tom Lane
Nick Withers writes: > I've been experiencing segfaults of PostgreSQL for quite a quite now > (since July 2008, PostgreSQL 8.3.3, perhaps?) on a FreeBSD 7 PowerPC > (7400) system (not sure if anyone really cares about this particular > platform, but I'll try :-)): Hmm, is this query accessing a t

Re: [GENERAL] Segmentation fault in backend/access/heap/pruneheap.c: heap_page_prune_opt() calling PageIsPrunable () with NULL page on FreeBSD / PowerPC

2009-01-22 Thread Nick Withers
On Thu, 2009-01-22 at 23:42 -0500, Tom Lane wrote: > Nick Withers writes: > > I've been experiencing segfaults of PostgreSQL for quite a quite now > > (since July 2008, PostgreSQL 8.3.3, perhaps?) on a FreeBSD 7 PowerPC > > (7400) system (not sure if anyone really cares about this particular > > p