Re: [SQL] Query about SQL in PostgreSQL

2005-04-19 Thread KÖPFERL Robert
Postgres has the weird behavour to compare identifies case sensitive BUT to downcast any non-quoted identifier inside an SQL statement. So it is reccomended to just use lower case (for readability) -Original Message-From: Muhammad Nadeem Ashraf [mailto:[EMAIL PROTECTED]Sent: D

Re: [SQL] trying to do an update a bit confused.

2005-04-19 Thread KÖPFERL Robert
You're most probably missing a Where clause after the parentensis. see: -Original Message-From: Joel Fradkin [mailto:[EMAIL PROTECTED]Sent: Dienstag, 19. April 2005 16:06To: pgsql-sql@postgresql.orgSubject: [SQL] trying to do an update a bit confused. update tblcase  s

[SQL] Function to either return one or all records

2005-04-20 Thread KÖPFERL Robert
Hi all, I think I have got a usual problem. I'm asking here, however, because I wonder why it works this way. The problem is to write a fcn that eihter returns all records or just one/none filtered by some expression. For example get a value by id or return all values if the given id is null. F

Re: [SQL] How do I connect with something like JDBCManager to Pos

2005-04-22 Thread KÖPFERL Robert
You are most probably missing entries in pg_hba.conf and the listen= directive in postgres.conf |-Original Message- |From: Adriaan Botha [mailto:[EMAIL PROTECTED] |Sent: Freitag, 22. April 2005 11:23 |To: 'PostgreSQL' |Subject: [SQL] How do I connect with something like JDBCManager to |Po

[SQL] Meaning of ERROR: tuple concurrently updated

2005-05-18 Thread KÖPFERL Robert
Hi, I have got some kind of FIFO-queue table. New records are inserted and the oldest are DELETEd. Thus I run VACUUM ANALYZE; every night by cron. However I keep getting ERROR: tuple concurrently updated My research lead me to the point that this is VACUUM tothether with the INSERTs being issued

Re: [SQL] Meaning of ERROR: tuple concurrently updated

2005-05-19 Thread KÖPFERL Robert
|PFERL_Robert?= <[EMAIL PROTECTED]> writes: |> Thus I run VACUUM ANALYZE; every night by cron. However I |keep getting |> ERROR: tuple concurrently updated | |Have you got other processes also doing VACUUM ANALYZE? The only known |reason for this to happen is that two processes concurrently |A

Re: [SQL] postgre variable

2005-05-19 Thread KÖPFERL Robert
You should considder a variation as Volkan suggested. Otherwise the EXECUTE command might be what you are looking for. Execute a sql made up in a string |-Original Message- |From: bandeng [mailto:[EMAIL PROTECTED] |Sent: Donnerstag, 19. Mai 2005 04:11 |To: pgsql-sql@postgresql.org |Subjec

Re: [SQL] Calling Functions in RULEs

2005-05-23 Thread KÖPFERL Robert
Hi, I had no try wheter this solves your problem, but have you conciddered using an array or a self-written fcn which dicards your results i.E. SELECT my_discard_but_last( q1(), q2(), q3()); or SELECT ARRAY[ q1(), q2(), q3() ]; or SELECT ROW(q1(), q2(), q3()) as my_tripel_type; Have you consi

Re: [SQL] Need clarification

2005-05-23 Thread KÖPFERL Robert
Your're looking for the interval data type. timestamp - timestamp or date - date can be compared with interval CURRENT_TIMESTAMP - '4d'::interval => today - 4 days |-Original Message- |From: [EMAIL PROTECTED] |[mailto:[EMAIL PROTECTED] |Sent: Montag, 23. Mai 2005 11:52 |To: pgsql-sql@p

[SQL] Generic Join on Arrays

2005-05-30 Thread KÖPFERL Robert
Hi, I'm currently on retrieving meta infromation about db-schemas. As I found out, pg_proc relation provides me with data about defined stored procedures. Togehter with other relations as pg_type I can retrieve readable information, like: select proname, pd.description FROM pg_proc pp left outer

[SQL] Splitting a table for performance reasons

2005-06-02 Thread KÖPFERL Robert
Hi, I've got a table whose records are more less big. There's however jus one Int-column changed frequently. According to postgres' MVCC a whole record gets written, even if just one bit was changed. I think of splitting the table now in two parts, connected via the former PK. so like: a|b|data |

Re: [SQL] getting details about integrity constraint violation

2005-06-03 Thread KÖPFERL Robert
| |You can't, at the moment, except by parsing the text message. | |The "error fields" facility in the FE/BE protocol could be extended |in that direction, and I think there's already been some discussion |about it; but no one has stepped up with a concrete proposal, much |less volunteered to do t

Re: [SQL] How do write a query...

2005-06-06 Thread KÖPFERL Robert
You could have a look at the OFFSET and LIMIT modifiers as for untested example select ((select max( "AValue") from table group by "Num") - "AValue") as difference from table order by "AValue" desc offset 1 this says: give me a inversed ordered AValue-list but ommitting the first (biggest) and su

Re: [SQL] Returning a Cross Tab record set from a function

2005-06-06 Thread KÖPFERL Robert
|-Original Message- |From: Marc Wrubleski [mailto:[EMAIL PROTECTED] |Sent: Mittwoch, 01. Juni 2005 16:15 |To: pgsql-sql@postgresql.org |Subject: [SQL] Returning a Cross Tab record set from a function | [...] | |It seems I can do this from any higher level language, but it drives me |crazy

Re: [SQL] SQL equivalent to nested loop

2005-06-06 Thread KÖPFERL Robert
This is basicly a Join, a cross table i.e. select b.w from table a, table b where ... |-Original Message- |From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] |Sent: Montag, 06. Juni 2005 18:53 |To: pgsql-sql@postgresql.org |Subject: [SQL] SQL equivalent to nested loop | | |Hi, | |I bas

Re: [SQL] SQL equivalent to nested loop

2005-06-07 Thread KÖPFERL Robert
; |-Original Message- |From: Markus Bertheau [mailto:[EMAIL PROTECTED] |Sent: Dienstag, 07. Juni 2005 01:17 |To: KÖPFERL Robert |Cc: pgsql-sql@postgresql.org |Subject: RE: [SQL] SQL equivalent to nested loop | | |Dnia 06-06-2005, pon o godzinie 20:08 +0200, KÖPFERL Robert napisał(a): |&

[SQL] Experience with splitting a Table transparently

2005-06-08 Thread KÖPFERL Robert
Hi, I'm looking for people who have got experience at splitting a table with heavy records into two relations. In my case there exists one table with the mentioned heavy records. These are processed by a statemachine. Thus a bunch of columns gets changed several times in the livetime of one recor

Re: [SQL] Cursor need it?

2005-06-08 Thread KÖPFERL Robert
| |I am a new postgres user | |I want to get a list of tables from pg_tables where tables are like |‘%wo%’ (for example).. and then query that list …. | |Select count(*) from tableVARIABLENAMEFROMFIRSTQUERY | |In SQL SERVER I can do that using cursor but in postgresql I don’t |understand how to

[SQL] How-to suggestions to views

2005-06-10 Thread KÖPFERL Robert
Hi, in the course of my investigation on how to agglomerate or concat several tables using a view or functions the following little HOW-TO felt out. It is kind of a full fledged example of how to coalesce two tables using a view. However it is as it is and I am more less new to writing rules and t

[SQL] Converting varchar to bool

2005-06-15 Thread KÖPFERL Robert
Hi, I have currently trouble working with boolean values and variables in functions. As one would expect, a select '1'::bool, 't'::bool, 'true'::unknown::boolean works. As a select '1' tells us this seems as a conversion unknown->bool or ??maybe?? a boolean literal?? what-o-ever, at least my

Re: [SQL] Alias to a type

2005-06-22 Thread KÖPFERL Robert
Keep in mind, though. Using a DOMAIN in some definition 'seals' the domain. Yo can't change the domain unless you drop all dependent objects |-Original Message- |From: Veikko Mäkinen [mailto:[EMAIL PROTECTED] |Sent: Mittwoch, 22. Juni 2005 15:14 |To: pgsql-sql@postgresql.org |Subject: Re:

[SQL] Converting TBL->View complaining about indexes

2005-06-24 Thread KÖPFERL Robert
Hi, I'm currently trying to make a table (where many fcns depend on) become a view. Thus I did a _truncate_ and lots of _alter table drop constraint_ and _drop index_ and then CREATE OR REPLACE RULE "_RETURN" AS ON SELECT TO "smsMessagesrewtet" DO INSTEAD SELECT "MessageID",. Post

Re: [SQL] ENUM like data type

2005-06-29 Thread KÖPFERL Robert
| |I personally think that the ENUM data type is for databases |that are not well |designed. So, if you see the need for ENUM, that means you |need to re-think |your data design. | I disagree. In several relations (views of the world) one needs to have a hand full of well defined values while

[SQL] Insert rule and default values for PK

2005-06-29 Thread KÖPFERL Robert
Hi, I've a prolem inserting records in a view using different ways. I want to insert either way, with PK given and without PK which should then be taken by its DEFAULT stanza: insert into a_and_b(a) values (537)# id not given, self assigned insert into a_and_b(x) values (true)# id not give

Re: [SQL] ENUM like data type

2005-06-30 Thread KÖPFERL Robert
|> > I disagree. In several relations (views of the world) one |needs to have a |> > hand full of well defined values while |> > integers or bools are not appropriate and strings are too |free form. |> > For example male female or true and false. Whilst the |second has a well |> > known type, ot

[SQL] UNIT-tests and SQL

2005-07-01 Thread KÖPFERL Robert
What's your experience concerning unit tests for stored procedures on postgres? I'd expect to write wrappers for any *unit - programming language and use its *unit variant to do the actual testing. >From my feeling SQLunit is kind of too xml-ish and I'm not sure wheter I can save the output of som

Re: [SQL] Help on Procedure running external function

2005-07-04 Thread KÖPFERL Robert
Maybe you're looking for the VOLATILE attribute of a function. For the query optimizer it depends on what type of function you have how often it is called. |-Original Message- |From: Din Adrian [mailto:[EMAIL PROTECTED] |Sent: Dienstag, 05. Juli 2005 01:10 |To: Zac; pgsql-sql@postgresql.o

Re: [SQL] Are long term never commited SELECT statements are a pr

2005-07-22 Thread KÖPFERL Robert
You may get problems. At least we did. Having a long term transaction which seemingly just was one Begin with nothing, we encountered a siginifficant decrease of performance after some days (70 tx/sec) During that the pg_subtrans dir filled up with files and the IO-reads of the disk as well. After

[SQL] Function with dynamic command (EXECUTE) not working

2005-11-02 Thread Robert Blixt
) ) LOOP END LOOP; RETURN NEXT rRec; END; $BODY$ LANGUAGE 'plpgsql' VOLATILE; [/CODE] Any help is highly appreciated. Kind Regards, Robert ---(end of broadcast)--- TIP 6: explain analyze is your friend

[SQL] Extract week from date, start with sunday

2005-11-07 Thread Robert Blixt
correct week. Is there a workaround for this? Thanks! Kind Regards, Robert ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] Extract week from date, start with sunday

2005-11-07 Thread Robert Blixt
> -Ursprungligt meddelande- > Från: Janning Vygen [mailto:[EMAIL PROTECTED] > Skickat: den 7 november 2005 15:18 > Till: pgsql-sql@postgresql.org > Kopia: Robert Blixt > Ämne: Re: [SQL] Extract week from date, start with sunday > > Am Montag, 7. November 2005 14

[SQL] Why can't I use daylight savings time aware time zones with the AT TIME ZONE clause?

2006-03-02 Thread Davidson, Robert
pc-linux-gnu, compiled by GCC 2.95.3 Why can't I use daylight savings time aware time zones with the AT TIME ZONE clause? Many thanks, Robert Davidson

[SQL] Getting yyyy-mm-dd 00:00:00 in an arbitrary time zone

2006-03-03 Thread Davidson, Robert
amp(extract(YEAR from '2005-12-31 23:00:00-800' at time zone 'CST')||'-'||     extract(MONTH from '2005-12-31 23:00:00-800' at time zone 'CST')||'-'||     extract(DAY from '2005-12-31 23:00:00-800' at time zone 'CST')||' 00:00

Re: [SQL] Getting yyyy-mm-dd 00:00:00 in an arbitrary time zone

2006-03-03 Thread Davidson, Robert
It does, doesn't it. And it does it just the way it is documented in 9.9.3 AT TIME ZONE table 9.27. I was expecting it to be harder and didn't see I had figured out the right answer already - thanks! Robert -Original Message- From: Tom Lane [mailto:[EMAIL PROTECTED] Se

[SQL] Question re: relational technique

2006-03-12 Thread Robert Paulsen
Here is a sample table: item item_id int namechar attrib1 char attrib2 char attrib3 char One problem with the above is that the list of attributes is fixed. I am looking for a way to assign new, previously undefined, attributes to items without changing the table structure

Re: [SQL] Question re: relational technique

2006-03-12 Thread Robert Paulsen
On Sunday 12 March 2006 11:29, chester c young wrote: > --- Robert Paulsen <[EMAIL PROTECTED]> wrote: > > One problem with the above is that the list of attributes is fixed. I > > am looking for a way to assign new, previously undefined, attributes > > to > > &

Re: [SQL] Question re: relational technique

2006-03-13 Thread Robert Paulsen
On Monday 13 March 2006 03:03, Richard Huxton wrote: > Robert Paulsen wrote: > > This still requires me to modify the overall database structure but not > > the original item table. As my reward :) I get to use any type I choose > > for each new attribute. > > The

[SQL] removing "not null" modifier

2006-03-13 Thread Robert Urban
ll Primary key: event_pkey Triggers: RI_ConstraintTrigger_43210 The question: how can I get rid of the "not null" modifier on status_id? thanks, Robert Urban ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [SQL] in PlPgSQL function, how to use variable in a "select ...

2006-03-17 Thread Robert Treat
guage 'plpgsql' IMMUTABLE STRICT; > select test('001'); > This function would work on 8.1, provided you created the sql statement correctly: query_value := 'SELECT col2 FROM ' ||lengendTableName||' WHERE col1 = \'' || col1_value || '\'';

[SQL] plpqsql and RETURN NEXT requires a LOOP?

2006-03-21 Thread Davidson, Robert
result set. Is this correct? If so, I would be happy to post this example to the interactive docs (which could use a RETURN NEXT example), but wanted to make sure that I wasn’t missing something more elegant or more efficient. Best Regards, Robert Davidson

[SQL] Using a parameter in Interval

2006-03-21 Thread Davidson, Robert
;testing" near line 2 I have tried concatenating it as a declared variable (with and without apostrophes) 1 weeks And ‘1 weeks’ With no success. Any tips? Many thanks, Robert

Re: [SQL] Using a parameter in Interval

2006-03-22 Thread Davidson, Robert
the outlook-ism, -Owen -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Davidson, Robert Sent: Tuesday, March 21, 2006 4:53 PM To: pgsql-sql@postgresql.org Subject: [SQL] Using a parameter in Interval No matter how I try to concatenate, I can't seem to get

[SQL] Function Parameters in GROUP BY clause cause errors

2006-03-22 Thread Davidson, Robert
Title: Function Parameters in GROUP BY clause cause errors When I use a parameter in a query which aggregates it fails with a GROUP BY error. What syntax can I use to avoid this error? CREATE TABLE test (email_creation_datetime timestamp); INSERT INTO test VALUES ('2006-03-20 09:00'); INSE

Re: [SQL] Function Parameters in GROUP BY clause cause errors

2006-03-23 Thread Davidson, Robert
intimidated by figuring out what to download to try compiling source. Best Regards, Robert Davidson -Original Message- From: Tom Lane [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 22, 2006 8:27 PM To: Davidson, Robert Cc: pgsql-sql@postgresql.org; pgsql-bugs@postgresql.org Subject

[SQL] uniqueness constraint with NULLs

2009-06-28 Thread Robert Edwards
I have a table with a uniqueness constraint on three columns: # \d bobtest Table "public.bobtest" Column | Type | Modifiers +-+-- id | integer | not null default nextval('bob

Re: [SQL] uniqueness constraint with NULLs

2009-06-29 Thread Robert Edwards
A. Kretschmer wrote: In response to Robert Edwards : Can anyone suggest a way that I can impose uniqueness on a and b when c is NULL? Sure, use a functional index: test=# create table bobtest (a int, b int, c int); CREATE TABLE test=*# create unique index idx_bobtest on bobtest(a,b,coalesce

Re: [SQL] uniqueness constraint with NULLs

2009-06-29 Thread Robert Edwards
Thanks for all these great ideas! Craig Ringer wrote: On Mon, 2009-06-29 at 15:42 +1000, Robert Edwards wrote: Can anyone suggest a way that I can impose uniqueness on a and b when c is NULL? One way is to add an additional partial index on (a,b): CREATE INDEX bobtest_ab_unique ON bobtest

[SQL] ERROR: null value in column "id" violates not-null constraint

2009-10-10 Thread Robert Paulsen
varying(256) NOT NULL, passwd character varying(256) NOT NULL, url character varying(4096), notes text ); CREATE SEQUENCE vault_id_seq INCREMENT BY 1 NO MAXVALUE NO MINVALUE CACHE 1; ALTER TABLE public.vault_id_seq OWNER TO robert; SELECT pg_catalog.setval('vault

Re: [SQL] ERROR: null value in column "id" violates not-null constraint

2009-10-10 Thread Robert Paulsen
On Saturday 10 October 2009 1:46 pm, Tom Lane wrote: > Robert Paulsen writes: > > I have a database with a sequence field as a primary key in a table and > > can no longer insert data into it as it gets the subject error message. > > Does the table actually have a default

Re: [SQL] ERROR: null value in column "id" violates not-null constraint

2009-10-10 Thread Robert Paulsen
On Saturday 10 October 2009 2:00 pm, Robert Paulsen wrote: > > So no default for id. What should it be? > > Something like one of this? > > default nextval('vault_id_seq') > Should have tried that before posting last message -- it worked. Thanks! -- Sent vi

Re: [SQL] ERROR: null value in column "id" violates not-null constraint

2009-10-10 Thread Robert Paulsen
On Saturday 10 October 2009 3:16 pm, Tom Lane wrote: > Robert Paulsen writes: > > On Saturday 10 October 2009 2:00 pm, Robert Paulsen wrote: > >> So no default for id. What should it be? > >> default nextval('vault_id_seq') > > > > Should have tr

Re: [SQL] ERROR: null value in column "id" violates not-null constraint

2009-10-10 Thread Robert Paulsen
On Saturday 10 October 2009 4:12 pm, Tom Lane wrote: > Robert Paulsen writes: > > I do have a question, though, I fixed things as indicated above: > > id integer DEFAULT nextval('vault_id_seq') NOT NULL, > > Dump gave back > > id integer DEFAULT n

Re: [SQL] ERROR: null value in column "id" violates not-null constraint

2009-10-11 Thread Robert Paulsen
On Sunday 11 October 2009 3:32 am, Dmitriy Igrishin wrote: > Hello. > Note, that you may use SERIAL data type and PostgreSQL will implicitly > create sequence for you column, for example, > CREATE table test ( > id SERIAL NOT NULL PRIMARY KEY, -- PostgreSQL will implicitly > create 'tes

Re: [SQL] ERROR: null value in column "id" violates not-null constraint

2009-10-11 Thread Robert Paulsen
On Sunday 11 October 2009 8:22 am, Dmitriy Igrishin wrote: > Hello! > > Please, read pg_dump(1) manual page. You will find this text in it: > "It is not guaranteed that pg_dump's output can be loaded into a server of > an older major version -- not even if the dump was taken from a server > of t

Re: [SQL] Dollar quoted strings

2010-03-25 Thread Robert Manning
Hi John, The type code 2003 indicates an SQL99 column type of ARRAY, which is not currently supported for rendering/editing. Here is the feature request for SQuirreL SQL Client to track this feature: https://sourceforge.net/tracker/?func=detail&aid=2972937&group_id=28383&atid=393417 Rob On Wed

Re: [SQL] Performance of NOT IN and <> with PG 9.0.4

2011-05-25 Thread Robert Haas
On Tue, May 24, 2011 at 7:45 AM, Jasmin Dizdarevic wrote: > Hi, > found the problem. > 238 sec. with set enable_material = 'on' > 4(!) sec. with set enable_material = 'off' > > @Robert Haas: I thought it would be interesting to you, because > you've c

Re: [SQL] Performance of NOT IN and <> with PG 9.0.4

2011-05-25 Thread Robert Haas
e's only one materialize node in the whole plan. And just incidentally, do you have any of the other enable_* settings turned off? -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To ma

Re: [SQL] Performance of NOT IN and <> with PG 9.0.4

2011-05-27 Thread Robert Haas
he EXPLAIN ANALYZE output and try to figure out which part of the plan is being mis-estimated. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql

Re: [SQL] [seapug] Re: [BUGS] pg_dump: aborting because of server version mismatchT

2012-05-03 Thread Robert Bernier
nd it wouldn't generate any errors although I wouldn't want to test it out on important stuff. Robert Bernier On Wednesday, May 02, 2012 02:53:53 pm Kevin Grittner wrote: > Mitesh Shah wrote: > > *pg_dump: server version: 9.1.2; pg_dump version: 9.0.5* > > *pg_dump: abor

Re: [SQL] Insane behaviour in 8.3.3

2012-06-15 Thread Robert Edwards
On 14/06/12 18:39, Achilleas Mantzios wrote: dynacom=# SELECT id from items_tmp WHERE id=1261319 AND xid=currval('xadmin_xid_seq'); id (0 rows) dynacom=# -- THIS IS INSANE Have you tried: SELECT id from items_tmp WHERE id=1261319 AND xid=currval('xadmin_xid_seq'::text) or even: SE

[SQL] [noob] How to optimize this double pivot query?

2012-10-01 Thread Robert Buck
I have two tables that contain key-value data that I want to combine in pivoted form into a single result set. They are related to two separate tables. The tables are: test_results, test_variables, metric_def, metadata_key. The latter two tables are enum-like tables, basic descriptors of data stor

Re: [SQL] [noob] How to optimize this double pivot query?

2012-10-01 Thread Robert Buck
sql-ow...@postgresql.org] *On Behalf Of *Robert Buck > *Sent:* Monday, October 01, 2012 8:47 PM > *To:* pgsql-sql@postgresql.org > *Subject:* [SQL] [noob] How to optimize this double pivot query? > > ** ** > > I have two tables that contain key-value data that I want to combine in &

Re: [SQL] [noob] How to optimize this double pivot query?

2012-10-02 Thread Robert Buck
Hi Samuel Thank you. This may be a bit of a stretch for you, but would it be possible for me to peek at a sanitized version of your cross tab query, for a good example on how to do this for this noob? This will be pretty common in my case. The biggest tables will get much larger as they are r

Re: [SQL] [noob] How to optimize this double pivot query?

2012-10-03 Thread Robert Buck
from > multiple tables into the same row. > > > > On Tue, Oct 2, 2012 at 12:57 PM, Samuel Gendler > wrote: > >> >> >> On Tue, Oct 2, 2012 at 2:45 AM, Robert Buck wrote: >> >>> Hi Samuel >>> >>> Thank you. This may be a bit

Re: [SQL] [noob] How to optimize this double pivot query?

2012-10-03 Thread Robert Buck
can also run this in a defined transaction boundary rather than using auto-commit. Right now I am thumbing through your email and trying it out. Bob On Wed, Oct 3, 2012 at 12:23 PM, Robert Buck wrote: > Thank you, Samuel. > > I am trying some of this out right now... > > This is gr

[SQL] Correlated Update Query

2013-06-02 Thread Robert DiFalco
I have an update query that I'm not sure if I am taking a good approach or a naive one. It works but seems ugly. I have a table named "contacts". Contacts have a user_id and an owner_id. There is also a one to many relationship between contacts and email addresses. Users also have an email addres

[SQL] on connect/on disconnect

2006-09-10 Thread Robert Edwards
(this is my first post to this list...) I am wondering if Postgres, and/or SQL in general, has a facility to run a function at connection set-up time (after a successful connection attempt) and/or at session completion (or disconnect)? I want to pre-populate a table (actually an INSERT rule on a

Re: [SQL] on connect/on disconnect

2006-09-10 Thread Robert Edwards
rotocol is that this is not allowed. Anyway, I still need to know if running functions during connection setup and tear-down, or change of user, is possible or not. Cheers, Bob Edwards. Aaron Bono wrote: On 9/10/06, *Robert Edwards* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> w

Re: [SQL] on connect/on disconnect

2006-09-11 Thread Robert Edwards
Markus Schaber wrote: Hi, Robert, Robert Edwards wrote: (this is my first post to this list...) Welcome here. :-) I am wondering if Postgres, and/or SQL in general, has a facility to run a function at connection set-up time (after a successful connection attempt) and/or at session

Re: [SQL] hi i am gettin error when i am deleting a function from

2006-09-11 Thread Robert Edwards
Can you give us the actual delete command you are issuing? You need to specify the types of the function arguments when deleting functions, for example: DELETE FUNCTION my_sum (int, int); etc. Cheers, Bob Edwards. Penchalaiah P. wrote: Hi good morning to all…. I created some functions in

Re: [SQL] [GENERAL] Any documatation about porting from Oracle to PostgreSQL

2006-10-18 Thread Robert Treat
) Felix, in case your still watching, a (in theory) more up to date link would be found at http://www.postgresql.org/docs/techdocs.3. Oh, and please don't crosspost across 3 different lists in the future, it just creates noise for the rest of us. -- Robert Treat Build A Brighter LAMP ::

[SQL] Index ANDing & Index ORing

2007-02-05 Thread Hiltibidal, Robert
Does postgres have support for index ANDing and index ORing? Thanks! -Rob PRIVILEGED AND CONFIDENTIAL This email transmission contains privileged and confidential information intended only for the use of the individual or entity named above. If the reader of the email is not the int

[SQL] Index Anding

2007-02-05 Thread Hiltibidal, Robert
Good Morning I am considering postgres for a project I am currently using DB2 for. The database is a 200 gb database on db2. The os is AIX 5.2 on a p5 series box with 2 processors and 7 gb ram. I have 300 gb in local scsi mirrored and 300 gb of shark disk raid5. The database

Re: [SQL] Index Anding

2007-02-05 Thread Hiltibidal, Robert
This is excellent information Thank you! -Original Message- From: Andrew Sullivan [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 31, 2007 9:53 AM To: Hiltibidal, Robert; pgsql-sql@postgresql.org Subject: Re: Index Anding You probably want to take these questions to the -general

[SQL] Compilation errors

2007-02-05 Thread Hiltibidal, Robert
Is this a good group to post compilation errors to? PRIVILEGED AND CONFIDENTIAL This email transmission contains privileged and confidential information intended only for the use of the individual or entity named above. If the reader of the email is not the intended recipient or the employee

[SQL] Compilation Error AIX

2007-02-05 Thread Hiltibidal, Robert
I am getting this error make -C port all make[3]: Entering directory `/db2/logs/downloads/postgres/postgresql-8.2.1/src/backend/port' gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -I../../../src/include -c

Re: [SQL] Index Anding

2007-02-05 Thread Hiltibidal, Robert
I will investigate this. Our gcc is only able to compile 32 bit. I think I will have to see if I can get/compile a 64 bit gcc I appreciate the help! -R -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chris Browne Sent: Thursday, February 01, 2007 4:45

Re: [SQL] Insert into a date field

2007-02-05 Thread Hiltibidal, Robert
Try this: '1/9/1963' I'm interpreting your date to be January 9, 1963. -R From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ezequias Rodrigues da Rocha Sent: Friday, February 02, 2007 7:08 AM To: pgsql-sql@postgresql.org Subject: [SQL] I

Re: [SQL] query to select a linked list

2007-05-09 Thread Robert Edwards
Hi Louis-David, I also have written a forum application using PostgreSQL. My schema has a "threadid" for each posting, which is actually also the "messageid" of the first posting in the thread, but that is irrelevant. I can then just select all messages belonging to that thread. The actual hie

Re: [SQL] accounting schema

2008-02-06 Thread Robert Edwards
Medi Montaseri wrote: Hi, I am learning my way into Accounting and was wondering how Accounting applications are designed. perhaps you could point the way On one hand, accountants talk about a sacret equation A = L + OE (Asset = Libility + Owner Equity) and then under each categories the

Re: [SQL] Proposed archival read only trigger on rows - prevent history modification

2008-02-21 Thread Robert Treat
ves (on update do nothing) which tends to work pretty well. You can also add triggers into the mix to raise errors on update. Also dont forget to revoke update/delete/install privileges as appropriate. And look into vacuum freeze. -- Robert Treat Build A Brighter LAMP :: Linu

Re: [SQL] May I have an assistance on CREATE TABLE Command

2008-09-17 Thread Robert Edwards
You could: INSERT INTO REGION VALUES (33, 'New Dar'); UPDATE DISTRICT SET region_id = 33 WHERE region_id = 99; DELETE FROM REGION WHERE region_id = 99; UPDATE REGION SET region_name = 'Dar es Salaam' WHERE region_id = 33; Of course, if there is no uniqueness constraint on region_name then yo

Re: [SQL] Problem with pg_connect() in PHP

2008-09-25 Thread Robert Edwards
Looks like you are missing the php_pgsql extension (I assume you are running on a Windows server). On Debian GNU/Linux, it is called php5-pgsql (or php4-pgsql, as appropriate). Not sure what it would be called for Windows, but something similar. Simply enabling it (by uncommenting the line in yo

Re: [SQL] fetching rows

2000-11-16 Thread Robert B. Easter
you'd > do: > > select * from films limit 25,26; > > or > > select * from files limit 25 offset 26; -- Robert B. Easter [EMAIL PROTECTED] - - CompTechNews Message Board http://www.comptechnews.com/ - - CompTechServ Tech Services http://www.comptechserv.com/ - -- http://www.comptechnews.com/~reaster/

Re: [SQL] how many rows? [was Re: fetching rows]

2000-11-17 Thread Robert B. Easter
On Friday 17 November 2000 04:01, Arnaud Vandyck wrote: > "Robert B. Easter" wrote: > > > you can't do that with a cursor, but you can use they mysql-ism called > > > a limit clause. for example, to fetch rows 26-50 from that query, > > > you'

Re: [SQL] Help with Procedures in pgsql

2000-11-30 Thread Robert B. Easter
Isn't that the right sintax to declare variables in pgsql? What's wrong > with it? > Does my procedure contain any other errors that will appear later? > > > > Thanks -- Robert B. Easter [EMAIL PROTECTED] - - CompTechNews Message Board http://www.comptechnews.com/ - - CompTechServ Tech Services http://www.comptechserv.com/ - -- http://www.comptechnews.com/~reaster/

Re: [SQL] Where Can I find JDBC driver.

2000-12-11 Thread Robert B. Easter
with the source. -- Robert B. Easter [EMAIL PROTECTED] - - CompTechNews Message Board http://www.comptechnews.com/ - - CompTechServ Tech Services http://www.comptechserv.com/ - -- http://www.comptechnews.com/~reaster/

Re: [SQL] Null comparison

2000-12-13 Thread Robert B. Easter
are > > NULL? select a.name, b.cost from a, b where a.type=b.type > > where a.type=b.type or (a.type is null and b.type is null) > should do it. > > > I'd like to make this as easy as possible so I can put it into a > > "translation" function. Currently I

Re: [SQL] How to represent a tree-structure in a relational database

2000-12-13 Thread Robert B. Easter
ay query is entirely once table linking to itself on > (hopefully) indexed fields, in my expreience it runs very, very fast. > 4. My PHP developer has reprogrammed the easily available PHP Tree > Control to uses this table structure (I don't know if he's giving it > out, but he said it wasn't very difficult). > > -Josh Berkus -- Robert B. Easter [EMAIL PROTECTED] - - CompTechNews Message Board http://www.comptechnews.com/ - - CompTechServ Tech Services http://www.comptechserv.com/ - -- http://www.comptechnews.com/~reaster/

Re: [SQL] Documentation for CASE

2000-12-16 Thread Robert B. Easter
r SQL language elements etc can be used in assignments too. On Saturday 16 December 2000 12:39, Peter Eisentraut wrote: > Albert REINER writes: > > I think that the documentation for CASE is not very clear: > > Maybe you will like this better (from upcoming 7.1): > > http

Re: [SQL] substring ..

2000-12-19 Thread Robert B. Easter
| [EMAIL PROTECTED] > www.pgsql.com | www.hub.org > 1-902-542-0713| 1-902-542-3657 > - > Facsimile : 1 902 542 5386 > IRC Nick : bignose > PGP Public Key : http://bignose.hub.org/public.txt --

Re: Sv: [SQL] how to build this query ??? Please help !!!

2001-01-08 Thread Robert B. Easter
n "count(*)") and > AFAIK in no other relational database. I really cannot imagine any > equivalent join-statement (or anything else like a subquery) which > brings the same results! Does this at all correlate with the philosophy > of a relational database? > > Best r

Re: Sv: [SQL] how to build this query ??? Please help !!!

2001-01-08 Thread Robert B. Easter
remove "AS b". On Monday 08 January 2001 17:24, Robert B. Easter wrote: > I was playing around with subselects and managed to crash the backend (if > you try, it can be done I guess): > > create table x (a numeric); > create table y (b numeric); > > insert int

[SQL] subselect test

2001-01-08 Thread Robert B. Easter
? Anyway, these new complex queries seem to be doing something in 7.1 cvs! -- ---- Robert B. Easter [EMAIL PROTECTED] - -- CompTechNews Message Board http://www.comptechnews.com/ -- -- CompTechServ Tech Services http://www.comptechserv.com/ -- -- http://www.comptechnews.com/~reaster/

[SQL] MATCH

2001-01-09 Thread Robert B. Easter
MATCH is not implemented? -- Robert B. Easter [EMAIL PROTECTED] - -- CompTechNews Message Board http://www.comptechnews.com/ -- -- CompTechServ Tech Services http://www.comptechserv.com/ -- -- http://www.comptechnews.com/~reaster/

Re: [SQL] Trouble with subqueries

2001-01-19 Thread Robert B. Easter
ed in returning a group row from a grouped table are aggregates on the group returned by that row, not the whole (ungrouped) table. Hope that makes sense. -- Robert B. Easter [EMAIL PROTECTED] - -- CompTechNews Message Board http://www.comptechnews.com/ -- -- CompT

[SQL] cannot get CREATE TABLE AS to work

2001-03-09 Thread Creager, Robert S
id? time psql -d tassiv -c "insert into observationsII( ra, decl, mag, smag, file_id ) select ra, decl, mag, smag, file_id from observations" INSERT 0 315446 0.01u 0.01s 3:13:22.39 0.0% Robert Creager Senior Software Engineer Client Server Library 303.673.2365 V 303.661.5379 F 888.91

RE: [SQL] cannot get CREATE TABLE AS to work

2001-03-09 Thread Creager, Robert S
Well, that explains why I wasn't seeing any appreciable speed increase with the INITIALLY DEFERRED. I tried mucking in pg_class, and saw a 3 fold increase in insert speed on inserts into my table with 2 relational triggers. SET CONSTRAINTS ALL DEFERRED does nothing to very little to increase th

RE: [SQL] Rule/currval() issue

2001-03-14 Thread Creager, Robert S
Tom, You indicate trigger, rather than rule. Going by Momjian's book, he indicates that rules are "...ideal for when the action affects other tables." Can you clarify why you would use a trigger for this? I'm asking because I have no clue how to use rules or triggers, but need one or the othe

[SQL] Determine the time difference from records in a select

2001-06-13 Thread Creager, Robert S
each unique IP and the time difference from the latest hit to the first hit. I can do this in scripts, but was wondering if there is a pure SQL query/queries way to accomplish this. Help? Rob Robert Creager Senior Software Engineer Client Server Library 303.673.2365 V 303.661.5379 F 888.912.4

<    1   2   3   >