Re: [GENERAL] Mammoth replicator
Hello Martin, You can use this mailing list https://lists.commandprompt.com/mailman/listinfo/replicator-general to ask replicator-related questions. And there is the wiki for Mammoth Replicator - https://projects.commandprompt.com/public/replicator. Martín Marqués wrote: I was working on a replication system (open source) for a DB we are using and I was going to go for Slony-I for replication and pg_pool2 for load balancing. Just yeasterday I found out the Mammoth replicator was released as Open Source, and AFAICS it looks more suitable for our needs then Slony-I (we are going to replicate the whole DB). I'm I wrong on this? And finally a question related with the instalation: are there debian binaries to install replicator? TIA -- Andrei Kovalevski PostgreSQL Replication, Consulting, Custom Development, 24x7 support Managed Services, Shared and Dedicated Hosting Co-Authors: PL/php, ODBCng - http://www.commandprompt.com/ -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
Re: [GENERAL] How to design a customer TABLE which hold credit card infos and other payments?
Hello, Scott Marlowe wrote: On Thu, Nov 6, 2008 at 2:43 PM, Michelle Konzack [EMAIL PROTECTED] wrote: * Do not Cc: me, because I READ THIS LIST, if I write here * *Keine Cc: am mich, ich LESE DIESE LISTE wenn ich hier schreibe* Sorry, it's how this list works. If you don't want that, there are some options for majordomo you can set to alleviate the issue. I'm not changing how I reply to the list just for you. Hello, I am coding a new OnlineStore (the existing ones fit not my needs, are to complicate to use or simply closed source and too expensive e.g. InterShop) with an integrated powerful ledger. So now it comes to infos about Credit Cards, PayPal and friends... If you are storing credit card data then you must follow the PCI standards for doing so. Look them up on the web and get a copy. Failure to follow their security guidelines will result in you not being allowed to process or handle credit cards. That said, the best way to store them is to not store them. If you still have to, then use some kind of encryption using the user's password as part of the key, and don't store the user's password, only an md5 of it. Also, store the password on one machine, encrypted, do the encryption decryption on another machine Try to avoid storing any card and card holder info, and you definitely shouldn't keep in DB the whole data required to authorize transaction. Just take in mind how dangerous this info could be in case of security leak. -- Andrei Kovalevski PostgreSQL Replication, Consulting, Custom Development, 24x7 support Managed Services, Shared and Dedicated Hosting Co-Authors: PL/php, ODBCng - http://www.commandprompt.com/
Re: [GENERAL] [ODBC] Error in Adding All Table
Hello, What PostgreSQL server and ODBC driver version do you use? salman Sheikh wrote: Hi freinds, i wanted to add my all tables once in MFC application,normally we add it one by one. If i add all table by pressing control and click on all table ,i can add them,but by debugging it shows me always errors. ERROR: column reference ctid is ambiguous; Error while executing the query i need also suggestion,if it is better to add all table once or one by one though dialog Box. I am using Visual C++ 2005. thanks Sheikh Pt! Schon vom neuen WEB.DE MultiMessenger gehoum l;rt? Der kann`s mit allen: *http://www.produkte.web.de/messenger/?did=3123* -- Andrei Kovalevski PostgreSQL Replication, Consulting, Custom Development, 24x7 support Managed Services, Shared and Dedicated Hosting Co-Authors: plPHP, ODBCng - http://www.commandprompt.com/
Re: [GENERAL] Connect to postgres from a dynamic IP
Hello, Jorge Godoy wrote: Em Monday 03 March 2008 08:08:36 Raymond O'Donnell escreveu: On 03/03/2008 11:01, dfx wrote: The question il: Is there a method to avoid to insert the addesses of the clients in the pg_hba.conf and to allow connections from internet with security assured only by username and password? Yes, that's what people have been explaining: you insert a line something like: host [database] [user] 0.0.0.0/0 md5 But make it hostssl instead of host, to require some cryptography in the channel used, specially to authenticate the connection. Opening your access to everyone without crypto sounds like something you don't want to do. Specially if users can change their own passwords... Does anybody ever measured performance slowdown for SSL connections? -- Andrei Kovalevski PostgreSQL Replication, Consulting, Custom Development, 24x7 support Managed Services, Shared and Dedicated Hosting Co-Authors: plPHP, ODBCng - http://www.commandprompt.com/
Re: [GENERAL] (un)grouping question
May be this is what you need: select test.uid, coalesce(t.somevalue + a.max + t.uid, test.somevalue) from test left outer join (select * from test where (uid, somevalue) not in (select min(uid), somevalue from test group by somevalue) ) t on (test.uid = t.uid), (select max(somevalue) from test) a Rhys Stewart wrote: ok, let me clarify, dont want to remove them just want them changed but need to keep the uid. However, I would like just one somevalue to remain the same. so for example, uids, 2,4 and 8 have somevalue 44, after i would like 2 to remain 44 but uids 4 and 8 would be changed. 2008/1/21, Jeff Davis [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: On Mon, 2008-01-21 at 12:36 -0500, Rhys Stewart wrote: Hi list, have the following table uid|somevalue 1|11 2|44 3|31 4|44 5|71 6|33 7|33 8|44 9|14 would like to remove the duplicate values in the column somevalue. doing this by just adding a random number is perfectly fine, however i want to retain at least one of the original values of somevalue. Any ideas how to do this in in a query? Would something like this help? SELECT MIN(uid), somevalue FROM mytable GROUP BY somevalue; Also consider just doing: SELECT DISTINCT somevalue FROM mytable; ...if you don't need uid in the result set. Regards, Jeff Davis -- Andrei Kovalevski PostgreSQL Replication, Consulting, Custom Development, 24x7 support Managed Services, Shared and Dedicated Hosting Co-Authors: plPHP, ODBCng - http://www.commandprompt.com/ ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [GENERAL] (un)grouping question
Jeff Davis wrote: On Mon, 2008-01-21 at 14:25 -0500, Rhys Stewart wrote: ok, let me clarify, dont want to remove them just want them changed but need to keep the uid. However, I would like just one somevalue to remain the same. so for example, uids, 2,4 and 8 have somevalue 44, after i would like 2 to remain 44 but uids 4 and 8 would be changed. Can you explain why you're trying to do this? It's a very unusual requirement. That being said, the query would look something like this: (SELECT MIN(uid) AS uid, somevalue FROM mytable GROUP BY somevalue) UNION (SELECT uid, somevalue + random() AS somevalue FROM mytable WHERE uid NOT IN (SELECT MIN(uid) FROM mytable GROUP by somevalue) Disclaimer: I haven't actually tested this query, but it looks about right. How can you garantee that somevalue + random() won't duplicate other unique values in this column? ;) Regards, Jeff Davis ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq -- Andrei Kovalevski PostgreSQL Replication, Consulting, Custom Development, 24x7 support Managed Services, Shared and Dedicated Hosting Co-Authors: plPHP, ODBCng - http://www.commandprompt.com/ ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [GENERAL] Newbee to databases (ODBC)
Hello, You can use SQLGetData(...) function: //Setup selectstatement strcpy((char*) SQLStmt, Select no_char, blobdata from tab1); //Execute the statement rc = SQLExecDirect(dbConnection.StmtHandle, SQLStmt, SQL_NTS); //Define what to read out from the selection set rc =SQLBindCol(StmtHandle, 1, SQL_C_LONG, (SQLPOINTER) no, sizeOf(no), NULL); rc =SQLBindCol(StmtHandle, 2 SQL_C_BINARY, (SQLPOINTER) blob, no, NULL); // get the values while(SQLFetch(StmtHandle) != SQL_NO_DATA) { void* blob = malloc(no); if (blob) { rc = SQLGetData(StmtHandle, 2, SQL_V_BINARY, blob, no, no); ... ... free (blob); } } Malm Paul wrote: Hi all, I'm sorry to bother you with this question, I know it is a C++ ODBC question. But I'm a bit desperate. Perhaps I'll be lucky. I have a table with 2 columns no_char and blobdata were no_char is number of characters in blobdata. I would like to handle each row from the result set. I have got this far: //Setup selectstatement strcpy((char*) SQLStmt, Select no_char, blobdata from tab1); //Execute the statement rc = SQLExecDirect(dbConnection.StmtHandle, SQLStmt, SQL_NTS); //Define what to read out from the selection set rc =SQLBindCol(StmtHandle, 1 SQL_C_LONG, (SQLPOINTER) no, sizeOf(no), NULL); rc =SQLBindCol(StmtHandle, 2 SQL_C_BINARY, (SQLPOINTER) blob, no, NULL); // get the values while(SQLFetch(StmtHandle) != SQL_NO_DATA) { ... ... } But this will not work since I'm using no in the second statement to define the blob size, and no is not set yet. I could solve it by using 2 different select statemen (once for the size and one for the blob) but that seems to be a bad solution. Sorry again! /Paul -- Andrei Kovalevski PostgreSQL Replication, Consulting, Custom Development, 24x7 support Managed Services, Shared and Dedicated Hosting Co-Authors: plPHP, ODBCng - http://www.commandprompt.com/ ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings
Re: [GENERAL] postgresql 8.3rc1 on vista
Hello, The first thing which should be checked on Vista - correct file access permissions. Did you create postgres.conf yourself? Niederland wrote: This seems to be an installer bug for VISTA If I run postgres via the command prompt with: postgres -D ../data then the postgres.conf file is loaded as confirmed with a show all in psql If I start postgres via the service which is installed with installer the postgres.conf file values are not loaded. But I confirmed that the service is reading the postgres.conf file. Just to test I deleted the file, and the service would not start. Any suggestions? Thanks, Roger ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match -- Andrei Kovalevski PostgreSQL Replication, Consulting, Custom Development, 24x7 support Managed Services, Shared and Dedicated Hosting Co-Authors: plPHP, ODBCng - http://www.commandprompt.com/ ---(end of broadcast)--- TIP 6: explain analyze is your friend
Re: [GENERAL] Windows x64 Port
Hello, Magnus Hagander wrote: Willem Buitendyk wrote: Is there any plan to port Postgresql to windows x64? I can currently run Postgresql as 32 bit inside Vista 64 - would I see better performance if Postgresql was running under 64 bit. My biggest concern is memory - at 32 bit is not Postgresql limited to 4GB in windows? It's something we hope will be worked on for 8.4, but there are no firm plans. It's limited to 2Gb, actually, but *per process*. Since each backend is it's own process, you can use way more than 2Gb RAM on a 64-bit system. You can't use it for shared memory, but you can use it for local backend memory (work_mem). But you'll need a lot of backends to do it, and you will see other pieces of performance get worse with loads of backend. Oh, and your RAM will still be used for disk cache, since that's managed by the kernel. I'm wondering - what kind of problems do you expect with such port? By the way, are there any benchmark results to compare 32 and 64 bit version on Linux? Thanks, Andrei. ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [GENERAL] number errors
Hello, If you use ODBC - you should devide error from ODBC driver and errors from PostgreSQL, ODBC driver return it's own error codes, and composes error Description depending on Error Code and Text from PostgreSQL server. So you should have numbers: 1) ODBC error code - described in MSDN; 2) Native PostgreSQL error code - described in PostgreSQL manual; 3) Error description - composed by ODBC driver, based on description and error code, returned from server. João Paulo Zavanela wrote: Hi all, When my application returns errors from database, some numbers errors is equals. Why number errors is equals? odbc driver or postgresql return this? It's run in Windows. Thanks. ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings
Re: [GENERAL] odbcng
Hello, This query works for me on Access 2003. Which versions of Access and ODBCng you have? We can communicate via [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]. I'll try to help you with any problems. Sam Mason wrote: On Tue, Nov 06, 2007 at 05:48:12PM -0300, Alvaro Herrera wrote: FYI there's another Postgres ODBC driver that is said to have better performance. https://projects.commandprompt.com/public/odbcng (Yes, my company maintains it) Are there any known issues when calling it from VB? I've got a VB (MS Access) client that uses PG as its backend and it seems to die horribly when doing any sort of query that returns a text column. This happens through either DAO or ADO; though DAO gives the error the size of a field is too long, ADO just segfaults. For example, the following code doesn't work for me. Looks like the sort of thing that that should get lots of test coverage so maybe it's something on my system. Public Sub test() Dim con As ADODB.Connection, rs As ADODB.Recordset Set con = New ADODB.Connection con.Open DSN=badgerstudy Set rs = con.Execute(SELECT 1, 'foo'::TEXT, 'bar') While Not rs.EOF rs.MoveNext Wend End Sub Thanks, Sam ---(end of broadcast)--- TIP 6: explain analyze is your friend Thanks, Andrei. ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [GENERAL] Npsql is much faster than ODBC ?
Rainer Bauer wrote: Alvaro Herrera wrote: Rainer Bauer wrote: Andrej Ricnik-Bay wrote: On Nov 7, 2007 2:40 PM, Rainer Bauer [EMAIL PROTECTED] wrote: That's nice to hear. But I respect licences as they are and the ODBCng driver is licenced under the GPL. That doesn't mean that you're not allowed to use it with commercial applications; it just means that you need to be happy to provide the source for it on request. Which is exactly the reason why the LGPL licence was created. So that any software can link against a library without the restrictions of the GPL. Keep in mind, though, that the ODBC driver is not linked to your app. It is only loaded on demand at run time, and can be replaced by any other ODBC driver. So AFAIU your application is shielded from GPL. IANAL of course. Neither am I. However, the GPL FAQ has an entry specially for this case: http://www.gnu.org/licenses/gpl-faq.html#NFUseGPLPlugins If the program dynamically links plug-ins, and they make function calls to each other and share data structures, we believe they form a single program, which must be treated as an extension of both the main program and the plug-ins. In order to use the GPL-covered plug-ins, the main program must be released under the GPL or a GPL-compatible free software license, and that the terms of the GPL must be followed when the main program is distributed for use with these plug-ins. ODBC drivers are loaded by ODBC driver manager - which is also dinamically linked library. Application calls functions from Driver Manager, and then manager goes farther to the driver's level of abstraction. Driver has no information about the parent application, and can't call any functions from it. Driver is not a plug-in, and application doesn't have to worry about its existance. The way I read this section is that linking to a GPL ODBC driver would imply that I have to release my program under a GPL (compatible) licence. This was one of the reasons why I added Postgres support to my program instead of MySQL [1]. They altered the licence for their drivers from LGPL to GPL so that you have to purchase a commercial licence. Rainer [1] In the meantime I am of course glad that I made this decision. I have not only learned a lot more about databases, but especially that Postgres is superior to MySQL ;-) Thanks, Andrei. ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster
Re: [GENERAL] Windows vista
Hi! PostgreSQL win32 port works pretty well on Vista. You can find latest 8.2 binaries there: http://www.postgresql.org/ftp/binary/v8.2.5/win32/ Use installer from postgresql-8.2.5-1.zip http://wwwmaster.postgresql.org/download/mirrors-ftp?file=%2Fbinary%2Fv8.2.5%2Fwin32%2Fpostgresql-8.2.5-1.zip - you'll have less problems with permissions. [EMAIL PROTECTED] wrote: Where do I get the link needed to install postgres on windows vista and do I install it. Please help I need it for a school project Sent from my Verizon Wireless BlackBerry ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match Andrei ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/
Re: [GENERAL] Installation problems
Hi! [EMAIL PROTECTED] wrote: Hi all. I post it again, not sure to have posted it correctly the last time. My problem is about installing PostgreSQL 8.2.3 on WIndows XP Mediacenter. At the end of the installation, I get the following error: unable to start the service. Administrator right required. Did you try to start the service manually from Start - Administrative Tools - Services - PostgreSQL Database Server 8.2? Obviously I'm Administrator on my machine (I've cecked it). My question is. Exists a particolar version of PostgreSQL to download for Windows XP Mediacenter? Any Idea is appreciated. Thanks in advance. Luca. -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Viaggi, voli, soggiorni...cattura l'offerta e parti con Mondolastminute Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=6850d=20070820 ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/ ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/
Re: [GENERAL] Fastest way to import only ONE column into a table? (COPY doesn't work)
Phoenix Kiula wrote: On 16/08/07, Richard Broersma Jr [EMAIL PROTECTED] wrote: --- Phoenix Kiula [EMAIL PROTECTED] wrote: On 16/08/07, Rodrigo De León [EMAIL PROTECTED] wrote: On Aug 15, 11:46 pm, [EMAIL PROTECTED] (Phoenix Kiula) wrote: Appreciate any tips, because it would be nasty to have to do this with millions of UPDATE statements! - Create an interim table - COPY the data into it - Do an UPDATE ... FROM ... Thanks! I thought about it and then gave up because SQL trumped me up. Could you please suggest what the query should look like? Based on this: http://www.postgresql.org/docs/8.1/static/sql-update.html I tried this: UPDATE t1 SET title = title FROM t2 WHERE t1.id = t2.id; UPDATE T1 SET T1.title = T2.title FROM T2 WHERE T1.id = T2.id AND T1.title IS NULL; or UPDATE T1 SET title = ( SELECT title FROM T2 WHERE T2.id = T1.id ) WHERE T1.title IS NULL; Thanks much RIchard, but neither of those work. For me table t1 has over 6 million rows, and table t2 has about 600,000. In both of the queries above I suppose it is going through each and every row of table t1 and taking its own sweet time. I've dropped all indexes on t1, but the query has still been running for over 45 minutes as I write! Any other suggestions? I'm not sure would it be faster - but you can try to create a function which will create new empty table, then fill it with the result of SELECT query. Something like this: CREATE OR REPLACE FUNCTION add_column () RETURNS INTEGER AS $$ DECLARE r RECORD; BEGIN CREATE TABLE new_table (id integer, value varchar); FOR r IN select t1.id, t2.title value from t1 left outer join t2 on (t1.id = t2.id) LOOP INSERT INTO new_table VALUES(r.id, r.title); END LOOP; return 0; end $$ LANGUAGE plpgsql; Try this function and if its' time would be acceptable - you'll need to drop existing table and rename newly created one. ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster
Re: [GENERAL] PG Admin
Bob Pawley wrote: Can anyone tell me why a table developed through the PG Admin interface isn't found by SQL when accessing it through the SQL interface?? Bob Pawley 1) Are you sure you are connecting to the same database? 2) What kind of SQL interface you are using? Andrei. ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings
Re: [GENERAL] Error installing postgresql-8.2.4 on windows 2003 server
Hkrenske wrote: I have been successful in installing to Windows 2000 but when installing the binary installation “postgresql-8.2.msi” as a service, I receive the error The program postgres is needed by initdb but was not found in the same directory as C:/Program Files/PostgreSQL/8.2/bin/initdb. Check your installation. I have checked and found both the postgres.exe and initdb.exe files in the directory C:/Program Files/PostgreSQL/8.2/bin/initdb. Does anyone have any ideas what the problem could be? Hugh Try to run initdb under non-privileged user. You can use runas /user:username initdb -D ... Andrei. ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org/
[GENERAL] pgTray - win32 tray tool for monitoring PostgreSQL service
Hi all! Everyone who use PostgreSQL server on Windows knows - it would be nice to have some tray management and monitoring tool for PostgreSQL server which is running as NT Service (for example - MS SQL already have such tool). I have created a new project on pgfoundry - http://pgfoundry.org/projects/pgtray. I'm opened for any ideas how can we improve this tool and what features whould be helpful. Thanks, Andrei. ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings
Re: [GENERAL] pgTray - win32 tray tool for monitoring PostgreSQL service
Tony Caduto wrote: Andrei Kovalevski wrote: Hi all! Everyone who use PostgreSQL server on Windows knows - it would be nice to have some tray management and monitoring tool for PostgreSQL server which is running as NT Service (for example - MS SQL already have such tool). I have created a new project on pgfoundry - http://pgfoundry.org/projects/pgtray. I'm opened for any ideas how can we improve this tool and what features whould be helpful. Thanks, Andrei. ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings Have you done any development yet? Yes, you can download and try it. Now it's a single pgtray.exe application. I'm going to make an msi installer and add Autostart option to the menu. I can do something in Delphi in a matter of hours and would be able to donate the code as a BSD license. I have done a similar tray application for Firebird and it would be just a matter of changing the service it monitors. We could also do a control panel applet. Oh, very interesting. I'm not sure it's really required - but can you provide some links about this? Andrei. ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [GENERAL] odbc with encrypted ssl key?
Hi! You may try https://projects.commandprompt.com/public/odbcng/. This PostgreSQL ODBC driver's connection string can contain parameters you need: SSL_CERTIFICATE=[string] - path to SSL certificate file SSL_PRIVATE_KEY=[string] - your SSL private key SSL_PASSPHRASE=[string] - your SSL password phrase You can either use these parameters in connection string or configure DSN. Andrei. Andreas wrote: Hi, is there a way to have MS-Access use ODBC and still use a passphrase encrypted private-key? Right now ODBC works with unencrypted key. For security reasons I'd rather have my private key stored encrypted. I suppose to do this Access had to tell the odbc driver the passphrase so that it can decrypt the key. Until now I just found 2 connection string parameters ssl and sslmode but nothing resembling ssl-passphrase. Regards A. ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq
Re: [GENERAL] problems with SELECT query results
Joshua wrote: I checked the table and found that none of my fields in the SELECT statement contain NULLs. Any other suggestions? Why are you using such constructions in your query: ',' || ',' || ',' ? May be this set of commas makes you think that some of your fields are empty? Do you have empty fields in following query? SELECT 'PV.LINEITEM:' || partnum || ',' || round(onhand) || ',' || round(qm5) || ',' || round(lsm4) || ',' || round(onorder) || ',' || binone || ',' || round(backorderqty) || ',' || round(onhold) || ',' || round(qtyperjob) || ',' || round(ordermax) AS gmrim FROM slparts WHERE vendor LIKE 'CH%' P.S. If you really need so many commas - use them in a single block ',,,' PFC wrote: SELECT 'PV.LINEITEM:' || partnum || ',' || round(onhand) || ',' || round(qm5) || ',' || round(lsm4) || ',' || ',' || ',' || round(onorder) || ',' || ',' || ',' || binone || ',' || ',' || round(backorderqty) || ',' || ',' || round(onhold) || ',' || ',' || ',' || ',' || ',' || ',' || ',' || round(qtyperjob) || ',' || round(ordermax) AS gmrim FROM slparts WHERE vendor LIKE 'CH%' You could select columns and build the string in your application ? The query does work and I am getting results from the database. There are values for all 'partnum' in the database, however, the query results include blank fields here and there in between the returned records. Why am I receiving blank fields for 'gmrim' This absolutely defies logic Because one of your fields is probably NULL, and NULL || anything stays NULL. You have probably been misled to believe they are blanks because they don't display as NULL but as . I set psql to display NULL as NULL. If these columns can, must, or should not contain NULLs depends on your application... it's for you to chose. Use COALESCE, add NOT NULL constraints, grab the columns and build the string in your application, you chose. --No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 269.8.1/822 - Release Date: 5/28/2007 11:40 AM ---(end of broadcast)--- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly ---(end of broadcast)--- TIP 6: explain analyze is your friend
Re: [GENERAL] dns less connection
Hi! First of all, be sure you have PostgreSQL ODBC driver installed. To do this - follow: start -control panel - administrative tools - data sources (ODBC) - drivers If you see in a list PostgreSQL ANSI or PostgreSQL Unicode - this means driver is installed, otherwise - you should install one of the PostgreSQL ODBC drivers: http://www.postgresql.org/ftp/odbc http://projects.commandprompt.com/projects/public/odbcng If you already have installed driver - post here your ConnectionString, so we see it and help. marcelo Cortez wrote: Andreas ,Magnus I do where you say me but... ' ''IM002: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified''') i'm follow your instrutions and replace parts of connectString but don't work . Later a try with debugging options. best regards MDC --- Andreas [EMAIL PROTECTED] escribió: http://archives.postgresql.org/ ---(end of broadcast)--- TIP 6: explain analyze is your friend
Re: [GENERAL] C functions under windows
Islam Hegazy wrote: Hi all I have postgresql server installed on a windows machine and I want to retrieve data using C functions. I followed the steps in the documentation but it didn't work for windows. I created a .dll projects for my functions but postgres.h calls .h files that I can't find on the windows machine like strings.h. I tested my functions on another server installed on a linix machine and it worked correctly. So the problem appears to be in the include files under windows. Any idea how to solve this problem... Regards Islam Hegazy If you use MSVC - try to setup 'Additional include directories' for your project. It should point to the PostgreSQL 'include' folder. ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings
Re: [GENERAL] query from a list of ids
You can try this one. SELECT table2.* FROM (SELECT string_to_array(ids, ', ') FROM table1 WHERE name = 'Peter') AS a(a), (SELECT generate_series(1,array_upper(string_to_array(ids, ', '),1)+1,1)FROM table1 WHERE name = 'Peter') c(n), table2 WHERE table2.id = a[c.n] finecur wrote: Hi, Here is my first table: Table1 name| ids - Peter| 2, 3, 4, 5 Jack| 100, 34, 3 Both name and ids are in text format. Here is my second table Table2 id | Flag | Title - 2 | Red| good 3 | Blue | poor 4 | Green| middle id is in integer (serial) format. I would like to list all the rows in table 2 where the id is in the ids field of peter. So I did select * from tables where id in (select ids from table1 where name='Peter') It did not work. How can I do the query? Thanks, ff ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [GENERAL] SQLConnect failure
[EMAIL PROTECTED] wrote: Original Message Subject: Re: [GENERAL] SQLConnect failure From: Bill Moran [EMAIL PROTECTED] Date: Mon, April 02, 2007 2:54 pm To: [EMAIL PROTECTED] Cc: pgsql-general@postgresql.org In response to [EMAIL PROTECTED]: We have code that has been using MSDE/SQL Server successfully for years, and are adding Postgres support. Doing a SQLConnect to connect to a local Postgres server works fine, but if we try to connect to a remote system, the SQLConnect fails, and we get an error code that seems to indicate The value specified for the argument UserName or the value specified for the argument Authentication violated restrictions defined by the data source.. We can connect via pgadmin to the remote system, so we believe all the little .conf files should be correct, but can't get in programmatically. Any pointers on where to look? The logs on the PostgreSQL server would be a good place to start. This sounds suspiciously like a pg_hba.conf misconfig. You might want to verify its correctness. Thanks guys. I can connect to the remote server via pgadmin on a different machine, so I'm pretty sure that the .conf files are correct (that took awhile, but there are very good diagnostic messages when they are wrong). When I set the hba, the encryption is set to MD5 - does that need to be set somewhere on the client side? What version of the PostgreSQL ODBC driver you are using? ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings