[SQL] update on join ?

2007-11-21 Thread Andreas
Hi, I'd like to update a table efficiently where the relevant select-info is in another table that is foreign-linked. Stupid example. 2 tables: things (thing_id integer, name varchar(100), color varchar(100)) inventory (item_id integer, thing_fk integer references things (thing_id), number)

[SQL] How to find double entries

2008-04-15 Thread Andreas
gle' Then I want to match abbrevations like 'A-Company Ltd.', 'a company ltd.', 'A-Company Limited' Is there a way to do this? It would be OK just to list candidats up to be manually checked afterwards. Regards Andreas -- Sent via pgsql-sql mailing

[SQL] Need some magic with alternative rows

2008-06-06 Thread Andreas
a fk<>0 row that has the same group_nr ? I'd like to get just: 994001, Tick,1, 40, 994010 4002, LEADS, 2, 40, 0 994003, Track, 3, 40, 994010 Regards Andreas -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your su

[SQL] How to manage category-ids as array-fields ?

2008-06-13 Thread Andreas
Hi, I get from an outside source tables as simple textfiles to import. Those are obviously results of views with joined tables. Among the normal stuff are columns that have one or a list of id-numbers devided by a semicolon. In the next column there is the corresponding text for this ids. It

[SQL] I need some magical advice

2009-01-29 Thread Andreas
Hi, I'd like to update some records in a table. Those have a status_id and among other columns a varchar with a name and a create_date. The status_id is 0 if nothing was done with this record, yet. For some reasons I've got double entries which I now want to flag to -1 so that they can be sor

Re: [SQL] I need some magical advice

2009-01-29 Thread Andreas
Hi, yes, there is a serial as primary key. Lets call it "id". Therfore one could use this to find the oldest record. Regards Andreas Oliveiros Cristina schrieb: Andreas, Does your table has any field that can be used as primary key? Any "ID" field? Best, Olivei

[SQL] Funtion to clean up strings?

2009-02-12 Thread Andreas
Hi, I need a function that removes characters in strings that aren't in a given set of chars. e.g Input:12-34/ 56(8) I want just numbers so Output should in this case be: 1234568 Is there a solution? -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your s

Re: [SQL] Funtion to clean up strings?

2009-02-12 Thread Andreas
; and "+49" --> 0 while international numbers +33/123456789 0033/123456789 should come as +33123456789 I fear the hard part is that international codes have 1-3 digits :( Regards Andreas ivan Stoykov wrote: regexp_replace('120323423 23(fdf_)fd','[^[:digit:]]'

Re: [SQL] Funtion to clean up strings?

2009-02-17 Thread Andreas
) , E'^(?:\\+||00)(.*)', E'\\1') else regexp_replace(p, E'[^0-9]', '', 'g') end That would catch the leading spaces in " 00 49 ( 0 ) 1 2 3 456 -0", too. Creating a sql-function thows a WARNING: nonstandard use of \\ in a strin

Re: [SQL] Funtion to clean up strings?

2009-02-17 Thread Andreas
rect way to code the backslashes to avoid the Warning? Regards Andreas Raj Mathur schrieb: On Tuesday 17 Feb 2009, Andreas wrote: [snip] case when regexp_replace(p, E'[^0-9+]', '', 'g') ~ E'^(\\+|00)49' then '0'|| regexp_rep

[SQL] How concat 3 strings if 2 are not empty?

2009-02-18 Thread Andreas
L', ' is ', ' great'--> 'PostgreSQL is great' NULL, ' is ', ' great' --> 'great' 'PostgreSQL', ' is ', NULL--> 'PostgreSQL' NULL, ' is ', NULL --&

Re: [SQL] How concat 3 strings if 2 are not empty?

2009-02-18 Thread Andreas
No. B should only appear if A and C are not empty. B is just a filler. Thanks Andreas A. Kretschmer schrieb: In response to Andreas : I'd like a function that concats 3 string parameters on condition the 1st and 3rd are NOT empty or NULL. xCat (s1, s2, s3) s2 would be a connector

[SQL] Beginner problems with functions (Was: Is this the wrong list?)

