Re: [GENERAL] ERROR: could not open relation with OID 49152

2008-07-21 Thread Scott Marlowe
On Mon, Jul 21, 2008 at 6:07 PM, Tom Lane <[EMAIL PROTECTED]> wrote: > "Scott Marlowe" <[EMAIL PROTECTED]> writes: >> OK, I'm getting the above error on one of my fairly new 8.3 production >> databases. It happens when I run a query to see the size of my >> tables. > >> SELECT pg_relation_size(c.r

Re: [GENERAL] ERROR: could not open relation with OID 49152

2008-07-21 Thread Alvaro Herrera
Scott Marlowe escribió: > OK, I'm getting the above error on one of my fairly new 8.3 production > databases. It happens when I run a query to see the size of my > tables. > > SELECT pg_relation_size(c.relfilenode), n.nspname AS schemaname, > c.relname AS tablename, pg_get_userbyid(c.relowner) AS

Re: [GENERAL] ERROR: could not open relation with OID 49152

2008-07-21 Thread Tom Lane
"Scott Marlowe" <[EMAIL PROTECTED]> writes: > OK, I'm getting the above error on one of my fairly new 8.3 production > databases. It happens when I run a query to see the size of my > tables. > SELECT pg_relation_size(c.relfilenode), Pretty sure that should be c.oid. reg

[GENERAL] ERROR: could not open relation with OID 49152

2008-07-21 Thread Scott Marlowe
OK, I'm getting the above error on one of my fairly new 8.3 production databases. It happens when I run a query to see the size of my tables. SELECT pg_relation_size(c.relfilenode), n.nspname AS schemaname, c.relname AS tablename, pg_get_userbyid(c.relowner) AS tableowner, t.spcname AS tablespace

Re: [GENERAL] COPY between 7.4.x and 8.3.x

2008-07-21 Thread Jack Orenstein
Francisco Reyes wrote: On 4:05 pm 07/21/08 Jack Orenstein <[EMAIL PROTECTED]> wrote: What if we do a binary copy instead? What do you mean by a binary copy? pg_dump -Fc? No, I mean changing this: psql -h $SOURCE_HOST ... -c "copy $SOURCE_SCHEMA.$SOURCE_TABLE to stdout" |\ psql ...

[GENERAL] inconsistent program behavior, fresh eyes needed

2008-07-21 Thread Emil Pedersen
Hello list! I'll try to keep this short, if any more info is needed just ask. I have a program that is supposed to parse standard log files and act on specific lines. It mostly does what it's supposed to, but if I run it a couple of time, using the same input data, some of the results differ.

Re: [GENERAL] COPY between 7.4.x and 8.3.x

2008-07-21 Thread Francisco Reyes
On 4:05 pm 07/21/08 Jack Orenstein <[EMAIL PROTECTED]> wrote: > We will now be adding 8.3.x databases to the mix, and will need to > copy between 7.4.x and 8.3.x in both directions. The datatypes we use I believe it should work. Also, one feature I believe started in the 8.X line (8.2?), is the ab

[GENERAL] COPY between 7.4.x and 8.3.x

2008-07-21 Thread Jack Orenstein
We have a set of 7.4.x databases, and will occasionally copy data between like so: psql -h $SOURCE_HOST ... -c "copy $SOURCE_SCHEMA.$SOURCE_TABLE to stdout" |\ psql ... -c "copy $TARGET_SCHEMA.$TARGET_TABLE from stdin" This is always run on the host containing the target table. We will

Re: [GENERAL] Calling Python functions with parameters

2008-07-21 Thread brian
Jerry McRae wrote: I am having a problem with the simplest of Python functions, so I must be doing something wrong. After hours of searching and trying many options, I need the key that my puny brain is missing here. I cannot pass parameters to a plpythonu function. I have tried within psql an

Re: [GENERAL] How to remove duplicate lines but save one of the lines?

