Re: [SQL] A form of inheritance with PostgreSQL

2007-03-09 Thread Bart Degryse
Just a little example of what I've been using on version 8.0.3 with total satisfaction. CREATE TABLE public.tblMovementDetails ( ID INTEGER NOT NULL, PlanningDetailID INTEGER NOT NULL, MovementID INTEGER NOT NULL, UserID VARCHAR(5) NOT NULL, Number INTEGER DEFAULT 0 NOT NULL,

Re: [SQL] Creating views

2007-03-09 Thread Richard Huxton
Kashmira Patel (kupatel) wrote: Hi all, Is it possible to create views that take parameters? Basically, I have to create some very complex historical reports, and as of now I am using temporary tables to store intermediate query results. I calculate values based on the content of these temporary

Re: [SQL] Table inherit foreign key problem

2007-03-09 Thread Richard Huxton
Moritz Kobel wrote: i would like to reference to the element table, because i have some tables which inherit from element and i would like to add comments to these elements. is this impossible or did i do a silly mistake? i did not find a solution unsing google. Foreign-key limitations with

Re: [SQL] SHA-1 vs MD5

2007-03-09 Thread Chad Wagner
On 3/9/07, Ezequias Rodrigues da Rocha [EMAIL PROTECTED] wrote: Thank you so much for your information. I installed the pgCrypto. Now I have more than 40 functions (i believe all are from pgcrypto) but when I try to run your query: select encode(digest('blahblah', 'sha256'), 'hex'); I got the

[SQL] CREATE TABLE

