[GENERAL] How to delete completely duplicate rows

2014-01-01 Thread Janek Sendrowski
Hi,   I want to delete duplicates in my table. I've dropped the unique constraint to insert my data. My id value is a hash calculated witch the values of the two other columns. So I want to delete all columns, which are indentical, but keeping one.   DELETE FROM table t1 USING table t2 WHERE t1.id

Re: [GENERAL] How to delete completely duplicate rows

2014-01-01 Thread Erik Darling
With C as ( Select row_number() over partition by (list, all, columns, here order by oid) as rn ) Delete >From C Where rn > 1; On Jan 1, 2014 7:15 AM, "Janek Sendrowski" wrote: > Hi, > > I want to delete duplicates in my table. I've dropped the unique > constraint to insert my data. > My id valu

[GENERAL] Refresh Materialized View

2014-01-01 Thread Jayadevan M
Hello all, A few questions about materialized views. When I refresh a materialized view, is it a DELETE/INSERT behind the scenes? Do we need to vacuum to reclaim space? If a query is executed against the view when the refresh is happening, will the query see the data before the refresh started? Doe

Re: [GENERAL] Refresh Materialized View

2014-01-01 Thread Jayadevan M
To answer my own question, I saw this thread - http://postgresql.1045698.n5.nabble.com/Efficiency-of-materialized-views-refresh-in-9-3-td5762618.html I think that does answer my questions. Nothing has changed? Regards, Jayadevan On Wed, Jan 1, 2014 at 6:42 PM, Jayadevan M wrote: > Hello all, >

Re: [GENERAL] How to delete completely duplicate rows

2014-01-01 Thread bricklen
On Wed, Jan 1, 2014 at 4:14 AM, Janek Sendrowski wrote: > I want to delete duplicates in my table. I've dropped the unique > constraint to insert my data. > My id value is a hash calculated witch the values of the two other columns. > So I want to delete all columns, which are indentical, but kee

[GENERAL] duplicate OID issue when using pg_upgrade to move from 8.4 to 9.2

2014-01-01 Thread Reiser, John J.
Hello, I'm working on an upgrade to our database cluster, attempting to move from 8.4 to 9.2. I'm encountering the following error when I attempt the upgrade (in pg_upgrade_restore.log): CREATE FUNCTION "st_envelope_in"(cstring) RETURNS st_envelope LANGUAGE "c" IMMUTABLE STRICT AS 'st_g

Re: [GENERAL] duplicate OID issue when using pg_upgrade to move from 8.4 to 9.2

2014-01-01 Thread Reiser, John J.
The --link argument doesn't work, either: bash-4.1$ export LD_LIBRARY_PATH=/usr/pgsql-9.2/lib bash-4.1$ /usr/pgsql-9.2/bin/pg_upgrade --old-datadir=/var/lib/pgsql/data --new-datadir=/var/lib/pgsql/9.2/data --old-bindir=/usr/bin --new-bindir=/usr/pgsql-9.2/bin --check Performing Consistency Check

Re: [GENERAL] duplicate OID issue when using pg_upgrade to move from 8.4 to 9.2

2014-01-01 Thread Adrian Klaver
On 01/01/2014 08:53 AM, Reiser, John J. wrote: Hello, I'm working on an upgrade to our database cluster, attempting to move from 8.4 to 9.2. I'm encountering the following error when I attempt the upgrade (in pg_upgrade_restore.log): CREATE FUNCTION "st_envelope_in"(cstring) RETURNS st_enve

Re: [GENERAL] duplicate OID issue when using pg_upgrade to move from 8.4 to 9.2

2014-01-01 Thread Adrian Klaver
On 01/01/2014 09:08 AM, Reiser, John J. wrote: The --link argument doesn't work, either: Consult the last few lines of "pg_upgrade_restore.log" for the probable cause of the failure. Failure, exiting bash-4.1$ tail -n 20 pg_upgrade_restore.log (1 row) CREATE TYPE "spheroid" ( INTERNALL

Re: [GENERAL] duplicate OID issue when using pg_upgrade to move from 8.4 to 9.2

2014-01-01 Thread Reiser, John J.
Adrian, On 1/1/14, 12:26 PM, "Adrian Klaver" wrote: >On 01/01/2014 09:08 AM, Reiser, John J. wrote: >> The --link argument doesn't work, either: >> > >> >> Consult the last few lines of "pg_upgrade_restore.log" for >> the probable cause of the failure. >> Failure, exiting >> bash-4.1$ tail -n 2

Re: [GENERAL] duplicate OID issue when using pg_upgrade to move from 8.4 to 9.2

2014-01-01 Thread Tom Lane
"Reiser, John J." writes: > I'm working on an upgrade to our database cluster, attempting to move from > 8.4 to 9.2. I'm encountering the following error when I attempt the upgrade > (in pg_upgrade_restore.log): > CREATE FUNCTION "st_envelope_in"(cstring) RETURNS st_envelope > LANGUAGE "c"

Re: [GENERAL] duplicate OID issue when using pg_upgrade to move from 8.4 to 9.2

