Re: [SQL] SQL Query Results

2001-01-24 Thread Christopher Sawtell
On Wed, 24 Jan 2001 18:02, wrote: > I want to show a certain person the commands I type and the query results, > and I want to save them in a file. I tried \e filename and \E filename and > its not working. Can someone please help me?? I don't know if this is available on your particular machine

Re: [SQL] Rule not invoked in 7.1

2001-01-24 Thread Tom Lane
Kyle <[EMAIL PROTECTED]> writes: > ERROR: Cannot update a view without an appropriate rule. 7.1 insists that you provide an *unconditional* DO INSTEAD rule for a view. What do you think was happening on your old database when the "where old.status = 'appr'" clause wasn't satisfied? Nothing good

[SQL] Insertion and Retrieval of BLOB

2001-01-24 Thread Som
Hi Everybody, There are two methods we can insert and retrieve image from db. One is by JDBC way , another is by Postgres extensions. I have problem with both while implementing. If im trying to retrieve the image (which is stored in OID type) by Postgres extensions, Ex: using LargeObjectManager

Re: [SQL] Re: Problem with Dates

2001-01-24 Thread Brett W. McCoy
On Thu, 25 Jan 2001, Glen and Rosanne Eustace wrote: > pressie# select '31/12/2000'::date + '1 year'::timespan; > ?column? > - > 01/01/2002 00:00:00.00 NZDT > (1 row) > > pressie=# > > Well I do :-( > > I vaguely remember someone else having the same problem

[SQL] Re: Problem with Dates

2001-01-24 Thread Mike Castle
On Thu, Jan 25, 2001 at 03:06:38PM +1300, Glen and Rosanne Eustace wrote: > pressie# select '31/12/2000'::date + '1 year'::timespan; > ?column? > - > 01/01/2002 00:00:00.00 NZDT > (1 row) What are the outputs of select '31/12/2000'::date; select '31/12/2000

[SQL] Re: Problem with Dates

2001-01-24 Thread Glen and Rosanne Eustace
pressie# select '31/12/2000'::date + '1 year'::timespan; ?column? - 01/01/2002 00:00:00.00 NZDT (1 row) pressie=# Well I do :-( I vaguely remember someone else having the same problem and it was something to do with daylight saving. I don't recall the sol

Re: [SQL] Rules and transactions

2001-01-24 Thread Jan Wieck
Brett Schwarz wrote: > If I have a rule, is the rule inside a tranaction along with the table that > it references. For example, if I have a rule that deletes an entry from > table B, whenever an entry in table A gets deleted, then is the delete for > table A and table B wrapped inside the same tr

[SQL] Rule not invoked in 7.1

2001-01-24 Thread Kyle
I have a number of views that seemed to work fine in 7.0.3.  When I try to do an update to these views under 7.1, I get the following error: ERROR:  Cannot update a view without an appropriate rule. For example, there's a view that looks like this: create view pay_req_v_prl as select empl_id,wdat

[SQL] Veering OT opinions please XQL versus XML-QL

2001-01-24 Thread clayton cottingham
just wondering which of these two formats seems best pros and cons of each i know that supposedly xql is simpler in style than XML-QL but XML-QL has some nice sql like syntax the perl modules seem to work nicer too

Re: [SQL] unreferenced primary keys: garbage collection

2001-01-24 Thread Forest Wilkinson
On Wed, 24 Jan 2001 00:26:58 -0500 (EST), Michael Fork wrote: >One other method is to setup up the foreign keys as ON DELETE RESTRICT, >then outside of your transaction block issue a DELETE FROM address WHERE >add_id = 1; If there are still records in the other tables referencing >this record, i

Re: [SQL] Problem with Dates

2001-01-24 Thread Mike Castle
On Thu, Jan 25, 2001 at 08:49:27AM +1300, Glen and Rosanne Eustace wrote: > I am using 7.0.3, > I have a column tstamp defined to be 'date'; > > With a current value of '31-12-2000', > if I update tstamp=tstamp+'1 year'::timespan > I get '1-1-2002' This almost sounds like it takes the year 2000,

Re: [SQL] How to change the ownership of the table?

2001-01-24 Thread Najm Hashmi
> > > Working out the exact UPDATE command to use is left as an exercise > for the student ;-) > > regards, tom lane It is funny.. LOL Najm

