Re: [GENERAL] Looping through cursor row batches

2008-10-06 Thread Henry Combrinck
Anyone know the most efficient way of FETCHing a batch of rows, and looping >> through them in a function? FETCHing a record at a time will work, but I >> was wondering whether this could be done. You're outsmarting yourself. :-) One can only try. plpgsql already does the equivalent of

[GENERAL] how to remove the duplicate records from a table

2008-10-06 Thread Yi Zhao
I have a table contains some duplicate records, and this table create without oids, for example: id | temp_id +- 10 | 1 10 | 1 10 | 1 20 | 4 20 | 4 30 | 5 30 | 5 I want get the duplicated records removed and only one is reserved, so th

Re: [GENERAL] Installation on CentOS 5.2 (readline trouble)

2008-10-06 Thread Greg Smith
On Mon, 6 Oct 2008, Carlos Moreno wrote: The configure script fails reporting it doesn't find readline. The package readline-devel *is* installed, and indeed the .so file is under /usr/lib and /usr/lib64 If I remember correctly this happens if you try to build from source but are missing ncur

Re: [GENERAL] Federated Server

2008-10-06 Thread Jonah H. Harris
On Mon, Oct 6, 2008 at 11:57 PM, searchelite <[EMAIL PROTECTED]> wrote: > Is there any capability of PostgreSQL to become a federated server? See http://archives.postgresql.org/pgsql-performance/2008-06/msg00182.php -- Jonah H. Harris, Senior DBA myYearbook.com -- Sent via pgsql-general mailin

[GENERAL] Federated Server

2008-10-06 Thread searchelite
Hi all.. Is there any capability of PostgreSQL to become a federated server? Thanks -- View this message in context: http://www.nabble.com/Federated-Server-tp19850547p19850547.html Sent from the PostgreSQL - general mailing list archive at Nabble.com. -- Sent via pgsql-general mailing list

Re: [GENERAL] Installation on CentOS 5.2 (readline trouble)

2008-10-06 Thread Scott Marlowe
On Mon, Oct 6, 2008 at 7:17 PM, Carlos Moreno <[EMAIL PROTECTED]> wrote: > > Hi, > > I just downloaded the latest, 8.3.4, and I'm trying to install it on > a CentOS 5.2 machine with all the updates (64-bit --- the system > is an Opteron DC) > > The configure script fails reporting it doesn't find

Re: [GENERAL] Can update triggers detect the column in the update statement?

2008-10-06 Thread Martin Gainty
hi ben trigger happens only a with dml update (you have to change something in the DB for the trigger to do its work) Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of S

[GENERAL] Installation on CentOS 5.2 (readline trouble)

2008-10-06 Thread Carlos Moreno
Hi, I just downloaded the latest, 8.3.4, and I'm trying to install it on a CentOS 5.2 machine with all the updates (64-bit --- the system is an Opteron DC) The configure script fails reporting it doesn't find readline. The package readline-devel *is* installed, and indeed the .so file is under

Re: [GENERAL] Can update triggers detect the column in the update statement?

2008-10-06 Thread Ben Chobot
On Oct 6, 2008, at 5:53 PM, Tom Lane wrote: Ben Chobot <[EMAIL PROTECTED]> writes: Say I have: create t (c1 int not null, c2 int); Is it possible to create an update trigger on t such updates will only be allowed if the update statement explicitly sets c1, even if the new value is the sa

Re: [GENERAL] Can update triggers detect the column in the update statement?

2008-10-06 Thread Tom Lane
Ben Chobot <[EMAIL PROTECTED]> writes: > Say I have: > create t (c1 int not null, c2 int); > Is it possible to create an update trigger on t such updates will only > be allowed if the update statement explicitly sets c1, even if the new > value is the same? No. A trigger can only tell whethe

Re: [GENERAL] feature idea

2008-10-06 Thread Klint Gore
hubert depesz lubaczewski wrote: hi would it be possible to allow (in psql) syntax like: \do = | grep ... or even: select * from table; | zcat - > /tmp/table.data.gz i.e. - adding | ... at the end of command to send its output via pipe to another program? usecase that i had today was pretty si

[GENERAL] Can update triggers detect the column in the update statement?