2008-07-21 Thread btober
A B wrote: I have a table with rows like this A 1 A 1 B 3 B 3 C 44 C 44 and so on. and I want it to be A 1 B 3 C 44 so how can I remove the all the duplicate lines but one? CREATE TEMP TABLE tmp AS SELECT DISTINCT * FROM t1; DROP TABLE t1; CREATE TABLE t1 AS SELECT * FROM tmp; -- Sent via

Re: [GENERAL] How to remove duplicate lines but save one of the lines?

2008-07-21 Thread Scott Marlowe
On Mon, Jul 21, 2008 at 9:51 AM, A B <[EMAIL PROTECTED]> wrote: >> There is probably a more elegant way of doing it, but a simple way of doing >> it ( depending on the size of the table ) could be: >> >> begin; >> >> insert into foo select distinct * from orig_table; >> delete from orig_table; >>

Re: [GENERAL] How to remove duplicate lines but save one of the lines?

2008-07-21 Thread Said Ramirez
Yes, here foo is a temp table. As others have pointed out, you could probably do a create table foo as select distinct * from orig_table. I would move the data back to orig_table, so that constraints and privileges are maintainited. After you have done this, you can put a uniq constraint on col

Re: [GENERAL] Problems using Grails with Postgresql

2008-07-21 Thread Scott Marlowe
On Mon, Jul 21, 2008 at 5:00 AM, priyaa <[EMAIL PROTECTED]> wrote: > > i am using postgresql instead of mysql ,but while execute i am getting error > like > > > Caused by: org.codehaus.groovy.runtime.InvokerInvocationException: > org.springframework.dao.InvalidDataAccessResourceUsageException: coul

Re: [GENERAL] Field size

2008-07-21 Thread Martin
hubert depesz lubaczewski <[EMAIL PROTECTED]> write: > http://www.postgresql.org/docs/faqs.FAQ.html#item4.4 That's not what I'm looking for. I want the size limit defined for the varchar field not the max size the database system can handle, e.g. if the field is varchar(4) I want the 4. -- Sen

Re: [GENERAL] Field size

2008-07-21 Thread Ludwig Kniprath
>On Sun, Jul 20, 2008 at 05:50:30PM -0500, Martin wrote: >> Ok, this should be simple. How do I find the defined maximum >> length of a varchar field? SELECT character_maximum_length FROM information_schema.columns WHERE table_schema = 'name_of_your_schema' and table_name = 'name_o

Re: [GENERAL] How to remove duplicate lines but save one of the lines?

2008-07-21 Thread A B
> There is probably a more elegant way of doing it, but a simple way of doing > it ( depending on the size of the table ) could be: > > begin; > > insert into foo select distinct * from orig_table; > delete from orig_table; > insert into orig_table select * from foo; > > commit; Just to make it c

Re: [GENERAL] How to remove duplicate lines but save one of the lines?

2008-07-21 Thread Francisco Reyes
On 11:33 am 07/21/08 "A B" <[EMAIL PROTECTED]> wrote: > and I want it to be > A 1 > B 3 > C 44 The slow way select distinct field1, field2 from sometable. The faster way select field1,fields2 from sometable group by field1, field2. Distinct should in theory be the same speed, but on several test

Re: [GENERAL] How to remove duplicate lines but save one of the lines?

2008-07-21 Thread Said Ramirez
There is probably a more elegant way of doing it, but a simple way of doing it ( depending on the size of the table ) could be: begin; insert into foo select distinct * from orig_table; delete from orig_table; insert into orig_table select * from foo; commit; -Said A B wrote: I have a ta

Re: [GENERAL] How to remove duplicate lines but save one of the lines?

2008-07-21 Thread Raymond O'Donnell
On 21/07/2008 16:33, A B wrote: I have a table with rows like this A 1 A 1 B 3 B 3 C 44 C 44 and so on. and I want it to be A 1 B 3 C 44 so how can I remove the all the duplicate lines but one? You could copy them into a new table, like so: CREATE TABLE newtable AS SELECT DISTINCT * FROM old

[GENERAL] How to remove duplicate lines but save one of the lines?

