[GENERAL] Problem about export/import postgresql tables use pg_dump/pg_restore

2010-02-08 Thread Ma, Dong (vinc...@bas-becom-bj)
Hi all, Recently I want to import a new table into a existing database, I run with follow steps: 1. Export my whole database schema from test machine database: pg_dump -s -F t -f dumpfile database 2. Import only one table into existing database: pg_restore -F t -d database -t

[GENERAL]

2010-02-08 Thread jehanzeb mirza
hi im facing a problem of installing postgre sql in my windows based system please guide me the way i have downloaded the application but i cannot find any setup file in it. secondly has anyone had experience on working both on geoserver and postgresql(POSTGIS) how do i interrelate them jehanzeb

Re: [GENERAL]

2010-02-08 Thread Filip Rembiałkowski
2010/2/8 jehanzeb mirza jehanzeb.mirz...@gmail.com hi im facing a problem of installing postgre sql in my windows based system please guide me the way i have downloaded the application but i cannot find any setup file in it. which installer have you downloaded? you should use this one:

Re: [GENERAL] Multiple buffer cache?

2010-02-08 Thread Alvaro Herrera
Greg Stark wrote: I doubt pinning buffers ever improve system on any halfway modern system. It will often *look* like it has improved performance because it improves the performance of the queries you're looking at -- but at the expense of slowing down everything else. There is a use case

Re: [GENERAL] weird bug in rebuilding RPMs

2010-02-08 Thread Alvaro Herrera
zhong ming wu escribió: I can now rebuild rpms so that all files go under a specific directory specified by _prefix directive in ~/.rpmmacros Forgetting lots of other bugs that I managed to fix, this weird bug is making me use _prefix that does not include the word pgsql in the path name

Re: [GENERAL] weird bug in rebuilding RPMs

2010-02-08 Thread Tom Lane
Alvaro Herrera alvhe...@commandprompt.com writes: zhong ming wu escribió: I can now rebuild rpms so that all files go under a specific directory specified by _prefix directive in ~/.rpmmacros Forgetting lots of other bugs that I managed to fix, this weird bug is making me use _prefix that

[GENERAL] which the best way to start postgres.

2010-02-08 Thread erobles
Which is the best way to start postgres througth pc_ctl or postmaster -- La información contenida en este correo electrónico es confidencial de Sensa Control Digital, S.A. de C.V. Está dirigido solamente a la dirección de correo señalada. El acceso a este correo electrónico por

Re: [GENERAL] PostgreSQL + Hibernate, Apache Mod Security, SQL Injection and you (a love story)

2010-02-08 Thread David Kerr
On Fri, Feb 05, 2010 at 12:09:57PM -0800, John R Pierce wrote: - that would be a function of how you use Postgresql. if you do the - typical PHP hacker style of building statements with inline values then - executing them, you're vunerable unless you totally sanitize all your - inputs.

Re: [GENERAL] PostgreSQL + Hibernate, Apache Mod Security, SQL Injection and you (a love story)

2010-02-08 Thread David Kerr
On Fri, Feb 05, 2010 at 09:19:40PM +0100, Sebastian Hennebrueder wrote: - John R Pierce schrieb: - David Kerr wrote: - Howdy all, - - We're using Postgres 8.3 with all of our apps connecting to the database - with Hibernate / JPA. - - Our security team is concerned about SQL Injection attacks,

Re: [GENERAL] which the best way to start postgres.

2010-02-08 Thread erobles
i forgot, the version of postgresql is 8.3.1 througth pg_ctl or postmaster or postgres ?? erobles wrote: Which is the best way to start postgres througth pc_ctl or postmaster -- La informacin contenida en este correo electrnico es confidencial de Sensa Control

Re: [GENERAL] Multiple buffer cache?

2010-02-08 Thread Greg Smith
Alvaro Herrera wrote: This should be easy to test, no? Just set some variable while running latency-critical queries that makes PinBuffer increment usage_count by more than one when pinning a buffer. Such a buffer would have its usage count typically higher than a buffer only used for regular

Re: [GENERAL] which the best way to start postgres.

2010-02-08 Thread John R Pierce
erobles wrote: Which is the best way to start postgres througth pc_ctl or postmaster depends on your OS too. on a RH/Fedora kind of install, where there is a /etc/init.d script to start postgres, the best way of starting it is... # /etc/init.d/postgresql start on a windows

[GENERAL] second concurrent update takes forever

2010-02-08 Thread Janning Vygen
Hi folks, I don't need this list very often because postgresql works like a charm! But today we encountered a rather complicated puzzle for us. We really need your help! we are using postgresql 8.4 on a debian lenny with latest security patches applied. We are running a rather complicated