2008-10-06 Thread Ben Chobot
Say I have: create t (c1 int not null, c2 int); Is it possible to create an update trigger on t such updates will only be allowed if the update statement explicitly sets c1, even if the new value is the same? (I'm trying to write a change log system where the users are application users

Re: [GENERAL] feature idea

2008-10-06 Thread Tom Lane
hubert depesz lubaczewski <[EMAIL PROTECTED]> writes: > On Mon, Oct 06, 2008 at 11:45:44AM -0700, Steve Crawford wrote: >> What's wrong with: >> \o '| gzip -c - > foo.gz' >> \d >> \o > it's too long. and it requires disabling. i'd like something that would > work exactly like unix pipe - send inpu

Re: [GENERAL] Static functions

2008-10-06 Thread Joseph S
Martijn van Oosterhout wrote: On Sat, Oct 04, 2008 at 08:30:32PM -0400, Joseph S wrote: In this case, with the function being called over and over again inside a nested loop, it would be worth the effort. I'm not even talking about caching the result for the whole transaction block, just repla

Re: [GENERAL] postgres/postgis

2008-10-06 Thread Brent Wood
You might try the Geo repository for OpenSUSE. This includes builds in 32 & 64 bit for several other distros as well as OpenSUSE for the GIS related applications, but you will probably need to compile Postgres (that version) from scratch. Which is unfortunate, as the default build by compiling Po

Re: [GENERAL] Re: [Pkg-postgresql-public] Postgres major version support policy on Debian

2008-10-06 Thread Greg Smith
On Mon, 6 Oct 2008, Scott Marlowe wrote: On Mon, Oct 6, 2008 at 9:34 AM, Markus Wanner <[EMAIL PROTECTED]> wrote: Once Postgres supports in-place upgrades between major versions, this issue is solved. It has in the past but apparently the work required in coding and testing was too much and

Re: [GENERAL] SCROLL CURSOR

2008-10-06 Thread Tom Lane
<[EMAIL PROTECTED]> writes: > I declare a cursor as below: > DECLARE > links_cur SCROLL CURSOR IS SELECT * FROM road; > and get this error: > CONTEXT: invalid type name "SCROLL CURSOR IS SELECT * FROM road" What PG version? IIRC plpgsql didn't allow the SCROLL modifier there

Re: [GENERAL] feature idea

2008-10-06 Thread hubert depesz lubaczewski
On Mon, Oct 06, 2008 at 09:32:00PM +0200, Martijn van Oosterhout wrote: > Isn't this what \g does? only for queries. it doesn't work for psql builtins - like \do which i used in my original mail. best regards, depesz -- Linkedin: http://www.linkedin.com/in/depesz / blog: http://www.depesz.c

[GENERAL] SCROLL CURSOR

2008-10-06 Thread cyw
I declare a cursor as below: DECLARE links_cur SCROLL CURSOR IS SELECT * FROM road; and get this error: CONTEXT: invalid type name "SCROLL CURSOR IS SELECT * FROM road" If I take away 'SCROLL', it has no problem. Any hint? Thanks, cyw -- Sent via pgsql-general mailing lis

[GENERAL] how to use pam-pgsql

2008-10-06 Thread Dejan Dimic
Does anyone know how to set vsftpd to work with pam-pgsql for user authentification or how to use pam-pgsql at all. -- 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] feature idea

2008-10-06 Thread Martijn van Oosterhout
On Mon, Oct 06, 2008 at 09:18:00PM +0200, hubert depesz lubaczewski wrote: > it's too long. and it requires disabling. i'd like something that would > work exactly like unix pipe - send input of one command to another. Isn't this what \g does? Have a nice day, -- Martijn van Oosterhout <[EMAIL

Re: [GENERAL] feature idea

2008-10-06 Thread hubert depesz lubaczewski
On Mon, Oct 06, 2008 at 11:45:44AM -0700, Steve Crawford wrote: > What's wrong with: > \o '| gzip -c - > foo.gz' > \d > \o > I use: > \o '|lpr' > all the time. it's too long. and it requires disabling. i'd like something that would work exactly like unix pipe - send input of one command to another

Re: [GENERAL] feature idea

2008-10-06 Thread Steve Crawford
hubert depesz lubaczewski wrote: hi would it be possible to allow (in psql) syntax like: \do = | grep ... or even: select * from table; | zcat - > /tmp/table.data.gz ... What's wrong with: \o '| gzip -c - > foo.gz' \d \o I use: \o '|lpr' all the time. Cheers, Steve -- Sent via pgsql-gene

[GENERAL] feature idea

