Re: [SQL] double precision to numeric overflow error

2003-01-07 Thread Thomas O'Connell
Well, it would've immediately (rather than the several minutes it took) given away the problem if it read something like: ERROR: overflow caused by cast of double precision value to numeric without sufficient precision, scale (15, 6) or even, depending on how much detail is available or how mu

Re: [SQL] [GENERAL] double precision to numeric overflow error

2003-01-07 Thread Tom Lane
"Thomas O'Connell" <[EMAIL PROTECTED]> writes: > Indeed, it seems as though my inability to count digits was the real > problem. Still, does this not strike anyone as a somewhat abstruse error > message? How would you phrase it? > ERROR: overflow on numeric ABS(value) >= 10^9 for field with pr

Re: [SQL] double precision to numeric overflow error

2003-01-07 Thread Thomas O'Connell
Indeed, it seems as though my inability to count digits was the real problem. Still, does this not strike anyone as a somewhat abstruse error message? -tfo In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Stephan Szabo) wrote: > On Tue, 7 Jan 2003, Thomas O'Connell wrote: > > > is this exp

Re: [SQL] double precision to numeric overflow error

2003-01-07 Thread Stephan Szabo
On Tue, 7 Jan 2003, Thomas O'Connell wrote: > is this expected behavior? if so, then why? I'd guess so if the timestamp value's integer part is 10 digits long since I believe trying to fit that into a numeric(15,6) wouldn't work (9 digits . 6 digits). > db=# create table foo( col timestamp ); >

[SQL] double precision to numeric overflow error

2003-01-07 Thread Thomas O'Connell
is this expected behavior? if so, then why? -tfo db=# create table foo( col timestamp ); db=# select cast( extract( epoch from col ) as numeric( 15, 6 ) ) from foo; date_part --- (0 rows) db=# insert into foo values( current_timestamp ); INSERT 1705954 1 db=# select cast( extract( epoc

Re: [SQL] [PERFORM] 7.3.1 index use / performance

2003-01-07 Thread Tom Lane
Rod Taylor <[EMAIL PROTECTED]> writes: >> I am wondering about a compiler bug, or some other peculiarity on your >> platform. Can anyone else using FreeBSD try the above experiment and >> see if they get different results from mine on 7.3.* (or CVS tip)? > On FreeBSD 4.7 I received the exact same

Re: [SQL] [PERFORM] 7.3.1 index use / performance

2003-01-07 Thread Rod Taylor
> I am wondering about a compiler bug, or some other peculiarity on your > platform. Can anyone else using FreeBSD try the above experiment and > see if they get different results from mine on 7.3.* (or CVS tip)? On FreeBSD 4.7 I received the exact same results as Tom using the statements shown b

Re: [SQL] [PERFORM] 7.3.1 index use / performance

2003-01-07 Thread Achilleus Mantzios
On Tue, 7 Jan 2003, Tom Lane wrote: > Achilleus Mantzios <[EMAIL PROTECTED]> writes: > > My case persists: > > After clean install of the database, and after vacuum analyze, > > i get > > Um ... is it persisting? That looks like it's correctly picked the > vcode index this time. Strange behavior

Re: [SQL] [GENERAL] 7.3.1 function problem: ERROR: cache lookup failed

2003-01-07 Thread Joe Conway
Achilleus Mantzios wrote: On Tue, 7 Jan 2003, Tom Lane wrote: Does your function know about filling in the elemtype field that was recently added to struct ArrayType? She has no clue :) Any pointers would be great. See construct_array() in src/backend/utils/adt/arrayfuncs.c. HTH, Joe ---

Re: [SQL] [PERFORM] 7.3.1 index use / performance

2003-01-07 Thread Tom Lane
Achilleus Mantzios <[EMAIL PROTECTED]> writes: > My case persists: > After clean install of the database, and after vacuum analyze, > i get Um ... is it persisting? That looks like it's correctly picked the vcode index this time. Strange behavior though. By "clean install" do you mean you rebui

Re: [SQL] [PERFORM] 7.3.1 index use / performance