Re: [SQL] Making a foreign key chain - good idea or bad idea?

2001-01-24 Thread Stephan Szabo
On Wed, 24 Jan 2001, Frank Joerdens wrote: > I just did something which seems to work alright and which makes sense > to me now but which I have a funny feeling about. It may be good > standard practice (and I just don't know about it) or dangerously > foolish or just plain silly: I created a fo

[SQL] Problem with Dates

2001-01-24 Thread Glen and Rosanne Eustace
I am using 7.0.3, I have a column tstamp defined to be 'date'; With a current value of '31-12-2000', if I update tstamp=tstamp+'1 year'::timespan I get '1-1-2002' Is this what is supposed to occur. If this isn't the right way to do this, how should it be done ? Thanks -- Glen and Rosanne Eusta

[SQL] Please don't kill me!

2001-01-24 Thread David Olbersen
I have two statements that accomplish the same task and I'm trying to decide which to use. One uses a sub-select, and the other just does a few more joins. I expect that giving the SELECT statement's themseleves won't get me much help, so here is the output of the EXPLAIN query that I ran on both

Re: [SQL] plpgsql language

2001-01-24 Thread Albert REINER
On Wed, Jan 24, 2001 at 01:39:48PM +0800, chard wrote: > hello, > i got this error when i tried to create a function > "unrecognized language specified in CREATE FUNCTION: 'plpgsql'" why is > that? man createlang -- -- Al

Re: [SQL] How to change the ownership of the table?

2001-01-24 Thread Jie Liang
Hi, there, I believe that you can use iat least: pg_dump -t table -f out dbname then vi out change the owner (first line -- connnect ...) then drop the old table and reload new table by psql dbname < out If your table have no index or any constraint, you can use SELECT * into newtable then if

Re: [SQL] pl/pgsql Limits

2001-01-24 Thread Josh Berkus
Ian, > That works, but when do you delete the records? I delete the records: a) When the user runs the report a second time, with different parameters. b) After the user exits, as part of a DB-wide clean-up procedure (Function) that dumps everything with the user's session key.

[SQL] Making a foreign key chain - good idea or bad idea?