2008-07-21 Thread A B
I have a table with rows like this A 1 A 1 B 3 B 3 C 44 C 44 and so on. and I want it to be A 1 B 3 C 44 so how can I remove the all the duplicate lines but one? -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org

Re: [GENERAL] Problems using Grails with Postgresql

2008-07-21 Thread Richard Huxton
priyaa wrote: i am using postgresql instead of mysql ,but while execute i am getting error like Caused by: org.codehaus.groovy.runtime.InvokerInvocationException: org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.excepti

Re: [GENERAL] [Postgresql 8.2.3] autovacuum starting up even after disabling ?

2008-07-21 Thread Dushyanth
Hey, > > They are all under 200 million > > Weird > > Could you fetch from pg_stat_activity the table it's processing, and its > pg_class row and that of its toast table (if any)? Sorry for the delay. Required details are at http://pastebin.com/pastebin.php?dl=fd699fbb Let me know if you need

Re: [GENERAL] Field size

2008-07-21 Thread hubert depesz lubaczewski
On Sun, Jul 20, 2008 at 05:50:30PM -0500, Martin wrote: > Ok, this should be simple. How do I find the defined maximum > length of a varchar field? http://www.postgresql.org/docs/faqs.FAQ.html#item4.4 depesz -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes t

Re: [GENERAL] question about performance

2008-07-21 Thread A. Kretschmer
am Mon, dem 21.07.2008, um 9:40:19 +0200 mailte Torsten Zühlsdorff folgendes: > A. Kretschmer schrieb: > > >>if I have a table, the_table, with a DATE field, i'll call it 'day', and > >>I'd like to find all rows whos day falls within a given month, which of > >>the following methods is faster/

[GENERAL] Calling Python functions with parameters

2008-07-21 Thread Jerry McRae
I am having a problem with the simplest of Python functions, so I must be doing something wrong. After hours of searching and trying many options, I need the key that my puny brain is missing here. I cannot pass parameters to a plpythonu function. I have tried within psql and with pgAdmin III (w

Re: [GENERAL] question about performance

2008-07-21 Thread Torsten Zühlsdorff
A. Kretschmer schrieb: if I have a table, the_table, with a DATE field, i'll call it 'day', and I'd like to find all rows whos day falls within a given month, which of the following methods is faster/costs less: 1. SELECT * FROM the_table WHERE day LIKE '2008-01-%'; 2.

[GENERAL] Problems using Grails with Postgresql

2008-07-21 Thread priyaa
i am using postgresql instead of mysql ,but while execute i am getting error like Caused by: org.codehaus.groovy.runtime.InvokerInvocationException: org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarEx

Fw: Re: [GENERAL] C-procedure crashed in Postgres 8.3.3 when using 'text'variable (WinXP) - additional

2008-07-21 Thread el dorado
Yes, I use a Microsoft Visual Studio compiler, but the full version - not Express Edition. Just in case I quote the code again ( it's short): -- include "postgres.h" #include "fmgr.h" #include "executor/executor.h" #include "uti

Re: [GENERAL] C-procedure crashed in Postgres 8.3.3 when using 'text' variable (WinXP) - additional

2008-07-21 Thread Craig Ringer
el dorado wrote: Hello. Thank you very much for your answer. 1>d:\pgsql83\getstring\c_getstring.c(10) : warning C4273: 'Pg_magic_func' : inconsistent dll linkage 1>d:\pgsql83\getstring\c_getstring.c(10) : see previous definition of 'Pg_magic_func' This should be a big red fla

Re: [GENERAL] C-procedure crashed in Postgres 8.3.3 when using 'text' variable (WinXP) - additional

2008-07-21 Thread el dorado
Hello. Thank you very much for your answer. I found an option "Configuration Properties\C/C++/General/Detect 64-bit Portability Issues". It was set to 'Yes'. I made it 'No'. Now I don't get these warnings about 'type cast'. The result: 1>Compiling... 1>getstring.c 1>d:\pgsql83\getstring\