2000-08-17 Thread Andreas Tille
thing(rs.getString("col1"), rs.getString("col2"), rs.getString("col3"), rs.getString("col4") ); So I have to serve my servlet with any kind of datasets and I really can't imagine, that such a basic task isn't possible with PostgeSQL. Kind regards Andreas.

[SQL] Re: Beginner problems with functions

2000-08-21 Thread Andreas Tille
rking. Not very clever, but should work, hopefully. 3) Use another database server, could be Interbase but I would prefer PostgreSQL. Could somebody please help me to decide which strongle depends from the SQL procedure problem. Kind regards Andreas.

[SQL] Re: Beginner problems with functions

2000-08-22 Thread Andreas Tille
ng feature? Kind regards Andreas.

[SQL] Date of creation and of change

2000-08-23 Thread Andreas Tille
change to the data set I hope someone has this quite usual feature handy or at least a pointer where this is described. Thank you very much Andreas.

[SQL] Re: Using SETOF in plpgsql function

2000-08-23 Thread Andreas Tille
r > 7.1, and I'm not sure if we will be able to do it for 7.2 > yet. Just to make sure you've got to know that this is a feature needed by many users: Add me to the list of users who have a big need for this! Kind regards Andreas.

[SQL] Re: Date of creation and of change

2000-08-23 Thread Andreas Tille
r you mentioned > CREATE TRIGGER myt_stamp BEFORE INSERT OR UPDATE ON mytable > FOR EACH ROW EXECUTE PROCEDURE myt_stamp(); the function could cause errors. Sorry, I'm not very familiar with this function stuff :-(. Kind regards Andreas.

[SQL] Re: Date of creation and of change

2000-08-23 Thread Andreas Tille
gt; > Create table fred (joe integer, createdtime datetime not null default text > 'now'); > > If you dont put the text in you get the date the table was created in all > future inserts. The text force the current now to be used. > ?Is this fixed in 7.0.x Would do a better job in this case? What's wrong here? Kind regards Andreas.

[SQL] Create table in functions

2000-08-23 Thread Andreas Tille
work and what copy function fails here?? Kind regards Andreas.

[SQL] RE: Create table in functions

2000-08-25 Thread Andreas Tille
c (@Query) Select @num=(Select Max(Num) From #NumTable) Drop Table #NumTable return @num May be there are some clever ways to avoid the temporary table. I really wonder if my solution is in fact very clever because I'm unsure if it is thread-safe. Any hints? Kind regards Andreas.

[SQL] Re: Date of creation and of change

2000-08-25 Thread Andreas Tille
ROR: parser: parse error at or near "changedat" What's the problem here. Is there a conflict between the definition with DEFAULT now() and the TRIGGER BEFORE INSERT OR UPDATE. Should perhaps be the DEFAULT in the definition be removed or just the INSERT in the TRIGGER? Or is there a completely different problem? Kind regards Andreas.

[SQL] Re: Date of creation and of change

2000-08-25 Thread Andreas Tille
NEW.ChangedAt := timestamp(''now''); > RETURN NEW; > END; > ' LANGUAGE 'plpgsql'; > > I didn't test it, but as pgSQL looks like Oracle, it should be ok :-) This avoids the error message, but doesn't have any effect to the value of ChangedAt. It just remains the same as CreatedAt :-(. Kind regards Andreas.

[SQL] Re: Date of creation and of change

2000-08-25 Thread Andreas Tille
re's hint to "put null" into the field. Bay the way: If we once solved the problem it might be a topic for the FAQ, perhaps? Kind regards Andreas.

[SQL] Re: Date of creation and of change

2000-08-25 Thread Andreas Tille
res server) has changed the data set while I was edditing it? (In general it's no problem, but if I try two changes immediately the second change will be started with this boring warning.) But this is perhaps off topic in this list Kind regards and many thanks to you all Andreas.

[SQL] Argument variables for select

2000-08-28 Thread Andreas Tille
ith Exec ( query ) Kind regards Andreas.

[SQL] Re: Argument variables for select

2000-08-28 Thread Andreas Tille
On Mon, 28 Aug 2000, Yury Don wrote: > Andreas Tille wrote: > > > > Create Function VarSelect ( varchar, varchar ) > >returns int > >As ' > > Declare num int ; > > > > Begin > >Select Into num Count(*

[SQL] Re: Argument variables for select

2000-08-29 Thread Andreas Tille
. I have to admit that my boss wonders why I'm switching from a working solution (MS SQL) to so much trouble :-(. I really hope to convince him to OpenSource but it's much harder than I expected. Kind regards Andreas.

[SQL] Re: RE: Create table in functions

2000-09-01 Thread Andreas Tille
w to PostgreSQL. Hopefully some other PostgreSQL users besides me will love you for that . Kind regards Andreas.

[SQL] Order by in stored functions

2000-09-03 Thread Andreas Tille
ERROR: function declared to return varchar returns multiple values in final retrieve If O just remove the ORDER BY clause als works well so I guess that the ORDER BY has to be replaced by somethjing other. Could somebody enlighten me how to do the ordering in a stored procedure? Kind regards Andreas.

[SQL] Re: Order by in stored functions

2000-09-04 Thread Andreas Tille
re or less beginners like me regarding when to use views and when to use functions? Kind regards Andreas.

[SQL] Re: Returning Recordsets from Stored-procs

2000-11-06 Thread Andreas Tille
you have continuos headache while trying to port a database. I think I'm not the only one who would be really, really happy if *real* stored procedures would be high on top of the todo list. (In fact this is the *only* thing I'm currently really missing in PostgreSQL.) Kind regards Andreas.

[SQL] Oracle, ODBC, MS IIS -> problem!

2000-11-08 Thread ANDREAS STEINBACH
reference, that was requested by the application. Is there anybody out there who can be of help on that matter? I really tried to find an answer myself, but now I'm stuck. Any help is highly appreciated. Thanks in advance, Andreas (Vienna, Austria, Europe, Earth)

[SQL] Re: Requests for Development

2000-11-09 Thread Andreas Tille
for your ongoing hard work! Couldn'trepeated often enough alos for the past! Kind regards Andreas.

AW: [SQL] Case Insensitive Queries

2001-05-29 Thread Manessinger Andreas
ould be a match. As is, this > compare is case sensitive. select * from account where lower(username) = 'test'; Dipl.Ing. Andreas Manessinger - CCT / Competence Center Telematik Magistrat der Stadt Wien, Magistratsabteilung 14 - ADV, Rathausstr. 1, A-1082 Wien E-Mail: [EMAIL PROTE

[SQL] Foreign key problem

2001-06-25 Thread Andreas Tille
check(s) ERROR: UNIQUE constraint matching given keys for referenced table "reskulturdetail" not found Can anybody explain, why the foreign key constraint fails? Thanks and have a nice weekend Andreas. ---(end of broadcast)---

[SQL] Error with DISTINCT and AS keywords

2002-07-10 Thread Andreas Schlegel
r or modify the query If I remove the DISTINCT keyword it works: select tnr, titel, 'TEST' AS testcol from tTitel; Greetings, Andreas ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

[SQL] Explicite typecasting of functions

2002-08-14 Thread Andreas Tille
Id)+1 from Items where Id < 100;' LANGUAGE 'sql'; I did not found any trace of documentation how to do an explicit typecast for the function. Defining the function first fails because: ERROR: Relation "items" does not exist Any hint to solve

Re: [SQL] Explicite typecasting of functions

2002-08-14 Thread Andreas Tille
Ids. But anyway for academic reasons: What means adding 'explicit typecast' of a func??? I was not able to find this term in the docs. Kind regards Andreas. ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] Explicite typecasting of functions

2002-08-14 Thread Andreas Tille
On Wed, 14 Aug 2002, Tom Lane wrote: > I concur with Richard that Andreas needs to solve a different problem, > but just for the record, the way you could do it is > > CREATE TABLE without mentioning the default > > CREATE FUNCTION > > ALTER TABLE

[SQL] Trigger/Function problem

2002-08-21 Thread Andreas Johansson
gger: function fix_status() does not exist Why doesn't the trigger acknowledge that I want to call fix_status with a parameter for which table name I should use? I'm completely stuck and I someone out there can help me. -> Andreas ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

[SQL] Separating data sets in a table

2002-08-22 Thread Andreas Tille
your patience Andreas. ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html

Re: [SQL] Separating data sets in a table

