Re: [SQL] Setting session global variables

2001-05-16 Thread Jonathan Bartlett
Yes, that's perfect! Actually, I was thinking of a real user, but more in the fashion of "pretend" users. If you've ever used Oracle apps, it would be like an apps user, not the user "apps". Anyway, that's an excellent idea. Thank you much! Jon [EMAIL PROTECTED] SDF Public Access UNIX System

Re: [SQL] Give me a suggestion 'START WITH .. CONNECT BY'.

2001-05-16 Thread Roberto Mello
On Tue, May 15, 2001 at 05:40:32PM +0900, ?$B;3$5$s wrote: > Hello! > I try to translate a database to PostgreSQL from ORACLE, but have a regret > over a function '... START WITH .. CONNECT BY ...'. > This function is descrived in a sql sentence for ORACLE, and I could not > find in PostgreSQL. >

Re: [SQL] Exp/Imp Problems...

2001-05-16 Thread Roberto Mello
On Tue, May 15, 2001 at 08:22:36PM +0530, ameet wrote: > > We are trying to export a tablespace 'XYZ' from an Oracle8i Database server to a >Oracle 9i Application Server, both residing on different machines. > > As far the Export is concerned,we are succesfully able to create the required >'ab

Re: [SQL] Setting session global variables

2001-05-16 Thread Tom Lane
Jonathan Bartlett <[EMAIL PROTECTED]> writes: > However, the only way I can see to implement this is to have session > global variables. Is there a way to fake session global variables with a > table? Any comments would be appreciated. You could do it with temp tables: the same temp table name

[SQL] Setting session global variables

2001-05-16 Thread Jonathan Bartlett
Is there a way to set a session global variable in PostgreSQL? The only thing I see are examples of setting config variables. What I would like to do is this: Have a table "insertedby" or something that has created_object oid, created_by_user oid, creation_date datetime Then have a procedure,

[SQL] Exp/Imp Problems...

2001-05-16 Thread ameet
We are trying to export a tablespace 'XYZ' from an Oracle8i Database server to a Oracle 9i Application Server, both residing on different machines. As far the Export is concerned,we are succesfully able to create the required 'abc.dmp' file on the 8i server. We then copy the 'abc.dmp' file an

[SQL] Re: Auto incrementing an integer

2001-05-16 Thread Sylte
Thanks MartínI found this http://dis.lib.muohio.edu/code/entry.html?ID=3 Creating an Autoincrement field in Postgresql postgres does this a little differently; the "serial" type creates an integer column, and a sequence used to increment this column. try this: create table table_name(

[SQL] case insensitive sort for output from SELECT

2001-05-16 Thread Stephen Patterson
Is there any way to alphabetically sort the output of a select statement correctly? what I'm using at the moment is SELECT data FROM table ORDER BY DATA ASC which gives (for example) A B C a b Is there any way to rig this so that it sorts 'properly', i.e. both the a's come together? Given wha

Re: [SQL] Select most recent record?

2001-05-16 Thread George Moga
Marc Sherman wrote: > .. > > Heh. I obviously simplified my situation too much. > > This is closer to what I've really got: > > create table user (userid int4 primary key, groupid int4); > create table log (userid int4, timestamp datetime, value int4); > > I need to select sum(value) for ea

[SQL] "avg" function for arrays?

2001-05-16 Thread G. Anthony Reina
I know that there's an "average" function (avg) for some datatypes. Is there something comparable for float or int arrays? e.g. select avg(time_instants[1:5]) from ellipse_proc where rep = 1; time_instants - {"148","167.8","187.6","207.4","227

[SQL] Give me a suggestion 'START WITH .. CONNECT BY'.

2001-05-16 Thread $B;3$5$s(B
Hello! I try to translate a database to PostgreSQL from ORACLE, but have a regret over a function '... START WITH .. CONNECT BY ...'. This function is descrived in a sql sentence for ORACLE, and I could not find in PostgreSQL. For example    SELECT LEVEL, COMP_ITM, COMP_NAME, COMP_AMT FROM PS

Re: [SQL] [Fwd: [Gborg-bugs] BUG: reference error when using inheritedtables (ID: 269) (new)]

2001-05-16 Thread Stephan Szabo
> I have a problem with inherited refences. > For example : > CREATE TABLE A(LNR integer Primary key blabla); > CREATE TABLE B () INHERITS(A); > CREATE TABLE C(LNR integer primary key blabla, RNR Intger not null, > unique(RNR), FOREIGN KEY(RNR) REFERENCES A.LNr ON DELETE CASCADE); > will throw a

Re: [SQL] Select most recent record?

2001-05-16 Thread Tom Lane
Andrew Perrin <[EMAIL PROTECTED]> writes: > Except that he wants max(timestamp) by id; perhaps a GROUP BY would > help, something like (untested): Oh, I'm sorry, I missed the "for each id" bit. > select max(timestamp) from log group by id; That gives you the max timestamp for each id, all right

RE: [SQL] Select most recent record?

2001-05-16 Thread Marc Sherman
From: Tom Lane [mailto:[EMAIL PROTECTED]] > > "Marc Sherman" <[EMAIL PROTECTED]> writes: > > I'd like to select the newest (max(timestamp)) row for each id, > > before a given cutoff date; is this possible? > > select * from log order by timestamp desc limit 1; Heh. I obviously simplified my s

[SQL] To Run 2 database servers at the same time

2001-05-16 Thread Najm Hashmi
HI all, I want to install postgresql v71.1.1 while keeping my old version of it . I think it is v7.0.3. What your advise would be for me ?  I have down loaded all the file form the following link: http://www.ca.postgresql.org/ftpsite/v7.1.1/ What are the necessary step should i take to do it corr

[SQL] oid and triggers

2001-05-16 Thread Adam Doligalski
Hi everybody! Is there any possibility to access oid's in trigger routines? I suppose that it makes no sense while 'before insert' routines but it would be very usable while treating oid's as rows identifiers. Thanks, Adam ---(end of broadcast)---

Re: [SQL] Select most recent record?

2001-05-16 Thread Andrew Perrin
Except that he wants max(timestamp) by id; perhaps a GROUP BY would help, something like (untested): select max(timestamp) from log group by id; Tom Lane wrote: > > "Marc Sherman" <[EMAIL PROTECTED]> writes: > > I'd like to select the newest (max(timestamp)) row for each id, > > before a given

Re: [SQL] Select most recent record?

2001-05-16 Thread Tom Lane
"Marc Sherman" <[EMAIL PROTECTED]> writes: > I'd like to select the newest (max(timestamp)) row for each id, > before a given cutoff date; is this possible? select * from log order by timestamp desc limit 1; regards, tom lane ---(end of broadcast)

[SQL] Restricting the number of decimal digits

2001-05-16 Thread Srikanth Rao
I have a query that calculates the average of difference between timestamps. I want the output to be upto 1 decimal point. How do I do it? __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/ --

[SQL] Select most recent record?

2001-05-16 Thread Marc Sherman
Hi, I was hoping I could get some help with a select statement. I have a log table with three columns: id int4, timestamp datetime, value int4. For any given ID, there will be a large number of rows, with different timestamps and values. I'd like to select the newest (max(timestamp)) row for ea

[SQL] [Fwd: [Gborg-bugs] BUG: reference error when using inherited tables (ID: 269) (new)]

2001-05-16 Thread Chris Ryan
I received this bug on a project I administer that Isn't related to my project. I forwarded it here to see if any of you could help this person. [EMAIL PROTECTED] wrote: > > Title: reference error when using inherited tables > Bug Type: Software bug > Severity: Serious > Software Versio