Re: [GENERAL] I/O error on data file, can't run backup

2011-10-05 Thread Leif Biberg Kristensen
On Thursday 6. October 2011 07.07.11 Craig Ringer wrote: > On 10/06/2011 03:06 AM, Leif Biberg Kristensen wrote: > > I seemingly fixed the problem by stopping postgres and doing: > > > > balapapa 612249 # mv 11658 11658.old > > balapapa 612249 # mv 11658.old 11658 > > > > And the backup magically

Re: [GENERAL] user-interface to upload csv files

2011-10-05 Thread Craig Ringer
On 10/06/2011 01:47 PM, Robert Buckley wrote: Hi, I am having problems getting csv files into postgres. Does anyone know if there is an opensource user-interface to tackle this? If it's a well-behaved CSV file, use the COPY command or psql's \copy. For more complicated work, use an ETL tool l

Re: [GENERAL] Fwd: Postgresql-8.2 Replication

2011-10-05 Thread Scott Marlowe
On Wed, Oct 5, 2011 at 10:41 PM, khizer wrote: > ***root***@**mehdi-desktop**:~/slony/slony1-1.2.22# make > > make[1]: Entering directory `/home/mehdi/slony/slony1-1.2.22/src' > make[2]: Entering directory `/home/mehdi/slony/slony1-1.2.22/src/xxid' > gcc -g -O2 -Wall -Wmissing-prototypes -Wmissing

[GENERAL] user-interface to upload csv files

2011-10-05 Thread Robert Buckley
Hi, I am having problems getting csv files into postgres. Does anyone know if there is an opensource user-interface to tackle this? yours, Rob

[GENERAL] Fwd: Postgresql-8.2 Replication

2011-10-05 Thread khizer
Hi Experts, I want to set Master Slave replication of a database on Ubuntu 10.10 So kindly requesting u to send the instructions. Please waiting for your valuable responses I tried to compile and install slony but i am getting error for installation as follows; ***mehdi***@**mehdi-deskto

Re: [GENERAL] I/O error on data file, can't run backup

2011-10-05 Thread Craig Ringer
On 10/06/2011 03:06 AM, Leif Biberg Kristensen wrote: I seemingly fixed the problem by stopping postgres and doing: balapapa 612249 # mv 11658 11658.old balapapa 612249 # mv 11658.old 11658 And the backup magically works. Woo! That's ... "interesting". I'd be inclined to suspect filesyst

[GENERAL] plpgsql: type of array cells

2011-10-05 Thread Amit Dor-Shifer
I'm trying to use an array of objects in plpgsql (postgresql 8.4): drop type if exists test_t cascade; create type test_t AS (        i integer,        s text ); create or replace function test2()        RETURNS SETOF test_t AS $$ DECLARE arr test_t ARRAY[3]; tmp test_t; BEGIN        FOR i in 1

[GENERAL] plpgsql: type of array cells

2011-10-05 Thread Amit Dor-Shifer
I'm trying to use an array of objects in plpgsql (postgresql 8.4): drop type if exists test_t cascade; create type test_t AS ( i integer, s text ); create or replace function test2() RETURNS SETOF test_t AS $$ DECLARE arr test_t ARRAY[3]; tmp test_t; BEGIN FOR i i

Re: [GENERAL] Create Extension search path

2011-10-05 Thread Tom Lane
Roger Niederland writes: > On my windows install of postgres 9.1.0. > I have a search_path set in the config file. This search path has > several schemas defined. > Some of the databases within postgres, do not have the schema specified > on the search path defined within the database. > Tryin

Re: [GENERAL] Selecting All Columns Associated With Maximum Value of One Column

2011-10-05 Thread Chris Curvey
On Wed, Oct 5, 2011 at 7:34 PM, Rich Shepard wrote: > A table (chemistry) has columns named site_id, sample_date, param, quant, > and str_name (among other columns). I want to find the site_id, > sample_date, > and quant for a specific str_name and param. I cannot get the proper syntax > in the S

Re: [GENERAL] I/O error on data file, can't run backup

2011-10-05 Thread Steve Crawford
On 10/05/2011 03:43 PM, Leif Biberg Kristensen wrote: On Thursday 6. October 2011 00.17.38 Steve Crawford wrote: I'm thinking perhaps a funky memory problem - you are having odd crashes after all. I've been thinking about the memory myself, but it passes memtest86plus with flying colors. Or at

Re: [GENERAL] Problem with pg_upgrade 9.0 -> 9.1