2007-03-09 Thread Shavonne Marietta Wijesinghe
Hello From my asp page i create a table TableName = CON01 strSQL = CREATE TABLE TableName ( ID text, N_GEN serial not null); But the problem i have is that when i go and open my database in pgadmin the table name and coloumn name is written in lowercase :( How do i ask it to write

Re: [SQL] CREATE TABLE

2007-03-09 Thread Rodrigo De León
On 3/9/07, Shavonne Marietta Wijesinghe [EMAIL PROTECTED] wrote: Hello From my asp page i create a table TableName = CON01 strSQL = CREATE TABLE TableName ( ID text, N_GEN serial not null); But the problem i have is that when i go and open my database in pgadmin the table name and

Fw: [SQL] CREATE TABLE

2007-03-09 Thread Shavonne Marietta Wijesinghe
The problem i'm having is i can't pass them in the strSQL string. coz when i write i close the string :\ Shavonne Wijesinghe http://www.studioform.it Le informazioni contenute nella presente comunicazione e i relativi allegati possono essere riservate e sono, comunque destinate

Fw: [SQL] CREATE TABLE

2007-03-09 Thread Shavonne Marietta Wijesinghe
false alarm.. sorry i just forgot about the Thanks Shavonne Wijesinghe http://www.studioform.it Le informazioni contenute nella presente comunicazione e i relativi allegati possono essere riservate e sono, comunque destinate esclusivamente alle persone o alla Società sopra indicati. La

Re: [SQL] CREATE TABLE

2007-03-09 Thread Milen A. Radev
Shavonne Marietta Wijesinghe wrote: Hello From my asp page i create a table TableName = CON01 strSQL = CREATE TABLE TableName ( ID text, N_GEN serial not null); But the problem i have is that when i go and open my database in pgadmin the table name and coloumn name is

Re: Fw: [SQL] CREATE TABLE

2007-03-09 Thread Andrew Sullivan
On Fri, Mar 09, 2007 at 03:15:54PM +0100, Shavonne Marietta Wijesinghe wrote: The problem i'm having is i can't pass them in the strSQL string. coz when i write i close the string :\ You likely need to escape the double-quotes. How you do it in your environment is a topic for the manuals for

Re: [SQL] CREATE TABLE

2007-03-09 Thread Bart Degryse
Because being consistent is easily overlooked I would advise not to quote the table names Instead of calling your table thisTableIsBig call it this_table_is_big Andrew Sullivan [EMAIL PROTECTED] 2007-03-09 15:21 On Fri, Mar 09, 2007 at 02:56:06PM +0100, Shavonne Marietta Wijesinghe wrote:

Re: [SQL] View Vs. Table

2007-03-09 Thread Bruno Wolff III
On Tue, Mar 06, 2007 at 09:32:19 -0500, Radhika Sambamurti [EMAIL PROTECTED] wrote: From the application's perspective the View is much better as data is being stored in one place, reducing errors and also storage. But from the db point of view, is there a bigger performace hit when I

Re: [SQL] [Re: PRIMARY KEY]

2007-03-09 Thread Bruno Wolff III
On Wed, Mar 07, 2007 at 23:20:12 +1100, Phillip Smith [EMAIL PROTECTED] wrote: If you actually need to know the value of N_GEN in your ASP application, you will need to query the database first and select the NEXTVAL from the sequence that the serial data type will create, then use that

Re: [SQL] index not being used. Why?

2007-03-09 Thread Richard Huxton
Gerardo Herzig wrote: - Seq Scan on pages (cost=0.00..9.08 rows=408 width=55) Watch the last row of the explain command. It makes a sequential scan on the pages table, like it is not using the index on the id field. You only have 408 rows in the table - it's probably not worth the

Re: [SQL] A form of inheritance with PostgreSQL

2007-03-09 Thread Steve Midgley
Hi Greg, While not in a C++ framework, you might find that it's not too hard to implement something similar in your system - It's called Single Table Inheritance. References to the Ruby on Rails implementation here: http://wiki.rubyonrails.org/rails/pages/SingleTableInheritance It's based

Re: [SQL] index not being used. Why?

2007-03-09 Thread Gerardo Herzig
Someday i will ask some question that will makes you think a little more. You'll see. I will populate the tables and redo the explain. Thanks dudes!! Gerardo Gerardo Herzig [EMAIL PROTECTED] writes: Watch the last row of the explain command. It makes a sequential scan on the pages table,

[SQL] Statistics

2007-03-09 Thread Ezequias Rodrigues da Rocha
Hi list, Does someone have statistcs from PostgreSQL ? Numbers from the list, performance statistics. I must argue with another person the idea of do not put Oracle in our organization. We are quite well with postgresql and I have no plans to change my plataform. Regards -- Ezequias Rodrigues

Re: [SQL] SHA-1 vs MD5

2007-03-09 Thread Ezequias Rodrigues da Rocha
You are correct. My pg (8.1.3) Now what I do to remove it ? Just delete the functions ? Ezequias 2007/3/9, Chad Wagner [EMAIL PROTECTED]: On 3/9/07, Ezequias Rodrigues da Rocha [EMAIL PROTECTED] wrote: Thank you so much for your information. I installed the pgCrypto. Now I have more than

Re: [SQL] Statistics

2007-03-09 Thread Joe
On Fri, 2007-03-09 at 14:22 -0300, Ezequias Rodrigues da Rocha wrote: Does someone have statistcs from PostgreSQL ? Numbers from the list, performance statistics. I must argue with another person the idea of do not put Oracle in our organization. We are quite well with postgresql and I have

Re: [SQL] SHA-1 vs MD5

2007-03-09 Thread Chad Wagner
On 3/9/07, Ezequias Rodrigues da Rocha [EMAIL PROTECTED] wrote: You are correct. My pg (8.1.3) Now what I do to remove it ? Just delete the functions ? There is usually an uninstall_pgcrypto.sql script you can run against the database. But 8.1 probably supports at least sha1, or you can

[SQL] PostgreSQL to Oracle

2007-03-09 Thread Ezequias Rodrigues da Rocha
Hi list, Is it a simple action to convert a database from PostgreSQL to Oracle ? I mean a simple database with 33 tables 8 functions 31 sequencies 2 triggers 1 type 3 views Has someone any idea ? -- Ezequias Rodrigues da Rocha http://ezequiasrocha.blogspot.com/ use Mozilla

Re: [SQL] Statistics

2007-03-09 Thread Frank Bax
At 12:22 PM 3/9/07, Ezequias Rodrigues da Rocha wrote: Does someone have statistcs from PostgreSQL ? Numbers from the list, performance statistics. I must argue with another person the idea of do not put Oracle in our organization. Performance should not be the *only* consideration when

Re: [SQL] PostgreSQL to Oracle

2007-03-09 Thread Frank Bax
At 12:54 PM 3/9/07, Ezequias Rodrigues da Rocha wrote: Is it a simple action to convert a database from PostgreSQL to Oracle ? I mean a simple database with 33 tables 8 functions 31 sequencies 2 triggers 1 type 3 views Has someone any idea ? Depends on what's actually in the above objects;

Re: [SQL] Statistics

2007-03-09 Thread Ezequias Rodrigues da Rocha
Thank you all. Those are quite important questions to considerate. About the late time of requisitions. I allways have replyes becouse 3:00 am in brazil does not means 3:00 in many other countries. I experiment it in other free communities too. My Brat Regards Ezequias 2007/3/9, Frank Bax

Re: [SQL] PostgreSQL to Oracle

2007-03-09 Thread Jonah H. Harris
On 3/9/07, Ezequias Rodrigues da Rocha [EMAIL PROTECTED] wrote: Is it a simple action to convert a database from PostgreSQL to Oracle ? Yes, relatively. Has someone any idea ? There's a couple ways to do this, but I'd recommend first using pg_dump to export schema only. Your functions and

[SQL] Running in single instance mode

2007-03-09 Thread Karthikeyan Sundaram
Hi Everybody, We are using postgres 8.1.0. I want to do some maintenance work. Hence, I want to run postgres in single user mode so that external people won't be able to access the database. How can I run the postgres in single user mode?. Any idea? Regards skarthi

Re: [SQL] Running in single instance mode

2007-03-09 Thread Rodrigo De León
On 3/9/07, Karthikeyan Sundaram [EMAIL PROTECTED] wrote: Hi Everybody, We are using postgres 8.1.0. I want to do some maintenance work. Hence, I want to run postgres in single user mode so that external people won't be able to access the database. How can I run the postgres in single

Re: [SQL] index not being used. Why?

2007-03-09 Thread Scott Marlowe
On Fri, 2007-03-09 at 09:01, Gerardo Herzig wrote: Hi all. I have this 2 relations SNIP Index Cond: ((upper((word)::text) ~=~ 'TEST'::character varying) AND (upper((word)::text) ~~'TESU'::character varying)) - Hash (cost=9.08..9.08 rows=408 width=55) - Seq

Re: [SQL] index not being used. Why?

2007-03-09 Thread gherzig
Thanks all you guys. Indeed, populating the tables with 10.000 entrys make the things different, and now it uses all the indexes as i spect. It was just a matter of being pacient and loading more data to test it out and see. And, yes, i need to upgrade psql now. Actually the real server has an

Re: [SQL] PostgreSQL to Oracle

2007-03-09 Thread Ezequias Rodrigues da Rocha
Thank you Jonah, That isn't a decision taken but I will need to argue with the new team of my new company. I can't see why but I will see how the things occurs. Thank you again Ezequias 2007/3/9, Jonah H. Harris [EMAIL PROTECTED]: On 3/9/07, Ezequias Rodrigues da Rocha [EMAIL PROTECTED]

Re: [SQL] [Re: PRIMARY KEY]

2007-03-09 Thread Phillip Smith
Of course - my bad... That's the main reason I upgraded to 8.2! On Fri, 2007-03-09 at 09:03 -0600, Bruno Wolff III wrote: On Wed, Mar 07, 2007 at 23:20:12 +1100, Phillip Smith [EMAIL PROTECTED] wrote: If you actually need to know the value of N_GEN in your ASP application, you will need