Re: [GENERAL] username length character limits?

2004-07-03 Thread Stephan Szabo
On Sat, 3 Jul 2004, Dennis Gearon wrote: > Stephan Szabo wrote: > > > IIRC, psql (and the createuser shell script and such) treat it as if you > > had double quoted its argument because of the way shells handle quotes > > which would necessitate something like '&qu

Re: [GENERAL] Interpreting query plan

2004-07-06 Thread Stephan Szabo
On Tue, 6 Jul 2004, Chris Smith wrote: > Thanks for your reply. Here is the output of "explain analyze". I also > replaced by simple values with a real query that gets run and (according to > our profiling) takes a long time. However, the query is now taking a much > shorter period of time tha

Re: [GENERAL] Postgres doesn't use indexes for prefix matching?

2004-07-08 Thread Stephan Szabo
On Fri, 2 Jul 2004, Jon Valvatne wrote: > Pasted below, I demonstrate two queries which both produce the same two > records in their result set (the two objects which have my full name in > their name field). Based on my experiences with other DBMS, I would have > thought Postgres could do a simpl

Re: [GENERAL] Index Using

2004-07-19 Thread Stephan Szabo
On Mon, 19 Jul 2004, Michal Hlavac wrote: > hello, > > I have in db table with 3 columns... table name is l_model_to_part > columns: i_model_id, i_part_id, i_year > > I have index on every column separately and primary key is (i_model_id, > i_part_id, i_year) > > when I use: EXPLAIN SELECT * FROM

Re: [GENERAL] system catalog and varchar datatype

2004-07-19 Thread Stephan Szabo
On Mon, 19 Jul 2004, sandra ruiz wrote: > hi, I need to find out the length of a varchar attribute .. > > for example,if a I have an atribute "description varchar(256)" I would > expect to see this "256" in the pg_attribute table. > > there's is an "attlen" In the pg_attribute but this doesn't gi

Re: [GENERAL] locale-specific sort algorithms undocumented?

