Re: [SQL] Entering data in serial column

2001-09-29 Thread david
S ('$name','$surname', > '#address'); > > Is there a shorter way of doing this? I mean, if I had 40 fields in this > table, would I have to write all the fields? I mean, is there a syntax > beginning like > > INSERT INTO info VALUES (

Re: [SQL] Linking against null-fields.

2001-10-09 Thread david
R with NULL values. Eg: FILE: ID DRIVER 1 NULL 2 1 3 4 DRIVER: ID NAME 1 broken.dll 2 foo.zip SELECT f.ID, d.NAME FROM FILE f LEFT OUTER JOIN DRIVER d ON d.ID = f.DRIVER; ID NAME 1 NULL 2 broken.dll 3 NULL -- David Stanaway ---

Re: [SQL] arrays and polygons

2004-02-13 Thread David
Thanks to you both that helped enormously, Dave - Original Message - From: "Joe Conway" <[EMAIL PROTECTED]> To: "Tom Lane" <[EMAIL PROTECTED]> Cc: "David" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, February 13, 2004

[SQL] searching polygons

2004-02-20 Thread David
What query would i have to use to search for an item using a polygon as a parameter? (i.e a very large polygon that would identify smaller polygons within it) ideally i would like to give postgresq a series of co-ordinates and then have it return all those results whose polygons fall into that set

Re: [SQL] searching polygons

2004-02-27 Thread David
e this query using an explicit cast (State:S1000, Native Code: 7) I am not sure how to do this, any suggestions Many thanks Dave - Original Message - From: "elein" <[EMAIL PROTECTED]> To: "David" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Sunday

[SQL] changing constraints

2004-03-10 Thread David
I tried adding a constraint thus: de4=> ALTER TABLE genus ADD CHECK(gender = 'masculine' || 'feminine'); But get the msg: ERROR: AlterTableAddConstraint: rejected due to CHECK constraint $2 de4=> \d genus Table "public.genus" Column | Type | Modifiers ---

Re: [SQL] changing constraints

2004-03-10 Thread David
Cheers that worked fine, i guess its obvious im new to postgres (SQL in general!), oh well you have to learn somehow Dave > > Try something like (untested): > ALTER TABLE genus ADD CONSTRAINT valid_gender CHECK (gender IN > ('masculine','feminine')); > > > -- > Richard Huxton > Archonet Lt

[SQL] Alter table

2004-03-10 Thread David
Ok another very newbie question. How can i change the data type a column can accept? at the moment it will only take character(7) i want to change it to varchar(30), but i cant figure how, ideas? Many thanks Dave ---(end of broadcast)--- TIP 8: exp

[SQL] Changing primary keys

2004-03-10 Thread David
Is it possible to change the primary key of a relation? I want to add an attribute, that i already have in the realtion, to the primary key (yes i realise i designed my model pretty badly) ---(end of broadcast)--- TIP 7: don't forget to increase you

[SQL] arrays and polygons

2004-05-31 Thread David
t the following error message: ERROR: Bad polygon external representation '((432' Where am i going wrong, all help is much appreciated DAvid ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (s

[SQL] table as field type??

2000-10-03 Thread David Diller
le foo. Is there a way to perform a query on bar that will return values from table foo (i.e., val1)? Thanks, David

[SQL] blobs and small binary objects

2001-01-24 Thread David Wall
t in the documentation to know if this is a real type, one of the user defined types that's a common extension, etc. Anybody handle these issues yet? Thanks, David

[SQL] Re: blobs and small binary objects

2001-01-24 Thread David Wall
ts to my blob? Or is it more like a VARCHAR, in which case it would be better to store it at the end of the row for storage performance reasons? David

[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

[SQL] Don't want blank data

2001-01-25 Thread David Olbersen
Greetings, Is there a way to have postgresql always return a value for each row requested? To be more clear, if I were using a Perl SQL hybrid I would write something like SELECT computer_ip or 'unset' FROM computers; So that if computers.computer_ip is NULL or '' I will get 'unset' ba

Re: [SQL] Change or get currentdb

2001-01-25 Thread David Olbersen
>From \? \c[onnect] [dbname|- [user]] connect to new database (currently '') so typing "\c" gives you the database you're currently connected to and "\c " would connect you to that database. On Thu, 25 Jan 2001, Sergiy Ovcharuk wrote: ->How can I change and/or get to know a c

[SQL] PL/PGSQL function with parameters

2001-02-05 Thread David Richter
body (Jan Wieck?) who can make some sugestions on the above will receive my enthusiastic gratitude. David

Re: [SQL] SQL Join - MySQL/PostgreSQL difference?

2001-02-05 Thread David Olbersen
On Thu, 1 Feb 2001, Brice Ruth wrote: ->SELECT -> a.Number, -> a.Code, -> a.Text ->FROM -> b, -> a ->WHERE -> (b.Id = a.Id) AND These next two statements are very ambiguous. Make them explicit as you have with "(b.Id = a.Id)" and "(b.d_Id = 'key3')" Also, be sure that 'key3' is how what y

[SQL] Data Types

2001-02-16 Thread David Olbersen
Hello. I have a table in which I'm trying to store the length of a sound file. I decided to use the TIME data type. Was this correct? One of the operations I want to do is sum() all of my files lengths to get the total amount in terms of time, of sound that I have. I notice that sum() doesn't ta

Re: [SQL] Temp Tables & Connection Pooling

2001-03-02 Thread David Olbersen
On Fri, 2 Mar 2001, Gerald Gutierrez wrote: ->Recently I wanted to implement Dijkstra's algorithm as a stored procedure, ->and finding that PL/PGSQL cannot return record sets, I thought about using ->a temporary table for the results. If tempoary tables are session-specific, ->however, then would

Re: [SQL] Two way encryption in PG???

2001-03-04 Thread David Olbersen
On Sun, 4 Mar 2001, Boulat Khakimov wrote: ->How do I encrypt/decrypt something in PG? Perhaps it'd be better to one-way encrypt something? Granted I don't know the details of your project, but allowing a way to "decrypt" something is rather insecure. -- Dave ---(end o

Re: [SQL] How do I use text script containing SQL?

2001-03-05 Thread David Olbersen
On Mon, 5 Mar 2001, Jeff S. wrote: ->I want to be able to use the file to create my table. ->I've tried psql -d databasename -e < filename.txt ->but that doesn't work. You're making it too dificult :-) 'psql -d databasename < filename.txt' should work just fine -- Dave ---

[SQL] explain EXPLAIN?

2001-03-08 Thread David Olbersen
Hello, I'm looking for a better tutorial of how EXPLAIN works. I know Mr. Tom Lane wrote a "quick & dirty explanation" and that "plan-reading is an art that deserves a tutorial, and I haven't had time to write one". In which case I'd like to know if there's any other tutorials/resources.

[SQL] Optimization via explicit JOINs

2001-03-09 Thread David Olbersen
Greetings, I've been toying aroudn with postgres 7.1beta5's ability to control the planner via explicitely JOINing tables. I then (just for giggles) compare the difference in the EXPLAIN results. I'm no super-mondo-DBA or anything, but in my two attempts so far, the numbers I get out of

Re: [SQL] Optimization via explicit JOINs

2001-03-09 Thread David Olbersen
On Fri, 9 Mar 2001, Stephan Szabo wrote: ->Not entirely. Those are only estimates, so they don't entirely line up ->with reality. Also, I notice the first estimates 14 rows and the second ->1, which is probably why the estimate is higher. In practice it probably ->won't be significantly diffe

Re: [SQL] Optimization via explicit JOINs

2001-03-09 Thread David Olbersen
On Fri, 9 Mar 2001, Stephan Szabo wrote: -> Hmm, what were the two queries anyway? The "slower" query SELECT to_char( p.insertion_time, 'HH:MI AM MM/DD' ) as time_in, s.nameas title, a.nameas artist, s.length as le

Re: [SQL] Optimization via explicit JOINs

2001-03-09 Thread David Olbersen
On Fri, 9 Mar 2001, Stephan Szabo wrote: ->As a question, how many rows does ->select * from playlist p join songs s using (song_id) where ->p.waiting=TRUE; ->actually result in? Well it depends. Most of the time that playlist table is "empty" (no rows where waiting = TRUE), however users can (i

Re: [SQL] Comparing dates

2001-03-12 Thread David Lynn
Hello - It seems that using BETWEEN would work well, especially for finding dates between two other dates. WHERE date_date BETWEEN '03-02-2001'::date and '03-03-2001'::date --d > On Tue, 6 Mar 2001, Markus Fischer wrote: > > > Hello, > > > > I've a SELECT statement on many joined Tabled and

[SQL] error joining 2 views containing GROUP BYs

2001-03-12 Thread david morgan
s would be greatly appreciated. David Morgan. drop table Users; create table Users ( UID int4 PRIMARY KEY, Name text, Address text, TelNo text, EmailAddress

Re: [SQL] error joining 2 views containing GROUP BYs

2001-03-13 Thread david morgan
Thanks for your help. It runs blindlingly fast under beta5 so I'll keep my fingers crossed and hope it will be stable enough! Tom Lane wrote in message <[EMAIL PROTECTED]>... >"david morgan" <[EMAIL PROTECTED]> writes: >> I am having a few problems using

Re: [SQL] Select very slow...

2001-03-18 Thread David Olbersen
On Sun, 18 Mar 2001, Fernando Eduardo B. L. e Carvalho wrote: > select p.city,count(*) from sales s, person p where s.doc = p.doc > group by p.city; > >Anyone help-me? 1: VACUUM ANALYZE sales VACUUM ANALYZE person; 2: That 'count(*)' is going to be slow. Try counting a column that'

[SQL] Self-Referencing

2001-03-28 Thread David Olbersen
Hello, I have a feeling this isn't going to make much sense, but I'm gonig to try anyway. What I'd like to do is be able to refer to an outer-SELECT from an inner-SELECT. I hope this makes sense. I need to be able to refer to the row that's being processed in a SELECT. I'm going to

[SQL] Inserting binary data (BLOBs) in v7.1

2001-04-04 Thread David Lizano
Has somebody insert binary data (BLOBs) in a row in PostgreSQL v7.1? Is the correct data type to do it "VARCHAR(65535)"? ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [E

Re: [SQL] pg_dumpall and password access

2001-04-04 Thread David Lizano
At 19.29 3/4/01 -0400, you wrote: >Christophe Labouisse <[EMAIL PROTECTED]> writes: > > I'm trying to run pg_dumpall to backup all my users' bases but since I > > have configure pg_hba.conf to "passwd" pg_dumpall always fails: > >pg_dumpall doesn't work very well with password authentication (and

[SQL] DROP TABLE in transaction

2001-04-12 Thread David Olbersen
Hello. I was wondering if anybody could explain to me why I can't roll back dropping a table. I would think that of all the events that should be rollback-able, dropping a table would be the first on the list. -- Dave ---(end of broadcast)--- TIP

Re: [SQL] DROP TABLE in transaction

2001-04-12 Thread David Olbersen
On Thu, 12 Apr 2001, Peter Eisentraut wrote: > Because DROP TABLE removes the table file on disk, and you can't roll back > that. Actually, in 7.1 you can. ;-) Well I understand that it's being taken from the disk, but why does that action have to be done *right now*? Why can't it be postponed

Re: [SQL] is this proper sql?

2001-04-17 Thread David Olbersen
On Tue, 17 Apr 2001, clayton cottingham wrote: > now i personally dont think this is real sql > anyone? Nope, not real. Although that type of syntax would be handy IMHO. -- Dave ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] index/join madness

2001-05-23 Thread David Olbersen
On Wed, 23 May 2001, Michael Richards wrote: > Finally, I'm planning on moving this to 7.2 and converting all the > joins to use outer joins. Will there be a significant penalty in > performance running outer joins? Why are you planning on using outer joins? Yes there is a performance penalty be

[SQL] binary data

2001-05-29 Thread David Lizano
Is there any method to insert binary data in a PostgreSQL row? What data type must I use to insert an image? Thanks in advance. ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl

[SQL] Problem with pg_index.

2001-06-01 Thread David BOURIAUD
? I've checked out the online doc, and the archives of this list (that's where I got pg_index.indkey[0] from), but nothing seems to work, since pg_index.indkey seems to be an int2vector, and I found no integrated function to check if a value is in this vector... T

[Fwd: [SQL] Problem with pg_index.]

2001-06-01 Thread David BOURIAUD
-- David BOURIAUD -- In a world without walls or fences, what use do we have for windows or gates ? -- ICQ#102562021 Tom Lane wrote: You are totally right ! > > I don'

[SQL] How to use the type int2vector ?

2001-06-05 Thread David BOURIAUD
Hi the list ! How can I make a test on a int2vector ? If I have a vector that contains (1, 2, 5, 9), how can I check these values incivicually ? Thanks by advance for your help. -- David BOURIAUD -- In a world without walls or fences, what

Re: [SQL] How to use the type int2vector ?

2001-06-06 Thread David BOURIAUD
David BOURIAUD wrote: > > Hi the list ! > How can I make a test on a int2vector ? If I have a vector that contains > (1, 2, 5, 9), how can I check these values incivicually ? Thanks by > advance for your help. I answer myself by posting another question... Is there a way to know

[SQL] About i8n

2001-06-07 Thread David BOURIAUD
Hi the list ! I principally use postgres with php, but I think that for my question, it remains the same... Is there a way to have all error messages returned by the back-end translated into french or another language ? If so, how to set it up ? Thanks by advance. -- David BOURIAUD

[SQL] About table column names.

2001-06-07 Thread David BOURIAUD
ng this kind of datas ? Thanks by advance for any suggestion. -- David BOURIAUD -- In a world without walls or fences, what use do we have for windows or gates ? -

Re: [SQL] Re: About i8n

2001-06-07 Thread David BOURIAUD
"J.H.M. Dassen (Ray)" wrote: > > David BOURIAUD <[EMAIL PROTECTED]> wrote: > > Is there a way to have all error messages returned by the back-end > > translated into french or another language ? > > http://www.de.postgresql.org/devel-corner/docs/postgres

[SQL] Memory exhausted

2001-06-11 Thread David Richter
hange the postmaster parameters? actually they are : ./postmaster -i -S -D/usr/local/pgsql/data -B 256 -o -e -o -F What can I do? Thanks in advance for any advice David begin:vcard url;quoted-printable:http://mbi.DKFZ-Heidelberg.de/=0D=0A n:M. Richter;David x-mozilla-html:FALSE org:Deutsches Kr

[SQL] listing foreign keys

2001-06-12 Thread David Brown
is there any way to view the existing foreign keys in a database schema? ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

[SQL] indexing arrays in pgaccess's query interface is failing

2001-07-03 Thread David Stanaway
dialogue: Error: invalid command name "akID" Is there an alternate way indexing arrays in queries that I should be using? Or is pgaccess just not suitable for this class of queries! -- Best Regards David Stanaway .- Tech

[SQL] cumulative sum in aggregate query.

2001-07-10 Thread David Stanaway
| 1 1.9 | 1 3.4 | 5 5.2 | 3 6.7 | 2 9.3 | 0 11.3| 1 Does anyone have any suggestions as to how to do this? -- Best Regards David Stanaway .- Technology Manager - Australia's Premier Internet Broadca

Re: [SQL] example of [outer] join

2001-07-20 Thread David Stanaway
reason to upgrade to 7.1 if you are still using an earlier version of postgres) == David Stanaway Personal: [EMAIL PROTECTED] Work: [EMAIL PROTECTED]

Re: [SQL] nextval on insert by arbitrary sequence

2001-07-20 Thread David Stanaway
t; Sorry for the confusion. > > > > > > -- Dado Feigenblatt Wild Brain, Inc. > Technical Director (415) 553-8000 x??? > [EMAIL PROTECTED] San Francisco, CA. > > > > > >

Re: [SQL] Are circular REFERENCES possible ?

2001-08-07 Thread David Lizano
> > >Which leads to : > >CREATE TABLE shops ( id_shop SERIAL PRIMARY KEY, id_cust integer >REFERENCES customers, ...) You can't reference to a table who doesn't exists still. >CREATE TABLE customers ( id_cust SERIAL PRIMARY KEY, id_defaultshop >integer REFERENCES shops, ...) Perhaps

Re: [SQL] Table Constraints with NULL values

2001-10-19 Thread David Allardyce
hey meant what you want the behavior to > be, ISTM they'd have defined uniqueness constraints by saying "all the > rows must be distinct". > Actually, I don't think the definition of distinct is a contradiction at all. Instead, I think it explains why they specifically exc

[SQL] Table Constraints with NULL values

2001-10-18 Thread David Allardyce
VARYING(100) NULL DEFAULT NULL, arg3CHARACTER VARYING(100) NULL DEFAULT NULL, CONSTRAINT unique_aofunction UNIQUE (name, skill, arg1, arg2, arg3) ); David Allardyce ---(end of broadcast)--- TIP 3: if posting/reading through Usenet

Re: [SQL] URGENT: restoring a database

2001-10-25 Thread David Stanaway
t this point I am completely stuck. > Please help. > thanks, > > Oleg > > > ---(end of broadcast)--- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to [EMAIL

Re: [SQL] how to sort a birthday list ?

2002-06-20 Thread David Stanaway
On Thu, 2002-06-20 at 13:55, Michael Agbaglo wrote: > Hi ! > > there's a nice query for retrieving the people who have their birthday > in the next n days: (taken from Joe Celko's SQL for Smarties, 1st Ed., > p. 76) > > SELECT * > FROM Persons > WHERE EXTRACT( YEAR FROM AGE(dateofbirth) ) < EX

[SQL] Unsubscription -- How?

2002-06-27 Thread David Secret
Can someone please tell me how to unsubscribe from all the pgsql lists? ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] graphical interface - admin

2002-06-27 Thread David BOURIAUD
st)--- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html -- David BOURIAUD -- In a world without walls or fences, what use do we have for windows or gates ? -

[SQL] SQL problem with aggregate functions.

2002-07-09 Thread David BOURIAUD
y f1;", cause i want to get all the possible count values in one row (these data are already grouped on another field). To give a more accurate example, here is what I want to retrieve : Field group | count of D | count of R | count of X. Any clues

Re: [SQL] is there a way to get hh:mm:ss given seconds

2002-07-09 Thread David Stanaway
row) scratch=# \q dstanawa@ciderbox:~$ bc -l 7*60+2 422 I don't know where you got 1:01:02 from. -- David Stanaway signature.asc Description: This is a digitally signed message part