2003-01-07 Thread Achilleus Mantzios
On Tue, 7 Jan 2003, Tom Lane wrote: > There is no way that adding the filter condition should have reduced the > estimated runtime for this plan --- reducing the estimated number of > output rows, yes, but not the runtime. And in fact I can't duplicate My case persists: After clean install of th

Re: [SQL] [GENERAL] 7.3.1 function problem: ERROR: cache lookup failed

2003-01-07 Thread Achilleus Mantzios
On Tue, 7 Jan 2003, Tom Lane wrote: > Achilleus Mantzios <[EMAIL PROTECTED]> writes: > > Hi i had written a C function to easily convert an int4 to its > > equivalent 1x1 int4[] array. > > Does your function know about filling in the elemtype field that was > recently added to struct ArrayType? S

Re: [SQL] [GENERAL] 7.3.1 function problem: ERROR: cache lookup failed for type 0

2003-01-07 Thread Tom Lane
Achilleus Mantzios <[EMAIL PROTECTED]> writes: > Hi i had written a C function to easily convert an int4 to its > equivalent 1x1 int4[] array. Does your function know about filling in the elemtype field that was recently added to struct ArrayType? regards, tom lane --

[SQL] 7.3.1 function problem: ERROR: cache lookup failed for type 0

2003-01-07 Thread Achilleus Mantzios
Hi i had written a C function to easily convert an int4 to its equivalent 1x1 int4[] array. It worked fine under 7.1,7.2. Now under 7.3.1 i get the following message whenever i try to: dynacom=# select itoar(3126); ERROR: cache lookup failed for type 0 Surprisingly though when i do something l

Re: [SQL] [PERFORM] 7.3.1 index use / performance

2003-01-07 Thread Tom Lane
Achilleus Mantzios <[EMAIL PROTECTED]> writes: >> Also, I would like to see the results of these queries on both versions, >> so that we can see what the planner thinks the index selectivity is: >> > [ data supplied ] There is something really, really bizarre going on there. You have dynacom=#

Re: [SQL] [PERFORM] 7.3.1 index use / performance

2003-01-07 Thread Achilleus Mantzios
On Tue, 7 Jan 2003, Tom Lane wrote: > Achilleus Mantzios <[EMAIL PROTECTED]> writes: > > About the stats on these 3 columns i get: > > Does 7.2 generate the same stats? (minus the schemaname of course) Not absolutely but close: (See attachment) > > Also, I would like to see the results of thes

Re: [SQL] weighting (the results of) a query ?

2003-01-07 Thread Peter Galbavy
> I think your query might fail on that requirement regardless, no? At > least I missed how you'd prevent it. I have had about 10 minutes to play with this - my day jobrequires I do real testing when I get home later tonight :) Thanks, and I will keep an eye out for this and figure a way around

Re: [SQL] weighting (the results of) a query ?

2003-01-07 Thread Tom Lane
"Peter Galbavy" <[EMAIL PROTECTED]> writes: > Not sure - what I want is only one row per real row but ordered as per the > constants. When you say duplicate-row-elimination do you mean including the > 'constant' weighting, Yes, UNION would consider all columns in deciding if two rows are dups. >

Re: [SQL] [PERFORM] 7.3.1 index use / performance

2003-01-07 Thread Tom Lane
Achilleus Mantzios <[EMAIL PROTECTED]> writes: > About the stats on these 3 columns i get: Does 7.2 generate the same stats? (minus the schemaname of course) Also, I would like to see the results of these queries on both versions, so that we can see what the planner thinks the index selectivity

Re: [SQL] weighting (the results of) a query ?

2003-01-07 Thread Peter Galbavy
> Most likely you should write UNION ALL, not UNION. As given, the query > will go through a pass of attempted duplicate-row-elimination, which is > almost certainly not what you want. Not sure - what I want is only one row per real row but ordered as per the constants. When you say duplicate-row

Re: [SQL] [PERFORM] 7.3.1 index use / performance

2003-01-07 Thread Achilleus Mantzios
On Tue, 7 Jan 2003, Stephan Szabo wrote: > > On Tue, 7 Jan 2003, Achilleus Mantzios wrote: > > > i am just in the stage of having migrated my test system to 7.3.1 > > and i am experiencing some performance problems. > > > > i have a table "noon" > > Table "public.noon" > >