2011-10-05 Thread Bruce Momjian
Thomas Kellerer wrote: > Thomas Kellerer, 17.09.2011 12:32: > > I was trying to upgrade my Postgres 9.0 installation using pg_upgrade. > > Running it first with --check revealed no problems. > > > > The when I did the actual migration, the following happened: > > > > > > Mismatch of relation id: d

Re: [GENERAL] Selecting All Columns Associated With Maximum Value of One Column

2011-10-05 Thread David Johnston
On Oct 5, 2011, at 19:34, Rich Shepard wrote: > A table (chemistry) has columns named site_id, sample_date, param, quant, > and str_name (among other columns). I want to find the site_id, sample_date, > and quant for a specific str_name and param. I cannot get the proper syntax > in the SELECT s

[GENERAL] Selecting All Columns Associated With Maximum Value of One Column

2011-10-05 Thread Rich Shepard
A table (chemistry) has columns named site_id, sample_date, param, quant, and str_name (among other columns). I want to find the site_id, sample_date, and quant for a specific str_name and param. I cannot get the proper syntax in the SELECT statement. My attempts are variations of, SELECT ma

Re: [GENERAL] I/O error on data file, can't run backup

2011-10-05 Thread Leif Biberg Kristensen
On Thursday 6. October 2011 00.17.38 Steve Crawford wrote: > I'm thinking perhaps a funky memory problem - you are having odd crashes > after all. I've been thinking about the memory myself, but it passes memtest86plus with flying colors. Or at least it did the last time I checked which is a few

Re: [GENERAL] gaps/overlaps in a time table : current and previous row question

2011-10-05 Thread Phil Couling
I think you need to get the full list of change dates first. Assuming you're searching over a time period between "period_from" and "period_to": SELECT change_time, sum(diff) as total_diff FROM ( SELECT starttime as change_time, 1 AS diff FROM t WHERE starttime > period_from AND endtime < period_t

Re: [GENERAL] I/O error on data file, can't run backup

2011-10-05 Thread Steve Crawford
On 10/05/2011 02:48 PM, Leif Biberg Kristensen wrote: I had a hang on the machine a few hours earlier that required a power-off reboot. That has been a problem with this rig since I built it about a year ago, it's probably a funky connection somewhere. This may be the direct cause of the I/O err

Re: [GENERAL] I/O error on data file, can't run backup

2011-10-05 Thread Leif Biberg Kristensen
On Wednesday 5. October 2011 22.41.49 Tom Lane wrote: > Leif Biberg Kristensen writes: > > I'm gonna move the data to another disk right now. > > Good plan. Couple of things I forgot to mention, in case it matters: The disk is a 1 TB Seagate Barracuda S-ATA, and it has been in use for about a

Re: [GENERAL] I/O error on data file, can't run backup

2011-10-05 Thread Tom Lane
Leif Biberg Kristensen writes: > I seemingly fixed the problem by stopping postgres and doing: > balapapa 612249 # mv 11658 11658.old > balapapa 612249 # mv 11658.old 11658 > And the backup magically works. Wow, that is magic. I was going to suggest copying pg_opfamily from template0, which wou

Re: [GENERAL] Analytic type functionality, matching patters in a column then increment an integer

2011-10-05 Thread Henry Drexler
that was spot on Richard. Thank you for your time and the solution. On Wed, Oct 5, 2011 at 3:22 PM, Richard Huxton wrote: > On 05/10/11 19:29, Henry Drexler wrote: > >> >> and would like to have a column indicate like this: >> >> 'evaluation' 'indicator' >> tf 1 >> tt

Re: [GENERAL] Analytic type functionality, matching patters in a column then increment an integer

2011-10-05 Thread Richard Huxton
On 05/10/11 19:29, Henry Drexler wrote: and would like to have a column indicate like this: 'evaluation' 'indicator' tf 1 tt 1 ft 1 ff ff tf 2 ft 2 tf 3 tt

Re: [GENERAL] I/O error on data file, can't run backup

2011-10-05 Thread Leif Biberg Kristensen
I seemingly fixed the problem by stopping postgres and doing: balapapa 612249 # mv 11658 11658.old balapapa 612249 # mv 11658.old 11658 And the backup magically works. I'm gonna move the data to another disk right now. regards, Leif -- Sent via pgsql-general mailing list (pgsql-general@postgr

Re: [GENERAL] I/O error on data file, can't run backup

2011-10-05 Thread Leif Biberg Kristensen
On Wednesday 5. October 2011 20.42.00 Tom Lane wrote: > Postgres can't magically resurrect data that your drive lost, if that's > what you were hoping for. However, you might be in luck, because that > file is probably just an index and not original data. Try this: > > select relname from