2014-01-01 Thread Reiser, John J.
On 1/1/14, 12:38 PM, "Tom Lane" wrote: >"Reiser, John J." writes: >> I'm working on an upgrade to our database cluster, attempting to move >>from 8.4 to 9.2. I'm encountering the following error when I attempt the >>upgrade (in pg_upgrade_restore.log): > >> CREATE FUNCTION "st_envelope_in"(cstri

Re: [GENERAL] duplicate OID issue when using pg_upgrade to move from 8.4 to 9.2

2014-01-01 Thread Tom Lane
"Reiser, John J." writes: > On 1/1/14, 12:38 PM, "Tom Lane" wrote: >> What this smells like is a bug in the pg_dump --binary_upgrade logic that >> tries to preserve type OIDs from the old installation to the new one. >> Is there a preceding CREATE TYPE command for st_envelope in the dump >> scrip

Re: [GENERAL] duplicate OID issue when using pg_upgrade to move from 8.4 to 9.2

2014-01-01 Thread Reiser, John J.
On 1/1/14, 3:37 PM, "Tom Lane" wrote: >"Reiser, John J." writes: >> On 1/1/14, 12:38 PM, "Tom Lane" wrote: >>> What this smells like is a bug in the pg_dump --binary_upgrade logic >>>that >>> tries to preserve type OIDs from the old installation to the new one. >>> Is there a preceding CREATE

[GENERAL] question on IPC vs TCPIP

2014-01-01 Thread Andrew McIntyre
Does postgres have an equivalent C level (or ODBC) parameter so you can use IPC for local to db server only code? http://pic.dhe.ibm.com/infocenter/db2luw/v10r5/topic/com.ibm.db2.luw.apdv.cli.doc/doc/r0008807.html There is a measurable reduction in elapsed time for my code when I specify IPC. M

Re: [GENERAL] duplicate OID issue when using pg_upgrade to move from 8.4 to 9.2

2014-01-01 Thread Adrian Klaver
On 01/01/2014 12:45 PM, Reiser, John J. wrote: On 1/1/14, 3:37 PM, "Tom Lane" wrote: Could you look at the text surrounding these places to determine which types this OID is being selected for? Each of these calls should be just preceding a CREATE TYPE command (with maybe a set_next_array

Re: [GENERAL] question on IPC vs TCPIP

2014-01-01 Thread Martijn van Oosterhout
On Wed, Jan 01, 2014 at 03:55:50PM -0500, Andrew McIntyre wrote: > Does postgres have an equivalent C level (or ODBC) parameter so you > can use IPC for local to db server only code? > http://pic.dhe.ibm.com/infocenter/db2luw/v10r5/topic/com.ibm.db2.luw.apdv.cli.doc/doc/r0008807.html > > There is

[GENERAL] How to list and describe tables in psql???

2014-01-01 Thread peterlen
I am using PostgreSQL 9.1 and have boon looking for psql commands to list all tables in the current database as well as how to "describe" a given table. I have come across some info on the web (older mostly) that lists commands like \d, \dt, or \d+ but I get results like "no relations found" or "

Re: [GENERAL] How to list and describe tables in psql???

2014-01-01 Thread Adrian Klaver
On 01/01/2014 05:53 PM, peterlen wrote: I am using PostgreSQL 9.1 and have boon looking for psql commands to list all tables in the current database as well as how to "describe" a given table. I have come across some info on the web (older mostly) that lists commands like \d, \dt, or \d+ but I g

Re: [GENERAL] duplicate OID issue when using pg_upgrade to move from 8.4 to 9.2

2014-01-01 Thread Tom Lane
Adrian Klaver writes: > On 01/01/2014 12:45 PM, Reiser, John J. wrote: >> Thanks for the info. After searching the output for the connection string, >> I found that it's failing on a database that can be archived. I think I'll >> get what I need from the database, drop it, then perform the upgrade

Re: [GENERAL] How to list and describe tables in psql???

2014-01-01 Thread Ian Lawrence Barwick
014/1/2 peterlen : > I am using PostgreSQL 9.1 and have boon looking for psql commands to list all > tables in the current database as well as how to "describe" a given table. > I have come across some info on the web (older mostly) that lists commands > like \d, \dt, or \d+ but I get results like

Re: [GENERAL] How to list and describe tables in psql???

2014-01-01 Thread peterlen
Thanks for the responses. I found that I was using an older version of psql (one that got installed when I installed Cygwin on my windows box. I changed it so now the \d+ gives me the description but \d and \dt still gives me "No relations found" so I must be using those incorrectly. Thanks

Re: [GENERAL] How to list and describe tables in psql???

2014-01-01 Thread Ian Lawrence Barwick
2014/1/2 peterlen : > Thanks for the responses. I found that I was using an older version of psql > (one that got installed when I installed Cygwin on my windows box. I > changed it so now the \d+ > gives me the description but \d and \dt still gives me "No relations > found" so I must be usi

[GENERAL] pg_largeobject related issue with 9.2

2014-01-01 Thread sramay
Hi, I am having a application which was running on Jboss 5 with Hibernate and PostgreSQL 9.2. Due to media corruption. Data without largeobject was restored and largeobject I restored from some other source. Now the application is giving error eventhough largeobject is present it is giving e

[GENERAL] question on parallelism

2014-01-01 Thread Andrew McIntyre
does postgres have this capability? specifically local intrapartition? http://pic.dhe.ibm.com/infocenter/db2luw/v10r5/topic/com.ibm.db2.luw.admin.partition.doc/doc/c0004557.html sorry for all the newbie pg questions... -- personal Signature

Re: [GENERAL] question on parallelism

2014-01-01 Thread Chris Travers
On Wed, Jan 1, 2014 at 7:35 PM, Andrew McIntyre wrote: > does postgres have this capability? specifically local intrapartition? > > http://pic.dhe.ibm.com/infocenter/db2luw/v10r5/topic/com.ibm.db2.luw.admin.partition.doc/doc/c0004557.html > > Nope. Here's a quick breakdown of what is done in pa