[SQL] refining view using temp tables

2006-11-06 Thread BeemerBiker
Using postgre with dotnet VS8. I came up with a scheme of having a web user search thru the database and selecting into a temp table. Then a further refined search would use the temp table as input and another temp table as output. Then swap the source and destination so as to not use up

[SQL] Distribution of results

2006-11-06 Thread Raghuraman K
Hi, I have a table like this: create table(xyz char(10), answer number(4)). There are a lot of rows in this table. I am looking at a query that will help me represent the distribution of data records based on the column answer. For example, we may take that the highest entry for answer

Re: [SQL] fetching unique pins in a high-transaction environment...

2006-11-06 Thread Bobus
I think we've figured out a way to implement the equivalent of a READPAST hint in a function. The basic idea is to loop until we find the next available unlocked row, using the lock_not_available exception to determine if the record is locked or not. Our early testing seems to indicate that this

[SQL] show privileges

2006-11-06 Thread Rares Vernica
Hi, How can I view the privileges that an user or a role has? Or what is the equivalent of show privileges from MySQL? Thanks, Ray ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate

[SQL] Composite Types

2006-11-06 Thread Jose
Hello I am using postgres r8.1 and i make 2 Composite Types as: CREATE TYPE regiao AS (pais_nome varchar(150), estado_nome varchar(150), estado_sigla varchar(4), cidade_nome varchar(150));ALTER TYPE regiao OWNER TO postgres;== and CREATE TYPE telcontato AS (telefone1

[SQL] fetching unique pins in a high-transaction environment...

2006-11-06 Thread Bobus
Hi, I posted this question to the general forum, but then discovered this one which I think is more appropriate. Apologies for the cross-post. We are in the process of porting an application from SQL Server to PostgresQL. We have a table which contains a bunch of prepaid PINs. What is the

[SQL] Database recovery in postgres 7.2.4.

2006-11-06 Thread Santosh
Hi All. My setup is as follows: OS: Sun Solaris 5.8. Postgres: 7.2.4 I have very large database, which contain 15 tables and each table is contain more than 10,00,000 records. My application is parsing text data files and inserting records into database. When this process was running last

[SQL] PLPGSQL question

2006-11-06 Thread Sorin Schwimmer
Hi All,I have a stored procedure that fails and don't know how to fix it, so I hope to find some help here.I works on a table called 'locations' that looks like this:design=# \d locations Table "public.locations"Column | Type | Modifiers-+--+-store |

[SQL] a celko-puzzle from long time ago

2006-11-06 Thread stig erikson
While reading celko's SQL puzzles (second edition) i followed a reference to http://www.dbmsmag.com/9801d06.html. There is a puzzle that counts items in boxes. When i try to run the proposed solution on PG 8.1.5, PG says: ERROR: column reference qty is ambiguous apparently the variable

Re: [SQL] Function to reset sequence.....

2006-11-06 Thread Anonymous
It is not the answer to your question, but please note that the NATURAL JOIN may cause problems if the underlaying database structure changes (for example after a version upgrade). See the following thread for more information: http://forums.oracle.com/forums/thread.jspa?threadID=440287

[SQL] Nested select

2006-11-06 Thread Hubert Retif
Hi, I am migrating my application from MySQL to Postgresql and have met following situation: SELECT (sum(sold_price)/(select sum(sold_price) from car_archive))*100 as CA_pcent, reason_text FROM car_archive group by reason_text order by CA_pcent desc works perfectly in MySQL,

Re: [SQL] Nested select

2006-11-06 Thread imad
Can you write the error message here? --Imad www.EnterpriseDB.com On 11/6/06, Hubert Retif [EMAIL PROTECTED] wrote: Hi, I am migrating my application from MySQL to Postgresql and have met following situation: SELECT (sum(sold_price)/(select sum(sold_price) from car_archive))*100 as

Re: [SQL] Composite Types

2006-11-06 Thread Tom Lane
Jose [EMAIL PROTECTED] writes: If I try use select unidade_regiao.(estado_sigla) from unidades No, you should do select (unidade_regiao).estado_sigla from unidades regards, tom lane ---(end of broadcast)--- TIP 7: You

[SQL] Groups and Roles and Users

2006-11-06 Thread Ezequias Rodrigues da Rocha
Hi list,Could someone suggest me how to get a documentation about Groups and Roles and Users ?It would be nice to see a simple and easy documentation (a tutorial could be better, with pgadmin much better). Regards

Re: [SQL] fetching unique pins in a high-transaction environment...

2006-11-06 Thread Scott Marlowe
On Sun, 2006-10-29 at 10:36, Bobus wrote: Hi, I posted this question to the general forum, but then discovered this one which I think is more appropriate. Apologies for the cross-post. We are in the process of porting an application from SQL Server to PostgresQL. We have a table which

Re: [SQL] Nested select

2006-11-06 Thread Tom Lane
=?us-ascii?Q?Hubert_Retif?= [EMAIL PROTECTED] writes: I am migrating my application from MySQL to Postgresql and have met following situation: ... works perfectly in MySQL, but not in Postgresql. If you want useful help, you need to explain exactly what results you got and what you expected

Re: [SQL] Distribution of results

2006-11-06 Thread Jorge Godoy
Raghuraman K [EMAIL PROTECTED] writes: Hi, I have a table like this: create table(xyz char(10), answer number(4)). There are a lot of rows in this table. I am looking at a query that will help me represent the distribution of data records based on the column answer. For example, we

Re: [SQL] Composite Types

2006-11-06 Thread imad
This is *not* a good practice to handle elements of a composite data type seperately because they all build it up together and without one of it, the data type is meaningless. Secondly, If you are going to base our application on this principle, you better rethink your design. --Imad

Re: [SQL] Distribution of results

2006-11-06 Thread imad
What else do you want to know about it? (keeping in mind the example you gave) Because, apparently this is just a matter of min and max. --Imad On 11/1/06, Raghuraman K [EMAIL PROTECTED] wrote: Hi, I have a table like this: create table(xyz char(10), answer number(4)). There are a lot of rows

Re: [SQL] a celko-puzzle from long time ago

2006-11-06 Thread Richard Broersma Jr
While reading celko's SQL puzzles (second edition) i followed a reference to http://www.dbmsmag.com/9801d06.html. There is a puzzle that counts items in boxes. When i try to run the proposed solution on PG 8.1.5, PG says: ERROR: column reference qty is ambiguous apparently the

Re: [SQL] Groups and Roles and Users

2006-11-06 Thread Richard Broersma Jr
Could someone suggest me how to get a documentation about Groups and Roles and Users ? It would be nice to see a simple and easy documentation (a tutorial could be better, with pgadmin much better). This is the documentment that I know of:

Re: [SQL] fetching unique pins in a high-transaction environment...

2006-11-06 Thread Richard Broersma Jr
Best practice, to me, is to do a couple things. One, create a sequence and set it to the first available pin number. Let's say you have pins available from the number 1 to . Create a default sequence, it'll start on 1. Then, select nextval('yourseqhere') and use that to fetch the pin

Re: [SQL] Database recovery in postgres 7.2.4.

2006-11-06 Thread Scott Marlowe
On Mon, 2006-10-30 at 04:25, Santosh wrote: Hi All. My setup is as follows: OS: Sun Solaris 5.8. Postgres: 7.2.4 Just so you know, 7.2 is ancient. You should, at a minimum be running the latest 7.2 release, 7.2.8. You should really look into upgrading to a later version as soon as

Re: [SQL] fetching unique pins in a high-transaction environment...

2006-11-06 Thread Scott Marlowe
On Mon, 2006-11-06 at 14:04, Richard Broersma Jr wrote: Best practice, to me, is to do a couple things. One, create a sequence and set it to the first available pin number. Let's say you have pins available from the number 1 to . Create a default sequence, it'll start on 1. Then,

[SQL] Is there anyway to...

2006-11-06 Thread louis gonzales
Hello all, Is there an existing mechanism is postgresql that can automatically increment/decrement on a daily basis w/out user interaction? The use case I'm considering is where a student is in some type of contract with an instructor of some sort, and that contract puts a time limit on the

Re: [HACKERS] [SQL] Case Preservation disregarding case

2006-11-06 Thread Chuck McDevitt
At Teradata, we certainly interpreted the spec to allow case-preserving, but case-insensitive, identifiers. Users really liked it that way: If you re-created a CREATE TABLE statement from the catalog, you could get back exactly the case the user had entered, but people using the table didn't need

Re: [HACKERS] [SQL] Case Preservation disregarding case

2006-11-06 Thread Chuck McDevitt
We treated quoted identifiers as case-specific, as the spec requires. In the catalog, we stored TWO columns... The column name with case converted as appropriate (as PostgreSQL already does), used for looking up the attribute, And a second column, which was the column name with the case exactly

Re: [HACKERS] [SQL] Case Preservation disregarding case

2006-11-06 Thread Chuck McDevitt
Oh... And Microsoft SQLServer does something similar. At Greenplum, we've already gotten complaints from customers about this when they were switching from MSSQL to GP's PostgreSQL-based database. -Original Message- From: Tom Lane [mailto:[EMAIL PROTECTED] Sent: Monday, October 30, 2006

Re: [HACKERS] [SQL] Case Preservation disregarding case

2006-11-06 Thread Andrew Dunstan
There was some discussion a couple of years ago on the -hackers list about it, so you might like to review the archives. The consensus seemed to be that behaviour would need to be set no later than createdb time. The options I thought of were: . current postgres behaviour (we need to do

Re: [HACKERS] [SQL] Case Preservation disregarding case

2006-11-06 Thread Chuck McDevitt
Sorry, my last mail wasn't well thought out. Yes, the information_schema needs the case-folded name (although it might be ok to add additional columns to the information_schema for extra information). But, stepping back from all that, what is it the users want? 1) When re-creating a CREATE

Re: [HACKERS] [SQL] Case Preservation disregarding case

2006-11-06 Thread Simon Riggs
On Wed, 2006-11-01 at 11:31 -0500, Chuck McDevitt wrote: But, stepping back from all that, what is it the users want? 1) When re-creating a CREATE TABLE statement from whatever catalog info, they'd like the names to come back exactly as then entered them. If I do: CREATE

[SQL] Requirement for PostgreSQL Database Developer

2006-11-06 Thread Mark
Hi , Location: San Diego, CA [You can also TeleCommute...] Duration: 6+ months. This isMark with ProV International, This email is in regards to the requirement we have with one of our direct client in San Diego, CA. PostgreSQL Database Developer This position involves creating

Re: [SQL] Requirement for PostgreSQL Database Developer

2006-11-06 Thread Richard Broersma Jr
Thanks for I think the list that you are looking for is: [EMAIL PROTECTED] --- Mark [EMAIL PROTECTED] wrote: Hi , Location: San Diego, CA [You can also TeleCommute...] Duration: 6+ months. This is Mark with ProV International, This email is in regards to the

Fwd: [SQL] refining view using temp tables

2006-11-06 Thread Aaron Bono
-- Forwarded message --From: Aaron Bono [EMAIL PROTECTED]Date: Nov 6, 2006 4:51 PM Subject: Re: [SQL] refining view using temp tablesTo: BeemerBiker [EMAIL PROTECTED]Cc: pgsql-sql@postgresql.org On 10/31/06, BeemerBiker [EMAIL PROTECTED] wrote: Using postgre with dotnet VS8.I came

Re: [SQL] show privileges

2006-11-06 Thread Aaron Bono
On 11/2/06, Rares Vernica [EMAIL PROTECTED] wrote: Hi,How can I view the privileges that an user or a role has?Or what is the equivalent of show privileges from MySQL?select * from pg_user;Hey guys, this comes up every so often. Could some kind of syntax be added, at least to the psql tool, to get

Re: [SQL] a celko-puzzle from long time ago

2006-11-06 Thread George Pavlov
Should be entirely executable in postgres using psql variables (once you get around the psql quoting weirdnesses). do this: gp_test=# \set item '\''Apple' gp_test=# \set qty 6 gp_test=# \echo :item 'Apple' gp_test=# \echo :qty 6 and then run his query. Now, i am not sure what DBMS lets Mr.

Re: [SQL] show privileges

2006-11-06 Thread Joe
On Mon, 2006-11-06 at 17:01 -0600, Aaron Bono wrote: On 11/2/06, Rares Vernica [EMAIL PROTECTED] wrote: Hi, How can I view the privileges that an user or a role has? Or what is the equivalent of show privileges from MySQL? select * from

[SQL] converting Informix outer to Postgres

2006-11-06 Thread gurkan
Hi all, I have been working on this Informix SQL query which has an outer join. I have attached Informix query and my supposedly solution to this query but I cannot get the same count. I appreciate for any help. Thanks. --Informix query select count(u.id) from user u, invention i, inv_contracts

Re: [SQL] converting Informix outer to Postgres

2006-11-06 Thread Richard Broersma Jr
--- [EMAIL PROTECTED] wrote: Hi all, I have been working on this Informix SQL query which has an outer join. I have attached Informix query and my supposedly solution to this query but I cannot get the same count. I appreciate for any help. Thanks. --Informix query select count(u.id)

[SQL] writing a simple sql parser and database program

2006-11-06 Thread Peter Michaux
Hi, I would like to learn how to write a simple SQL parser and database program. This is for an embeded situation where I can't use a database program like postgre. Jumping into the postgre source code seems a little overwelming as I don't have a general understanding of how this is done. Is