2008-10-06 Thread hubert depesz lubaczewski
hi would it be possible to allow (in psql) syntax like: \do = | grep ... or even: select * from table; | zcat - > /tmp/table.data.gz i.e. - adding | ... at the end of command to send its output via pipe to another program? usecase that i had today was pretty simple - check list of operators that

Re: [GENERAL] on windows 8.3 many processes - is it normal?

2008-10-06 Thread johnf
On Monday 06 October 2008 10:34:12 am Scott Marlowe wrote: > On Mon, Oct 6, 2008 at 11:30 AM, johnf <[EMAIL PROTECTED]> wrote: > > When I open task manager there appears 10 'postgres.exe' in the list. I > > this normal. Windows XP, postgres 8.3 > > Yep. pgsql uses a 1 process per customer design

Re: [GENERAL] on windows 8.3 many processes - is it normal?

2008-10-06 Thread Bill Moran
In response to johnf <[EMAIL PROTECTED]>: > When I open task manager there appears 10 'postgres.exe' in the list. I this > normal. Windows XP, postgres 8.3 Postgres starts a new process for each connection in addition to a few maintenance processes. -- Bill Moran Collaborative Fusion Inc. ht

Re: [GENERAL] on windows 8.3 many processes - is it normal?

2008-10-06 Thread Scott Marlowe
On Mon, Oct 6, 2008 at 11:30 AM, johnf <[EMAIL PROTECTED]> wrote: > When I open task manager there appears 10 'postgres.exe' in the list. I this > normal. Windows XP, postgres 8.3 Yep. pgsql uses a 1 process per customer design. The basic database running with no external connections will have

[GENERAL] on windows 8.3 many processes - is it normal?

2008-10-06 Thread johnf
When I open task manager there appears 10 'postgres.exe' in the list. I this normal. Windows XP, postgres 8.3 -- John Fabiani -- 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] restore a dump db from tar file