Re: [GENERAL] second concurrent update takes forever

2010-02-08 Thread Tom Lane
Janning Vygen vy...@kicktipp.de writes: We are running a rather complicated Update statement from time to time which is only triggered by administrators. The statement updates about 50.000 rows. It takes usually about 10-30 seconds to execute and that's fine for us. This time two

[GENERAL] turning a tsvector without position in a weighted tsvector

2010-02-08 Thread Ivan Sergio Borgonovo
If I convert a string to a tsvector just casting (::tsvector) I obtain a vector without positions. tsvectors without positions don't have weights too. I haven't found a way to turn a vector without weight/pos, into a vector with weight/pos. Is there a way to apply weight/add positions to

[GENERAL] Creating subsets on timestamp with modulo, date_trunc and ?suggestions?

2010-02-08 Thread Davor J.
A simple way I came up is to truncate the date. So if you have 2009-08-08, and you want a subset on month, then just truncate the day-part: 2009-08-00 on the whole column, and SELECT DISTINCT so you have a subset. You can use this subset then to join the dates, GROUP BY and aggregate An

[GENERAL] One column to multiple columns based on constraints?

2010-02-08 Thread Davor J.
Let's say you have a table: CREATE TABLE t ( time date, data integer ) Suppose you want a new table that has columns similar to the following: (x.time, x.data, y.time, y.data, z.time, z.data) where x.time, y.time and z.time columns are constrained (for example x.time 2007 AND x.time 2008,

[GENERAL] R: One column to multiple columns based on constraints?

2010-02-08 Thread Vincenzo Romano
Look for crosstab in the documentation. Il giorno 8 feb, 2010 8:21 p., Davor J. dav...@live.com ha scritto: Let's say you have a table: CREATE TABLE t ( time date, data integer ) Suppose you want a new table that has columns similar to the following: (x.time, x.data, y.time, y.data, z.time,

Re: [GENERAL] turning a tsvector without position in a weighted tsvector

2010-02-08 Thread Oleg Bartunov
Ivan, what's wrong with: postgres=# select 'abc:1'::tsvector; tsvector -- 'abc':1 postgres=# select setweight('abc:1'::tsvector,'a'); setweight --- 'abc':1A or just use to_tsvector() instead of casting? Oleg On Mon, 8 Feb 2010, Ivan Sergio Borgonovo wrote: If I convert

[GENERAL] WINDOW functions - proposed addition weight (dp) for percent_rank, cume_dist

2010-02-08 Thread Michael van der Kolff
Dear all, I have a bunch of CDRs which I turned into a running list showing how many were in progress at any one time: WITH parameters as ( SELECT (timestamp with time zone '2010-01-19 00:00:01+11') as beginning, (timestamp with time zone '2010-01-19 00:00:01+11') + (interval '24

Re: [GENERAL] turning a tsvector without position in a weighted tsvector

2010-02-08 Thread Ivan Sergio Borgonovo
On Mon, 8 Feb 2010 23:01:45 +0300 (MSK) Oleg Bartunov o...@sai.msu.su wrote: Ivan, what's wrong with: postgres=# select 'abc:1'::tsvector; tsvector -- 'abc':1 Yes you're right. I think I misplaced some quotes. But still, once a vector has no position, I can't add the

[GENERAL] How do I delete duplicate rows in a table?

2010-02-08 Thread Wang, Mary Y
Hi, I have a table that have that duplicate rows. How do I find them and delete them? Please advise. Mary -- 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] How do I delete duplicate rows in a table?

2010-02-08 Thread Ivan Sergio Borgonovo
On Mon, 8 Feb 2010 15:32:51 -0800 Wang, Mary Y mary.y.w...@boeing.com wrote: Hi, I have a table that have that duplicate rows. How do I find them and delete them? http://www.webthatworks.it/d1/node/page/eliminating_duplicates_place_without_oid_postgresql Most likely I've learned it

[GENERAL] vacuumdb ERROR: out of memory

2010-02-08 Thread David Kerr
I'm getting error: When I try vacuumdb -z assessment or vacuumdb assessment I get: vacuumdb: vacuuming of database assessment failed: ERROR: out of memory DETAIL: Failed on request of size 1073741820. The only way i can actually analyze the DB is if i do a vacuumdb -f The database is

[GENERAL] viewing large queries in pg_stat_activity

2010-02-08 Thread David Kerr
It seems like pg_stat_activity truncates the current_query to about 1024 characters. The field is a text, so i'm wondering if there is a way to see the full query? (I know i can turn on log_statement=all, or log_min_duration_statement) but i'd like something that doesn't require a restart.

[GENERAL] Order by and strings

2010-02-08 Thread Fredric Fredricson
Hi! New to the list with a question that I cannot find the answer to in the manual or on the internet but I suspect is trivial. If somebody could point me in the correct direction I would be greatful. This is what I do (condensed, of course): # create table tmp ( x text ) ; CREATE TABLE #

Re: [GENERAL] vacuumdb ERROR: out of memory

2010-02-08 Thread Tom Lane
David Kerr d...@mr-paradox.net writes: I'm getting error: When I try vacuumdb -z assessment or vacuumdb assessment I get: vacuumdb: vacuuming of database assessment failed: ERROR: out of memory DETAIL: Failed on request of size 1073741820. What have you got maintenance_work_mem set to?

Re: [GENERAL] Order by and strings

2010-02-08 Thread Justin Graf
On 2/8/2010 7:09 PM, Fredric Fredricson wrote: Hi! New to the list with a question that I cannot find the answer to in the manual or on the internet but I suspect is trivial. If somebody could point me in the correct direction I would be greatful. This is what I do (condensed, of course):

Re: [GENERAL] vacuumdb ERROR: out of memory

2010-02-08 Thread David Kerr
Tom Lane wrote: David Kerr d...@mr-paradox.net writes: I'm getting error: When I try vacuumdb -z assessment or vacuumdb assessment I get: vacuumdb: vacuuming of database assessment failed: ERROR: out of memory DETAIL: Failed on request of size 1073741820. What have you got

[GENERAL] How do I drop a CONSTRAINT TRIGGER?

2010-02-08 Thread Wang, Mary Y
Hi, How do I drop a CONSTRAINT TRIGGER? Thanks Mary -- 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] vacuumdb ERROR: out of memory

