Re: [GENERAL] OT: SCO Extortion

2004-01-24 Thread Bruce Momjian
Chris Travers wrote: > I am not sure where SCO is coming from or where its influences are. > However, I have noticed a number of interesting issues which makes me think > that this is a major problem at SCO which goes back quite a ways. > > I remember Ransom Love (former Caldera CEO) writing that

[GENERAL] Multiway associations

2004-01-24 Thread Russell Shaw
Hi, I'm making my first database. I have a list of parts, each of which is sold by multiple vendors. I also have a list of vendors, each of which sell multiple parts. How should i arrange the tables for this that doesn't involve having lots of empty fields "just in case" ? -

[GENERAL] I can't upgrade to PostgreSQL 7.4 in RedHat 9.0

2004-01-24 Thread Manuel Tejada
Hello list This is my situation: My box: Pentium III, Red Hat 9.0 I was working fine with PostgreSQL 7.3.2. Recently I decided to upgrade it to PostgreSQL 7.4 installing the twelve rpms I downloaded from ftp://ftp15.us.postgresql.org/binar...dhat/refhat-9/. I followed the standar command to upg

Re: [GENERAL] FAQ (disk space)

2004-01-24 Thread Bruce Momjian
Clarence Gardner wrote: > >> Could you please tell me if there's a limit in the amount of records that > >> the database can handle? > > >See the FAQ: http://www.postgresql.org/docs/faqs/FAQ.html#4.5 > > Speaking of the FAQ, in the next question (#4.6), should > "NULLs are stored in bitmaps" say

Re: [GENERAL] fixed-length row

2004-01-24 Thread Bruce Momjian
Richard Huxton wrote: > On Thursday 15 January 2004 14:17, David Garamond wrote: > > The MySQL manual recommends that we create a "fixed-length row" if > > possible, for speed (especially scanning speed). A fixed-length row is a > > row which is comprised of only fixed-length fields. A fixed-length

Re: [GENERAL] Mailing list? was Postgress and MYSQL

2004-01-24 Thread Bruce Momjian
Tom Lane wrote: > Csaba Nagy <[EMAIL PROTECTED]> writes: > > On Thu, 2004-01-15 at 16:14, Marc G. Fournier wrote: > >> why not use pgsql-chat, which isn't being used at all right now ... ? > > > I have the impression that these "Postgres vs MySQL vs XXX" stuff is > > regularly started up by newcom

Re: [GENERAL] Log_statement behaviour a little misleading?

2004-01-24 Thread Bruce Momjian
Tom Lane wrote: > Mark Kirkwood <[EMAIL PROTECTED]> writes: > > So setting "log_statement=true" does all *statements* - but not all > > *executions* of each statement. Is this the intention? > > AFAIK this is an implementation artifact that's never really been > discussed. Another aspect of the

Re: [GENERAL] pl/pgsql docs 37.4.3. Row Types -- how do I use this function?

2004-01-24 Thread Lee Harr
I am following along with the pl/pgsql docs here: http://www.postgresql.org/docs/current/static/plpgsql-declarations.html Now, how do I call the function? I believe you want select use_two_tables(tablename.*) from tablename; "foo.*" is the locution for referring to the whole-row value coming fro

Re: [GENERAL] Touch row ?

2004-01-24 Thread Eric Ridge
On Jan 24, 2004, at 3:58 PM, Tom Lane wrote: True. So if your goal is to force the timestamp column to be the correct value even when the user tries to set it to something else, you'd still have to use a trigger or rule. Maybe the rule is that the computed value is always used, unless: UP

Re: [GENERAL] Touch row ?

2004-01-24 Thread Tom Lane
Eric Ridge <[EMAIL PROTECTED]> writes: > On Jan 24, 2004, at 2:34 PM, Tom Lane wrote: >> A different tack that might be interesting to think about is to invent >> a notion of an "update default" for a column, analogous to the existing >> "insert default". > This thought ran through my head last ni

Re: [GENERAL] Touch row ?

2004-01-24 Thread Eric Ridge
On Jan 24, 2004, at 2:34 PM, Tom Lane wrote: The restriction is not that: the restriction is that you can't have an infinite recursion in your rules. The above is infinitely recursive because it says that for any UPDATE on mytable, you should also do an UPDATE on mytable ... but then for that UPDA

Re: [GENERAL] pl/pgsql docs 37.4.3. Row Types -- how do I use this function?

2004-01-24 Thread Tom Lane
"Lee Harr" <[EMAIL PROTECTED]> writes: > I am following along with the pl/pgsql docs here: > http://www.postgresql.org/docs/current/static/plpgsql-declarations.html > Now, how do I call the function? I believe you want select use_two_tables(tablename.*) from tablename; "foo.*" is the locution f

Re: [GENERAL] Touch row ?

2004-01-24 Thread Eric B . Ridge
On Jan 24, 2004, at 12:18 PM, Tom Lane wrote: This surprises me. There's a moderate amount of overhead involved in a plpgsql trigger, but I'd not have thought it would swamp the added inefficiencies involved in a rule. Notice that you're getting a double indexscan in the rule case --- that takes

[GENERAL] on cascade set null works on not null columns

2004-01-24 Thread Baldur Norddahl
Hi, I just noticed that I could do this: webshop=# create table foo (bar text not null primary key); NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "foo_pkey" for table "foo" CREATE TABLE webshop=# create table foo2 (bar text not null, foreign key (bar) references foo(bar) on upda

Re: [GENERAL] Touch row ?

2004-01-24 Thread Tom Lane
"Eric B.Ridge" <[EMAIL PROTECTED]> writes: > On Jan 24, 2004, at 12:36 AM, Chris Travers wrote: >> CREATE RULE touch_row AS ON UPDATE TO mytable DO >> (UPDATE mytable SET last_updated = NOW() WHERE my_id = NEW.my_id); > [ ... but that produces ] > test=# update mytable set my_id = 1; > ERROR: inf

Re: [GENERAL] pl/pgsql docs 37.4.3. Row Types -- how do I use this

2004-01-24 Thread Lee Harr
>Unless your function parameter is an integer you must quote it... eq: > >select use_two_tables('tablename'); > Hrm... That does not work either: # select use_two_tables('tablename'); ERROR: function use_two_tables("unknown") does not exist Why not just use a text type in your definition? CREATE

Re: [GENERAL] pl/pgsql docs 37.4.3. Row Types -- how do I use this

2004-01-24 Thread Jim Wilson
Lee Harr <[EMAIL PROTECTED]> said: > >Unless your function parameter is an integer you must quote it... eq: > > > >select use_two_tables('tablename'); > > > > Hrm... That does not work either: > > # select use_two_tables('tablename'); > ERROR: function use_two_tables("unknown") does not exist >

Re: [GENERAL] pl/pgsql docs 37.4.3. Row Types -- how do I use this

2004-01-24 Thread Lee Harr
Unless your function parameter is an integer you must quote it... eq: select use_two_tables('tablename'); Hrm... That does not work either: # select use_two_tables('tablename'); ERROR: function use_two_tables("unknown") does not exist HINT: No function matches the given name and argument types

[GENERAL] Is there something like an dynamic view ?

2004-01-24 Thread Andreas
Hi, I'd like to fetch a selection of records out of a big n:m-relation. It's something like: customers (c_id, c_name, c_address, ); projects (p_id, p_name, c_start, ); cp_relation (c_id, p_id, status_id, ); I use Access2000 as client. The user selects an project_id by a combobox in th

Re: [GENERAL] Touch row ?

2004-01-24 Thread Tom Lane
"Eric B.Ridge" <[EMAIL PROTECTED]> writes: > [ update timestamp via a rule ] > explain analyze update foo_view set id = 1 where id = 1; > Average runtime for 10 executions: 0.165ms > [ update timestamp via a trigger ] > explain analyze update foo2 set id = 1 where id = 1; > Average runtime for 10