2002-08-25 Thread Andreas Tille
On Sat, 24 Aug 2002, Mark Stosberg wrote: > On Thu, 22 Aug 2002, Andreas Tille wrote: > > Hello, > > > > I want to solve the following problem: > > > > CREATE TABLE Ref( Id int ) ; > > CREATE TABLE Import ( Idint, >

Re: [SQL] Separating data sets in a table

2002-08-25 Thread Andreas Tille
led COPY statements. I've thought that including all data and handling them afterwards would be agood idea and it is just my lack of SQL knowledge which prevents me from finding a clever solution to sort the stuff out. Kind regards Andreas. ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] Separating data sets in a table

2002-08-26 Thread Andreas Tille
d be possible. That's why I had the idea just to set a certain flag and then do the insert of all data sets where flag = OK. Kind regards Andreas. ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an approp

Re: [SQL] query concat

2002-09-20 Thread Andreas Schmitz
". but I am not sure if this will display your needs. Do you really need the data like "ORD0244, ORD0245..." ? Then you should use an array or set datatype. They are normally not nice to handel. regards -andreas -- Andreas Schmitz - Phone +49 201 8501 318 Cityweb-Te

[SQL] [OT] Unsubscribe does not work

2003-01-21 Thread Andreas Tille
Hi, once I subscribed to this list I've got the information how to subscribe: If you ever want to remove yourself from this mailing list, send the following command in email to [EMAIL PROTECTED]: approve unsubscribe Andreas Tille <[EMAIL PROTECTED]> Well, I did so bu

Re: [SQL] [OT] Unsubscribe does not work

2003-01-21 Thread Andreas Tille
e command to majordomo as usual for mailing lists, but if I get those explicite advise ... Next try: mailx -s unsubscribe [EMAIL PROTECTED] <<... unsubscribe ... Let's see what happens ... Andreas. ---(end of broadcast)--- T

[SQL] UPDATE FROM portability

2003-03-24 Thread Andreas Pflug
1 JOIN tab2 T2 ON T1.key=T2.Key <<<<<< WHERE T2.restr=1 I'm looking for a portable query style, without using a subquery in the SET clause (which could make things quite slow) Any hints? Regards, Andreas ---(end of broadcast)-

Re: [SQL] Problem with old relation

2003-05-02 Thread Andreas Schmitz
Hi, you also have to drop the sequence. drop sequence kokot_kokot_seq; regards -andreas On Friday 02 May 2003 14:20, Rado Petrik wrote: > Hi, > > 1) When I create new table expample. > > CREATE TABLE "kokot" ( > "kokot" SERIAL ); > > > 2) and

[SQL] plpgsql - how can I use TG_OP ?

2003-07-02 Thread Andreas Schmitz
rom tipp_team_members where member_team_id=2 and member_user_id=27; WARNING: Error occurred while executing PL/pgSQL function update_team_member_count WARNING: line 13 at if ERROR: Attribute "delete" not found tippspiel2003=# What am I making wrong ? best regards -Andreas Schmitz -- An

[SQL] sort for ranking

2003-07-07 Thread Andreas Schmitz
ed correctly but the ranking is a mess. I recongnized that the select seems to follow primarily the internal table order. Is there any way to solve this nicely. Hints and solutions are appreciated. Thanks in advance -Andreas -- Andreas Schmitz - Phone +49 201 8501 318 Cityweb-Technik-Serv

[SQL] Scaler forms as function arguments

2003-11-26 Thread Andreas Tille
result SETOF MyTable ; BEGIN result := (SELECT * FROM MyTable); RETURN result ; END; ' LANGUAGE 'plpgsql'; wich failed. Kind regards Andreas. ---(end of broadcast)--- TIP 5: Have you checked

Re: [SQL] Scaler forms as function arguments

2003-11-27 Thread Andreas Tille
QL function plpgsqldepartmentsalaries WARNING: line 5 at return next ERROR: Set-valued function called in context that cannot accept a set test=# Any hint what might be wrong here? I'm using PostgreSQL 7.3.2 under Debian GNU/Linux (testing). Kind regards Andreas. ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings

Re: [SQL] Scaler forms as function arguments

2003-11-27 Thread Andreas Tille
On Thu, 27 Nov 2003, Joe Conway wrote: > Andreas Tille wrote: > > test=# select PLpgSQLDepartmentSalaries() ; > > This should be: > regression=# select * from PLpgSQLDepartmentSalaries(); > departmentid | totalsalary > --+- > 1 |

[SQL]

2003-11-29 Thread Andreas Heissenberger
 

[SQL] Updating session id based on accesstimeout

2003-11-29 Thread Andreas Heissenberger
all records. The fastes solution I found until now was not to use any data base, sort the data with the unix command sort and process the logfile text directly with perl.   Thanks in advance!   Andreas  

[SQL] oracle decode()

2004-03-03 Thread Andreas Schmitz
Hello, is there any equivalent for ORACLEs decode() in pl/pgsql ? regards, -Andreas -- ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

[SQL] Trigger functions with dynamic SQL

2004-07-24 Thread Andreas Haumer
System Administrator 22004-01-01 12:00:00 infinity Guest Table "t_person" could have the following contents: id begin_val end_valusername role ===== 120

Re: [SQL] Trigger functions with dynamic SQL

2004-07-24 Thread Andreas Haumer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi! Many thanks for your reply! Tom Lane wrote: > Andreas Haumer <[EMAIL PROTECTED]> writes: > >>It seems I would have to use EXECUTE on dynamically constructed >>PL/PGSQL statements in order to have my trigger function re

Re: [SQL] Trigger functions with dynamic SQL

2004-07-26 Thread Andreas Haumer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi! I have solved the problem! Tom Lane wrote: > Andreas Haumer <[EMAIL PROTECTED]> writes: > >>I just can't figure out where and how many quotation marks >>I have to place in my function. > > > It's messy

Re: [SQL] Displaying two tables side by side

2004-08-11 Thread Andreas Haumer
at this is of course very platform specific. On Oracle you could use rownum, for example. I don't have a more portable solution on hand right now. HTH - - andreas - -- Andreas Haumer | mailto:[EMAIL PROTECTED] *x Software + Systeme | http://www.xss.co.at/ Karm

Re: [SQL] COMMENT ON CONSTRAINT

2004-08-15 Thread Andreas Seltenreich
Sascha Ziemann writes: > it is defined in this way: [...] > CONSTRAINT constraint_name ON table_name | Well then... > comment on constraint uni on table tab3 is 'unique pair'; ^ ...why do you insert "table" when it is defined

Re: [despammed] [SQL] update/insert data

2004-11-28 Thread Kretschmer Andreas
am Sat, dem 27.11.2004, um 12:55:40 -0500 mailte Keith Worthington folgendes: > Hi All, > > I have two tables in different schemas. The first table in the data_transfer > schema is loaded with a COPY command. I need to transfer the data to the > second schema inserting new records and updating

Re: [despammed] [SQL] session-wide autocommit off

2004-11-30 Thread Andreas Kretschmer
OCOMMIT \set AUTOCOMMIT FALSE begin; But this works only one transaction. regards, Andreas -- Andreas Kretschmer(Kontakt: siehe Header) Tel. NL Heynitz: 035242/47212 GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net ===Schollglas Untern

Re: [despammed] [SQL] sum query

2004-12-04 Thread Andreas Kretschmer
select id, sum(summe) from (select id, sum(quantity) as summe from tbl3 where order_id in (select order_id from tbl2 where closed = false) group by id union select id,0 from tbl1 group by id) as x group by x.id order by x.id; and this result: id | sum --+- AB12 | 15 CD34 | 5

Re: [SQL] sum query

2004-12-04 Thread Kretschmer Andreas
); using UNION in place of an outer join is _very_ unwise. (In fact > UNION / INTERSECT / EXCEPT should normally be reserved for those cases > where there is simply no alternative.) Okay. I'm learning ;-) Andreas -- Diese Message wurde erstellt mit freundlicher Unterstützung eines fre

Re: [despammed] [SQL] question about index

2004-12-16 Thread Andreas Kretschmer
for this task? I would prefer a smallint for this with a check-contraint to check the values. > be as fast as possible. > > considering that almost 70% of the rows will be with 'VALUE1', 20% > will be with 'VALUE2' and 10% will be with 'VALUE3' on the

Re: [despammed] [SQL] sql can i substitute

2004-12-17 Thread Andreas Kretschmer
d' test-# when fruit = 2 then 'bad' test-# when fruit = 3 then 'rotten' end from fruit; name | fruit | case +---+ Apple | 1 | good Banana | 2 | bad Cherry | 3 | rotten (3 Zeilen) Please read http://www.postgresql.org/docs/7.4/interactive

Re: [despammed] [SQL] sql can i substitute

2004-12-17 Thread Andreas Kretschmer
and 'rotten' under the column 'fruit'? Yes, simple: test=# select name, case test-# when fruit = 1 then 'good' test-# when fruit = 2 then 'bad' test-# when fruit = 3 then 'rotten' end as fruit from fruit; name | fruit ----+ Apple

Re: [SQL] [despammed] question about index

2004-12-16 Thread Andreas Kretschmer
am 16.12.2004, um 8:10:25 -0600 mailte Bruno Wolff III folgendes: > On Thu, Dec 16, 2004 at 12:01:39 +0100, > Andreas Kretschmer <[EMAIL PROTECTED]> wrote: > > > > > > considering that almost 70% of the rows will be with 'VALUE1', 20% > > > w

Re: [SQL] Revoke on all database

2004-12-18 Thread Kretschmer Andreas
you can walk through all database via 'psql -l' and then walk through all tables in every database via 'echo "\d " | psql db'. You get all tables in all databases and now you can do a 'revoke' on this tables. But i'm afraid, there is a better way to do th

[SQL] Question about geometric function area()

2004-12-19 Thread Kretschmer Andreas
from geo where id=1;' fails. If I do 'select area(box(koerper)) from geo where id=1;' it works, but this isn't the right answer. Is this a limitation for area()? Version is 7.4.5. Regards, Andreas -- Diese Message wurde erstellt mit freundlicher Unterstützung eines fre

Re: [SQL] Question about geometric function area()

2004-12-19 Thread Kretschmer Andreas
am Sun, dem 19.12.2004, um 11:38:40 +0100 mailte Kretschmer Andreas folgendes: > Now, I need the area, but 'select area(koerper) from geo where id=1;' > fails. If I do 'select area(box(koerper)) from geo where id=1;' it > works, but this isn't the right ans

Re: [SQL] Formatting an Interval

2005-01-02 Thread Kretschmer Andreas
rs in 28672 seconds: test_db=# select 28672 / 3600; ?column? -- 7 (1 Zeile) Now you can add 24 hours and 7 hours, the remainder is test_db=# select 28672 - 3600*7; ?column? -- 3472 (1 Zeile) seconds. Now you can calculate the minutes and, finaly, the seconds.

Re: [SQL] Calling a table residing in another database from Plpgsql

2005-01-05 Thread Kretschmer Andreas
went through some documentation > and found out that it is possible through dblink. > > I infact downloaded the dblink package in contrib folder. But still when i > tried to use dblink in the following manner: You must run the dblink.sql, not only download. Regards, Andreas -- Di

[SQL] Question about a select

2005-01-22 Thread Kretschmer Andreas
problem is, i need also rows for machine and week with no entrys in the table. For this rows the sum(area) shold be NULL ore 0. In other words: for every machine i need M rows, and M must be constant. Regards & Thx, Andreas -- Diese Message wurde erstellt mit freundlicher Unterstützung eines fre

Re: [despammed] [SQL] private table

2005-01-26 Thread Andreas Kretschmer
am 26.01.2005, um 10:13:52 +0200 mailte Din Adrian folgendes: > Hello, > I am want to use a private table in postgresql(every client to see his own > data). > Is this possible? How can I do it! Why? You can create different users and/or different databases. Regards, Andreas

Re: [SQL] pgdump by schema?

2005-02-02 Thread Kretschmer Andreas
am Wed, dem 02.02.2005, um 9:33:22 -0600 mailte Bradley Miller folgendes: > Is there a way to dump everything in a particular schema? RTFM. man pg_dump, search for --schema Regards, Andreas -- Diese Message wurde erstellt mit freundlicher Unterstützung eines freilau- fenden Pinguins

Re: [despammed] [SQL] Accessing objects over db-borders