2001-01-24 Thread Frank Joerdens
I just did something which seems to work alright and which makes sense to me now but which I have a funny feeling about. It may be good standard practice (and I just don't know about it) or dangerously foolish or just plain silly: I created a foreign key reference on a column that is also the prim

[SQL] RE: SQL Query Results

2001-01-24 Thread Michael Davis
In psql you can try \g or \o. -Original Message- From:[SMTP:[EMAIL PROTECTED]] Sent: Tuesday, January 23, 2001 10:03 PM To: [EMAIL PROTECTED] Subject:SQL Query Results I want to show a certain person the commands I type and the query results, and I want to save them i

Re: [SQL] How to change the ownership of the table?

2001-01-24 Thread Tom Lane
Ramesh H R <[EMAIL PROTECTED]> writes: > Please, any one guide me how to change the ownership of the table? There's an ALTER TABLE command for this in current sources, but I think it's new in 7.1. In older releases, you have to reach in by hand and change the 'relowner' field of the table's pg_c

Re: [SQL] i have a big trouble

2001-01-24 Thread Tom Lane
Sandis Jerics <[EMAIL PROTECTED]> writes: > www_mod_lv=> \copy news from '/home/sites/www.mod.lv/web/news.sql' > \. > ERROR: copy: line 2, pg_atoi: error in " > At the international humanitarian mission of KFOR the Latvian unit participates with >10 soldiers from the National Armed Forces. The K

[SQL] select returns no line

2001-01-24 Thread Attila Kevei
Hi, Our database has a SELECT problem using varchar columns in WHERE clause (but not in all rows!!!). We can fix the whole table (or just the row) as shown below but later it seems wrong again (and after the fix the row isn't UPDATEd). Idea? Thanks Attila

[SQL] SQL Query Results

2001-01-24 Thread
I want to show a certain person the commands I type and the query results, and I want to save them in a file. I tried \e filename and \E filename and its not working. Can someone please help me??

[SQL] help with query

2001-01-24 Thread Oleg Bartunov
Hi, I have a table messages which has (for simplicity) two columns - msg_id, last_id, where last_id is sort of symbolical link - it points to the msg_id of the last version of message. There are no limitation to the number of versions. The problem I have is to get history of message with given

[SQL] Inserting and incrementing with MAX aggregate

2001-01-24 Thread Keith Perry
I was wondering if this statement was still supported in 7.0.x versions of pgSQL. I upgraded from a 6.x version where say: insert into events (eid,name) values (max(eid)+1,'server down'); works but not in the 7.x variants. I know that I could use the serial type for that column but in the inte

[SQL] Re: blobs and small binary objects

2001-01-24 Thread David Wall
I discovered type OID in the JDBC sample database for BLOBs, but I don't see it in the documentation. >From a quick test, it appears that the blob itself is not stored in the row itself, but is instead an object pointer of some kind. Is an OID actually a fixed length field that points to my blob

Re: [SQL] Joining several tables

2001-01-24 Thread PM
As long as the contactid is not null in any of the tables its easy. You didn't give any column name information so I'll wing it. Not knowing the relationships between the tables means this might get you a fair amount of repeat data. If there is only ONE row in each table for a given contactid it'l

[SQL] blobs and small binary objects

2001-01-24 Thread David Wall
I'm new to Postgresql and am trying to figure out how I'd store Serializable objects, byte arrays and potentially large binary objects. JDBC has APIs for getObject(), getBytes() and getBlob(), but how do I define those attributes inside a table? I don't see the typical BYTE or BINARY or BLOB typ

[SQL] Convert an interval in seconds

2001-01-24 Thread Blaise Carrupt
Hi all ! I've search all the doc to find a function which would allow me to convert an interval into a number of seconds. What I get is @ 1 hour, what I would like is -3600. I'd think to something like select interval('sec', myTime) - Ingres syntax - but it doesn't work. Does somebody has an

Re: [SQL] Use of INNER JOIN and others ??!?

2001-01-24 Thread Bruce Momjian
> Is it possible to use the statements INNER JOIN, OUTER JOIN, LEFT JOIN > and RIGHT JOIN in the new version of PostgreSQL 7.1 ? Yes in 7.1beta. See FAQ 'outer' entry for a short description. -- Bruce Momjian| http://candle.pha.pa.us [EMAIL PROTECTED]

[SQL] i have a big trouble

2001-01-24 Thread Sandis Jerics
Hello list, i expirienced that postgres seems doesn't want to eat it's own dump... why? even freshly created! whats wrong with me? www_mod_lv=> \copy news from '/home/sites/www.mod.lv/web/news.sql' \. ERROR: copy: line 2, pg_atoi: error in " At the international humanitarian mission of KFOR

[SQL] Some queries

2001-01-24 Thread Som
Dear sir, Q 1) While retrieving BLOBs from the database... There is an Exception displaying : with message... Fast path protocol error : z Eventhough i am importing like : import postgresql.fastpath.*; import postgresql.largeobject.*; and connecting :     Fastpath fp;   LargeObjectManager lobj;  

Re: [SQL] DATE

2001-01-24 Thread Oliver Elphick
john whale wrote: >PLEASE ADVISE HOW I SHOULD ALTER THE COMMAND: > ><$NOW;DD;> > >TO GIVE ME A DATE THAT IS X DAYS FORWARD > >ie: I WISH TO REPRESENT A DATE IN FORM WHICH IS A 7 DAYS FORWARD >OF THE DATE NOW. I don't recognise the format you are using, but in standard SQL

[SQL] Use of INNER JOIN and others ??!?

2001-01-24 Thread Luis Sousa
Is it possible to use the statements INNER JOIN, OUTER JOIN, LEFT JOIN and RIGHT JOIN in the new version of PostgreSQL 7.1 ? Luis Sousa

[SQL] How to change the ownership of the table?

2001-01-24 Thread Ramesh H R
Hai Please, any one guide me how to change the ownership of the table? Regards, -- Ramesh HR Trainee Engineer EASi Technologies 213, 3rd Main, 4th Cross Chamrajpet, Bangalore - 560 018 India Ph.: 660 1086 / 660 2365 / 667 2984 Extn.: 155 Facsimile: 667 5274 www.easi.soft.net

Re: [SQL] select returns no line

2001-01-24 Thread Attila Kevei
This locale-thing sounds good...:-) As I remember, we've changed the locale settings after the creation of the table. The former opinions (space after the text, value length, etc.) didn't help us too much. Anyway, thanks to all. So, I try to re-create the index. Attila Quoting Tom Lane <[EMAIL