Re: [SQL] query/transaction history/logs

2002-07-10 Thread David BOURIAUD
peech you get from the postmaster). > ---(end of broadcast)--- > TIP 4: Don't 'kill -9' the postmaster -- David BOURIAUD -- In a world without walls or fence

[SQL] Insert Function

2002-07-10 Thread David Durst
t: ERROR: function declared to return integer, but final statement is not a SELECT I thought that a insert would return a internal row #, but I am not sure about this. Thanks, David Durst MIS Manager www.la-rubber.com ---(end of broadcast)--- TIP 4:

[SQL] Returning rows from functions

2002-07-10 Thread David Durst
I was wondering if there was a way of returning a complete row from a function, in reading the documentation of CREATE FUNCTION. I was under the impression that you could return a row by using setof, but this does not seem to be true. Can anyone help? ---(end of broadcas

[SQL] ANNOUNCE: Bricolage 1.3.3

2002-08-25 Thread David Wheeler
The Bricolage developers are pleased to announce the release of Bricolage version 1.3.3! This the release candidate for Bricolage verion 1.4.0, and is considered feature-complete. Nearly 50 new features have been added since the 1.2.2 release, and over 80 bugs fixed. Barring any unforseen maj

Re: [SQL] Returning a reference to a cursor from a function

2002-09-18 Thread david williams
: Richard Huxton Sent: Wednesday, September 18, 2002 6:32 AM To: david williams Cc: [EMAIL PROTECTED] Subject: Re: [SQL] Returning a reference to a cursor from a function  On Tuesday 17 Sep 2002 7:12 pm, you wrote:> Richard,>> Thanks for the information. I've made some modifications to

[SQL] Is there a better way than this to get the start and end of a month?

2002-09-21 Thread David Stanaway
(''month'' FROM day); year := extract(''year'' FROM day); IF month = 12 THEN month := 1; year := year +1; ELSE month := month +1; END IF; RETURN (''01-''||month||''-''||year)::date -

Re: [SQL] Stored Procedures

2002-10-02 Thread david williams
Cc: david williams; [EMAIL PROTECTED] Subject: Re: [SQL] Stored Procedures  Ok, if this does not apply to versions prior to 7.3beta then what do I need to do if I am running 7.2.1? When I try to use the SETOF to retrun a row set, I only get one column.Do I need to update Postgres to get things to

Re: [SQL] Stored Procedures

2002-10-02 Thread david williams
http://developer.postgresql.org/docs/postgres/xfunc-sql.html#AEN30400   See section   9.2.4. SQL Table Functions   - Original Message - From: [EMAIL PROTECTED] Sent: Tuesday, October 01, 2002 4:25 PM To: [EMAIL PROTECTED] Subject: [SQL] Stored Procedures  Hi all. I'm looking for a little

Re: [SQL] Stored Procedures

2002-10-02 Thread david williams
Also,   the table definition MUST be in the Public Schema. I use my own schema names but in order for the table to be found by the function it ( the table ) must be in the public schema. Although it can be empty.   DaveGet more from the Web. FREE MSN Explorer download : http://explorer.msn.com

[SQL] trigger to maintain relationships

2002-12-11 Thread David M
I am maintaining a set of hierarchical data that looks a lot like a tree. (And my SQL is very rusty. And I'm new to postgres.) Questions: - 1.) Is the following a reasonable solution? Is there a postgres-specific way to handle this better? Is there a good generic SQL way to handle

Re: [SQL] trigger to maintain relationships

2002-12-11 Thread David M
ect NEW.node_id, ancestor_id from NEW left outer join ancestors on (NEW.parent_id = ancestors.node_id); return NEW;' language 'plpgsql'; create trigger tr_i_nodes after insert on nodes for each row execute procedure pr_tr_i_nodes(); David M wrote: > I am maintainin

[SQL] unsubscribe

2002-12-19 Thread david williams
unsubscribe _ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

[SQL] Returning row or rows from function?

2003-01-13 Thread David Durst
I want to create a function that will return a row or rows of a table is this possible? If so can someone replay with a complete example? ---(end of broadcast)--- TIP 2: you can get off all lists at once with the unregister command (send "unre

[SQL] returning setof in plpgsql

2003-01-21 Thread David Durst
I have a function that I want to return setof a table in plpgsql. Here is what I have: CREATE FUNCTION lookup_account(varchar(32)) RETURNS SETOF accounts AS ' DECLARE aname ALIAS FOR $1; rec RECORD; BEGIN select into rec * from accounts where accountname = aname; return rec; END;' LANGUAG

[SQL] NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index

2003-01-22 Thread David Durst
Can anyone tell me why postgres is creating a implicit index when I already have a PKEY specified Or am I just interpreting this all wrong? Here is the entry I am putting in: create sequence journal_line_id_seq increment 1 start 1; create table journal_lines ( journal_line_id int4 PRIMARY

[SQL] Scheduling Events?

2003-01-23 Thread David Durst
Is there anyway to schedule DB Events based on time? So lets say I had a table w/ depreciation schedules in it, I would like the DB to apply the formula and make the entries on the END of every month. ---(end of broadcast)--- TIP 3: if posting/read

Re: [SQL] Scheduling Events?

2003-01-23 Thread David Durst
On a side note, if the DB doesn't support this capability. Does anyone see a HORRIBLE issue w/ creating a C func something of this nature. int handle_temporal_events() { if(fork == 0) { //In here we monitor what time it is //And maintain a Datastructure w/ events //And update it eve

Re: [SQL] Scheduling Events?

2003-01-24 Thread David Durst
> On Thu, 23 Jan 2003, David Durst wrote: > >> Is there anyway to schedule DB Events based on time? > > Yes! cron > >> So lets say I had a table w/ depreciation schedules in it, >> I would like the DB to apply the formula and make the entries on the >> EN

Re: [SQL] Scheduling Events?

2003-01-24 Thread David Durst
here is a possible NON-Cron solution that a friend of mine came up w/ 1) Create a table w/ scheduled events and Account Ids attached to them. 2) Create a table w/ temporal event execution timestamps. 3) On journal entry check to see if there any schedule events for the Account 4) Check timestamp t

[SQL] Function for adding Money type

2003-01-24 Thread David Durst
Are there functions for adding and subtracting this type from itself? Or is there a simple way to do it? ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] Function for adding Money type

2003-01-24 Thread David Durst
> David, > >> Are there functions for adding and subtracting this type from itself? >> Or is there a simple way to do it? > > The MONEY type is depreciated, and should have been removed from the > Postgres source but was missed as an oversight. Use NUMERIC ins

[SQL] ERROR: Cannot display a value of type RECORD

2003-01-26 Thread David Durst
I recieve this error when executing the following function: select lookup_journal_entries(to_date('20030125','MMDD'), to_date('20030125','MMDD')); Here is the function itself: create function lookup_journal_entries(date,date) returns setof journal as ' selec

Re: [SQL] ERROR: Cannot display a value of type RECORD

2003-01-26 Thread David Durst
I figured out the issue, DH stupid mistake select entry_id, entry_description from lookup_journal_entries(to_date('20030125','MMDD'), to_date('20030125','MMDD')); > I recieve this error when executing the following function: > > select lookup_journal_entries(to_

[SQL] LONG - Question on dealing w/ numerics

2003-01-28 Thread David Durst
I have a function that is to create a Accounting JOURNAL entry. The strange thing is the function works for simple entries such as: Cash - Debit 100 A/R - Credit 100 But when I try to trick it or break it for testing purposes (IT DOES BREAK WHEN IT SHOULDN'T) on a entry like this: Cash - Debit

Re: [SQL] LONG - Question on dealing w/ numerics

2003-01-29 Thread David Durst
> "David Durst" <[EMAIL PROTECTED]> writes: >> insert into journal_lines >> (entry_id,account_id,line_type,line_amount) >> values (eid,aid,ltype,amount); >> select into line * from journal_lines where entry_id = eid AND >> account_id = aid

[SQL] Question about passing User defined types to functions

2003-01-30 Thread David Durst
is there a example on how to pass user defined types into a function?? What I am looking for is something of this nature. CREATE TYPE dumby_type AS (dumby_id int4, dumby_name text); create function kick_dumby(dumby dumby_type) returns INTEGER AS ' DECLARE somenumber integer; BEGIN return 1;

[SQL] Postgres MD5 Function

2003-01-31 Thread David Durst
Does there exsist a MD5 Function I can call??? If not, is there any interest in one? ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] Postgres MD5 Function

2003-02-02 Thread David Durst
Is there anywhere I can get these in binary? Or is my only option to compile Postgres from source?? > Larry Rosenman wrote: >> --On Friday, January 31, 2003 01:34:42 -0800 David Durst >> <[EMAIL PROTECTED]> wrote: >>> Does there exsist a MD5 Function I can call??? &

[SQL] Commenting PLPGSQL

2003-02-03 Thread David Durst
Is it possible to have comment lines inside PLPGSQL?? ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing li

[SQL] The folding of unquoted names to lower case in PostgreSQL is incompatible with the SQL standard

2003-03-12 Thread David Delorme
ver. I am in the process of changing to grass5 for all my map production. I have a schema called MAPINFO and a table called MAPINFO_MAPCATALOG. I need to fold unquoted names to uppercase. I really only need to change this behaviour for this schema. David Delorme

[SQL] Casting with character and character varying

2003-03-18 Thread David Loh
Hi all. Recently I face some problem with casting character type variable and varchar variable. The situation was like: I had 2 table, on table A, the user_name is defined as character(32), and table B uses varchar(32). I have 1 function and a trigger to manipulate with these data. Here's the func

[SQL] Help with LIKE

2003-03-20 Thread David Olbersen
omething instead of LIKE? Thoughts? -- David Olbersen iGuard Engineer 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Re: [SQL] What this parser mean?

2003-03-20 Thread David Witham
Hi Abdul, You may have lost the '' around the date specification in the to_char function when forming the string in Java. Before submitting the query, check the contents of the query string to make sure you still have the '' marks. Regards, David Witham -Original Mess

Re: [SQL] FUNCTIONS PROBLEM

2003-03-23 Thread David Witham
, val3 real, val4 char); See the SELECT reference page in the documentation. There are other ways (which may be better) to do this that don't require the output types to be specified with the query but this is the one I got going first so I stuck with it. Hope this helps. Regards, David

[SQL] Rows UPDATEd?

2003-05-30 Thread David Olbersen
ansaction? For what it's worth, a Perl script is doing this using the Pg module. I didn't see anything in the Pg man page describing this. It does cover INSERT and DELETE by using "$cmdStatus = $result->cmdStatus", but not UPDATE. Any suggestions? --

Re: [SQL] Rows UPDATEd? (solved!)

2003-05-30 Thread David Olbersen
acking. -- David Olbersen iGuard Engineer 11415 West Bernardo Court San Diego, CA 92127 1-858-676-2277 x2152 > -Original Message- > From: David Olbersen > Sent: Thursday, May 29, 2003 10:01 AM > To: [EMAIL PROTECTED] > Subject: [SQL] Rows UPDATEd? > > > >

[SQL] SELECT statement within libpq

2003-05-31 Thread David Klugmann
d not a transaction and a cursor ? Also does anyone have any generic routines for handling results of all types of select. Many thanks David _ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/

[SQL] (long) What's the problem?

2003-06-07 Thread David Olbersen
e load on this machine is zero when I attempt this, and no other processes are trying to use massive amounts of resources. This is a P3 550 with 512MB of RAM. I can provide more information if needed. Anybody have ideas about the problem? -- David Olbersen iGuard Engineer

[SQL] (long) What's the problem?

2003-06-07 Thread David Olbersen
e load on this machine is zero when I attempt this, and no other processes are trying to use massive amounts of resources. This is a P3 550 with 512MB of RAM. I can provide more information if needed. Anybody have ideas about the problem? -- David Olbersen iGuard Engin

  1   2   3   4   5   >