2005-02-04 Thread Andreas Kretschmer
rently the context on DB bbb? Yes, take a look at dblink (contrib-package) Andreas -- Andreas Kretschmer(Kontakt: siehe Header) Heynitz: 035242/47212, D1: 0160/7141639 GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net ===Schollglas Unternehmensgruppe=== --

Re: [despammed] [SQL] SQL error: function round(double precision, integer) does not exist

2005-02-28 Thread Andreas Kretschmer
meter,oe_count_matches(smiles,smarts) as > count, > round((parameter*oe_count_matches(smiles,smarts)),2) as > psa,tpsa(smiles) as ctpsa,tpsa > from structure,tpsa > where id < 237610 > and oe_count_matches(smiles,smarts) > 0 try ... round((parameter*oe_count_m

Re: [despammed] [SQL] How do I do this?

2005-03-23 Thread Andreas Kretschmer
linux-gnu, compiled by GCC i386-linux-gcc (GCC) 3.3.5 (Debian 1:3.3.5-5) (1 Zeile) Regards, Andreas -- Andreas Kretschmer(Kontakt: siehe Header) Heynitz: 035242/47212, D1: 0160/7141639 GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net ===Schollglas Unternehmensgruppe=== --

Re: [despammed] [SQL] Crosstab function

2005-04-06 Thread Andreas Kretschmer
am 06.04.2005, um 13:55:35 +0700 mailte bandeng folgendes: > hello guys, > > I want to use crosstab function but that function it doesnt exist. my > version is 7.3 so how do i get the tablefunc.sql from postgre contrib? apt-get install postgresql-contrib Regards, Andreas

Re: [despammed] [SQL] How do I connect with something like JDBCManager to Postgres on Fedora Linux

2005-04-22 Thread Andreas Kretschmer
he pg_hba.conf. Read this about -i and TCPIP_SOCKET and edit this to enable access via tcp/ip. Andreas -- Andreas Kretschmer(Kontakt: siehe Header) Heynitz: 035242/47212, D1: 0160/7141639 GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net ===Schollglas Unternehmensgruppe=== --

Re: [despammed] [SQL] Insert psql commands inside a script

2005-04-22 Thread Andreas Kretschmer
a file for > the sql instructions but right on the same line. I use very short psql > commands and would like to do it all with 1 file. echo "select bla from fasel" | psql -U database You can also use here documents, shell-variables and so on. Regards, Andreas -- Andreas Kre

[SQL] how many tuples on a cursor?

2005-05-02 Thread Andreas Kretschmer
i'm using 7.4.6. Is there now a way to get the total number of rows in a CURSOR? Andreas -- Andreas Kretschmer(Kontakt: siehe Header) Heynitz: 035242/47212, D1: 0160/7141639 GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net ===Schollglas Unternehmensgruppe=== -

Re: [despammed] [SQL] Query two database at once

2005-05-02 Thread Andreas Kretschmer
trib on dblink. You should look in the archiv of the list, Tom Lane and other people described the way with dblink in the past. Andreas -- Andreas Kretschmer(Kontakt: siehe Header) Heynitz: 035242/47212, D1: 0160/7141639 GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net ===Schollglas

Re: [despammed] [SQL] accessing multiple database

2005-05-04 Thread Andreas Kretschmer
erent db site. Tq in > advance. 1. write your own client thats connect to several databases 2. use dblink, this is part of the contrib-distribution Andreas -- Andreas Kretschmer(Kontakt: siehe Header) Heynitz: 035242/47212, D1: 0160/7141639 GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp

Re: [despammed] [SQL] Balance Calculation

2005-05-22 Thread Andreas Kretschmer
his should solve your perfomance-problem. Regards, Andreas -- Andreas Kretschmer(Kontakt: siehe Header) Heynitz: 035242/47212, D1: 0160/7141639 GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net ===Schollglas Unternehmensgruppe=== ---

Re: [despammed] [SQL] Balance Calculation

2005-05-22 Thread Andreas Kretschmer
am 22.05.2005, um 10:17:53 +0200 mailte Andreas Kretschmer folgendes: > > can you help me how to fix them. > > Can I using function to fix them (how?) > > It is possible to create a extra table for the balance and a trigger for > insert/update that calculates the balance

Re: [despammed] [SQL] need date clarification

2005-05-23 Thread Andreas Kretschmer
ENT_DATE; date 2005-05-23 (1 Zeile) Regards, Andreas -- Andreas Kretschmer(Kontakt: siehe Header) Heynitz: 035242/47212, D1: 0160/7141639 GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net ===Schollglas Unternehmensgruppe=== --

Re: [despammed] Re: [SQL] Need clarification

2005-05-23 Thread Andreas Kretschmer
0 2005-05-23 (2 Zeilen) test=# select * from datediff where CURRENT_DATE - start > 10; start 1966-08-30 (1 Zeile) test=# select * from datediff where CURRENT_DATE - start < 10; start 2005-05-23 (1 Zeile) Btw.: please no TOFU, read http://en.wikipedia.org/wi

Re: [despammed] [SQL] Duplicated records

2005-05-24 Thread Andreas Kretschmer
am 24.05.2005, um 17:59:31 -0300 mailte [EMAIL PROTECTED] folgendes: > Hi. > How can I delete the duplicated records with "DELETE FROM TABLE WHERE..." > clause?? Please read http://www.gtsm.com/oscon2003/deletetid.html Its a very good article about this problem. Regards,

Re: [despammed] Re: [SQL] Duplicated records

2005-05-25 Thread Andreas Kretschmer
=# insert into blub values (1, 'x'); | INSERT 970706 1 | test_db=# insert into blub values (1, 'y'); | FEHLER: duplizierter Schlüssel verletzt Unique-Constraint >>blub_pkey<< ` In other words: if there a primary key on the first row, you cannot insert duplicates.

Re: [despammed] [SQL] rejecting characters in a field

2005-06-09 Thread Andreas Kretschmer
h a RULE or a TRIGGER. Regards, Andreas -- Andreas Kretschmer(Kontakt: siehe Header) Heynitz: 035242/47212, D1: 0160/7141639 GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net ===Schollglas Unternehmensgruppe=== ---(end of broadcast)---

Re: [SQL] [despammed] rejecting characters in a field

2005-06-09 Thread Andreas Kretschmer
am 09.06.2005, um 3:29:15 -0500 mailte Bruno Wolff III folgendes: > On Thu, Jun 09, 2005 at 09:18:09 +0200, > Andreas Kretschmer <[EMAIL PROTECTED]> wrote: > > am 09.06.2005, um 12:36:31 +0530 mailte Kenneth Gonsalves folgendes: > > > hi > > > i have a tab

Re: [despammed] [SQL] substr or char_length problem

2005-06-17 Thread Andreas Kretschmer
195 > > > Select * from tbl_xxx where > tbl_xxx.A2=substr('196895588454554545454',0,char_length(tbl_xxx.A2)+1); Perhaps because char_length() returns NULL and this is a invalid value for substr(). Use coalesce(): ... substr('196895588454554545454',0,coalesce(ch

Re: [despammed] [SQL] info

2005-06-20 Thread Andreas Kretschmer
am 20.06.2005, um 11:45:55 +0200 mailte Luca Rasconi folgendes: > I need to know if somebody read this mail. Yes, i read it ;-) Regards, Andreas -- Andreas Kretschmer(Kontakt: siehe Header) Heynitz: 035242/47212, D1: 0160/7141639 GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.

Re: [despammed] Re: [SQL] 'show full processlist' in postgres?

2005-07-01 Thread Andreas Kretschmer
- > 7349453 | admintool |5436 | 100 | admintool | | > 7349454 | postgres |5437 |1 | postgres | | > (2 rows) > > But 'current_query' is still always empty... B-( enable stats_command_string in your postgresql.conf Re

Re: [SQL] Problem with a Pettern Matching Check

2005-08-15 Thread Andreas Seltenreich
) scratch=# select '1'::char(3) ~ '^\\d+\\s*$'; ?column? -- t (1 row) scratch=# select '1'::varchar(3) ~ '^\\d+$'; ?column? -- t (1 row) --8<---cut here---end--->8--- regards Andreas -- ---(end of broadcast)--- TIP 6: explain analyze is your friend

<    1   2   3   4   5   >