Re: [GENERAL] procedure in db

2011-03-08 Thread Pavel Stehule
Hello 2011/3/9 abcdef : > I use postgresql in red hat linux . > I want to know how I can find out all the procedure stored in the database . > Any SQL command to do it ??? > you can try \df in psql or select * from pg_proc Regards Pavel Stehule > > -- > View this message in context: > http:/

Re: [GENERAL] equivalent of mysql's SET type?

2011-03-08 Thread John R Pierce
On 03/08/11 5:06 PM, Reece Hart wrote: I'm considering porting a MySQL database to PostgreSQL. That database uses MySQL's SET type. Does anyone have advice about representing this type in PostgreSQL? MySQL DDL excerpt: CREATE TABLE `transcript_variation` ( `transcript_variation_id` int(10) u

[GENERAL] procedure in db

2011-03-08 Thread abcdef
I use postgresql in red hat linux . I want to know how I can find out all the procedure stored in the database . Any SQL command to do it ??? -- View this message in context: http://postgresql.1045698.n5.nabble.com/procedure-in-db-tp3414995p3414995.html Sent from the PostgreSQL - general mailing

Re: [GENERAL] equivalent of mysql's SET type?

2011-03-08 Thread Darren Duncan
Reece Hart wrote: On Tue, Mar 8, 2011 at 5:52 PM, Darren Duncan wrote: Try starting with an enum type to define the possible values: CREATE TYPE Consequence_Type AS ENUM ('ESSENTIAL_SPLICE_SITE','STOP_GAINED', 'STOP_LOST','COMPLEX_INDEL','SPLICE_SITE'); ... and then you could try usi

Re: [GENERAL] equivalent of mysql's SET type?

2011-03-08 Thread Reece Hart
On Tue, Mar 8, 2011 at 5:51 PM, Steve Atkins wrote: > tsvector or intarray might be other options, depending on how you're going > to query it and whether those are really strings or more enum-ish. > > The more SQLy way of doing it would be to have that stored in a separate > table, with a foreig

Re: [GENERAL] equivalent of mysql's SET type?

2011-03-08 Thread Reece Hart
On Tue, Mar 8, 2011 at 5:52 PM, Darren Duncan wrote: > Try starting with an enum type to define the possible values: > > CREATE TYPE Consequence_Type >AS ENUM ('ESSENTIAL_SPLICE_SITE','STOP_GAINED', > 'STOP_LOST','COMPLEX_INDEL','SPLICE_SITE'); > > ... and then you could try using "ARRAY

Re: [GENERAL] Using bytea field...

2011-03-08 Thread Josh Kupershmidt
On Tue, Mar 8, 2011 at 8:00 PM, David Johnston wrote: > You could avoid the synchronization issues by putting the hash in an > index...in theory...I'd wait for someone else to opine on that particular > option. Yes, a functional index on MD5(your_bytea_column) will work and is the way to go for

Re: [GENERAL] 9.1 - rewrite less alter table?

2011-03-08 Thread Noah Misch
On Sat, Mar 05, 2011 at 12:55:18PM +0100, hubert depesz lubaczewski wrote: > perhaps I misunderstood something from commits, but I assumed that in > 9.1 this operation shouldn't rewrite the table: > > CREATE TABLE test ( x varchar(16) ); > insert into test select i::text from generate_series(1,100

Re: [GENERAL] equivalent of mysql's SET type?

2011-03-08 Thread Darren Duncan
Reece Hart wrote: I'm considering porting a MySQL database to PostgreSQL. That database uses MySQL's SET type. Does anyone have advice about representing this type in PostgreSQL? MySQL DDL excerpt: CREATE TABLE `transcript_variation` ( `transcript_variation_id` int(10) unsigned NOT NULL AUTO_I

Re: [GENERAL] equivalent of mysql's SET type?

2011-03-08 Thread Steve Atkins
On Mar 8, 2011, at 5:06 PM, Reece Hart wrote: > I'm considering porting a MySQL database to PostgreSQL. That database uses > MySQL's SET type. Does anyone have advice about representing this type in > PostgreSQL? > > MySQL DDL excerpt: > CREATE TABLE `transcript_variation` ( > `transcript_va

[GENERAL] equivalent of mysql's SET type?

2011-03-08 Thread Reece Hart
I'm considering porting a MySQL database to PostgreSQL. That database uses MySQL's SET type. Does anyone have advice about representing this type in PostgreSQL? MySQL DDL excerpt: CREATE TABLE `transcript_variation` ( `transcript_variation_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `transcr

Re: [GENERAL] Using bytea field...

2011-03-08 Thread David Johnston
Not sure if it is possible directly but have you considered (or you might have to) generating an MD5 hash of the data (possibly after encoding) and then comparing the hashes? For a small image it may not matter but if you plan on making the check with any frequency (and multiple times against t

[GENERAL] @@ to_tsquery help

2011-03-08 Thread akp geek
Hi all - I have 2 tables A,B . Can I write a select statement as follows. My query is running slow ( 7000 ms). I have created gin index on text_col and also transactionid is PK on both tables. thanks for your help B has a transactionid and tsvector columns A has trasactionid and other columns

Re: [GENERAL] Why count(*) doest use index?

2011-03-08 Thread Glenn Maynard
On Tue, Mar 8, 2011 at 10:42 AM, Igor Neyman wrote: > Indexes don't "maintain counts", indexes maintain pointers to the table > records. > The whole point is that they don't, even if you can afford the costs. What you need is "materialized view" storing aggregates. > And it looks like you alrea

Re: [GENERAL] Using bytea field...

2011-03-08 Thread Andy Colson
On 3/8/2011 12:28 PM, Andre Lopes wrote: Hi, I'm using a bytea field to store small images in base64. I need to know if I can compare bytea rows for equality. To know for example if the file already exists in the database, this is possible with bytea? Best Regads, You dont need to use both b

[GENERAL] Using bytea field...

2011-03-08 Thread Andre Lopes
Hi, I'm using a bytea field to store small images in base64. I need to know if I can compare bytea rows for equality. To know for example if the file already exists in the database, this is possible with bytea? Best Regads, -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) T

[GENERAL] #PgEast schedule is up

2011-03-08 Thread Joshua D. Drake
Hey, The schedule for #PgEast is up. It can be found here: https://www.postgresqlconference.org/files/east_2011_schedule.html As usually we have a increasingly wide selection of content. Sincerely, JD -- PostgreSQL.org Major Contributor Command Prompt, Inc: http://www.commandprompt.com/ - 509

Re: [GENERAL] NULL value vs. DEFAULT value.

2011-03-08 Thread James B. Byrne
On Tue, March 8, 2011 10:09, Scott Ribe wrote: > On Mar 8, 2011, at 7:54 AM, James B. Byrne wrote: > >> My question is: Why am I getting a NULL exception? > > Because you're trying to insert NULL explicitly? Yes, that is the problem. Evidently RoR's ActiveRecord helpfully converts a string cont

Re: [GENERAL] NULL value vs. DEFAULT value.

2011-03-08 Thread David Johnston
I do not see any NULL exception. A default value is used whenever a specific value for a column is not specified. If whatever is trying to insert into this table is assigning a "NULL" value to a field the DEFAULT no longer applies but the NOT NULL check still does. CREATE TABLE Notnullfi

Re: [GENERAL] Why count(*) doest use index?

2011-03-08 Thread Igor Neyman
> -Original Message- > From: Glenn Maynard [mailto:gl...@zewt.org] > Sent: Monday, March 07, 2011 5:27 PM > To: pgsql-general@postgresql.org > Subject: Re: Why count(*) doest use index? > > > An index on "events(user, event_time::date)" could optimize > this, eg. effectively maintainin

Re: [GENERAL] NULL value vs. DEFAULT value.

2011-03-08 Thread Raymond O'Donnell
On 08/03/2011 14:54, James B. Byrne wrote: My question is: Why am I getting a NULL exception? Should I only specify DEFAULT and drop the NOT NULL constraint? Good question. Are you trying to insert an explicit NULL? Can you show us your INSERT statement? Ray. -- Raymond O'Donnell :: Galway

Re: [GENERAL] NULL value vs. DEFAULT value.

2011-03-08 Thread Thom Brown
On 8 March 2011 20:24, James B. Byrne wrote: > version = postgresql-8.4.4-2PGDG.el5.src.rpm > > I am seeing this problem and I cannot explain why it is happening. > Evidently I misapprehend something about the interaction of NOT NULL > and DEFAULT.  If someone could tell me what the actual case is

Re: [GENERAL] NULL value vs. DEFAULT value.

2011-03-08 Thread Scott Ribe
On Mar 8, 2011, at 7:54 AM, James B. Byrne wrote: > My question is: Why am I getting a NULL exception? Because you're trying to insert NULL explicitly? -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice -- Sent via pgsql-general mailing list (pgsq

[GENERAL] NULL value vs. DEFAULT value.

2011-03-08 Thread James B. Byrne
version = postgresql-8.4.4-2PGDG.el5.src.rpm I am seeing this problem and I cannot explain why it is happening. Evidently I misapprehend something about the interaction of NOT NULL and DEFAULT. If someone could tell me what the actual case is I would appreciate it very much. The table definitio

Re: [GENERAL] unexpected EOF on client connection vs 9.0.3

2011-03-08 Thread Francisco Figueiredo Jr.
Indeed those messages appear when the client closes the socket connection only. Npgsql has connection pooling and if the app domain is unloaded and there are connections in the pool, those connections don't get a chance to have the Close message sent to backend server. So, even when you are corre

Re: [GENERAL] Why count(*) doest use index?

2011-03-08 Thread Alban Hertroys
On 7 Mar 2011, at 22:16, Glenn Maynard wrote: > The stats system only helps for the most basic case--counting the number of > rows in a table. In my experience that's not very common; most of the time > it's counting total results from some more interesting query, eg. for > pagination. In my

Re: [GENERAL] unexpected EOF on client connection vs 9.0.3

2011-03-08 Thread rsmogura
On Tue, 08 Mar 2011 11:30:10 +0800, Craig Ringer wrote: On 08/03/11 02:49, Piotr Czekalski wrote: I've checked and verified that all connections are closed within the code, what's more, the problem has appeared just as I've moved server from Fedora Linux x86_64 running Postgres 8.4.2 to the Wi