Re: [SQL] weighting (the results of) a query ?

2003-01-07 Thread Tom Lane
"Peter Galbavy" <[EMAIL PROTECTED]> writes: > Thanks to Len Morgan for the hints to get to this: > SELECT *, '4' as result FROM images > WHERE > iptc_release_date < 'today' AND > iptc_priority BETWEEN 1 AND 5 AND iptc_caption ~* 'term' > UNION > SELECT *, '3' as result FROM images

Re: [SQL] weighting (the results of) a query ?

2003-01-07 Thread Peter Galbavy
Thanks to Len Morgan for the hints to get to this: SELECT *, '4' as result FROM images WHERE iptc_release_date < 'today' AND iptc_priority BETWEEN 1 AND 5 AND iptc_caption ~* 'term' UNION SELECT *, '3' as result FROM images WHERE iptc_release_date < 'today' AND ipt

Re: [SQL] insert rule doesn't see id field

2003-01-07 Thread Tom Lane
Ron Peterson <[EMAIL PROTECTED]> writes: > CREATE RULE person_insert AS > ON INSERT TO person > DO > INSERT INTO person_log ( name_last, name_first, mod_type, person_id ) > VALUES ( new.name_last, new.name_first, 'I', new.id ); > [where id is a serial column] > My insert rule creates a rec

Re: [SQL] [PERFORM] 7.3.1 index use / performance

2003-01-07 Thread Stephan Szabo
On Tue, 7 Jan 2003, Achilleus Mantzios wrote: > i am just in the stage of having migrated my test system to 7.3.1 > and i am experiencing some performance problems. > > i have a table "noon" > Table "public.noon" > Column | Type | Modifiers

Re: [SQL] A problem about alter table

2003-01-07 Thread Jeff Eckermann
--- jack <[EMAIL PROTECTED]> wrote: > Hi, all > I'm using postgreSQL 7.2.3. The following statement > always cuases a parser > error, "parse error at or near NOT". Please adivse, > thank you in advance. > > ALTER TABLE _acct_group1 > ALTER groupkey SET NOT NULL; I believe you will need to u

Re: [SQL] insert rule doesn't see id field

2003-01-07 Thread Ron Peterson
BTW, PostgreSQL 7.2.1-2woody2 on Debian. -- Ron Peterson -o) Network & Systems Manager /\\ Mount Holyoke College_\_v http://www.mtholyoke.edu/~rpeterso ---(end of broadcast)--- TIP 5: Hav

[SQL] insert rule doesn't see id field