2010-02-08 Thread Tom Lane
David Kerr d...@mr-paradox.net writes: Tom Lane wrote: David Kerr d...@mr-paradox.net writes: I get: vacuumdb: vacuuming of database assessment failed: ERROR: out of memory DETAIL: Failed on request of size 1073741820. What have you got maintenance_work_mem set to? maintenance_work_mem

Re: [GENERAL] vacuumdb ERROR: out of memory

2010-02-08 Thread David Kerr
Tom Lane wrote: David Kerr d...@mr-paradox.net writes: Tom Lane wrote: David Kerr d...@mr-paradox.net writes: I get: vacuumdb: vacuuming of database assessment failed: ERROR: out of memory DETAIL: Failed on request of size 1073741820. What have you got maintenance_work_mem set to?

Re: [GENERAL] vacuumdb ERROR: out of memory

2010-02-08 Thread John R Pierce
David Kerr wrote: maintenance_work_mem = 1GB So evidently, when it tries to actually allocate 1GB, it can't do it. Ergo, that setting is too high for your machine. ... seems like i've got 2GB free. is this a 64bit postgres build? if not, you're probably running out of virtual address

[GENERAL] pg_stat_user_indexes and pg_stat_user_tables description?

2010-02-08 Thread AI Rumman
Could anyone please tell me where may I get the details of the following views: pg_stat_user_indexes pg_stat_user_tables I want to know the meaning of every column like idx_tup_read and idx_tup_fetch.

Re: [GENERAL] pg_stat_user_indexes and pg_stat_user_tables description?

2010-02-08 Thread Ben Chobot
On Feb 8, 2010, at 9:02 PM, AI Rumman wrote: Could anyone please tell me where may I get the details of the following views: pg_stat_user_indexes pg_stat_user_tables I want to know the meaning of every column like idx_tup_read and idx_tup_fetch. The fine user manual is helpful for

[GENERAL] importing from a file with UTF-8 escape characters

2010-02-08 Thread Seb
Hi, I'm trying to import the geonames table from http://download.geonames.org/export/dump/allCountries.zip. A PostgreSQL user recommended using: create table geonames ( geonameid int, namevarchar(200), asciinamevarchar(200),

Re: [GENERAL] questions about a table's row estimates

2010-02-08 Thread Ben Chobot
On Feb 5, 2010, at 12:14 PM, Ben Chobot wrote: I'm looking at pg_stat_user_tables in 8.4.2, and I'm confused about n_live_tup. Shouldn't that be at least fairly close to (n_tup_ins - n_tup-del)? It doesn't seem to be, but I'm unclear why. Is everybody else unclear as well? -- Sent via

Re: [GENERAL] How do I drop a CONSTRAINT TRIGGER?

2010-02-08 Thread A. Kretschmer
In response to Wang, Mary Y : Hi, How do I drop a CONSTRAINT TRIGGER? Just with DROP TRIGGER: test=# create table foo(a int); CREATE TABLE test=*# create function foo_proc() returns trigger as $$begin return new; end; $$ language plpgsql; CREATE FUNCTION test=*# create constraint trigger