2008-10-06 Thread Alain Roger
> > From the docs: > > > -C > --create > >Begin the output with a command to create the database itself and > reconnect to the created database. (With a script of this form, it > doesn't matter which database you connect to before running the script.) > >This option is only meaningful for

Re: [GENERAL] restore a dump db from tar file

2008-10-06 Thread Raymond O'Donnell
On 06/10/2008 16:12, Alain Roger wrote: > AFAIK, pg_dump -v -o -U username -ci -Ft -f tarname.tar dbname > backup the DB but without inserting code to create the BD itself... just What's -ci? Looking at the docs, there's are -c and -i options, but I don't see -ci. > how can i do that automatical

Re: [GENERAL] restore a dump db from tar file

2008-10-06 Thread Scott Marlowe
On Mon, Oct 6, 2008 at 9:12 AM, Alain Roger <[EMAIL PROTECTED]> wrote: > > AFAIK, pg_dump -v -o -U username -ci -Ft -f tarname.tar dbname > backup the DB but without inserting code to create the BD itself... just to > create its structure and populate it. > noting about create database dbname > gra

Re: [GENERAL] Re: [Pkg-postgresql-public] Postgres major version support policy on Debian

2008-10-06 Thread Scott Marlowe
On Mon, Oct 6, 2008 at 9:34 AM, Markus Wanner <[EMAIL PROTECTED]> wrote: > Hi, > > Gerfried Fuchs wrote: > >> On the >> other hand, I still don't fully understand the problems of not being >> able to upgrade to pg-8.3 properly. People seem to have been able to >> upgrade from 8.1 to 8.2, so what's

[GENERAL] Re: [Pkg-postgresql-public] Postgres major version support policy on Debian

2008-10-06 Thread Martin Pitt
Hi Markus, Markus Wanner [2008-10-06 17:34 +0200]: > Note that these are bugfixes only and backporting those is certainly as > much work as supporting a new major version. Often enough, this should > just mean upgrading the sources, without having to adjust anything > debian specific. Right. The

[GENERAL] Re: [Pkg-postgresql-public] Postgres major version support policy on Debian

2008-10-06 Thread Martin Pitt
Gerfried Fuchs [2008-10-06 17:04 +0200]: > I'm sorry to have done the addition of pg 8.2 initially, and propably > should also be sorry for adding pg 8.3 to backports.org, I thought it > would be a service to the users, It is, and I think that -8.3 in backports makes perfect sense. It is what L

Re: [GENERAL] Re: [Pkg-postgresql-public] Postgres major version support policy on Debian

2008-10-06 Thread Alvaro Herrera
Markus Wanner wrote: > Gerfried Fuchs wrote: > > Alright, so it was actually my own fault to have done the pg-8.2 > > backports, and I'm sorry for have followed the request to do so. > > Don't be sorry. I still appreciate having an up to date Postgres version > available on etch. (And I still th

Re: [GENERAL] General data warehousing questions

2008-10-06 Thread Shane Ambler
Scott Marlowe wrote: On Sun, Oct 5, 2008 at 7:48 PM, Sean Davis <[EMAIL PROTECTED]> wrote: I am looking at the prospect of building a data warehouse of genomic sequence data. The machine that produces the data adds about 300million rows per month in a central fact table and we will generally wa

[GENERAL] Re: [Pkg-postgresql-public] Postgres major version support policy on Debian

2008-10-06 Thread Markus Wanner
Hi, Gerfried Fuchs wrote: > Alright, so it was actually my own fault to have done the pg-8.2 > backports, and I'm sorry for have followed the request to do so. Don't be sorry. I still appreciate having an up to date Postgres version available on etch. (And I still think it's the right thing to s

Re: [GENERAL] function returning setof..select versus select * from

2008-10-06 Thread Tom Lane
Jeff Amiel <[EMAIL PROTECTED]> writes: > What is the difference between: > select foo(); > and > select * from foo(); They're implemented differently, partly for legacy or lack-of-round-tuit reasons, and partly because different PLs prefer different strategies for returning sets. The first form o

Re: [GENERAL] Frustrated...pg_dump/restore

2008-10-06 Thread Jeff Amiel
--- On Mon, 10/6/08, Scott Marlowe <[EMAIL PROTECTED]> wrote: > I'm wondering if the OP has some line breaks in his > data that are > getting misinterpreted, or maybe his encoding on the two > dbs is > different and he's not taking care of that. Ahhh *looks at encoding* Well..they are both

[GENERAL] Clarification on documentation

2008-10-06 Thread Keaton Adams
Just wanted to clarify something in the Docs. An "index" page. If I create an index on a table for column foo character(8) would that require: Character value overhead: 4 bytes Per index page: 20 bytes Row offset per index entry: 4 bytes Row fixed-size header per index entry: 27 bytes Doe

Re: [GENERAL] Frustrated...pg_dump/restore

2008-10-06 Thread ries van Twisk
On Oct 6, 2008, at 10:11 AM, Scott Marlowe wrote: On Mon, Oct 6, 2008 at 8:40 AM, ries van Twisk <[EMAIL PROTECTED]> wrote: On Oct 6, 2008, at 9:11 AM, Jeff Amiel wrote: I performed a pg_dump on a database and created a new schema-only database to copy that data into. However trying to

Re: [GENERAL] restore a dump db from tar file

2008-10-06 Thread Alain Roger
On Mon, Oct 6, 2008 at 3:12 PM, Raymond O'Donnell <[EMAIL PROTECTED]> wrote: > On 06/10/2008 14:03, Alain Roger wrote: > > this is basically what i use but it does not work. > > > > pg_restore -C -d sewe survey.tar -U postgres > > Just a guess, since I haven't used pg_restore - a quick look at

Re: [GENERAL] Frustrated...pg_dump/restore

2008-10-06 Thread Scott Marlowe
On Mon, Oct 6, 2008 at 8:40 AM, ries van Twisk <[EMAIL PROTECTED]> wrote: > > On Oct 6, 2008, at 9:11 AM, Jeff Amiel wrote: > >> >> I performed a pg_dump on a database and created a new schema-only database >> to copy that data into. >> >> However trying to use psql -f to load the data in, I get a

Re: [GENERAL] Frustrated...pg_dump/restore

2008-10-06 Thread ries van Twisk
On Oct 6, 2008, at 9:11 AM, Jeff Amiel wrote: I performed a pg_dump on a database and created a new schema-only database to copy that data into. However trying to use psql -f to load the data in, I get a plethora of syntax errors including the dreaded "invalid command \N". I even tried

Re: [GENERAL] postgres/postgis

2008-10-06 Thread Dave Page
On Mon, Oct 6, 2008 at 3:26 PM, Eduardo Arévalo <[EMAIL PROTECTED]> wrote: > hello is campatible install postgresql-8.3.4-1-linux-x64 with > postgis-1.3.3. > postgis there for 64-bit architecture?? > There are the libraries and proj4 GEOS arqitectura for 64-bit?? You will need to build them yours

[GENERAL] postgres/postgis

2008-10-06 Thread Eduardo Arévalo
hello is campatible install postgresql-8.3.4-1-linux-x64 with postgis-1.3.3. postgis there for 64-bit architecture?? There are the libraries and proj4 GEOS arqitectura for 64-bit??

[GENERAL] function returning setof..select versus select * from

2008-10-06 Thread Jeff Amiel
What is the difference between: select foo(); and select * from foo(); Foo is defined as: CREATE OR REPLACE FUNCTION foo() RETURNS SETOF integer AS 'SELECT column from foo_table;' LANGUAGE 'sql' STABLE; Explain shows difference... explain select * from foo() "Function Scan on foo (cos

[GENERAL] Frustrated...pg_dump/restore

2008-10-06 Thread Jeff Amiel
I performed a pg_dump on a database and created a new schema-only database to copy that data into. However trying to use psql -f to load the data in, I get a plethora of syntax errors including the dreaded "invalid command \N". I even tried to pipe the pg_dump results directly into the psql co

Re: [GENERAL] restore a dump db from tar file

2008-10-06 Thread Raymond O'Donnell
On 06/10/2008 14:03, Alain Roger wrote: > this is basically what i use but it does not work. > > pg_restore -C -d sewe survey.tar -U postgres Just a guess, since I haven't used pg_restore - a quick look at the docs suggests that the filename should come *last* on the command line, so try that

Re: [GENERAL] restore a dump db from tar file

2008-10-06 Thread Alain Roger
this is basically what i use but it does not work. > pg_restore -C -d sewe survey.tar -U postgres > but i get the following error message: pg_restore: [archiver (db)] connection to database "sewe" failed: FATAL: > passwo > rd authentication failed for user "raf_new" > where raf_new is my comput

Re: [GENERAL] Looping through cursor row batches

2008-10-06 Thread Tom Lane
"Henry Combrinck" <[EMAIL PROTECTED]> writes: > Anyone know the most efficient way of FETCHing a batch of rows, and > looping through them in a function? FETCHing a record at a time will > work, but I was wondering whether this could be done. You're outsmarting yourself. plpgsql already does

Re: [GENERAL] restore a dump db from tar file

2008-10-06 Thread Raymond O'Donnell
On 06/10/2008 09:07, Alain Roger wrote: > i backup my database "sewe" using a standard process. > 1. it backups only database and not roles :-( roles are backuped separately. > 2. backup is a tar file > 3. backup command is : pg_dump -v -o -U myuser -ci -Ft -f sewe.tar sewe > > Question > how can

Re: [GENERAL] restore a dump db from tar file

2008-10-06 Thread Albe Laurenz
Alain Roger wrote: > i backup my database "sewe" using a standard process. > 1. it backups only database and not roles :-( roles are backuped separately. > 2. backup is a tar file > 3. backup command is : pg_dump -v -o -U myuser -ci -Ft -f sewe.tar sewe > > Question > how can i restore it now ? >

[GENERAL] Looping through cursor row batches

2008-10-06 Thread Henry Combrinck
Greetings, I gather the following isn't possible (which would have been elegant and ideal): FOR rec IN FETCH 10 FROM cursor LOOP ... Anyone know the most efficient way of FETCHing a batch of rows, and looping through them in a function? FETCHing a record at a time will work, bu

Re: [GENERAL] restore a dump db from tar file

2008-10-06 Thread Filip Rembiałkowski
2008/10/6 Alain Roger <[EMAIL PROTECTED]>: > Hi, > > i backup my database "sewe" using a standard process. > 1. it backups only database and not roles :-( roles are backuped separately. > 2. backup is a tar file > 3. backup command is : pg_dump -v -o -U myuser -ci -Ft -f sewe.tar sewe You know wha

[GENERAL] Re: [Pkg-postgresql-public] Postgres major version support policy on Debian

2008-10-06 Thread Markus Wanner
Hi Martin, Martin Pitt wrote: > Indeed it was quite clear to me right from the beginning that Lenny > would ship with 8.3 only. I think from the POV of not supporting > several PostgreSQL versions in stable Debian releases there is no > disagreement. Etch is an exception because we needed 7.4 to g

[GENERAL] restore a dump db from tar file

2008-10-06 Thread Alain Roger
Hi, i backup my database "sewe" using a standard process. 1. it backups only database and not roles :-( roles are backuped separately. 2. backup is a tar file 3. backup command is : pg_dump -v -o -U myuser -ci -Ft -f sewe.tar sewe Question how can i restore it now ? could something like that coul