[SQL] RETURN QUERY generates error

2008-03-05 Thread Yura Gal
Here is my function: CREATE OR REPLACE FUNCTION "hg18"."get_genomeseq" (_chr varchar, _byblocks boolean, _starts integer [], _ends integer []) RETURNS SETOF text AS $body$ DECLARE _startinteger; _end integer; _sequence text[]; _seq50RECORD; _seq text

[SQL] Bit string help, please

2008-03-05 Thread tyrrill_ed
Hey PostgreSQL Gurus, I am experimenting with PostgreSQL bit strings to see if they might help with some performance issues I am having. I added a "bit varying" column to one of my tables. I have a PL/pgSQL function with an insert statement into this table. For the bit varying column I would li

Re: [SQL] finding columns that have three or fewer distinct characters

2008-03-05 Thread Jeff Frost
On Wed, 5 Mar 2008, Osvaldo Rosario Kussama wrote: Jeff Frost escreveu: I've got an interesting one...I'm trying to find columns that have three or fewer distinct characters (for example, "aa"). Wondering if I need to write a function or if someone has an idea how to do it with built

Re: [SQL] finding columns that have three or fewer distinct characters

2008-03-05 Thread Osvaldo Rosario Kussama
Jeff Frost escreveu: I've got an interesting one...I'm trying to find columns that have three or fewer distinct characters (for example, "aa"). Wondering if I need to write a function or if someone has an idea how to do it with built in functions and/or pattern matching? I think the

Re: [SQL] finding columns that have three or fewer distinct characters

2008-03-05 Thread Colin Wetherbee
Jeff Frost wrote: I've got an interesting one...I'm trying to find columns that have three or fewer distinct characters (for example, "aa"). Wondering if I need to write a function or if someone has an idea how to do it with built in functions and/or pattern matching? I think the thi

Re: [SQL] using copy from in function

2008-03-05 Thread Steve Midgley
At 03:20 AM 3/5/2008, [EMAIL PROTECTED] wrote: Date: Wed, 5 Mar 2008 01:51:19 +0300 From: "Yura Gal" <[EMAIL PROTECTED]> To: pgsql-sql@postgresql.org Subject: using copy from in function Message-ID: <[EMAIL PROTECTED]> I'm trying to automate import data using CORY FROM. For this purpose I wrot

[SQL] finding columns that have three or fewer distinct characters

2008-03-05 Thread Jeff Frost
I've got an interesting one...I'm trying to find columns that have three or fewer distinct characters (for example, "aa"). Wondering if I need to write a function or if someone has an idea how to do it with built in functions and/or pattern matching? I think the thing to do would be t

Re: [SQL] Documenting a DB schema

2008-03-05 Thread Professor Flávio Brito
Hi You may try this. CREATE TYPE tabela_estrutura AS (esquema text, tabela text, campo text, tipo text, valor text, autoincremento boolean); ALTER TYPE tabela_estrutura OWNER TO postgres; CREATE OR REPLACE FUNCTION dados_tabela(character varying) RETURNS SETOF tabela_e