Re: [SQL] Generating serial number column

2003-02-13 Thread Gary Stainburn
On Thursday 13 Feb 2003 4:21 pm, Mintoo Lall wrote: Hi Everybody , Is there a way in postgresql by which I can generate serial number column for the resultset. I wanted the resulset to look like below sno Name --- 1JOE 2JOHN 3

Re: [SQL] Debugging postmaster to fix possible bug in Postgres? Followup to How do you select

2003-02-13 Thread Nicholas Allen
Ooops! Appologies to all for being sooo stupid! I thought the order by was applied before the WHERE and if ordering in DESC order for example would mean greater than and so on in the where clause because I assumed meant it would appear before in the returned order. Of course the where just

Re: [SQL] PL/PGSQL EDITOR

2003-02-13 Thread Frankie Lam
You can try Crimson Editor, a free powerful editor. http://www.crimsoneditor.com/ Regards Frankie Eduardo [EMAIL PROTECTED] wrote in message news:b2h2b0$uqd$[EMAIL PROTECTED]... Do exists a PL/PGSQL editor? Thanks. ---(end of

Re: [SQL] PL/PGSQL EDITOR

2003-02-13 Thread Josh Berkus
Eduardo, Do exists a PL/PGSQL editor? Not that I know of. We've talked about this for PGAccess, but nothing's come of it because nobody has the motivation to code it, yet. PGAccess does have a function editor, but it's rather limited. I've been told that TOra (http://www.globecom.se/tora/)

[SQL] Passing arrays

2003-02-13 Thread Michael Weaver
Title: Passing arrays How do you get an array of elements to be passed to a stored proc such that you can use the array in a SELECT statement in the WHERE clause - e.g. WHERE field IN (array) etc... CREATE OR REPLACE FUNCTION sp_report_retail_sales(int8[]) RETURNS SETOF

Re: [SQL] Passing arrays

2003-02-13 Thread Josh Berkus
Micheal, How do you get an array of elements to be passed to a stored proc such that you can use the array in a SELECT statement in the WHERE clause - e.g. WHERE field IN (array) etc... There's no easy way, right now. You'll have to: 1) loop through the array and pass its elements to a

[SQL] rownum

2003-02-13 Thread chester c young
sorry about this - braindead and cannot find in doc. what's pg's rownum pseudo-column or function name that returns the record number of a set? __ Do you Yahoo!? Yahoo! Shopping - Send Flowers for Valentine's Day http://shopping.yahoo.com

Re: [SQL] rownum

2003-02-13 Thread Josh Berkus
Chester, sorry about this - braindead and cannot find in doc. what's pg's rownum pseudo-column or function name that returns the record number of a set? There isn't one, unless there's something in /contrib that you can build. -- Josh Berkus Aglio Database Solutions San Francisco

Re: [SQL] Debugging postmaster to fix possible bug in Postgres? Followup

2003-02-13 Thread Dmitry Tkach
SQL92 says: direct select statement: multiple rows ::= query expression [ order by clause ] [...] 3) Let T be the table specified by the query expression. 4) If ORDER BY is specified, then each sort specification in the order by clause shall identify a column of

[SQL] Extending Datatype

2003-02-13 Thread Wei Weng
Where can I find a more detailed doc on how to write module for extended datatype? There isn't much about it on techdoc.postgresql.org. (I need to write one for UNIQUEIDENTIFIER.) Thanks! Wei ---(end of broadcast)--- TIP 5: Have you checked

[SQL] postmaster -i establishes three connections why?

2003-02-13 Thread Jeff Lu
Hi, I've just upgraded my cygwin to 1.3.20-1 and postgresql to 7.3.2 And I found that when run postmaster -i There are three connections being established and why is that? Administrator@DemoServer ~ $ LOG: database system was shut down at 2003-02-13 17:33:26 EST LOG: checkpoint record

Re: [SQL] Debugging postmaster to fix possible bug in Postgres? Followup

2003-02-13 Thread Manfred Koizar
On Thu, 13 Feb 2003 17:50:22 -0500, Dmitry Tkach [EMAIL PROTECTED] wrote: Then it looks like postgres behaviour is still not compliant, if I read it correctly, because select x from mytable order by y; should be invalid according to this, but works just fine in postres. Yes, this is a Postgres

Re: [SQL] Extending Datatype

2003-02-13 Thread Bruce Momjian
Try the SERIAL data type. It uses sequences and DEFAULT. Read the FAQ. --- Wei Weng wrote: Where can I find a more detailed doc on how to write module for extended datatype? There isn't much about it on

Re: [SQL] Debugging postmaster to fix possible bug in Postgres? Followup

2003-02-13 Thread Tom Lane
Dmitry Tkach [EMAIL PROTECTED] writes: Then it looks like postgres behaviour is still not compliant, if I read it correctly, because select x from mytable order by y; should be invalid according to this, but works just fine in postres. Yup, it's an extension --- as indeed is pointed out at

Re: [SQL] SQL Functions vs PL/PgSQL

2003-02-13 Thread Tom Lane
Roberto Mello [EMAIL PROTECTED] writes: On Thu, Feb 13, 2003 at 09:02:05AM -0800, Josh Berkus wrote: Unless you know something I don't, I do not believe that PL/pgSQL stores execution plans for functions. AFAIK execution plans for PL/pgSQL functions were cached once per backend. No? Yes.

[SQL] table Pivot

2003-02-13 Thread V. Cekvenich
How do you do a table Pivot in PostgreSQL? tia, .V = ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send unregister YourEmailAddressHere to [EMAIL PROTECTED])

Re: [SQL] SQL Functions vs PL/PgSQL

2003-02-13 Thread Josh Berkus
Johnny, Does postgres store execution plan's for user-defined SQL functions as the PL/pgSQL interpreter does. And if so - will this only be prepared after an initial call to the function? Can't seem to find this information in the docs!? Thanks, Unless you know something I don't, I do not

Re: [SQL] Debugging postmaster to fix possible bug in Postgres? Followup to How do you select

2003-02-13 Thread Nicholas Allen
Because the WHERE clause is directly affected by the ORDER BY clause. If you leave out the order by clause then the row count will be completely different and therefore wrong. The ORDER BY clause is just as important as the WHERE clause when counting rows. It should be possible to get a count