Re: [GENERAL] Wrong string length from unicode database in Borland's app

2004-11-22 Thread Alex Guryanow
TL Alex Guryanow [EMAIL PROTECTED] writes: When pg-server is version 7.1.3 windows app works fine, but when pg-server is version 7.4.6 or 8.0beta4 under certain conditions the app receives strings with wrong lengths. TL Are both servers set up with the same database encoding? I think the

Re: [GENERAL] How to make a good documentation of a database ?

2004-11-22 Thread David Pradier
Yes, it seems interesting. (Is import of sql database possible ?) But for now, I'll stick to postgresql_autodoc. Thanks all the same, Bill, I'll try to keep an eye on this project. On Thu, Nov 18, 2004 at 04:55:06PM +, Bill Harris wrote: [EMAIL PROTECTED] (David Pradier) writes: I'd

Re: [GENERAL] infinite recursion detected in rules for relation ...

2004-11-22 Thread Sebastian Böck
Tom Lane wrote: =?ISO-8859-1?Q?Sebastian_B=F6ck?= [EMAIL PROTECTED] writes: infinite recursion detected in rules for relation ... If you need a patch immediately, here it is. *** src/backend/rewrite/rewriteHandler.c.orig Sat Nov 6 12:46:35 2004 --- src/backend/rewrite/rewriteHandler.c Sat Nov 20

Re: [GENERAL] COMMIT within function?

2004-11-22 Thread Dawid Kuroczko
On Sun, 21 Nov 2004 20:10:03 -0700, Michael Fuhr [EMAIL PROTECTED] wrote: http://developer.postgresql.org/docs/postgres/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING BEGIN DELETE FROM values WHERE value_id = r.value_id; EXCEPTION WHEN foreign_key_violation THEN

Re: [GENERAL] How to handle larger databases?

2004-11-22 Thread Terry Lee Tucker
Yes, I would like to hear about this as well, especially since all my character strings are defined as varchar. On Monday 22 November 2004 02:09 am, Patrick B Kelly saith: On Nov 19, 2004, at 2:37 AM, Jerry III wrote: Do not use variable length types. Why do you suggest not using variable

Re: [GENERAL] How to handle larger databases?

2004-11-22 Thread Martijn van Oosterhout
On Mon, Nov 22, 2004 at 02:09:49AM -0500, Patrick B Kelly wrote: On Nov 19, 2004, at 2:37 AM, Jerry III wrote: Do not use variable length types. Why do you suggest not using variable length types? Especially since PostgreSQL has no fixed length string types, so following that advice

Re: [GENERAL] Delete very slow after deletion of many rows in dependent

2004-11-22 Thread Cornelius Buschka
Hi Stephan, caching of the execution plan is a good hint. We'll try it in a new connection. Best Regards Cornelius Stephan Szabo wrote: On Sun, 21 Nov 2004, Cornelius Buschka wrote: Hi, we saw the following problem: We deleted all rows from a table B referencing table A (~50 records). No

Re: [GENERAL] How to handle larger databases?

2004-11-22 Thread Matt
Especially since PostgreSQL has no fixed length string types, so following that advice would exclude any strings. That's kind of useless. char(n) ? ---(end of broadcast)--- TIP 9: the planner will ignore your desire to choose an index scan if

Re: [GENERAL] How to handle larger databases?

2004-11-22 Thread Martijn van Oosterhout
On Mon, Nov 22, 2004 at 11:33:35AM +, Matt wrote: Especially since PostgreSQL has no fixed length string types, so following that advice would exclude any strings. That's kind of useless. char(n) ? Is not fixed length. The actual size varies by encoding. Consider the string: zeeën

[GENERAL] Oid to text...

2004-11-22 Thread Katsaros Kwn/nos
Hi, Given the Oid restype of a Resdom object, is there any system table I could query in order to retrieve the text representation of this type? If for example a Resdom restype is 23 how can I get the string integer or something like that? Are these mappings stored anyware? Thanks in advance,

Re: [GENERAL] Oid to text...