Re: [GENERAL] pl/pgsql docs 37.4.3. Row Types -- how do I use this

2004-01-24 Thread Joshua D. Drake
Hello, Unless your function parameter is an integer you must quote it... eq: select use_two_tables('tablename'); Sincerely, Joshua D. Drake Lee Harr wrote: I am following along with the pl/pgsql docs here: http://www.postgresql.org/docs/current/static/plpgsql-declarations.html In section 37.4

[GENERAL] pl/pgsql docs 37.4.3. Row Types -- how do I use this function?

2004-01-24 Thread Lee Harr
I am following along with the pl/pgsql docs here: http://www.postgresql.org/docs/current/static/plpgsql-declarations.html In section 37.4.3. Row Types I have altered the function slightly (I finished the where ... clause) : CREATE or REPLACE FUNCTION use_two_tables(tablename) RETURNS text AS ' DECL

[GENERAL] Powerbuilder and PostgreSQL information

2004-01-24 Thread Jim Wilson
There wasn't much help online when I decided this had to be a concept that would work. Sybase is not a lot of help on this either. After sometimes spending hours staring at traces and explains in order to solve a single problem (and often using a totally heuristic approach to debugging :-)), I f

Re: [GENERAL] If table A value IS NULL then table B

2004-01-24 Thread Marco Lazzeri
Il ven, 2004-01-23 alle 19:59, Ezra Epstein ha scritto: > > I've got a table called 'main' described as follow > > > > CREATE TABLE main ( > > id_other_table INT, > > value CHAR > > ); > > > > and a table called 'other' described as follow > > > > CREATE TABLE other ( > > id INT PRIMARY KEY,

Re: [GENERAL] sequence in schema -- broken default

2004-01-24 Thread Nigel J. Andrews
On Fri, 23 Jan 2004, Joshua D. Drake wrote: > > > CREATE DATABASE d; > > \c d > > > > CREATE SCHEMA one; > > SET search_path TO one; > > > > CREATE SEQUENCE foo_seq; > > CREATE TABLE foo( > >i integer > >DEFAULT nextval('foo_seq') > > ); > > > > > > SET search_path TO public; > > > >

Re: [GENERAL] force drop of database others are accessing

2004-01-24 Thread Lee Harr
So that means somehow I need to kick off another script with elevated priveleges to take care of it ... I would rather not have to do that, but I do not see another way. If you are creating a database from scratch why not create a brand new database and drop the old one at some later point in time

Re: [GENERAL] Touch row ?

2004-01-24 Thread Doug McNaught
"Chris Travers" <[EMAIL PROTECTED]> writes: >> Interesting. Yet another item to tack onto my list of differences between >> MySQL and Postgres. > > Does MySQL apply defaults to updates? Not quite. AIUI MySQL has a "magic timestamp" feature where the first TIMESTAMP column in a table will be aut

Re: [GENERAL] If table A value IS NULL then table B

2004-01-24 Thread Marco Lazzeri
Yes, id_other_table IS a foreign key to id and usually I've got records in each table. Thanks to all of you! Il ven, 2004-01-23 alle 21:45, [EMAIL PROTECTED] ha scritto: > As for the outer join, I think that the problem was ambiguous. > > Is id_other_table a foreign key to id? Is there at most o

Re: [GENERAL] force drop of database others are accessing

2004-01-24 Thread Kris Jurka
On Sat, 24 Jan 2004, Lee Harr wrote: > >>Every once in a while my automated script fails because > >>some other system which should have disconnected > >>failed to unhook. The old data and old connection are > >>not important to me. The new run needs to go through. > > > >You can look for people

Re: [GENERAL] force drop of database others are accessing

2004-01-24 Thread Lee Harr
Every once in a while my automated script fails because some other system which should have disconnected failed to unhook. The old data and old connection are not important to me. The new run needs to go through. You can look for people connected and kick them out with kill -2 on their pid. The tr