Re: [GENERAL] I/O error on data file, can't run backup

2011-10-05 Thread Tom Lane
Leif Biberg Kristensen writes: > Running postgresql 9.0.5 on > balapapa ~ # uname -a > Linux balapapa 2.6.39-gentoo-r3 #1 SMP Sun Jul 17 11:22:15 CEST 2011 x86_64 > Intel(R) Core(TM) i7 CPU 930 @ 2.80GHz GenuineIntel GNU/Linux > I'm trying to run pg_dump on my database, and get an error: > pg_

[GENERAL] Analytic type functionality, matching patters in a column then increment an integer

2011-10-05 Thread Henry Drexler
I can do this in excel with vba, though due to the volume of data that is now impracticable and I am trying to move most of my logic into the query and db for analysis. Looking at the analytic functions I see no way to carry values over the way they need to be. Example column: I have a column th

[GENERAL] I/O error on data file, can't run backup

2011-10-05 Thread Leif Biberg Kristensen
Running postgresql 9.0.5 on balapapa ~ # uname -a Linux balapapa 2.6.39-gentoo-r3 #1 SMP Sun Jul 17 11:22:15 CEST 2011 x86_64 Intel(R) Core(TM) i7 CPU 930 @ 2.80GHz GenuineIntel GNU/Linux I'm trying to run pg_dump on my database, and get an error: pg_dump: SQL command failed pg_dump: Error mes

Re: [GENERAL] null values in a view

2011-10-05 Thread Lauri Kajan
This worked. Thank you all! I know the casting is quite basic operation but could this be added to the CREATE VIEW documentation? Now there is only an example: CREATE VIEW vista AS SELECT text 'Hello World' AS hello; The same syntax won't work with other type as Tom wrote. -Lauri On Wed, Oct 5,

Re: [GENERAL] How to create database link and synonym in postgresql 9.0

2011-10-05 Thread Filip Rembiałkowski
There is no CREATE SYNONYM in PostgreSQL and it's not planned for implementation. There is also no direct support for foreign data wrapper. But it's planned for 9.2. Nearest that you can get with PostgreSQL 9.0 is cautious use of dblink and views and rules. here's a sample script to show what I

Re: [GENERAL] Restoring 2 Tables From All Databases Backup

2011-10-05 Thread Raghavendra
Hi Adarsh, Filip workaround is right approach, since its plain text format you need to play with SED/AWK to pull those two tables. Following link will help you:- http://blog.endpoint.com/2010/04/restoring-individual-table-data-from.html --- Regards, Raghavendra EnterpriseDB Corporation Blog: ht

Re: [GENERAL] function "XXX" already exists with same argument types

2011-10-05 Thread Alexander Farber
Thank you Michael, but no - On Wed, Oct 5, 2011 at 5:24 PM, Michael Glaesemann wrote: >> psql:pref-2011-10-05-a.sql:339: ERROR:  function "pref_update_match" >> already exists with same argument types >> ALTER FUNCTION > > Likely someone mistakenly added the functions to template1 of the machine

Re: [GENERAL] function "XXX" already exists with same argument types

2011-10-05 Thread Michael Glaesemann
On Oct 5, 2011, at 11:21, Alexander Farber wrote: > Hello, > > I use PostgreSQL 8.4 under CentOS 5.7: > > # rpm -qa | grep post > compat-postgresql-libs-4-1PGDG.rhel5 > postgresql-8.4.9-1PGDG.rhel5 > postgresql-server-8.4.9-1PGDG.rhel5 > compat-postgresql-libs-4-1PGDG.rhel5 > postgresql-libs-8

Re: [GENERAL] Restoring 2 Tables From All Databases Backup

2011-10-05 Thread pasman pasmański
You should to create new database with two empty tables, set access rights for all schemas readonly and pipe backup to this database. 2011/10/5, Dickson S. Guedes : > 2011/10/5 Adarsh Sharma : >> About 1 month ago, I take a complete databases backup of my Database >> server >> through pg_dumpall c

[GENERAL] function "XXX" already exists with same argument types

2011-10-05 Thread Alexander Farber
Hello, I use PostgreSQL 8.4 under CentOS 5.7: # rpm -qa | grep post compat-postgresql-libs-4-1PGDG.rhel5 postgresql-8.4.9-1PGDG.rhel5 postgresql-server-8.4.9-1PGDG.rhel5 compat-postgresql-libs-4-1PGDG.rhel5 postgresql-libs-8.4.9-1PGDG.rhel5 postgresql-devel-8.4.9-1PGDG.rhel5 And perform nightly

