Re: [SQL] [GENERAL] How do I copy part of table from db1 to db2 (and

2005-08-31 Thread Thomas Pundt
t; utility can help then? Something like pg_dump -t artik munttest | recode latin1..utf | psql muntfinal Ciao, Thomas -- Thomas Pundt <[EMAIL PROTECTED]> http://rp-online.de/ ---(end of broadcast)--- TIP 4: Have you searched o

Re: [SQL] [GENERAL] How do I copy part of table from db1 to db2 (and

2005-08-31 Thread Thomas Pundt
On Wednesday 31 August 2005 14:09, Thomas Pundt wrote: | maybe the "recode" utility can help then? Something like | | pg_dump -t artik munttest | recode latin1..utf | psql muntfinal sorry to follow up on myself, but that command should read pg_dump -t artik munttest | recode la

Re: [SQL] How to add column from old_table to new_table?

2005-09-21 Thread Thomas Pundt
sting rows in "new_table", you might try UPDATE new_table SET new_attribute = old_table.old_attribute FROM old_table WHERE new_table.id = old_table.id; Ciao, Thomas -- Thomas Pundt <[EMAIL PROTECTED]> http://rp-online.de/ ---

Re: [SQL] postgres on the comman line

2005-09-22 Thread Thomas Pundt
s with colon separated values consisting of host:port:database:user:password and must not be world-readable. | Also I like to direct the result to a file, I assume I can do this via > | but not haveing passed the first problem I did not check this. yes. Ciao, Thomas -- Thomas Pundt <[EMAIL

Re: [SQL] Postgres 7.4.9 slow!

2005-10-21 Thread Thomas Pundt
der by count(*) desc; this is not what Otto requested; please send the output of EXPLAIN ANALYZE select p.phone, count(*) from phones p left join table_data d on p.phone = d.phone group by p.phone having count(*) > 1 order by count(*) desc; for both versions. Ciao, Thomas -- Thoma

Re: [SQL] @@Error equivalent in Postgresql

2009-10-22 Thread Thomas Pundt
Hi maboyz schrieb: I am in the process of migrating our database from MS Server 2000 to Postgres. I have a bunch of stored procs which i have to modify the syntax so they work in postgresql. My ? is is there an equivalent for the @@Error function in T-SQL for postgres: The stored proc i am conve

Re: [SQL] record to columns: syntax question and strange behaviour

2009-10-27 Thread Thomas Pundt
Hi, Marc Mamin schrieb: how should I retrieve the result from a function with some OUT paramenters? (PG is 8.3.7) here a short example to illustrate my question: CREATE OR REPLACE FUNCTION test (In a int, OUT b int, OUT c int) AS $BODY$ BEGIN b:=a+1; c:=a+2; raise notice 'done: %', a;

Re: [SQL] Query is fast and function is slow

2006-12-07 Thread Thomas Pundt
lighten me. | Can you do something like explain analyze on a function Just a guess: is the column "doc_num" really of type text? Maybe using "text" in the function lets the planner choose a sequential scan? I'd try putting a "raise notice '%', exp

Re: [SQL] Query is fast and function is slow

2006-12-07 Thread Thomas Pundt
ermission:52: | ^ | dcc=# ok, seems you can't use a SQL statement as expression here; instead try using a "for statement" then: for v_rec in explain analyze loop raise notice '%', v_rec; end loop; don't forget to declare "v_re