Re: [SQL] [GENERAL] SQL query problem (many table in FROM statement and many LEFT JOIN's)

2003-10-14 Thread Tom Lane
"Marek Lewczuk" <[EMAIL PROTECTED]> writes: > ... It also working fine. The question is, why my first query isn't > working: > SELECT > _CON.con_id, > _MOD.mod_ty, > _VER.version, > _YEA.year, > _CON.dri_id, > _CON.man_cod, > _ENG.eng_pow > FROM > db_data.mda_mod _MOD, > db_

Re: [SQL] sql performance and cache

2003-10-14 Thread Tom Lane
"Chris Faulkner" <[EMAIL PROTECTED]> writes: > I am seeing this message in my logs. > "bt_fixroot: not valid old root page" That's not good. I'd suggest reindexing that index. regards, tom lane ---(end of broadcast)--- TIP

Re: [SQL] [postgres] Foreign Key

2003-10-14 Thread Stefan Sturm
Hallo, > > In der Tabelle status befinden sich Datensätze. Die Tabelle logins > ist > > leer. Nun versuche ich folgenden Befehl: > > > > ALTER TABLE "public"."login " ADD CONSTRAINT "test" FOREIGN KEY > > ("status__id") REFERENCES "public"."status"("id") > > ON DELETE RESTRICT > > ON UPDATE RE

[SQL] Escaping the $1 parameter in stored procedures

2003-10-14 Thread robert
I'm running Postgres 7.3.2 in Redhat 9.0. I'm trying to execute a function below defined as a stored procedure ALTER TABLE tms_schedule DROP CONSTRAINT "$1"; However, postgres thinks the "$1" is a parameter value. How do I tell postgres to treat it as a literal $1? TIA, Robert

[SQL] removing precision from timestamp (microseconds) ..

2003-10-14 Thread Marc G. Fournier
>From the docs, if you do: traffic=# select CURRENT_TIMESTAMP(0); timestamptz 2003-10-13 11:04:09-03 (1 row) the 0 reduces the precision of the time to get rid of the microseconds ... is there a way of having this done by default on, if anything, a per connection

[SQL] HELP ME

2003-10-14 Thread jagan reddy
Where can i find a tutorial on PL/PGSQL?.Help me by listing some sites to guide me in this context. Thanks. __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com ---(end of broadcast)

[SQL] about postgre SQL download

2003-10-14 Thread Illusiontechnologies
how can we download the postgre SQL database Thank you   Jagdish RautWeb DeveloperIllusion Technologies--Illusion Technologies: A complete Design and Development company.IndiaPh:   009

Re: [SQL] Oracle 'connect by prior' now eaiser in 7.3?

2003-10-14 Thread Thomas Wegner
Hello! Can anyone help me to use connectby() with my structure? I cannot change the name of tables. It is a import! -- Thomas Wegner "Thomas Wegner" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > Hello, > > i have a table like this: > >

Re: [SQL] Oracle 'connect by prior' now eaiser in 7.3?

2003-10-14 Thread Thomas Wegner
Hello, i have a table like this: CREATE TABLE "public"."WINUSER" ( "ID_WINUSER" INTEGER NOT NULL, "STATUS" INTEGER NOT NULL, "CUSTOMERID" VARCHAR(8) NOT NULL, "CUSTOMERPW" VARCHAR(100) NOT NULL, "EMAIL" VARCHAR(100) NOT NULL, "REF_ID_WINUSER" INTEGER, PRIMARY KEY("ID_WINUSER"), ) WI

[SQL] smart(er) column aliases

2003-10-14 Thread Iain Sinclair
(B (B (BHi all, (B  (BTo take a simple example here is what I (Bwanted to do: (B  (B   select 1 as one, 2 as two, (Bone + two as three; (B  (Bbut it doesn't work. I've checked it out (Bthough, and I found that I can do this: (B  (B   select one, two, one + two (Bfrom (select 1 a

[SQL] security definer function

2003-10-14 Thread Tomek
Hi I have two functions: A) function defined with "SECURITY DEFINER" B) function defined with "SECURITY INVOKER" Function A calls function B. How is the function b called - with rights of definer of function A, or rather with rights of caller of function A ? Regards, Tomasz Myrta -

Re: [SQL] PG equivalent to Sybase varbinary

2003-10-14 Thread Bill Pfeiffer
Thanks for the response. I'll look into re-running the ddl using the bytea datatype the next time I perform the setup I'm using. (I used a Sybase SQL Anywhere db in the meantime to get me back on track with the task at hand). Thanks again, Bill "Richard Huxton" <[EMAIL PROTECTED]> wrote in messa

Re: [SQL] select

2003-10-14 Thread Janko Richter
roberto wrote: Dear friends, I have this table table work{ day date, hour integer, } select * from work; date | text --- 1-1-20031 1-1-20031 2-1-20035 3-1-200310 5-1-200315 how can i obtain this? date |text --- 1-1-20032 2-1-2003

[SQL] get diagnostics not supported by ecpg?

2003-10-14 Thread Slava Gorski
Hi all, It seems that get diagnostics is not supported by ecpg in postgresql 7.3, I always get the following error when trying to use it: ERROR: parse error at or near "diagnostics" For example, the following code does not compile: #include int main() { EXEC SQL BEGIN DECLARE SECTION;

[SQL] select

2003-10-14 Thread roberto
Dear friends, I have this table table work{ day date, hour integer, } select * from work; date | text --- 1-1-20031 1-1-20031 2-1-20035 3-1-200310 5-1-200315 how can i obtain this? date |text --- 1-1-20032 2-1-20035 3-1-2003

Re: [SQL] about postgre SQL download

2003-10-14 Thread Richard Huxton
On Thursday 09 October 2003 11:09, Illusiontechnologies wrote: > how can we download the postgre SQL database Start from http://www.postgresql.org/ Click the "download" link near the top, and choose a country near to you. There are source downloads available for a variety of *nix compatible syste

Re: [SQL] Oracle 'connect by prior' now eaiser in 7.3?

2003-10-14 Thread Joe Conway
Thomas Wegner wrote: SELECT "ID_WINUSER" FROM connectby('"WINUSER"', '"ID_WINUSER"', '"REF_ID_WINUSER"', 4, 0, '~') AS t("ID_WINUSER" integer) and get this error: ERROR: Query-specified return tuple not valid for Connectby: wrong number of columns Please see the documentation (README.tablefunc).

Re: [SQL] get diagnostics not supported by ecpg?

2003-10-14 Thread Peter Eisentraut
Slava Gorski writes: > What am I doing wrong? Or it's just not supported by ecpg in 7.3? Indeed. -- Peter Eisentraut [EMAIL PROTECTED] ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.or

[SQL] How to determine the current user

2003-10-14 Thread Michael Brusser
I'm running Pg v7.3.4 I have a function where I need to determine the current user. But since the function was created with option "SECURITY DEFINER" (it has to be this way) current_user returns the name of creator, rather than current user. Is there a way in such function find out the real curr

Re: [SQL] How to determine the current user

2003-10-14 Thread Sean Chittenden
> I'm running Pg v7.3.4 > I have a function where I need to determine the current user. > But since the function was created with option "SECURITY DEFINER" > (it has to be this way) current_user returns the name of creator, > rather than current user. > > Is there a way in such function find out

Re: [SQL] [postgres] Foreign Key

2003-10-14 Thread Stefan Sturm
Sorry für die letzte Mail. Habe bei der falschen Mail auf Antwort geklickt. Nochmals Sorry, Stefan > -Original Message- > From: Stefan Sturm [mailto:[EMAIL PROTECTED] > Sent: Monday, October 13, 2003 12:48 PM > To: [EMAIL PROTECTED] > Subject: RE: [SQL] [postgres] Foreign Key > > Hallo,

Re: [SQL] [postgres] Antwort von Microsoft auf Mail hier!

2003-10-14 Thread Cornelia Boenigk
Guten morgen miteinander > aber auf > jeden Fall gehen die Mails an [EMAIL PROTECTED] > seit Freitag auch an die (englischsprachige) Liste pgsql-sql bei > postgresql.org, was eindeutig fragwuerdig ist. Das habe ich gesehen, ich kann mir aber keinen Reim drauf machen, wie das moeglich ist. > Viel

Re: [SQL] [postgres] Foreign Key

2003-10-14 Thread Stefan Sturm
Ich melde mich doch. Ich sitze hier halt uns arbeite. Ich arbeite aber derzeit (außer der Formel1 Auswertung) nur an meinen Sachen. Und ich mache das schon ganz schön Fortschritte. Michelle hat gerade hier geklingelt. Sie kommt heute um ca. 19 Uhr zu uns. > -Original Message- > From: Stef

Re: [SQL] [postgres] Antwort von Microsoft auf Mail hier!

2003-10-14 Thread Danny Tramnitzke
Ja, sone Mail habe ich auch mal bekommen.. da ist wohl was zwischen MS und Yahoo im Busch ... Gruß, Danny Am Mon, 13 Oct 2003 14:18:41 +0200 hat Alvar Freude <[EMAIL PROTECTED]> geschrieben: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hallo allerseits, > > wer hat denn Zugriff auf di

[SQL] Inquiry From Form [pgsql]

2003-10-14 Thread Bram
Hello, I\'m looking for info about Join conditions in Postgre\'. I\'m head developer of ikonboard and we\'re trying to optimise it, with joins but how does this work in postgre can i download a manual anywhere? Thanks in advanced, Bram Wijnands Head IB Developer [EMAIL PROTECTED] -

[SQL] [postgres] Foreign Key

2003-10-14 Thread Stefan Sturm
Hallo zusammen, ich würde gerne folgenden Foreign Key in meine DB einbauen. Leider bekomme ich immer eine Fehlermeldung. Hier die Situation: Ich habe 2 Tabellen: status: ID Numeric Name Text logins: ID Numeric Name Text Status__id Numeric In der Tabelle status befinden sich Datensätze. Die Tabe

Re: [SQL] [postgres] Foreign Key

2003-10-14 Thread Stefan Sturm
Hallo, > Hallo, > > > Ich tippe mal, das der PostgreSQL Manager da selber ein Timeout > macht. > > Habe es auch mal mit phpPgAdmin versucht. Der läuft sich Tod. > > Ist die Tabelle groß? Da kann es natürlich sein, dass da ein ganzer > Haufen > an Updates gemacht werden muss, und dass gerade dies

[SQL] [postgres] Copy Timestamp NULL

2003-10-14 Thread Danny Tramnitzke
Hi Leute, Ich habe vor einiger Zeit eine spezielle Frage gestellt, die nicht ganz beantwortet wurde. Also es geht darum, dass ich in eine Postgres Tabelle per Copy Daten laden möchte. Bei einer Spalte handelt es sich um Timestamp NULL ... In der Source-Datei befinden sich in dieser Spalte ISO

Re: [SQL] [PERFORM] sql performance and cache

2003-10-14 Thread Christopher Kings-Lynne
I have two very similar queries which I need to execute. They both have exactly the same from / where conditions. When I execute the first, it takes about 16 seconds. The second is executed almost immediately after, it takes 13 seconds. In short, I'd like to know why the query result isn't being c

Re: [PERFORM] [SQL] sql performance and cache

2003-10-14 Thread Christopher Kings-Lynne
Nested Loop (cost=0.00..147.11 rows=1 width=148) (actual time=84.00..12323.00 rows=67 loops=1) The planner estimate doesn't seem to match reality in that particular step. Are you sure you've run: ANALYZE oscar_node; ANALYZE oscar_point; And you could even run VACUUM FULL on them just to make

Re: [SQL] [PERFORM] sql performance and cache

2003-10-14 Thread Wei Weng
On Sat, 11 Oct 2003, Christopher Kings-Lynne wrote: > > > I have two very similar queries which I need to execute. They both have > > exactly the same from / where conditions. When I execute the first, it takes > > about 16 seconds. The second is executed almost immediately after, it takes > > 13

Re: [SQL] [PERFORM] sql performance and cache

2003-10-14 Thread scott.marlowe
On Tue, 14 Oct 2003, Wei Weng wrote: > On Sat, 11 Oct 2003, Christopher Kings-Lynne wrote: > > > > > > I have two very similar queries which I need to execute. They both have > > > exactly the same from / where conditions. When I execute the first, it takes > > > about 16 seconds. The second is

Re: [SQL] [PERFORM] sql performance and cache

2003-10-14 Thread Rod Taylor
> > Perhaps you are confusing it with the MySQL query cache? > Is there plan on developing one (query cache)? For the most part, prepared queries and cursors give you a greater advantage due to their versatility -- both of which we do have. In the cases where an actual cache is useful, the clien

[SQL] Alias-Error

2003-10-14 Thread Jost Richstein
Hi, I am running a query with alias (a self join) against version 7.3.4 on Suse Linux 7.3 and on FreeBSD (v5?). It runs fine on Linux, but produces an error on FreeBSD: "unknown alias C2". And btw: the query runs on every other DB I have tried... The Query is something like this: SELECT DISTINCT

[SQL] Create View

2003-10-14 Thread Muhyiddin A.M Hayat
Dear all,   I Have This table     Table Billing:       id   trx_date   trx_time depart   payment_method    billing_amount    amount_paid balance   creator 1  10/09/2003  21:55:02   Resto    Visa   13.800,00   

[SQL] How can I produce the following desired result?

2003-10-14 Thread aicean
How can I produce the following desired result?       goodid    totalnum   operationdate storehistoryid    132  35.000  09-28-2003 66    135  11.500  09-28-2003 61    132  35.000  09-27-2003 60

Re: [SQL] How can I produce the following desired result?

2003-10-14 Thread Rod Taylor
On Tue, 2003-10-14 at 22:09, aicean wrote: > How can I produce the following desired result? I'm not sure I understand the problem, but you might want to try a subselect in the FROM. SELECT FROM table JOIN (SELECT goodid FROM table WHERE ) AS tab USING (good

Re: [SQL] How can I produce the following desired result?

2003-10-14 Thread aicean
Thanks very much. It seems can solve my problem.For select the max "storehistoryid",I have to compare each row's storehistoryid. Any other advice? Thanks again. aicean Mailto:[EMAIL PROTECTED] - Original Message - From: "Rod Taylor" <[EMAIL PROTECTED]> To: "aicean" <[EMAIL PROTE

[SQL] Sorting problem

2003-10-14 Thread George A.J
hi all, i am using postgres 7.3.2 .i am converitng a mssql database to postgres. now i am facing a strange problem. sorting based on a varchar field is not working as expected. the non alphanumeric characters are not sorting based on the ascii value of them.   i have the following table structure.

Re: [SQL] Sorting problem

2003-10-14 Thread Stephan Szabo
On Tue, 14 Oct 2003, George A.J wrote: > hi all, > i am using postgres 7.3.2 .i am converitng a mssql database to postgres. > now i am facing a strange problem. sorting based on a varchar field is not working > as expected. the non alphanumeric characters are not sorting based on the ascii > valu