[GENERAL] How to create database link and synonym in postgresql 9.0

2011-10-05 Thread tushar nehete
Hi, In one of the migration porject want to access and update some tables from other database on same postgresql server. The question is how to access tables from other database on the same postgres server. If it is by database link like Oracle then what is the syntax. And how to create synonym?

Re: [GENERAL] Restoring 2 Tables From All Databases Backup

2011-10-05 Thread Filip Rembiałkowski
2011/10/5 Adarsh Sharma > Dear all, > > About 1 month ago, I take a complete databases backup of my Database server > through pg_dumpall command. > Today I need to extract or restore only 2 tables in a database. > > Is it possible or I have to restore complete Databases again. Size of > backup is

Re: [GENERAL] how to disable all pkey/fkey constraints globally

2011-10-05 Thread salah jubeh
Create a temp table that will store all the foreign kez constraints  then create a function that add an entry to this table  then write a plpgsql function that reads the constraints and disable them  write another function to read the constraints from the temporary tables and create them again 

Re: [GENERAL] null values in a view

2011-10-05 Thread Tom Lane
Lauri Kajan writes: > This works with other values but not with nulls: > CREATE VIEW view1 AS > SELECT > attribute1 as a1, > text null as a2, > text 'test' as a3 > FROM > table; FYI, the syntax typename 'literal' works *only* with string literals, not anything else. For any other targ

Re: [GENERAL] Restoring 2 Tables From All Databases Backup

2011-10-05 Thread Dickson S. Guedes
2011/10/5 Adarsh Sharma : > About 1 month ago, I take a complete databases backup of my Database server > through pg_dumpall command. > Today I need to extract or restore only 2 tables in a database. > > Is it possible or I have to restore complete Databases again. Size of backup > is 10 GB in .sql

Re: [GENERAL] null values in a view

2011-10-05 Thread hubert depesz lubaczewski
On Wed, Oct 05, 2011 at 05:22:21PM +0300, Lauri Kajan wrote: > Hi all, > > How could I create a view that returns null values among all other values. > Here is a sample that i want to achieve: > > CREATE VIEW view1 AS > SELECT > attribute1 as a1, > null as a2 > FROM > table; > > Now the pr

Re: [GENERAL] null values in a view

2011-10-05 Thread Achilleas Mantzios
try: CREATE OR REPLACE VIEW view1 AS SELECT name as a1, null::text as a2, 'test'::text as a3 FROM some_table; Στις Wednesday 05 October 2011 17:22:21 ο/η Lauri Kajan έγραψε: > Hi all, > > How could I create a view that returns null values among all other values. > Here is a sample that i

Re: [GENERAL] gaps/overlaps in a time table : current and previous row question

2011-10-05 Thread Filip Rembiałkowski
2011/10/5 thomas veymont > hello, > > let's say that each rows in a table contains a start time and a end > time ("timeinterval" type), > there is no such type ( no result for select * from pg_type where typname ~ 'timeinterval' ). can you show exact table structure (output of psql "\d" or bette

[GENERAL] null values in a view

2011-10-05 Thread Lauri Kajan
Hi all, How could I create a view that returns null values among all other values. Here is a sample that i want to achieve: CREATE VIEW view1 AS SELECT attribute1 as a1, null as a2 FROM table; Now the problem is that I got an warning: column "a2" has type "unknown" I know that I should de

Re: [GENERAL] how to select one column into another in same table?

2011-10-05 Thread Phil Couling
I don't this this is possible as postgres. There is something simular with: alter table table_name alter column column_foo using column_bar But I don't think there's any performance advantage over a simple update and the using clause doesn't appear to have an equivalent in an add column statement.

[GENERAL] gaps/overlaps in a time table : current and previous row question

2011-10-05 Thread thomas veymont
hello, let's say that each rows in a table contains a start time and a end time ("timeinterval" type), but the index are not ordered nor consecutive, e.g : $ select * from T order by starttime index | starttime| endtime -+-+- 3| t1

Re: [GENERAL] Postgresql-8.2 Replication

2011-10-05 Thread Raymond O'Donnell
On 05/10/2011 12:24, khizer wrote: > ok Thank u > > but as i am new bie i am not aware abour mailing list of postgresql :-) But that's what you emailed to originally - the general mailing list for PostgreSQL. See here: http://www.postgresql.org/community/lists Make sure you do "Reply-all"

