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 RESTRICT NOT DEFERRABLE;

[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] 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:

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: CREATE

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), ) WITH OIDS; and

[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 as one,

[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 message

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 stdio.h int main() { EXEC SQL BEGIN DECLARE

[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

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). You need

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?

[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

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 the

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.

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:

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 die

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 in diesem

[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

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 executed

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 client

[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_datetrx_timedepartpayment_method billing_amount amount_paid balancecreator 1 10/09/2003 21:55:02Resto Visa13.800,00 10.000,00 3.800,00 middink Table Payment id r trx_date trx_timedescriptions payment_method amount creator