2004-07-25 Thread Stephan Szabo
On Tue, 20 Jul 2004, John Gunther wrote: > In the course of creating a new PG 7.4.3 server, I chose UTF-8 as my > locale. I now find that sorting is very different with that setting: It As a note, UTF-8 is not a locale. My guess is that you are actually using something like en_XX.UTF-8 (for some

Re: [GENERAL] case insensitive sorting & searching in oracle 10g

2004-08-05 Thread Stephan Szabo
On Thu, 5 Aug 2004, David Garamond wrote: > in oracle 10g, you can issue: > > ALTER SESSION SET NLS_COMP = ansi; > ALTER SESSION SET NLS_SORT = binary_ci; > > do you think this is an elegant solution for case insensitive sorting & > searching? is there interest in seeing this in postgres? IMH

Re: [GENERAL] case insensitive sorting & searching in oracle 10g

2004-08-05 Thread Stephan Szabo
On Thu, 5 Aug 2004, David Garamond wrote: > Stephan Szabo wrote: > >>in oracle 10g, you can issue: > >> > >> ALTER SESSION SET NLS_COMP = ansi; > >> ALTER SESSION SET NLS_SORT = binary_ci; > >> > >>do you think this is an elegant soluti

Re: [GENERAL] PostgreSQL 7.4.2 allows foreign key violation

2004-08-06 Thread Stephan Szabo
On Fri, 6 Aug 2004, Markus Bertheau wrote: > Up to here I thought that the following was going on: The UPDATE b > statement was rewritten into a UPDATE a statement by the rule system. > The update on a triggers the foreign key update on b. This UPDATE gets > rewritten again by the rule system to

Re: [GENERAL] PostgreSQL 7.4.2 allows foreign key violation

2004-08-06 Thread Stephan Szabo
On Fri, 6 Aug 2004, Tom Lane wrote: > Stephan Szabo <[EMAIL PROTECTED]> writes: > > It also looks like before triggers returning NULL can break them. > > Or a BEFORE trigger that overrides the attempted field update. > > > I think we'd been worried about the

Re: [GENERAL] PostgreSQL 7.4.2 allows foreign key violation

2004-08-06 Thread Stephan Szabo
On Fri, 6 Aug 2004, Stephan Szabo wrote: > On Fri, 6 Aug 2004, Tom Lane wrote: > > > Stephan Szabo <[EMAIL PROTECTED]> writes: > > > It also looks like before triggers returning NULL can break them. > > > > Or a BEFORE trigger that overrides the attempt

Re: [GENERAL] Postgres update with self join

2004-08-10 Thread Stephan Szabo
On Tue, 10 Aug 2004, Igor Kryltsov wrote: > Table looks like: > > select * from test; > name | code | master > --+---+ > ABC | 15074 | > ABC1 | 0 | ABC > ABC2 | 0 | ABC > EKL | 15075 | > EKL1 | 0 | EKL > (5 rows) > > > Now I need to replace "0" values in "code

Re: [GENERAL] BIGINT indexes still with problems

2004-08-10 Thread Stephan Szabo
On Mon, 9 Aug 2004, Dan Ruthers wrote: > Now, if I run this query (note the int8 cast - also tried with the '' cast to > String, same results): > test=> explain select * from dmaildatum where idparent=int8(783219); > QUERY PLAN > --

Re: [GENERAL] How copy a new line char to a file?

2004-08-11 Thread Stephan Szabo
On Wed, 11 Aug 2004, [iso-8859-1] Clodoaldo Pinto Neto wrote: > I should have explained it better: > > Why don't I just insert each line in the table and let "copy to" do its > thing inserting a new line char (lf) at the end of each line? > Because I need the file lines to be in a certain order.

Re: [GENERAL] Date and Timestamps

2004-08-18 Thread Stephan Szabo
[As a note, it's a bad idea to put a new message with a new problem in the same thread.] On Wed, 18 Aug 2004, Ying Lu wrote: > I have a question about "date" & "timestamp" types in PostgreSQL. I want > to setup the default value '-00-00' and "-00-00 00:00:00" for > them. However, it seem

Re: [GENERAL] Why does =ANY() need an extra cast when used

2004-08-23 Thread Stephan Szabo
On Mon, 23 Aug 2004, Frank van Vugt wrote: > The following works : > > db=# select 1 = ANY ('{1,2,3}'::int[]); > ?column? > -- > t > (1 row) > > > This doesn't : > > db=# select 1 = ANY (select '{1,2,3}'::int[]); > ERROR: operator does not exist: integer = integer[] > HINT: No operato

Re: [GENERAL] How is this possible? (more on deadlocks)

2004-08-24 Thread Stephan Szabo
On Tue, 24 Aug 2004, Carlos Moreno wrote: > Ok, now I'm really intrigued by what looks to me > (possibly from a naive point of view) like a bug, > or rather, a limitation on the implementation. Yep. See recent (and historical) discussions on needing a weaker lock than FOR UPDATE for handling fo

Re: [GENERAL] Primary key inheritance problem

2004-08-29 Thread Stephan Szabo
On Fri, 27 Aug 2004, Bruno Baguette wrote: > Hello, > > I've a strange problem with inheritance on PostgreSQL 7.4.1. It seems > like tables don't inherits the primary key of the 'mother' table. > Here's a little sample to show my problem : > > CREATE TABLE foo_a > ( > pk_idmyfoo INT2 PRIM

Re: [GENERAL] Display of text fields

2004-09-10 Thread Stephan Szabo
On Fri, 10 Sep 2004, Ennio-Sr wrote: > I slightly modified your queries and the result gets nearer my goals, > but ... > Here is what I tried: > > SELECT DISTINCT > /* despite the DISTINCT, it shows twice each matching record: once > with the memo fieldd and then without it!. Leaving out the DIST

Re: [GENERAL] Display of text fields

2004-09-10 Thread Stephan Szabo
On Fri, 10 Sep 2004, Ennio-Sr wrote: > * Stephan Szabo <[EMAIL PROTECTED]> [100904, 07:10]: > > On Fri, 10 Sep 2004, Ennio-Sr wrote: > > > > > I slightly modified your queries and the result gets nearer my goals, > > > but ... > > > Here is what

Re: [GENERAL] Display of text fields

2004-09-10 Thread Stephan Szabo
On Fri, 10 Sep 2004, Ennio-Sr wrote: > * Stephan Szabo <[EMAIL PROTECTED]> [100904, 09:05]: > > > > On Fri, 10 Sep 2004, Ennio-Sr wrote: > > > > > * Stephan Szabo <[EMAIL PROTECTED]> [100904, 07:10]: > > > > On Fri, 10 Sep 2004, Ennio-Sr wrot

Re: [GENERAL] PG case sensitivity

2004-09-14 Thread Stephan Szabo
On Tue, 14 Sep 2004, Christian Sell wrote: > Hello, > > I am running into a problem with PGs case sensitivity with regard to column and > table names. I am using program components that require the object names > returned from database metadata queries to be in uppercase. Therefore, I am > forced

Re: [GENERAL] PG case sensitivity

2004-09-14 Thread Stephan Szabo
On Tue, 14 Sep 2004, Tom Lane wrote: > Stephan Szabo <[EMAIL PROTECTED]> writes: > > ... There's been talk about supporting a > > mode which case folds the other direction. In general, however, mixing > > quoted and unquoted names is dangerous in all complien

Re: [GENERAL] Updating another table using a trigger

2004-09-15 Thread Stephan Szabo
On Wed, 15 Sep 2004, Robert Fitzpatrick wrote: > I am running PostgreSQL 7.4.5 and have a trigger on a table called > tblriskassessors which inserts, updates or delete a corresponding record > in tblinspectors by lookup of a contact id and license number match. The > INSERT and DELETE work fine.

Re: [GENERAL] Returning recordsets with functions

2004-09-23 Thread Stephan Szabo
On Thu, 23 Sep 2004, Robert Fitzpatrick wrote: > Can someone point me to some more information or perhaps show an example > of returning a recordset from a plpgsql function. I'd like to send an > argument or arguments to the function, do some queries to return a set > of records. I've done severa

Re: [GENERAL] self referencing table structure and constraints

2004-09-23 Thread Stephan Szabo
On Thu, 23 Sep 2004, Matthew Hixson wrote: > I have a categories table that contains a FK to another category in the > same table, creating a hierarchy. At the very top is this row: > > category_id | name | description | parent_id > -+--+-+--

Re: [GENERAL] Foreign key order evaluation

2004-09-28 Thread Stephan Szabo
On Tue, 28 Sep 2004, Randy Yates wrote: > Michael Fuhr <[EMAIL PROTECTED]> writes: > > > On Tue, Sep 28, 2004 at 01:30:08PM +, Randy Yates wrote: > >> Randy Yates <[EMAIL PROTECTED]> writes: > >> > > >> > I'm confused. Where is the lock? Is it on the 1 record in the model table? > > > > Yes. >

Re: [GENERAL] Indexes on Expressions -- Parentheses

2004-09-28 Thread Stephan Szabo
[EMAIL PROTECTED] On Tue, 28 Sep 2004, Thomas F.O'Connell wrote: > From 11.5 in the docs: > > "The syntax of the CREATE INDEX command normally requires writing > parentheses around index expressions, as shown in the second example. > The parentheses may be omitted when the expression is just a f

Re: [GENERAL] About PostgreSQL's limit on arithmetic operations

2004-09-29 Thread Stephan Szabo
On Wed, 29 Sep 2004, Devrim GUNDUZ wrote: > We were performing some tests on PostgreSQL and found that it fails on the > following query: > > SELECT 512*18014398509481984 AS result; > > and the result is: > > result > - -- > -9223372036854775808 This query should e

Re: [GENERAL] Setting search paths inside a function (plpgsql)

2004-09-29 Thread Stephan Szabo
On Wed, 29 Sep 2004, Gregory S. Williamson wrote: > I've got a problem which seemed to be neatly solved by the use of > schemas, and in fact it mostly works, but I have tried to go one step > too far, perhaps. > > Rather than have the application do > > SET search_path TO f12057; > SELECT * FROM

Re: [GENERAL] string is sometimes null ?

2004-09-29 Thread Stephan Szabo
On Wed, 29 Sep 2004, Graeme Hinchliffe wrote: > The RADIUS server is reporting problems when trying to write START of > accounting entries, and the error given is: > > ERROR: cannot EXECUTE a null querystring CONTEXT: PL/pgSQL function > "radacct_trig" line 43 at open > > The lines its re

Re: [GENERAL] string is sometimes null ?

2004-09-30 Thread Stephan Szabo
On Thu, 30 Sep 2004, Graeme Hinchliffe wrote: > > If monthcurr or username are null, the above will be null. > > Anything || NULL => NULL. > > AH! thanks sorted it now. That is not the behaviour I would have > expected :) > > Is there a concatination operator that will not do this? IE > > if > >

Re: [GENERAL] Mailing

2004-10-05 Thread Stephan Szabo
On Tue, 5 Oct 2004, Todd P Marek wrote: > Hello- > > I am in the process of translating a site using mysql as the backend > over to postgres. I have a lot of time data that I would like to > display to the user in the form of a schedule. > > I am using the to_char function to make the times huma

Re: [GENERAL] select, where and null-values (or: select null<>'1'is fuzzy)

2001-06-12 Thread Stephan Szabo
> I've a problem when selecting values out a table. It's correct. NULL<>1 is defined as NULL by the spec. Where clauses only return rows that the expression is true and so will not return the NULL row. If you want the null rows to show up, you'll need to either use coalesce or add or blah IS N

Re: [GENERAL] abs() does not exists..

2001-06-12 Thread Stephan Szabo
Trigger functions take no arguments (their arguments are passed in differently) and return opaque. That's why it's looking for abs() rather than abs(). Write a plpgsql trigger function that makes the change to the value. On Tue, 12 Jun 2001, mazzo wrote: > Hi all..i'm trying to create a trigge

Re: [GENERAL] function / trigger problem

2001-06-13 Thread Stephan Szabo
On Wed, 13 Jun 2001, F. Masselink wrote: > Hello, > > i've stumbled upon a problem with triggers and functions. > > this function doesn't work. > It gives an error when creating the trigger: set_leentype() does not exist. > > CREATE FUNCTION set_leentype (int4) RETURNS opaque AS ' > BEGIN

Re: [GENERAL] CVS, initdb and catalog version

2001-05-18 Thread Stephan Szabo
On Tue, 15 May 2001, Laurent Duperval wrote: > Hi, > > I updated my source code from CVS and it looks like it creates a problem > because now, the server won't come up because of this error: > > Starting postgresql service: + su -l postgres -c > '/usr/local/bin/pg_ctl -D /usr/local/var/lib/pgsq

Re: [GENERAL] Create an empty record

2001-05-19 Thread Stephan Szabo
I believe it's: insert into product default values; (Don't blame us, blame the standard... :) ) On Sat, 19 May 2001, Per-Olof Pettersson wrote: > Hi > > How would one goabout creating an empty record (for use in relations). > > I have tried INSERT INTO product() VALUES(); but as expected it

Re: [GENERAL] problem with 010.pgsql.sh start

2001-06-20 Thread Stephan Szabo
Do you have the postmaster configured to listen on the port as opposed to only the local socket? (Either the -i command line option or an option in the postgres.conf should do it I believe) On Sat, 16 Jun 2001, Sam Wun wrote: > Hi, > > When I finished running ./010.pgsql.sh start, then tried

Re: [GENERAL] performance tuning or real bug ?

2001-06-20 Thread Stephan Szabo
On 14 Jun 2001, denis wrote: > I use a linux/mandrake 7.2 on PIII 350 > when doing > 1 - create an initialisation file > i=0; > loadfile="/usr/local/pgsql/param/loadfile" > rm -fr $loadfile ; > #creating a file with 1500 records > while [ $i -lt 1500 ] ; do > i=`expr $i +

Re: [GENERAL] Foreign Keys to Non-primary keys?

2001-06-21 Thread Stephan Szabo
On Thu, 21 Jun 2001 [EMAIL PROTECTED] wrote: > > Is it possible to have a foreign key to a non-primary key (also > meaning non-unique and therefore non-indexed) column i a table? Generally no. It's not allowed by the spec, so as of 7.1, we prevent it. Admittedly, you could pull the rug out f

Re: [GENERAL] Re: 7.1.2 ERROR: UNIQUE constraint matching given keys for referenced table ......

2001-07-05 Thread Stephan Szabo
On Thu, 5 Jul 2001, eddie iannuccelli wrote: > Regrading your discussion, at the end, what is the difference between a > REFERENCE clause in a field definition and a FOREIGN KEY in the table > definition ? What is the best solution to implement a classical foreign > key in a table ? "If a i

Re: [GENERAL] orphaned RI constraints

2001-07-06 Thread Stephan Szabo
On Fri, 6 Jul 2001, Somazx Interesting wrote: > > I'm working with two different postgres installations - they're both > v7.1.2. On one I can drop a table and the related constraint info seems to > go away with the table, on the other the restraint trigger seems to remain > in the system tabl

Re: [GENERAL] orphaned RI constraints

2001-07-09 Thread Stephan Szabo
On Mon, 9 Jul 2001, Jan Wieck wrote: > Somazx Interesting wrote: > > At 01:30 PM 7/6/2001 -0700, you wrote: > > >To fix it, you should be able to use DROP TRIGGER on the appropriate > > >triggers that were created (you can find these through a select on > > >pg_trigger, using the tgargs to find

Re: [GENERAL] VACUUM ANALYZE

2001-07-18 Thread Stephan Szabo
It looks like the backend (I'd assume this one) crashed with a segmentation fault. This should leave a core file (I believe in your db data directory). Can you use a debugger to get a back trace from the core file? On Wed, 18 Jul 2001, Ben-Nes Michael wrote: > Hi > > I use 7.1.2 compiled with

Re: [GENERAL] REFERENCES Constraint

2001-07-18 Thread Stephan Szabo
On Wed, 18 Jul 2001, Pavel Fryc wrote: > Is there a way to find out for given row and column what other tables/rows > reference this row/column by means of reference integrity. I need this when > user deletes number of rows from a table and there is integrity violation I > want to get a list of t

Re: [GENERAL] VACUUM ANALYZE

2001-07-20 Thread Stephan Szabo
Hmm, unfortunate (was hoping that only the bottom of the trace was only addresses). Can you turn on --enable-debug (from configure), recompile, and see if it crashes then and what the trace is from that? I think that'd be sufficient in general to get routine names (if I'm wrong, I'm sure Tom wil

Re: [GENERAL] Does dropping a column from a table mess up foreignkeys?

2001-07-20 Thread Stephan Szabo
On Fri, 20 Jul 2001, IRWIN,KEITH (Non-HP-Corvallis,ex1) wrote: > Hi-- > > I'm getting the following error: > > ERROR: Relation "accounts" with OID 72496 no longer exists > > What I did was to drop a couple of columns using the example Bruce > provides in his book on page 264. Briefly,

Re: [GENERAL] Does dropping a column from a table mess up foreignkeys?

2001-07-23 Thread Stephan Szabo
On Mon, 23 Jul 2001, Keith Irwin wrote: > Okay, I've done some experiments and here's what I've found out: > > 1. In order to drop columns from a table, you must delete and recreate > the table. Right now, yes. Hopefully we'll eventually have drop column (but see past hackers discussions abou

[GENERAL] Re: [SQL] What's wrong with this syntax?

2001-07-23 Thread Stephan Szabo
I don't get a parse error for the below query (made up some table structures with those fields) on 7.2devel, what version are you running? On Mon, 23 Jul 2001, Raymond Chui wrote: > > SELECT id_1 FROM table1 WHERE state_code IN ('AZ','DE') > UNION > SELECT id_1 FROM table1 WHERE zip_code IN (

Re: [GENERAL] VACUUM ANALYZE

2001-07-17 Thread Stephan Szabo
What version are you using, and what does your postgres log show? There's probably more information there. - Original Message - From: "Ben-Nes Michael" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, July 17, 2001 5:02 AM Subject: [GENERAL] VACUUM ANALYZE > Hi All > > VA

Re: [GENERAL] concurent updates

2001-07-26 Thread Stephan Szabo
On Thu, 26 Jul 2001, Steve SAUTETNER wrote: > hi everybody ! > > I've got a little problem when updating a primary key in two table > where the primary key of the one is a foreign key from the second : > > here are the 2 tables : > > create table table1 (id int primary key, col1 int); > create

Re: [GENERAL] referential integrity violation

2001-07-30 Thread Stephan Szabo
It means that the particular key value that is used in the referencing table does not have an associated value in the referenced table, not the columns themselves. On 30 Jul 2001, tony wrote: > Hello, > > While copying from a text file of tab delimited data I am getting > " ERROR: referential

Re: [GENERAL] RULE vs TRIGGER

2001-07-30 Thread Stephan Szabo
On Mon, 30 Jul 2001, will trillich wrote: > i have a solution using RULES and PLGPSQL functions (instead of > triggers) for insert-unless-found, using perl lingo: > > # perlish pseudoCode > unless (select(tbl.fld == val)) { insert tbl.fld = val }; > > i'd love to hear the skinny on

Re: [GENERAL] re: 7.1.2 and foreign key unique constraint.

2001-08-02 Thread Stephan Szabo
> I ran accross this problem upon upgrading our database from 7.0.3 > to 7.1.2: > >ERROR: UNIQUE constraint matching given keys for referenced >table "some_table" not found Yeah, we fixed this to follow spec (sql actually requires that the references be to a unique or primary key const

Re: RE : Re: Re: [GENERAL] Asking for some PL/pgSQL Tips

2001-08-02 Thread Stephan Szabo
On Thu, 2 Aug 2001 [EMAIL PROTECTED] wrote: > Well thankyou very much :-) > > The way you have done the dynamic query was my first try, but as long > as it didn't work, I started messing it all. > > I have put it this way, but still returns the same ERROR message. > > I suppose that it

Re: [GENERAL] optimisation of outer join

2001-08-09 Thread Stephan Szabo
On Thu, 9 Aug 2001, Nicholas Piper wrote: > Hi everyone again ! You've been so useful that I've got more questions > :-) > > Sorry about the width of my posts by the way, I'm presuming it is > preferred to have wide tables than try and wrap them. > > I'm trying to select all rows from a join,

[GENERAL] Re: [BUGS] triggers

2001-08-14 Thread Stephan Szabo
On Tue, 14 Aug 2001, Martin Kuria wrote: > Hi, I have a problem I am using postgresql database and I want to enforce >>triggers between my related tables ( tables with relationship), one > table >>has a foreign key and the other the a primary key, I would like to use >>triggers to up

Re: [GENERAL] Is the bug system active?

2001-08-14 Thread Stephan Szabo
On Tue, 14 Aug 2001, Lee Kindness wrote: > Is the bug system at: > > http://www.ca.postgresql.org/bugs/ > > actively in use? I recently reported the following bug: > > http://www.ca.postgresql.org/bugs/bugs.php?4~415 > > and after doing so browsed through a number of earlier bugs it a

Re: [GENERAL] Is the bug system active?

2001-08-14 Thread Stephan Szabo
On Tue, 14 Aug 2001, Lee Kindness wrote: > Stephan Szabo writes: > > On Tue, 14 Aug 2001, Lee Kindness wrote: > > > Is the bug system at: > > > http://www.ca.postgresql.org/bugs/ > > > actively in use? > > It's mostly a front end for the

Re: [GENERAL] Null Conversion

2001-08-14 Thread Stephan Szabo
On Wed, 15 Aug 2001, Mike Withers wrote: > Can anyone tell me how I might convert a null attribute value into a zero > attribute value such that it can be multiplied in a query. > > In Oracle I could do: > > sal*12*NVL(COMM, 0) AS "Annual Income" > > where COMM is an attribute (a salesman com

Re: [GENERAL] Null Conversion

2001-08-14 Thread Stephan Szabo
On Wed, 15 Aug 2001, Mike Withers wrote: > At 06:30 PM 8/14/01 -0700, you wrote: > >On Wed, 15 Aug 2001, Mike Withers wrote: > > > >> Can anyone tell me how I might convert a null attribute value into a zero > >> attribute value such that it can be multiplied in a query. > >> > >> In Oracle I c

Re: [GENERAL] COUNT(*) very slow on table with primary key

2001-08-20 Thread Stephan Szabo
On Tue, 14 Aug 2001, Sheldon Hearn wrote: > I've been having trouble with a slow query on a table that has a primary > key (which I understand is supported in PostgreSQL by a UNIQUE non-NULL > index). It's a SELECT COUNT(*) without a WHERE clause; really simple > stuff. > > I would have thought

Re: [GENERAL] Re: is this possible? it should be!

2001-08-20 Thread Stephan Szabo
On Mon, 20 Aug 2001 [EMAIL PROTECTED] wrote: > On Mon, Aug 20, 2001 at 04:56:29PM -0700, Tony Reina wrote: > > Perhaps GROUP BY will get you where you want to go: > > > > select count(*), a, b, c from a where d=2 group by a, b, c order by e limit 10; > > > > > > Here count(*) doesn't give to

Re: [GENERAL] How do I drop or change a foreign key?

2001-08-23 Thread Stephan Szabo
On Thu, 23 Aug 2001 [EMAIL PROTECTED] wrote: > > > After I created my tables, I went back and added foreign keys to them. Now I > need to change one of the foreign keys to 'ON DELETE CASCADE' behaviour so that > related records are automatically deleted, rather than causing an error when a >

Re: [GENERAL] Re: MySQL's (false?) claims... (was: Re: PL/java?)

2001-08-26 Thread Stephan Szabo
> >* You can access many databases from the same connection (depending of > >course on your privileges). > > > >=> PostgreSQL does not allow you to access more than one database per > >connection. This makes the system much safer and allows for more robust > >design. > > How does that makes thin

Re: [GENERAL] Foreign keys

2001-08-27 Thread Stephan Szabo
On Mon, 27 Aug 2001, Neal Lindsay wrote: > If I create a columnA in a tableA that "REFERENCES tableB(columnB)" in > another table, where column B is not null, does that imply a "NOT NULL" on > my columnA? In other words, does it ensure that the value of A is in the > set of values for B, or t

Re: [GENERAL] Re: Referential Integrity problem...

2001-08-29 Thread Stephan Szabo
On Thu, 30 Aug 2001, Joel Burton wrote: > On Thu, 30 Aug 2001, Justin wrote: > > (cc'd to PG list in hopes that someone else might find this useful, > or that someone else might have a better solution.) > > > Have you ever come across the problem of having multiple fields in a > > table referrin

Re: [GENERAL] tuning

2001-08-30 Thread Stephan Szabo
On Thu, 30 Aug 2001, Daniel Lundqvist wrote: > I have a pgsql database containing DHCP lease informtation,one table for > each month. > As we get more and more customers there will be more rows in the tables. The > table for august > now contains about 2.7 million rows. There is about 5 inserts p

Re: [GENERAL] Re: Fw: [JDBC] Regarding vacuumdb

2001-08-30 Thread Stephan Szabo
> I tried with the command you gave. But, if I try to delete the table 'test1' > it comes with the following error: > ERROR: mdopen: couldn't open test1: Permission denied > > How to solve it?Any help. Make sure the file is owned and writable by the user that the database runs as. --

Re: [GENERAL] Re: quick question: index optimisations on small tables

2001-08-30 Thread Stephan Szabo
On Fri, 31 Aug 2001, Andrew Snow wrote: > Hrmm... I have 26 rows in mine at the moment, and after vacuum > analyzing, it uses a seq. scan. How come yours used the index? I > thought mine wasn't using an index because postgres won't use an index > until the table is "big enough". > > But if a

Re: [GENERAL] Locate on Max() and Group By

2001-08-31 Thread Stephan Szabo
On Wed, 29 Aug 2001, A. Snelders wrote: > I have the next problem: > > I open an table with > > select dnkey, Max(dvnaam) as dvnaam2, Max(dvpersoonnr) as dvpersoonnr from > tbmedewerker > group by dnkey > > When I want to locate like > > TblTbPGSMedew.Locate( 'dvnaam2', 'Hallo', [ ]); >

Re: [GENERAL] !! Newbie question!!!! connecting to multiple databases

2001-08-31 Thread Stephan Szabo
On Fri, 24 Aug 2001, uncleleo wrote: > I am attemping to create multiple databases with Postgresql ver. 7.0.3 > running on Mandrake 8.0 rpm. The tool that I am using is Pgadmin ver 7.1.0. > > Can someone tell me how I can connect to different databases in a single > select statement? Such as,

Re: [GENERAL] Referential Integrity --> SystemTables

2001-09-03 Thread Stephan Szabo
On Mon, 3 Sep 2001, David M. Richter wrote: > Hello! > > I want to update a old postgresdatabase. In the time of databasecreation > the postgres had no "references" construct. So the integrity is > maintained by the C-Driver. > Now I want to build in the integrity. But i have to maintain > compa

Re: [GENERAL] How Does TEMP Table Work In Plpgsql?

2001-09-03 Thread Stephan Szabo
> Weid is that test2 and test work only once per psql > connection (i.e. "session", am I correct?). > Can anyone help? The reason is that the query plans are getting cached. AFAIK, if you want to work with temp tables in plpgsql, you're going to need to use EXECUTE to generate all the queries

Re: [GENERAL] FOREIGN KEY: MATCH FULL

2001-09-05 Thread Stephan Szabo
On Wed, 5 Sep 2001, Gabriel Fernandez wrote: > Hi, > > What does it mean the MATCH FULL parameter in a foreign key specfication > ? > > It seems it is only valid for a multi-column foreign key: What's a > multi-column foreign key ? It's only different on multi-column fks, it's valid but unint

Re: [GENERAL] What Is The Firing Order?

2001-09-07 Thread Stephan Szabo
On Fri, 7 Sep 2001, Tom Lane wrote: > <[EMAIL PROTECTED]> writes: > > The document says: "Also, if more than one trigger is > > defined for the same event on the same relation, the > > order of trigger firing is unpredictable. > > Yup, and it means what it says. > > > My another question is: W

Re: [GENERAL] query help

2001-09-07 Thread Stephan Szabo
On Fri, 7 Sep 2001, Jeff Patterson wrote: > This seems like such a basic function that I'm sure I am missing something > fundamental. I have a table, say xref, whose columns are primary key values for > other tables. Some of theses keys may be NULL for a given row in xref. I want > to create a qu

Re: [GENERAL] What Is The Firing Order?

2001-09-07 Thread Stephan Szabo
On Fri, 7 Sep 2001, Tom Lane wrote: > Yes, the semantics of immediate and deferred triggers wouldn't change. > I'm just suggesting that when the system has a choice of legal firing > orders, it adopt an "alphabetical order" rule. AFAICS, all it would > take to implement this is for RelationBuild

Re: [GENERAL] Performance question

2001-09-10 Thread Stephan Szabo
On Mon, 10 Sep 2001, Tille, Andreas wrote: > On Mon, 10 Sep 2001 [EMAIL PROTECTED] wrote: > > > Use explain. Explain tells you the query plan of the optimizer. > > > > explain SELECT .; > Thanks I just found the thread "Index usage question" and tried to make > some profit from it: > > exp

Re: [GENERAL] where cannot use alias name of column?

2001-09-13 Thread Stephan Szabo
On Thu, 13 Sep 2001, Giorgio Volpe wrote: > May be it's my ignorance about sql ... > but why cannot i use alias name of a column in a where clause? > > # select key as cc from mytable where cc > 0; > ERROR: Attribute 'cc' not found Because the select list (the key as cc part) isn't evaluated u

Re: [GENERAL] returning value from inside a transaction

2001-09-14 Thread Stephan Szabo
On Wed, 12 Sep 2001, Matt wrote: > create table tez (i int); > insert into tez values(3); > > create function tezt0(int) returns int as ' > begin work; > lock table tez; > select * from tez as r; > commit work; > > select tez.i; > ' language 'sql'; It looks to me from testing r

Re: [GENERAL] Postgresql data backup

2001-09-14 Thread Stephan Szabo
On Thu, 13 Sep 2001, [iso-8859-1] Rajkumar Selvaraj wrote: > Please mail me ur replies on the following : > 1).I would like to know how to stop users who have > already opened up sessions with my database without > stopping the postmaster > service. Well, the problem is that if you stop them, an

Re: [GENERAL] get certain # of recs

2001-09-14 Thread Stephan Szabo
On Thu, 13 Sep 2001, Mike S. Nowostawsky wrote: > How can one select only a certain number of records in Postgres? > > In other SQL langs we can use, say, for the first 20 recs: > > select * from tablename where rownum < 21; > > WHAT should 'rownum' be to make this select work... OR is there

Re: [GENERAL] joinning tables

2001-09-14 Thread Stephan Szabo
On Wed, 12 Sep 2001, Emmanuel SARACCO wrote: > hi, > > it seems like postgresql does not interpret a LEFT JOIN instruction like > other sql engines. for exemple, if it have some null values on keys, data > tables are not joinned... same has if it was a INNER JOIN instruction. Can you give an ex

Re: [GENERAL] Numerical DB/Table Names

2001-09-14 Thread Stephan Szabo
On Fri, 14 Sep 2001, Jeff Brickley wrote: > I've just recently started working with PostgreSQL. We have a 7.0 > insallation and everything seems to work fine. I am embarking on > upgrading to 7.1.3 but have run into a problem. All of the databases > are stored with numerical names in the /$pre

Re: [GENERAL] Sequence query

2001-09-14 Thread Stephan Szabo
On Fri, 14 Sep 2001, Tamara D. Blum wrote: > Hi ! > > I need to ask for the following secuence number for a field. I am > connecting PostgreSQL with an ODBC Driver and with ADO. If i ask for > the value of the field after updating the recordset, i get it is null > (and it can't be), so i read

Re: [GENERAL] null answer - how?

2001-09-19 Thread Stephan Szabo
On Wed, 19 Sep 2001, Patrick Welche wrote: > select coalesce(sum(deltafromoctets),0) > from trans,stats > where stats_id=stats.id >and (timeslicet < '1:05' OR timeslicet > '6:05') > > returns a number (9188191930), whereas > > select coalesce(sum(deltafromoctets),0) > from trans,stats

Re: [GENERAL] EXISTS / IN - does it work on Postgresql?

2001-09-19 Thread Stephan Szabo
On 19 Sep 2001 [EMAIL PROTECTED] wrote: > Hello there, > > Finally I got a \"yes\" and I\'m moving from Microsoft SQL Server to > Postgresql. I\'m using PHP4 and PHPLIB to work with query > abstractions. I have a lot of subqueries like: > > WHERE ... EXISTS (SELECT ...) > > I was researching

Re: [GENERAL] Column 'CHECK' Constraint: bug or ?

2001-09-19 Thread Stephan Szabo
On Wed, 19 Sep 2001, Keary Suska wrote: > It appears that Postgres checks column CHECK constraints when performing an > update regardless of whether the particular column is being updated. Perhaps > my understanding of column vs table constraints is incomplete but this > doesn't seem to be proper

Re: [GENERAL] upper case constraint?

2001-09-25 Thread Stephan Szabo
On Tue, 25 Sep 2001, Gowey, Geoffrey wrote: > Just wondering if anyone knows off hand how to make it so all inserts on a > column will wind up being tranparently stored as uppercase (ex: ee1234567 = > EE1234567). Probably a trigger, before update/insert on table: create function gouppertable_co

Re: [GENERAL] question about indexing.

2001-09-30 Thread Stephan Szabo
On Sun, 30 Sep 2001, Brian Hirt wrote: > I have a table with about 1 million rows in it. One of the columns in this > table is some sort of status (it's an int2). Out of the million rows, only > about 100 of the rows have a status that is not like the rest. > > for example: > 999,900 have the

Re: [GENERAL] Newbie

2001-10-19 Thread Stephan Szabo
On Fri, 12 Oct 2001, William Winter wrote: > I'm Having a hard time with this statement: > > Select Jobs.*, ProjectedDates.* FROM Jobs, ProjectedDates WHERE (Plotted = > False) And (JobName = 'Boulder Valley') AND (BuilderName = 'Elliott Homes') > AND (Jobs.JobID = ProjectedDates.JobID) > > Ca

Re: [GENERAL] Temporary Table Problem

2001-09-29 Thread Stephan Szabo
IIRC, any things where you're doing creates/drops in plpgsql pretty much mean you have to generate the statements as strings and use EXECUTE which will prevent the plans from being cached. On Fri, 28 Sep 2001, Dinesh Parikh wrote: > Dear all, I have a strange problem.Document says that one can

Re: [GENERAL] Dynamic Query problem

2001-09-29 Thread Stephan Szabo
On Fri, 28 Sep 2001, Dinesh Parikh wrote: > Dear All, > I am new in postgres there for i have some problems. I am executing > some type of Business rule in strored procedure using language > plpgsql. When I am executing a Dynamic Query then It return an error > which is some how unable to under

Re: [GENERAL] what is wrong with this SQL?

2001-09-27 Thread Stephan Szabo
On 20 Sep 2001, Alex K. wrote: > create table USERS ( > ID decimal(19) CONSTRAINT primary_usr_oid > PRIMARY KEY, > WRITE_COUNT decimal(19) NOT NULL, > CLASS decimal(10) NOT NULL, >

Re: [GENERAL] ERROR: Unrecognized language specified ...

2001-10-10 Thread Stephan Szabo
You'll need to use createlang to add the handler. IIRC, it's createlang On Tue, 9 Oct 2001, Kevin HaleBoyes wrote: > I'm creating a function (for use in a trigger) from the example in the > documentation and encountered an error. If I type the following at > the psql prompt (database and us

Re: [GENERAL] Managing Users

2001-10-16 Thread Stephan Szabo
On Mon, 15 Oct 2001, Chris Cameron wrote: > I'm having a bit of a problem managing users. > > I have a database owned by user joe. Joe has a bunch of tables in this > database and is allowed to create databases but not users. All the > tables are owned by joe. > If I create another user withou

Re: [GENERAL] Another episode of the regular MySql-PostgreSQL war

2001-10-12 Thread Stephan Szabo
On Thu, 11 Oct 2001, Alessio Bragadini wrote: > What strikes me is that this time the chief developer of MySql, Michael > 'Monty' Widenius, had time available to reply talking about how good > MySql is (including his famous benchmarks), which at least shows some > impolite manners and probably th

Re: [GENERAL] Error with word 'desc'

2003-06-24 Thread Stephan Szabo
On Tue, 24 Jun 2003, Reuben D. Budiardja wrote: > Hi, > Seems that everytime I use the word 'desc' I got an error. For example, this > query: > SELECT code, desc FROM or_code_table WHERE tr = 'FORMAT' > gave me > ERROR: parser: parse error at or near "desc" > > When I created the table I got the

<    1   2   3   4   5   6   >