Re: [SQL] CONTEXT on PL/pgSQL

2004-05-07 Thread Gaetano Mendola
Martin Marques wrote: > El Vie 23 Abr 2004 11:18, Tom Lane escribió: > >>Martin Marques <[EMAIL PROTECTED]> writes: >> >>>I have a simple function made with PL/pgSQL and when I call it I get this >>>in the logs: >>> >>>2004-04-23 10:15:32 [30669] LOG: statement: SELECT nodoSuperior(22) AS >>>sup

Re: [SQL] \df

2004-05-07 Thread Jie Liang
Thanks. Jie Liang -Original Message- From: Stefan Weiss [mailto:[EMAIL PROTECTED] Sent: Friday, May 07, 2004 4:40 PM To: [EMAIL PROTECTED] Subject: Re: [SQL] \df On Saturday, 08 May 2004 01:15, Jie Liang wrote: > What sql statement equal to \df function_name > I want to know the result

Re: [SQL] \df

2004-05-07 Thread Stefan Weiss
On Saturday, 08 May 2004 01:15, Jie Liang wrote: > What sql statement equal to \df function_name > I want to know the result data type for a given function within plpgsql. Try the -E switch for pgsql: [EMAIL PROTECTED]:~ $ psql -E Welcome to psql 7.4.2, the PostgreSQL interactive terminal. Typ

[SQL] \df

2004-05-07 Thread Jie Liang
Hi, What sql statement equal to \df function_name I want to know the result data type for a given function within plpgsql. Thanks. Jie Liang ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscr

Re: [SQL] SELECT - ORDER BY Croatian characters ....

2004-05-07 Thread Peter Eisentraut
Kornelije wrote: > I'm using PostgreSQL and my database contains Croatian Characters > (ccz...) so when I pose a query, and I use order by clause, the > result is not sorted properly. You need to initdb your database with the proper locale (hr_HR, probably). Also, choose the right encodi

Re: [SQL] SUM() & GROUP BY

2004-05-07 Thread Jean-Luc Lachance
Try: SELECT d.divisions_name, s.pd_geo, COUNT(s.pd_geo) FROM ser s, ser_divisions d WHERE s.ser_divisions = '3131' AND s.ser_divisions = d.divisions_id GROUP BY d.divisions_name, s.pd_geo; Martin Kuria wrote: Thanks Huxton, Sorry for not explaining fully here is what I would like to achieve:

Re: [SQL] COUNT on a DISTINCT query

2004-05-07 Thread Suller András
SELECT COUNT(xxx.*) FROM () xxx This cause an error for me: ERROR: cannot pass result of subquery or join "xxx" to a function Try this instead: SELECT COUNT(*) FROM () xxx It worked for me. Regards, Suller Andras ---(end of broadcast)--- TIP 5: Have

[SQL] SELECT - ORDER BY Croatian characters ....

2004-05-07 Thread Kornelije
Hi everybody,   I'm using PostgreSQL and my database contains Croatian Characters (čćž...) so when I pose a query, and I use order by clause, the result is not sorted properly.   I was using once VB for aplications and there I've used a function which changed Croatian characters with

Re: [SQL] SUM() & GROUP BY

2004-05-07 Thread Richard Huxton
Martin Kuria wrote: Here is what Division table contains: SELECT * FROM ser_divisions; divisions_name | divisions_id --- DEE | 3131 ... Now I would like to get to know how each Division answered i.e. SELECT s.pd_geo, COUNT(s.pd_geo) FROM

Re: [SQL] SUM() & GROUP BY

2004-05-07 Thread Martin Kuria
Thanks Huxton, Sorry for not explaining fully here is what I would like to achieve: When I do: SELECT s.pd_geo, COUNT(s.pd_geo) FROM ser s GROUP BY s.pd_geo; OUTPUT: pd_geo | count -- 1| 49 2| 39 3|6 4|54 It outputs the number of en

Re: [SQL] not really SQL but I need info on BLOBs

2004-05-07 Thread Jeff Boes
In the same vein ... We are at present using BLOBs to store images (but not very many) and generated output (mostly HTML and XML). The data being stored doesn't require BLOB use because of size; it's mostly the binary nature of the data. Lack of satisfaction with the BLOB support (generally diffi

Re: [SQL] EXPORT / IMPORT

2004-05-07 Thread Andrew Sullivan
On Fri, May 07, 2004 at 10:20:52AM +0200, Freddy Villalba Arias wrote: > > Is there a simple way to generate an export / import script in > PostgreSQL (i.e. a script that contains INSERT statements for every row > in a table) ??? > > COPY is NOT a good option (personal opinion). pg_dump -d or -D

Re: [SQL] Display format for column

2004-05-07 Thread Karel Zak
On Fri, May 07, 2004 at 05:08:21PM +0800, Abdul Wahab Dahalan wrote: > Hi there! > > How do we format column size for displaying data in postgresql. > for example my data type for customername is varchar(100) and I want to > display the first 25 chars. > How should I do that? "display" a data i

[SQL] Display format for column

2004-05-07 Thread Abdul Wahab Dahalan
Hi there! How do we format column size for displaying data in postgresql. for example my data type for customername is varchar(100) and I want to display the first 25 chars. How should I do that? can I do something like: psql > column customername format a25 ---(end of

Re: [SQL] EXPORT / IMPORT

2004-05-07 Thread Jerome Alet
On Fri, May 07, 2004 at 10:20:52AM +0200, Freddy Villalba Arias wrote: > > Is there a simple way to generate an export / import script in > PostgreSQL (i.e. a script that contains INSERT statements for every row > in a table) ??? pg_dump bye Jerome Alet ---(end of broad

[SQL] EXPORT / IMPORT

2004-05-07 Thread Freddy Villalba Arias
Hello,   Is there a simple way to generate an export / import script in PostgreSQL (i.e. a script that contains INSERT statements for every row in a table) ???   COPY is NOT a good option (personal opinion).   I’m using pgAdmin3 but it does not offer this (quite disappointing, may I s

Re: [SQL] SUM() & GROUP BY

2004-05-07 Thread Richard Huxton
Martin Kuria wrote: Hi again I have two tables I would like to query i.e. service table and division table SELECT s.pd_geo, COUNT(s.pd_geo) FROM ser s GROUP BY s.pd_geo; OUTPUT: pd_geo | count -- 1| 49 2| 39 3|6 4|54 SELECT d.div