Re: [SQL] order of results

2004-04-06 Thread Bruno Wolff III
On Sat, Apr 03, 2004 at 17:08:34 +0200, Gregor Rot <[EMAIL PROTECTED]> wrote: > Bruno Wolff III wrote: > >On Thu, Mar 25, 2004 at 14:23:00 +0100, > > Gregor Rot <[EMAIL PROTECTED]> wrote: > > > >>Hi, > >> > >>i have a table called "people" (name:varchar, lastname:varchar). > >> > >>i do a select

Re: [SQL] Getting the ranks of results from a query

2004-04-06 Thread Bruno Wolff III
On Thu, Apr 01, 2004 at 11:05:55 -0500, abhi <[EMAIL PROTECTED]> wrote: > I have a query of the form > > select id from member order by age; > > id > - > 431 > 93 > 202 > 467 > 300 > > In addition to the id, I would like the get the rank of the row-- > in other words: > > id

Re: [SQL] partial unique constraint

2004-04-06 Thread Richard Huxton
On Tuesday 06 April 2004 17:38, Robert Treat wrote: > On Tue, 2004-04-06 at 11:17, Tom Lane wrote: > > Robert Treat <[EMAIL PROTECTED]> writes: > > > Trying to come up with the proper syntax to meet the following > > > criteria: create table foo (bar integer, baz boolean UNIQUE (bar, baz = > > > tr

Re: [SQL] Function To Log Changes

2004-04-06 Thread elein
A plpython solution is available in Issue #66 of PostgreSQL GeneralBits. http://www.varlena.com/GeneralBits/66 Let me know if this helps. elein On Mon, Apr 05, 2004 at 01:01:39PM -0400, Gavin wrote: > Hi All, I have been tinkering with a function to log the changes made on > any column through a

Re: [SQL] partial unique constraint

2004-04-06 Thread Robert Treat
On Tue, 2004-04-06 at 11:17, Tom Lane wrote: > Robert Treat <[EMAIL PROTECTED]> writes: > > Trying to come up with the proper syntax to meet the following criteria: > > create table foo (bar integer, baz boolean UNIQUE (bar, baz = true)); > > The correct way to do it is with a separate CREATE IND

Re: [SQL] could not devise a query plan

2004-04-06 Thread Tom Lane
"=?iso-8859-2?B?U1rbQ1MgR+Fib3I=?=" <[EMAIL PROTECTED]> writes: > I couldn't find the string of my email's subject on the web, except for one > place: the PostgreSQL source :) Seems that you've managed to tickle a strange corner case, which can be reduced to simplest form like this: regression=#

Re: [SQL] SQL Standatd

2004-04-06 Thread Bruce Momjian
Ricardo Vaz Mannrich wrote: > In PostgreSQL documentation, there is a section "Compatibility" > (Reference -> SQL Commands -> Any command). > > There, alway has something like: > > The ADD COLUMN form conforms with the SQL standard... > > Where can I find this "SQL standard"? What is its officia

[SQL] distinct values without seq scan

2004-04-06 Thread Bret Hughes
I have a table indexed on a char(35) field and want a query to return a distinct list of the values in this column. Is there some syntactical magic I can do to get these values without a sequential scan? I assume, ( here we go again ) that these values are in the index somewhere and I seem to rec

Re: [SQL] group by not returning sorted rows

2004-04-06 Thread Bret Hughes
On Mon, 2004-04-05 at 17:34, Tom Lane wrote: > Bret Hughes <[EMAIL PROTECTED]> writes: > > and the rows resulting from the query are no longer sorted by log date. > > Is this a change since 7.2x? > > Yes. 7.4 can use hashing instead of sorting to bring grouped rows > together. > > > I can achie

[SQL] SQL Standatd

2004-04-06 Thread Ricardo Vaz Mannrich
In PostgreSQL documentation, there is a section "Compatibility" (Reference -> SQL Commands -> Any command). There, alway has something like: The ADD COLUMN form conforms with the SQL standard... Where can I find this "SQL standard"? What is its official site? Thank you, -- Ricardo Vaz Mannric

Re: [SQL] partial unique constraint

2004-04-06 Thread Rod Taylor
On Tue, 2004-04-06 at 10:29, Robert Treat wrote: > Trying to come up with the proper syntax to meet the following criteria: > > create table foo (bar integer, baz boolean UNIQUE (bar, baz = true)); Tt takes 2 steps. CREATE TABLE ... CREATE UNIQUE INDEX ... (bar) WHERE baz = true; -- Rod Taylo

Re: [SQL] partial unique constraint

2004-04-06 Thread Paul Thomas
On 06/04/2004 15:29 Robert Treat wrote: Trying to come up with the proper syntax to meet the following criteria: create table foo (bar integer, baz boolean UNIQUE (bar, baz = true)); note the above syntax is not correct, but should demonstrate what i'm trying to do; I want to add a unique constra

Re: [SQL] partial unique constraint

2004-04-06 Thread Stephan Szabo
On Tue, 6 Apr 2004, Robert Treat wrote: > Trying to come up with the proper syntax to meet the following criteria: > > create table foo (bar integer, baz boolean UNIQUE (bar, baz = true)); > > note the above syntax is not correct, but should demonstrate what i'm > trying to do; I want to add a un

Re: [SQL] partial unique constraint

2004-04-06 Thread ries
You should create a functional index here. Ries > -Oorspronkelijk bericht- > Van: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Robert Treat > Verzonden: dinsdag 6 april 2004 16:30 > Aan: [EMAIL PROTECTED] > Onderwerp: [SQL] partial unique constraint > > > Trying to come up with the pro

Re: [SQL] partial unique constraint

2004-04-06 Thread Achilleus Mantzios
O kyrios Robert Treat egrapse stis Apr 6, 2004 : > Trying to come up with the proper syntax to meet the following criteria: > > create table foo (bar integer, baz boolean UNIQUE (bar, baz = true)); You could simply leave your table as is. A null vale on baz (equivalent of 'false') will have no

Re: [SQL] partial unique constraint

2004-04-06 Thread Tom Lane
Robert Treat <[EMAIL PROTECTED]> writes: > Trying to come up with the proper syntax to meet the following criteria: > create table foo (bar integer, baz boolean UNIQUE (bar, baz = true)); The correct way to do it is with a separate CREATE INDEX command: create table foo (bar integer, baz boolean

Re: [SQL] could not devise a query plan

2004-04-06 Thread Tom Lane
"=?iso-8859-2?B?U1rbQ1MgR+Fib3I=?=" <[EMAIL PROTECTED]> writes: > If this is a bug and has been fixed since 7.4.1, I'd take the task to > compile a newer version and see how it fares. It's still there in CVS tip :-(. Will look into it today. regards, tom lane ---

[SQL] partial unique constraint

2004-04-06 Thread Robert Treat
Trying to come up with the proper syntax to meet the following criteria: create table foo (bar integer, baz boolean UNIQUE (bar, baz = true)); note the above syntax is not correct, but should demonstrate what i'm trying to do; I want to add a unique constraint such that we only allow one case of

Re: [SQL] Entered data appears TWICE in table!!?

2004-04-06 Thread Jeff Eckermann
--- Ron Morgan <[EMAIL PROTECTED]> wrote: > Both Internet Explorer and Safari, on a Mac running > OS X. > > I'm just using the tutorial web site at > sqlcourse.com. They have a window > there where you type code and run it, etc. > > Ron > I recall doing that tutorial once upon a time. A very g

[SQL] could not devise a query plan

2004-04-06 Thread SZŰCS Gábor
Dear Gurus, I couldn't find the string of my email's subject on the web, except for one place: the PostgreSQL source :) So I'm desperate. -- VERSION I'm using "PostgreSQL 7.4.1 on i686-pc-linux-gnu, compiled by GCC 2.95.4" with the patch for "shown aggregate columns is 0" (if you know what I me

Re: [SQL] Rename Schema or Script DDL only a schema

2004-04-06 Thread Olivier Hubaut
On Tue, 6 Apr 2004 14:32:04 +0530, kumar <[EMAIL PROTECTED]> wrote: Dear Friends, Postgres 7.3.2 on Linux 8. I wanna move about 100 tables from one schema to another (within a database). Is possible to do that? Seems pg_dump doesnt have an option to script only the schema. Else, it possible

[SQL] Rename Schema or Script DDL only a schema

2004-04-06 Thread kumar
Dear Friends,   Postgres 7.3.2 on Linux 8.   I wanna move about 100 tables from one schema to another (within a database). Is possible to do that? Seems pg_dump doesnt have an option to script only the schema.   Else, it possible to rename the schema.   Please shed some light.   Thanks Kumar