Re: [GENERAL] Postgresql Data directory Issue

2011-10-05 Thread Achilleas Mantzios
Sorry to be rude, but you are in urgent need of a PostgreSQL DBA, (if you feel you somehow value your data). Anyways, 8.3 catalog is not compatible with 8.4. You need to dump->upgrade->restore if you just start 8.3 server with /usr/local/pgsql/bin/postgres -D what happens? Στις Wednesday 05 Oct

Re: [GENERAL] Postgresql Data directory Issue

2011-10-05 Thread Christian Ullrich
* Adarsh Sharma wrote: 2. I installed Postgresql-8.3 in new server and trying to use the data directory but it faces the below error :- Existing data directory is not empty and it cannot able to use it . First, be very, very careful. initdb already saved your data from destruction once, but

[GENERAL] Postgresql Data directory Issue

2011-10-05 Thread Adarsh Sharma
Dear all, I have a database server ( 10 databases near about 110 GB) running Postgresql-.8.3 ) Today I need to format that system but I an facing the below issues :- 1. I am trying to use the previous data directory (/opt/PostgresPlus/8.3/data) in new Postgresql-8.4 installation but it resul

[GENERAL] Fwd: [BUGS] BUG #6240: About - postgreswdinit.sql

2011-10-05 Thread Chethan HB
Hi, In a freshly commissioned h/w, when watchdog is created for the first time, I faced some problem. I never faced this problem earlier. Currenlty we are using the following version: export PGODBC_VERSION=psqlodbc-09.00.0300 Postgres version=9.0.4 Logs are attached here: Jan 1 02:05:09.49273

Re: [GENERAL] Postgresql-8.2 Replication

2011-10-05 Thread Raymond O'Donnell
On 05/10/2011 12:04, khizer wrote: > Raymond i have attached the error file as above. > You really should keep your replies on the list - some of the many experts on the list may be able to help you. I'm out of my depth on this one, but the error message looks to me as if you're missing the Post

Re: [GENERAL] Postgresql-8.2 Replication

2011-10-05 Thread Raymond O'Donnell
On 05/10/2011 11:19, khizer wrote: > Thanks for reply > > > Can we use slony on ubuntu OS > as it was giving error while compiling and installing slony Please keep your replies on the list. What errors were you getting? If I recall correctly, you need to have the headers for PostgreSQL on the m

Re: [GENERAL] Postgresql-8.2 Replication

2011-10-05 Thread Raymond O'Donnell
On 05/10/2011 09:46, khizer wrote: > Hi, > >Kindly requesting u to send the steps to set up the Postgresql-8.2 > database replication. 8.2 doesn't have built-in replication - you'll need to use Slony or one of the other tools. See the docs for suggestions: http://www.postgresql.org/docs/8.

Re: [GENERAL] how to disable all pkey/fkey constraints globally

2011-10-05 Thread Joe Abbate
On 10/05/2011 04:49 AM, depst...@alliedtesting.com wrote: >> -Original Message- >> From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- >> ow...@postgresql.org] On Behalf Of J.V. >> Sent: Tuesday, October 04, 2011 10:00 PM >> To: pgsql-general >> Subject: [GENERAL] how to disable

[GENERAL] Postgresql-8.2 Replication

2011-10-05 Thread khizer
Hi, Kindly requesting u to send the steps to set up the Postgresql-8.2 database replication. Mehdi -- 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 to disable all pkey/fkey constraints globally

2011-10-05 Thread depstein
> -Original Message- > From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- > ow...@postgresql.org] On Behalf Of J.V. > Sent: Tuesday, October 04, 2011 10:00 PM > To: pgsql-general > Subject: [GENERAL] how to disable all pkey/fkey constraints globally > > Is there a generic way

Re: [GENERAL] Hash index not being updated

2011-10-05 Thread pasman pasmański
Hi. Right direction is to use btree index. Hash indexes are sensitive to power failures. 2011/10/5, Justin Naifeh : > In Postgres 8.4, I have a table called java_types with two columns, > package_name and class_name. There is another table called java_objects > that defines a column called type

Re: [BUGS] [GENERAL] One-click installer, Windows 7 32-bit, and icacls.exe

2011-10-05 Thread Dave Page
On Wednesday, October 5, 2011, Thomas Kellerer wrote: > Dave Page, 04.10.2011 21:46: >> >> We updated our build system to use BitRock 7 today (for unrelated >> reasons) which has new features for ACL management. We're going to >> investigate replacing cacls/icacls with those features tomorrow and