2004-11-22 Thread Ian Barwick
On 22 Nov 2004 14:25:26 +0200, Katsaros Kwn/nos [EMAIL PROTECTED] wrote: Hi, Given the Oid restype of a Resdom object, is there any system table I could query in order to retrieve the text representation of this type? If for example a Resdom restype is 23 how can I get the string integer

Re: [GENERAL] Tsearch2 and Unicode?

2004-11-22 Thread Markus Wollny
Hi! I dug through my list-archives - I actually used to have the very same problem that you described: special chars being swallowed by tsearch2-functions. The source of the problem was that I had INITDB'ed my cluster with [EMAIL PROTECTED] as locale, whereas my databases used Unicode

Re: [GENERAL] How to handle larger databases?

2004-11-22 Thread Matt
Latin-9 5 bytes UTF-8 6 bytes UTF-16 10 bytes But it should still fit in a char(5), wouldn't you agree? Got you. In postgresql there is no difference in storage method between text, varchar(n) and char(n). Learn something new every day. Thanks! Matt

Re: [GENERAL] Tsearch2 and Unicode?

2004-11-22 Thread Oleg Bartunov
Markus, it'd be nice if you (or somebody) wrtite a note about unicode, so it could be added to tsearch2 documentation. It will help people and save time and hair :) Oleg On Mon, 22 Nov 2004, Markus Wollny wrote: Hi! I dug through my list-archives - I actually used to have the very same problem

[GENERAL] Help with syntax for timestamp addition

2004-11-22 Thread Scott Nixon
New to Postgres 7.3 from 7.0. Am having some trouble with a query that worked in 7.0 but not in 7.3.can't seem to figure out the syntax or find info about how to do this anywhere. Consider for the following query: - 'number' is an integer - 'procedures' is the table name - 'date' is a

Re: [GENERAL] How to handle larger databases?

2004-11-22 Thread Geoffrey
Matt wrote: Latin-9 5 bytes UTF-8 6 bytes UTF-16 10 bytes But it should still fit in a char(5), wouldn't you agree? Got you. In postgresql there is no difference in storage method between text, varchar(n) and char(n). Learn something new every day. Thanks! So that would say the

Re: [GENERAL] Help with syntax for timestamp addition

2004-11-22 Thread Patrick Fiche
Have a try at this syntax SELECT number FROM procedures WHERE date + CAST( numdays || ' days' AS interval ) = CURRENT_TIMESTAMP; Patrick -- - Patrick Fiche email : [EMAIL PROTECTED] tél : 01 69 29 36 18

Re: [GENERAL] Help with syntax for timestamp addition

2004-11-22 Thread Scott Nixon
Have a try at this syntax SELECT number FROM procedures WHERE date + CAST( numdays || ' days' AS interval ) = CURRENT_TIMESTAMP; Patrick Cool! Thanksthat works perfectly. -Scott ---(end of broadcast)--- TIP 2: you can get

Re: [GENERAL] Help with syntax for timestamp addition

2004-11-22 Thread Ian Barwick
On Mon, 22 Nov 2004 15:12:26 +0100, Patrick Fiche [EMAIL PROTECTED] wrote: Have a try at this syntax SELECT number FROM procedures WHERE date + CAST( numdays || ' days' AS interval ) = CURRENT_TIMESTAMP; Just for the record you could write it like this too: SELECT number FROM procedures

Re: [GENERAL] Help with syntax for timestamp addition

2004-11-22 Thread Peter Eisentraut
Ian Barwick wrote: On Mon, 22 Nov 2004 15:12:26 +0100, Patrick Fiche [EMAIL PROTECTED] wrote: Have a try at this syntax SELECT number FROM procedures WHERE date + CAST( numdays || ' days' AS interval ) = CURRENT_TIMESTAMP; Just for the record you could write it like this too:

Re: [GENERAL] Help with syntax for timestamp addition

2004-11-22 Thread Scott Nixon
Just to add to the record, the mathematically sound way to write this query would be this: SELECT number FROM procedures WHERE date + numdays * interval '1 day' = current_timestamp; Thanks for that Peter! That's a lot closer than what I originally had...I didn't think about doing that

