Re(2): [BUGS] REFERENCES fails on derived classes
a month i was told that my possible bug submission was "sort of" a bug. the report and reply are below. now i write a follow up because i don't know how to establish a workroom. specifically, i know know that a unique constraint must be added to an inherited "id" field, even if it's a primary key in the base table. i can do this by 'CREATE INDEX', but this creates a completely new constraint. i want to share the unique 'serial' behavior between the base table and derived table, so that en entry in either table is unique between the tables. that way, when i do a 'SELECT baseTable*' kind of command, i can differentiate between two records. is there a way to do this, or could this be considered a valid bug of some sort? thank you, jmichael [EMAIL PROTECTED] writes: >On Sat, 2 Jun 2001, J. Michael Caine wrote: > >> the following works: >> >> create table t1 (id serial primary key); >> create table t2 (id serial primary key); >> create table t12 ( >> t1_id int references t1(id) on delete cascade, >> t2_id int references t2(id) on delete cascade >> ); >> >> but the following does not: >> create table t1d () inherits(t1); >> create table t1d2 ( >> t1d_id int references t1d(id) on delete cascade, >> t2_id int references t2(id) on delete cascade >> ); >> >> i'm told: >> ERROR: UNIQUE constraint matching given keys for referenced table t1d >not >> found >> >> i'm working in postgresql 7.1 (i686-pc-linux-gnu) >> >> hope this is a bug (and i'm not wasting your time) and easily >verifiable, > >Sort of. The unique constraint does not get inherited by t1d right now >(nor do fk constraints inherit) so there isn't a unique constraint on >t1d(id). Add a unique constraint to t1d(id) and it should work. > ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
[BUGS] Information regarding foriegn key constraint.
Dear Sir, I am a Graduate student at the University of Toledo.My Master's project involves creating a database in PostgreSQL version 6.5.3.I was wondering if I can use SERIAL key along with a PRIMARY key as follows: create table ohiouniv (uid serial primary key, uname varchar(45) not null, ucity varchar(25) not null); create table departments (deptid serial primary key, deptshrtn varchar(10) not null, deptfulln varchar(45) not null, deptphone int8 unique not null check(deptphone>0)); When I tried giving the following for linking the above 2 tables: create table univdept (uid integer references ohiouniv, deptid integer references departments); The error was: create table/foreign key clause ignored; not yet implemented Does this mean we cannot use the foreign key constraint in this version of PostgreSQL, and if so, what is the alternative for the above problem.Please let me know about this at your earliest convinience. Thanks much! Best Regards Meeta Bhate University of Toledo. EECS Department. Ph:419 450 3685.
[BUGS] Problem with locale on Solaris 8.0 intel
On the the Solaris 8.0 platform, when database is build using Russian WIN encoding and initdb performed using LANG=ru_RU.ANSI1251, some russian letters for instance "small letter e" and "small letter che" according to unicode consortium naming, are considered equal. so I cannot insert into key field of some table russian words for this (ETO) and what(CHTO). Problem doesn't occur on Linux with ru_RU.CP1251 locale Locale itself is correctly written perl script --- use locale; print (("\375\362\356" eq "\367\362\356")?1:0,"\n"); returns 0 with locale ru_RU.ANSI1251 -- Victor Wagner [EMAIL PROTECTED] Chief Technical Officer Office:7-(095)-748-53-88 Communiware.Net Home: 7-(095)-135-46-61 http://www.communiware.net http://www.ice.ru/~vitus ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
[BUGS] help - Installing
Title: help - Installing Hi, I need help with finding some Documentation about how to install PostGerSQL on windows 2000 Step by step since I am trying to install PostGerSQL DB on Win2000 O/S. I have install the Cygwin but when I try create a database I get: $ createdb iweb psql: FATAL: PQsetdbLogin(): Unable to determine a Postgres username! createdb: database creation failed So I try to create a user I get: $ createuser iweb Shall the new user be allowed to create databases? (y/n) y Shall the new user be allowed to create more new users? (y/n) y psql: FATAL: PQsetdbLogin(): Unable to determine a Postgres username! createuser: creation of user "iweb" failed Can you please explain how do I need to install the database that it will run on Win2000 Thanks, Ilan
[BUGS] Syntax of stored procedures is not checked
In some languages used for stored procedures in PostgreSQL it is possible to catch some programming errors statically. At least Perl has this property (see -c in perldoc perlrun ) and it seems that PL/PGsql and SQL too allows to parse a function definition and catch errors in it without actual execution It would be be very nice feature if upon CREATE FUNCTION statement these checks would be performed. -- Victor Wagner [EMAIL PROTECTED] Chief Technical Officer Office:7-(095)-748-53-88 Communiware.Net Home: 7-(095)-135-46-61 http://www.communiware.net http://www.ice.ru/~vitus ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
[BUGS] column check constraint
POSTGRESQL BUG REPORT TEMPLATE Your name : Mike Nguyen Your email address : [EMAIL PROTECTED] System Configuration - Architecture (example: Intel Pentium) : Intel Pentium Operating System (example: Linux 2.0.26 ELF) : NT 4.0 sp6 PostgreSQL version (example: PostgreSQL-7.1.1): PostgreSQL-7.1.2 Compiler used (example: gcc 2.95.2) : gcc Please enter a FULL description of your problem: The following SQL statement fails to run because of the check constraint (num >= 0.0). It runs fine in Oracle sqlplus. > create table test ( num numeric (10, 2) check (num >= 0.0 and num <= 100.0) ) Error: ERROR: Unable to identify an operator '>=' for types 'numeric' and 'float8' You will have to retype this query using an explicit cast Please describe a way to repeat the problem. Please try to provide a concise reproducible example, if at all possible: -- If you know how this problem might be fixed, list the solution below: - The work around is to modify the constraint (num >= 0) __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
[BUGS] Bug in PostgreSQL/Python (7.1.1/1.5) fetchone()
Hi again, It appears that the bug in pgdb occurs for both examples below. Both return the first row multiple times. (This is with PostgreSQL 7.1.1 and Python 1.5.2.) _ for hits in range(curse.rowcount): print curse.fetchone() _ row = curse.fetchone() while row: print row row = curse.fetchone() _ On Mon, 4 Jun 2001, Andy Dustman <[EMAIL PROTECTED]> wrote: >On Fri, 1 Jun 2001, Kevin Cole wrote: > > Hi, > > > > I've got a little test code that sorta works, but not as well as I'd > > like. fetchall() does what I want, fetchone() appears to fetch the > > same row cursor.rowcount times, rather than fetching the next row. > > Here's what I'm doing: > > > > import pgdb > > mydb = pgdb.connect("localhost:mydb") > > curse = mydb.cursor() > > curse.execute("select * from mytable where state = 'MD') > > for hits in range(curse.rowcount): > >print curse.fetchone() > > > > If I use "for hits in curse.fetchall():" I get what I expect, and > > printing curse.rowcount yields the correct number of rows. What am > > I misunderstanding? > Nothing that I can see. Each fetchone() invocation should return a new > row, so this sounds like a pgdb bug. I wouldn't use range(curse.rowcount) > myself; more likely I'd use fetchall(). If the result set can be > arbitrarily large, I'd do something like this: > > row = curse.fetchone() > while row: > print row > row = curse.fetchone() > > -- > Andy Dustman PGP: 0xC72F3F1D > @ .net http://dustman.net/andy -- Kevin Cole| E-mail: [EMAIL PROTECTED] Gallaudet Research Institute | WWW: http://gri.gallaudet.edu/~kjcole/ Hall Memorial Bldg S-419 | Voice: (202) 651-5135 Washington, D.C. 20002-3695 | FAX: (202) 651-5746 ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
[BUGS] where clause bug
When specifying criteria in a where claue such as user_id = 'value' if a non-numeric is entered the query returns back all rows. user_id = user_id brings back every user_id instead of error because user_id is a numeric field and it shouldnt be able to accept chars. -Kyle __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
[BUGS] C++ interface
I have HedHat 7.1 on linux I made the c++ interface with the --with-CXX option during configure process. The make had no problem. I have run a test. I have created a database it works find in interactive mode. if I typeselect * from cds it will give me some output, But my C++ program that can be compiled successfully cannot do this simple command. It could something else !data.ExecCommandOk("BEGIN") !data.ExecCommandOk("DECLARE myportal CURSOR FOR select * from pg_database") ) { if ( !data.ExecTuplesOk("FETCH ALL in myportal") ) Where should I start to fix this problem? Kemin ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: Re(2): [BUGS] REFERENCES fails on derived classes
On Mon, 11 Jun 2001, Michael Caine wrote: > a month i was told that my possible bug submission was "sort of" a bug. > the report and reply are below. > > now i write a follow up because i don't know how to establish a workroom. > specifically, i know know that a unique constraint must be added to an > inherited "id" field, even if it's a primary key in the base table. i can > do this by 'CREATE INDEX', but this creates a completely new constraint. > i want to share the unique 'serial' behavior between the base table and > derived table, so that en entry in either table is unique between the > tables. that way, when i do a 'SELECT baseTable*' kind of command, i can > differentiate between two records. is there a way to do this, or could > this be considered a valid bug of some sort? Unfortunately there's no way within the current constraints to do that kind of unique constraint, although you should get actually unique numbers out of the serial -- and those will span the two tables since it uses the same sequence, you can't guarantee that explicitly placed values will be unique. This is probably a bug, but inheritance needs alot of work in general. You might be able fake it with a insert/update trigger in plpgsql that makes sure that there are no matching rows. It wouldn't exactly be the same thing as a unique constraint, but it'd probably be close enough for most use. ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [BUGS] where clause bug
On Fri, 8 Jun 2001, kyle wrote: > When specifying criteria in a where claue such as > user_id = 'value' if a non-numeric is entered the > query returns back all rows. > user_id = user_id brings back every user_id instead of > error because user_id is a numeric field and it > shouldnt be able to accept chars. What version are you running? Can you give a test case of the first case (user_id='value' for non-numeric value) with schema and sample data? When I try something like that on current sources I get "Bad numeric input format 'value'" for a numeric column. The second looks okay (user_id=user_id) since the value of the user_id column is going to be equal to itself for any non NULL value in user_id. I don't know why you'd expect that one to error. ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [BUGS] Information regarding foriegn key constraint.
On Fri, 8 Jun 2001, meeta bhate wrote: > Dear Sir, > I am a Graduate student at the University of Toledo.My Master's project > involves creating a database in PostgreSQL version 6.5.3.I was wondering > if I can use SERIAL key along with a PRIMARY key as follows: > > create table ohiouniv (uid serial primary key, > uname varchar(45) not null, > ucity varchar(25) not null); > > create table departments (deptid serial primary key, >deptshrtn varchar(10) not null, >deptfulln varchar(45) not null, >deptphone int8 unique not null check(deptphone>0)); > > When I tried giving the following for linking the above 2 tables: > > create table univdept (uid integer references ohiouniv, > deptid integer references departments); > > The error was: > create table/foreign key clause ignored; not yet implemented > > Does this mean we cannot use the foreign key constraint in this version of > PostgreSQL, and if so, what is the alternative for the above problem.Please > let me know about this at your earliest convinience. FK constraints were added in 7.0, various fixes in 7.1 (with more forthcoming). Your best bet would be to upgrade if possible. There was a contrib module in 6.5 that did something basically fk (it didn't use the references syntax and was installed manually as triggers). ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl
[BUGS] REPOST: redefining location of the socket file /tmp/.s.PGSQL.5432
I asked this in -general about ten days ago, but received no replies. Can I redefine location of the UNIX domain socket file to be other than /tmp/.s.PGSQL.5432? The problem is that there is a /tmp cleaning script on the Solaris system where Postgres is installed, which sweeps away anything older than 24 hours. Right now I'm getting away by having a cron job touch the file periodically, but this is not a nice solution. p.s. I'm sending this also to -bugs, because I think that the location of the socket file should be configurable (at least at compile time). Many thanks, -- Arcady Genkin ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly