Re: [SQL] Junk queries with variables?

2005-02-23 Thread Michael Fuhr
On Wed, Feb 23, 2005 at 11:12:47PM -0700, Steve - DND wrote: > I really have to be missing something here and this probably a *really* noob > question. I don't have a problem running little junk queries in the pgAdmin > query window(SELECT blah FROM blah, INSERT INTO blah, etc...), but I can't > f

[SQL] Junk queries with variables?

2005-02-23 Thread Steve - DND
I really have to be missing something here and this probably a *really* noob question. I don't have a problem running little junk queries in the pgAdmin query window(SELECT blah FROM blah, INSERT INTO blah, etc...), but I can't figure out how to run queries with variables outside of a function. I j

[SQL] Advanced SELECT

2005-02-23 Thread Kai Hessing
Hi Folks, I hope to have found the right group for my question. I have difficult sql-task. I try to describe it simple: We have a table 'company' with a cid and a table 'sector' with a sid. They are connected m:n via a third table 'company_sector' which contians csid, cid and sid. The normal cl

[SQL] Software for database-visualisation

2005-02-23 Thread Kai Hessing
Another question: Which software are you using to visualize your database-structur. We're doing it with Quark, but are not very happy with this. Thanks Kai... -- GnuPG-PublicKey -> http://www.hobsons.de/pgp/kai_hessing.asc Viele, die die schaendlichsten Handlungen begehen, fuehren hoechst vern

[SQL] Postgres 8 - problem: invalid input syntax for integer