Re: [GENERAL] Wrong string length from unicode database in Borland's app

2004-11-22 Thread Tom Lane
Alex Guryanow [EMAIL PROTECTED] writes: When pg-server is version 7.1.3 windows app works fine, but when pg-server is version 7.4.6 or 8.0beta4 under certain conditions the app receives strings with wrong lengths. TL If you try the same query in plain psql, what do you get? I get all ok.

[GENERAL] Storing every scrabble board possible

2004-11-22 Thread Jim C. Nasby
Here's an interesting discussing about storing every possible scrabble board: http://www.livejournal.com/users/stenz/117914.html Note that PostgreSQL ends up being 12x larger than a theoretical custom storage format, which isn't too bad considering the gymnastics going on in the custom storage

Re: [GENERAL] Oid to text...

2004-11-22 Thread Tom Lane
Katsaros Kwn/nos [EMAIL PROTECTED] writes: Given the Oid restype of a Resdom object, is there any system table I could query in order to retrieve the text representation of this type? If you're talking about C code inside the backend, format_type_be() is the usual subroutine.

Re: [GENERAL] Help with syntax for timestamp addition

2004-11-22 Thread Tom Lane
Scott Nixon [EMAIL PROTECTED] writes: Am having some trouble with a query that worked in 7.0 but not in 7.3.can't seem to figure out the syntax or find info about how to do this anywhere. SELECT number FROM procedures WHERE date + numdays = CURRENT_TIMESTAMP; In 7.0 this works with

Re: [GENERAL] Help with syntax for timestamp addition

2004-11-22 Thread Scott Nixon
So I think what you probably *really* want is ... WHERE CAST(date AS date) + numdays = CURRENT_DATE; Thanks Tom! Yeah, I guess you are right on that point. I hadn't thought about that. The implementation of this wouldn't be affected since this query is buried in a script that runs

[GENERAL] SELECT duplicates in a table

2004-11-22 Thread Kall, Bruce A.
I've look for a solution to this, but have only been able to find solutions to delete duplicate entries in a table by deleting entries not returned by SELECT DISTINCT. What sql should I use to SELECT entries in a table that have two particular column values that match? For example, my_table

Re: [GENERAL] SELECT duplicates in a table

2004-11-22 Thread vhikida
Try SELECT * FROM mytable WHERE (identification_number,date_of_birth) IN (SELECT identification_number , date_of_birth FROM mytable m2 GROUP BY identification_number,data_of_birth HAVING COUNT(*) 1 ) There are other ways

Re: [GENERAL] SELECT duplicates in a table

2004-11-22 Thread Kall, Bruce A.
Thanks. Worked like a charm! Bruce [EMAIL PROTECTED] wrote: Try SELECT * FROM mytable WHERE (identification_number,date_of_birth) IN (SELECT identification_number , date_of_birth FROM mytable m2 GROUP BY identification_number,data_of_birth

Re: [GENERAL] SELECT duplicates in a table

2004-11-22 Thread Edward Macnaghten
Assuming identification_number is a unique (primary) key... select * from my_table where date_of_birth in (select date_of_birth from my_table group by date_of_birth having count(*) 1) Or - it may be quicker to do... select * from my_table a where exists (select 'x' from my_table b where

[GENERAL] Postgres-Windows -Perl DBI

2004-11-22 Thread Goutam Paruchuri
Hello all, Anyone has perl DBI working with Postgres 8-beta on Windows. I get the following error when i compile. I have POSTGRES_LIB and POSTGRES_INCLUDE set to the right locations. The file 'libpq-fe.hdoes exist in the POSTGRES_LIB directory.. Copyright (C) Microsoft Corp

[GENERAL] Foriegn Keys?

2004-11-22 Thread Dev
Hello all, I have a database system in which i truncate a main table to update the information. I would like to setup some foriegn keys referencing back to that table but am concerned as to how the truncating of the Parent table will effect the keys? Would all I have to do is insure that I vacuum

[GENERAL] primary key and the default index operator class

2004-11-22 Thread Sally Sally
I am trying to figure out how I can change the default operator class of the index created for my primary key field. Is it even possible since I am not able to find the syntax? Or do I need to create the primary key and then an additional index with the operator class I want. (It would be a

[GENERAL] null value of type java.sql.Time

2004-11-22 Thread phil campaigne
Occasionally I want to store a null value for my java.sql.Time-- Time column in Postgresql. update event set game_clock=null where event_id=1; I can retreive the record with the null value (type Time) if I select on the primary key, select game_clock from event where event_id = 1; but when

Re: [GENERAL] null value of type java.sql.Time

2004-11-22 Thread Thomas Hallgren
phil campaigne wrote: Occasionally I want to store a null value for my java.sql.Time-- Time column in Postgresql. update event set game_clock=null where event_id=1; I can retreive the record with the null value (type Time) if I select on the primary key, select game_clock from event where

Re: [GENERAL] How to handle larger databases?

2004-11-22 Thread Neil Conway
On Mon, 2004-11-22 at 08:59 -0500, Geoffrey wrote: So that would say the previous statements are not accurate? That is, there's no problem with using a varchar? Right; there is no reason to prefer CHAR(n) over VARCHAR(n), unless you need whitespace padding. -Neil

Re: [GENERAL] null value of type java.sql.Time

2004-11-22 Thread Gregory S. Williamson
Try: SELECT * FROM event WHERE game_clock IS NULL; Greg Williamson DBA GlobeXplorer LLC -Original Message- From: phil campaigne [mailto:[EMAIL PROTECTED] Sent: Monday, November 22, 2004 2:33 PM To: [EMAIL PROTECTED] Subject: [GENERAL] null value of type java.sql.Time Occasionally I

[GENERAL] PostgreSQL 8.0.0 Beta 5 Now Available

2004-11-22 Thread Marc G. Fournier
Its been almost 4 weeks since Beta4, and alot of work, involving alot of bug fixes, and documentation improvements, to the source tree, we have just released our 5th Beta of 8.0.0. All of our major Open Items have now been completed, and we're slowly entering the final stages, involving alot

Re: [GENERAL] How to make a good documentation of a database ?

2004-11-22 Thread Bill Harris
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David Pradier [EMAIL PROTECTED] writes: Yes, it seems interesting. (Is import of sql database possible ?) But for now, I'll stick to postgresql_autodoc. I think it may be. I've (at least) once, as a test, used it to document an existing

[GENERAL] How to list databases with SQL statement?

2004-11-22 Thread Marian D Marinov
Hello, Is there a way to list all databases which belong to the current user with an SQL query? Regards M.Marinov -- One Planet, One Internet. We Are All Connected. ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL

Re: [GENERAL] How to list databases with SQL statement?

2004-11-22 Thread Quinton Delpeche
On Saturday 20 November 2004 02:39, Marian D Marinov wrote: Hello, Is there a way to list all databases which belong to the current user with an SQL query? I am not sure about a SQL Query. But if you login to the database using the command line psql interface and run \l it will give you

Re: [GENERAL] How to list databases with SQL statement?

2004-11-22 Thread Michael Fuhr
On Sat, Nov 20, 2004 at 12:39:38AM +, Marian D Marinov wrote: Is there a way to list all databases which belong to the current user with an SQL query? Such information is in the system catalogs: http://www.postgresql.org/docs/7.4/static/catalogs.html If you run psql with the -E option,

Re: [GENERAL] How to list databases with SQL statement?

2004-11-22 Thread John DeSoi
On Nov 19, 2004, at 7:39 PM, Marian D Marinov wrote: Hello, Is there a way to list all databases which belong to the current user with an SQL query? select datname, usename from pg_catalog.pg_database, pg_catalog.pg_user where datdba = usesysid and usename = current_user; Best,

[GENERAL]

2004-11-22 Thread Ramesh Patel
subscribeend