2003-01-07 Thread Ron Peterson
Two seperate problems, really, but first the SQL: CREATE SEQUENCE person_id_seq; CREATE TABLE person ( name_last VARCHAR( 50 ) NOT NULL, name_first VARCHAR( 50 ) NOT NULL, id INTEGER

Re: [SQL] A problem about alter table

2003-01-07 Thread Achilleus Mantzios
On Wed, 8 Jan 2003, jack wrote: > But on postgreSQL 7.2 reference manual, there is a statement for alter table > such as, ALTER TABLE [ ONLY ] table [ * ] > ALTER [ COLUMN ] column { SET | DROP } NOT NULL > > Do you mean this one hasn't been implemented? > > Jack This syntax is valid in 7.3

Re: [SQL] A problem about alter table

2003-01-07 Thread Tomasz Myrta
jack wrote: But on postgreSQL 7.2 reference manual, there is a statement for alter table such as, ALTER TABLE [ ONLY ] table [ * ] ALTER [ COLUMN ] column { SET | DROP } NOT NULL Do you mean this one hasn't been implemented? Jack Strange. I don't have such ALTER TABLE in my 7.2 documenta

Re: [SQL] A problem about alter table

2003-01-07 Thread jack
But on postgreSQL 7.2 reference manual, there is a statement for alter table such as, ALTER TABLE [ ONLY ] table [ * ] ALTER [ COLUMN ] column { SET | DROP } NOT NULL Do you mean this one hasn't been implemented? Jack - Original Message - From: "Tomasz Myrta" <[EMAIL PROTECTED]> To:

Re: [SQL] A problem about alter table

2003-01-07 Thread Tomasz Myrta
jack wrote: Hi, all I'm using postgreSQL 7.2.3. The following statement always cuases a parser error, "parse error at or near NOT". Please adivse, thank you in advance. ALTER TABLE _acct_group1 ALTER groupkey SET NOT NULL; Jack From Postgres 7.2 documentation: "In the current implementa

[SQL] A problem about alter table

2003-01-07 Thread jack
Hi, all I'm using postgreSQL 7.2.3. The following statement always cuases a parser error, "parse error at or near NOT". Please adivse, thank you in advance. ALTER TABLE _acct_group1 ALTER groupkey SET NOT NULL; Jack ---(end of broadcast)--- T

Re: [SQL] Inherancing

2003-01-07 Thread Adam Witney
Yes, if you do insert into cities values (1, 'Lajeado'); insert into centers values (1, 'Lajeado', 'AZ'); Then select * from cities will give you 1 Lajedo 1 Lajedo And select * from centers will give 1 Lajedo AZ However, if rather than duplicating the insert and just doing

Re: [SQL] 7.3.1 index use / performance

2003-01-07 Thread Achilleus Mantzios
On Tue, 7 Jan 2003, Tomasz Myrta wrote: > Maybe it is not an answer to your question, but why don't you help > Postgres by yourself? Thanx, i dont think that the issue here is to help postgresql by myself. I can always stick to 7.2.3, or use indexes that 7.3.1 will acknowledge, like noonf_vcode_

Re: [SQL] Inherancing

2003-01-07 Thread Nasair Junior da Silva
In this case, when i do select * from cities; i'll have two tuples with the name 'Lajeado'. Does it the only way i have ? Thanks again, Nasair JĂșnior da Silva Lajeado - RS - Brasil. Em Tue, 07 Jan 2003 12:02:13 +, Adam Witney <[EMAIL PROTECTED]> escreveu: >On 7/1/03 11:42 am, "Nasair Junior

Re: [SQL] Inherancing

2003-01-07 Thread Adam Witney
On 7/1/03 11:42 am, "Nasair Junior da Silva" <[EMAIL PROTECTED]> wrote: > Hi people, > supposing i have the tables : > > create table cities (id int, name varchar, primary key(id) ); > create table centers (state varchar(2)) inherits (cities); > > ant the tuple > insert into cities values (1, 'L

[SQL] Inherancing

2003-01-07 Thread Nasair Junior da Silva
Hi people, supposing i have the tables : create table cities (id int, name varchar, primary key(id) ); create table centers (state varchar(2)) inherits (cities); ant the tuple insert into cities values (1, 'Lajeado'); How i do if i want to make this city as a center ? Thanks, xx===

[SQL] 7.3.1 index use / performance

2003-01-07 Thread Achilleus Mantzios
Hi, i am just in the stage of having migrated my test system to 7.3.1 and i am experiencing some performance problems. i have a table "noon" Table "public.noon" Column | Type | Modifiers ++

Re: [SQL] SQL list table names

2003-01-07 Thread Adam Witney
If you start psql like so psql -E Then all the SQL behind the \d type commands is displayed for you. adam > is it possible to execute an sql query to be able to list the tables's > names? > well, you can do it on psql using \dt. but im talking about the SQL > statement, because i want to exec

[SQL] SQL list table names

2003-01-07 Thread alviN
is it possible to execute an sql query to be able to list the tables's names? well, you can do it on psql using \dt. but im talking about the SQL statement, because i want to execute that query from a script. thanks. alviN ---(end of broadcast)---

Re: [SQL] Sorry, to many clients already

2003-01-07 Thread Tambet Matiisen
> > When I'm trying to connect I have this error message: > > Something unusual has occured to cause the driver to > fail.Please report this > exception: java.sql.SQLException: Sorry, to many clients already. > I also met this error yesterday. Default PostgreSQL limit for incoming connections