2005-02-23 Thread mauro
Hi, In previous version di Postgres (7.2) I used this table: CREATE TABLE tablename (id serial, field int1, field2 text); Now this query work: UPDATE tablename SET field1=''; (NOTE: implicit conversion to 0) UPDATE tablename SET field2=''; (this cause of simple code-generation query - I don't kno

[SQL] Postgres performance

2005-02-23 Thread mauro
Hi, I understand this is an super-older thread!! note: i like postgres and not mysql! I'm a Postgres server user: I've postgres 7.2 and 8.0 in many servers and I've tested performance Postgres vs MySQL and I see Postgres is very slow. But my question is: why? Cannot Postgres team make faster becau

Re: [SQL] aggregate / group by question

2005-02-23 Thread Keith Worthington
T E Schmitz wrote: Hello, I must apologize for not coming up with a more descriptive subject line. I am struggling with the following query and I am not even sure whether what I want to achieve is possible at all: The problem in real-world terms: The DB stores TRANSAKTIONS - which are either sal

Re: [SQL] Working with XML.

2005-02-23 Thread Theo Galanakis
Title: Message Hi George,       I sent out a message shortly after this that didn't get through. However it's good news, I rebooted the server and it appears to work fine now. Thankyou for all your help, appreciated!!   Theo    -Original Message-From: George Weaver [mailto:[EMAIL PRO

Re: [SQL] dblink versus schemas. What to use in this case?

2005-02-23 Thread Gregory S. Williamson
Robert, A couple of possible issues -- Running two different databases (on the same server) implies more use of system resources, but may be slightly more robust (i.e. one could go down but the other would still work). dblink is certainly slower than refering to a table in a schema, but it se

Re: [SQL] Making NULL entries appear first when ORDER BY ASC

2005-02-23 Thread Thomas F . O'Connell
Yup. Got it. Wasn't thinking clearly about what expression meant. Thanks! -tfo -- Thomas F. O'Connell Co-Founder, Information Architect Sitening, LLC http://www.sitening.com/ 110 30th Avenue North, Suite 6 Nashville, TN 37203-6320 615-260-0005 On Feb 23, 2005, at 2:33 PM, Bruno Wolff III wrote: O

Re: [SQL] Making NULL entries appear first when ORDER BY ASC

2005-02-23 Thread Bruno Wolff III
On Wed, Feb 23, 2005 at 13:54:50 -0600, "Thomas F.O'Connell" <[EMAIL PROTECTED]> wrote: > How would one know from the reference material that it is possible to > include IS NOT NULL in an ORDER BY clause? > > Similarly, other than the FAQ, I've never been able to tell from the > SELECT documen

Re: [SQL] Making NULL entries appear first when ORDER BY

2005-02-23 Thread Ken Johanson
Well, for the docs to list every possible conditional-statement for an order by clause would just about include them all, so be all the more confusing. Sub queries, IN, aggregate functions, aliases.. the list goes on and on. I'd say that knowledge (that most conditionals can be used in an order

Re: [SQL] Making NULL entries appear first when ORDER BY ASC

2005-02-23 Thread Thomas F.O'Connell
How would one know from the reference material that it is possible to include IS NOT NULL in an ORDER BY clause? Similarly, other than the FAQ, I've never been able to tell from the SELECT documentation why ORDER BY random() works. -tfo -- Thomas F. O'Connell Co-Founder, Information Architect S

Re: [SQL] VIEW / ORDER BY + UNION

2005-02-23 Thread Bruno Wolff III
On Wed, Feb 23, 2005 at 19:33:07 +0100, KÖPFERL Robert <[EMAIL PROTECTED]> wrote: > > Otherwise you can treat this as a subselect and suround it with another > select. > > Like > select * from () order by orderno; That is still a bad idea in this case. He will end up scanning the table three t

Re: [SQL] VIEW / ORDER BY + UNION

2005-02-23 Thread KÖPFERL Robert
Otherwise you can treat this as a subselect and suround it with another select. Like select * from () order by orderno; C:\> -Original Message- C:\> From: Bruno Wolff III [mailto:[EMAIL PROTECTED] C:\> Sent: Mittwoch, 23. Februar 2005 18:20 C:\> To: WeiShang C:\> Cc: pgsql-sql@postgresql

Re: [SQL] VIEW / ORDER BY + UNION

2005-02-23 Thread Bruno Wolff III
On Thu, Feb 17, 2005 at 23:46:59 +0800, WeiShang <[EMAIL PROTECTED]> wrote: > Hi, I have created a view like this : > > CREATE VIEW v1 AS (SELECT orderno,weekday,time FROM t1,t2 where > t1.orderno=t2.orderno); > > if I create a SQL statment: > > (SELECT orderno FROM v1 WHERE weekday='MON' ORDE

Re: [SQL] Row Count

2005-02-23 Thread Michael Fuhr
On Wed, Feb 23, 2005 at 09:48:29PM +0530, sreejith s wrote: > How get Row count in a plpgsql fuction after executing update or > delete query to determine no. of rows affected. See "Obtaining the Result Status" in the PL/pgSQL documentation. http://www.postgresql.org/docs/8.0/static/plpgsql-stat

[SQL] Row Count

2005-02-23 Thread sreejith s
Hai friends, How get Row count in a plpgsql fuction after executing update or delete query to determine no. of rows affected. Sreejith ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] Comments on subquery performance

2005-02-23 Thread Edmund Bacon
Typically, this is handled as (omitting '"'s and schema names for clarity) SELECT CatID1, CatID2, CatID3, t1.CatName as CatName1, t2.CatName as CatName2, t3.CatName as CatName3 FROM tblListings JOIN tblCategories t1 on CatId1 = CatID JOIN tblCategories t2 on CatId2 = CatID JOIN tblCatego

Re: [SQL] Working with XML.

2005-02-23 Thread George Weaver
Title: Message Hi Theo,   Hmm.  Well we're getting into territory that's over my head.  I've simply been a user of xml2 and do not know much about its inner workings.  Just out of curiosity, what is the size of Sort_Mem in your postgresql.conf?   Regards, George - Original Message

[SQL] dblink versus schemas. What to use in this case?

2005-02-23 Thread KÖPFERL Robert
Hi all, I have got two database schemas. They're rather independend. Thus they are in two databases. However there is one function that needs access to the other database. As I found out, I have two choices: *Using schemas and put the schemas tighter together (via interdependencies). Dumping dist

Re: [SQL] PostgreSQL ignores my indexes

2005-02-23 Thread Andrew Sullivan
This is probably better on -performance, and is certainly a FAQ. But. . . On Wed, Feb 23, 2005 at 03:01:52PM +0100, Thomas Braad Toft wrote: > > Table device contains 5285 rows, tmeevent contains 834912 rows. ^^ > -> Seq Scan on tmeevent

[SQL] PostgreSQL ignores my indexes

2005-02-23 Thread Thomas Braad Toft
Hello, I'm having two tables (listed): CREATE TABLE "public"."device" ( "id" BIGSERIAL, "name" TEXT, "serialnumber" TEXT, -- many more columns -- ) WITH OIDS; CREATE UNIQUE INDEX "device_id_key" ON "public"."device" USING btree ("id"); CREATE INDEX "device_name_index" ON "public

Re: [SQL] No triggers visible for different user in information_schema.triggers

2005-02-23 Thread Michael Fuhr
On Wed, Feb 23, 2005 at 09:05:39AM +0100, Oliver Brück wrote: > While PostgreSQL implements the SQL:1999 behaviour, is there any way to > check if a certain trigger already has been created, though that trigger > is owned by another user? See the "System Catalogs" chapter in the documentation,

Re: [SQL] Speeds using a transaction vrs not

2005-02-23 Thread Richard Huxton
Joel Fradkin wrote: I wrote a .net program to move my data to postgres (works great on SQ_ASCII). In fiddling around I tried it using the odbc driver and a transaction originally, but converted it to using the .net connectivity but no transaction. What I found was it moved my database (4 gig in MSS

Re: [SQL] No triggers visible for different user in information_schema.triggers

2005-02-23 Thread Oliver Brück
Hello again, thanks a lot for the fast and significant help. Michael Fuhr schrieb: On Thu, Feb 17, 2005 at 04:58:24PM +0100, Oliver Brück wrote: > [SNIP] SQL:1999 defines the TRIGGERS view as: Identify the triggers in this catalog that are owned by a given user. SQL:2003 (Working Draft) says: