Re: [GENERAL] What is unsecure postgres languages? How to disable them?

2010-02-22 Thread Tino Wildenhain
to them unless you are super user or write insecure functions with them then say with the copy command. Regards Tino Wildenhain smime.p7s Description: S/MIME Cryptographic Signature

Re: [GENERAL] Is It Good Practice That I use TableName-Month-Year Convention

2010-01-13 Thread Tino Wildenhain
Hi, Am 13.01.2010 09:16, schrieb Yan Cheng Cheok: I realize the READ performance goes down dramatically when my table goes large. Every new day goes on, my table can increase x millions of new rows. I was wondering whether this is good practice I can design my database in this way? Instead

Re: [GENERAL] Session based transaction!!

2009-12-24 Thread Tino Wildenhain
Hi, S Arvind schrieb: Hi Everyone, In a web application running in Tomcat and Postgres 8.3 as DB, i need to know whether my given task is feasible or not. All the db operation which is done by that web application must be rollback at the end(session dies) and the DB data must be

Re: [GENERAL] Allowing for longer table names (64 characters)

2009-11-20 Thread Tino Wildenhain
Hi Allan, Am 20.11.2009 10:42, schrieb Allan Kamau: ... Thanks Andreas, I too agree it may not be a good idea to have long for various reasons including porting/upgrading issues and so on, as I have many tables, I seem to have been caught up in describing table functionality in the table name

Re: R: [GENERAL] Field's position in Table

2009-08-25 Thread Tino Wildenhain
Alvaro Herrera wrote: Michael Gould wrote: ... doesn't need to look at the overflow page. I don't know if this is true or not in PostGres. If it isn't then I'm not sure what difference it would make other than allowing for pretty documentation. Postgres does not overflow pages. Tuples are

Re: [GENERAL] Number Conversion Function

2009-04-13 Thread Tino Wildenhain
justin wrote: Tom Lane wrote: Tino Wildenhain t...@living-examples.com writes: I would not recommend to do this within the database. Thats typical a job for your presentation layer. ... but having said that, I think the money datatype has a function for this. Whether that's of any

Re: [GENERAL] Postgres: Starting Server in background mode

2009-04-09 Thread Tino Wildenhain
CM J wrote: Hi, I do not want start postgres as a service.Postgres will bundled along with my application and i am only looking at starting it only from cmd line.If there are any options to disable this cmd window which appears after executing the pg_ctl.exe start, that would be great !

Re: [GENERAL] Number Conversion Function

2009-04-06 Thread Tino Wildenhain
Abdul Rehman wrote: Hi all, Can any body help me in converting numeric values into words via postgres function: i.e. 313 to THREE HUNDRED THREE I would not recommend to do this within the database. Thats typical a job for your presentation layer. Regards Tino -- Sent via pgsql-general

Re: [GENERAL] sql transaction

2009-03-18 Thread Tino Wildenhain
Alvaro Herrera wrote: Andreas Kretschmer wrote: Alvaro Herrera alvhe...@commandprompt.com wrote: Andreas Kretschmer wrote: Jasid ZA za.ja...@gmail.com wrote: Hi, Can we use sql transactions(BEGIN, ROllBACK, COMMIT etc) in a postgresql function(user defined) which is written in PL/Perl?

Re: [GENERAL] Uploading data to postgresql database

2009-03-17 Thread Tino Wildenhain
Subha Ramakrishnan wrote: Hi All, I wanted to know if there is a way to upload kml/gpx data directly to the DB. By upload you mean...? You can always just insert the date opaque as raw field or text or use large object (lo). So far, I have been using shp2pgsql to upload data from shape

Re: [GENERAL] Imagenes

2009-03-16 Thread Tino Wildenhain
Hi Lius, Luis Cevallos wrote: Saludos Cordiales. Mi nombre es Luis Cevallos y tengo muchas dudas de como hacer para guardar una imagen desde php hasta una tabla que tiene campo oid no lo logro hacer claro estoy usando ADODB pero no se como hacerlo. it would be easier for us to help you if

Re: [GENERAL] alter multiple tables

2009-03-16 Thread Tino Wildenhain
Hi, Kodok Marton wrote: Hello, I have in every table columns like: username character varying(20) NOT NULL I want to extend the length of varchar in all tables. next time you should probably consider using a domain type (or stick to text) Since I have a lot of tables and mirrored

Re: [GENERAL] Transactions in user defined function

2009-03-13 Thread Tino Wildenhain
Jasid ZA wrote: Hi, Can we use sql transaction(BEGIN, COMMIT, REVOKE) inside a user defined function in Postgresql 8.3? Would that part of the documentation help? http://www.postgresql.org/docs/8.3/interactive/plpgsql-structure.html Functions and trigger procedures are always executed

Re: [GENERAL] Transactions in user defined function

2009-03-13 Thread Tino Wildenhain
Grzegorz Jaśkiewicz wrote: On Fri, Mar 13, 2009 at 12:03 PM, Jasid ZA za.ja...@gmail.com wrote: Hi, Can we use sql transaction(BEGIN, COMMIT, REVOKE) inside a user defined function in Postgresql 8.3? looking forward to hear from you Nope. If function does something naughty - do RAISE

Re: [GENERAL] Postgres Cookbook

2009-03-04 Thread Tino Wildenhain
Greg Smith wrote: On Wed, 4 Mar 2009, Artacus wrote: So it looks like at one time we had a cookbook. But the links are dead now. I'm not sure why Roberto Mello stopped hosting that, but you can see the last content posted there at

Re: [GENERAL] Running untrusted sql safely?

2009-02-15 Thread Tino Wildenhain
Scott Marlowe wrote: On Sun, Feb 15, 2009 at 4:39 PM, Christophe x...@thebuild.com wrote: On Feb 15, 2009, at 2:47 PM, Stuart McGraw wrote: I just hoping for some confirmation that the permissions based approach did not have some holes in it that I am not seeing. Another possibility is to

Re: [GENERAL] Need some help converting MS SQL stored proc to postgres function

2009-02-01 Thread Tino Wildenhain
Hi, Mike Christensen wrote: Hi guys, I'm in the process of migrating my database from MS SQL 2005 to PostgreSQL and there's one final stored proc that's giving me some problems.. Perhaps someone can give me some help? Here's the sproc: SELECT RecipeId, Avg(Rating) as Rating INTO

Re: [GENERAL] auto insert data every one minute

2009-01-03 Thread Tino Wildenhain
Hi, searchelite wrote: ... i can use pg_sleep..but i have thousands of data to be inserted..is there any better way using pg_sleep? I wonder what is you complete problem? It seems all the advices given so far are shots-in-the-dark. Could you perhaps expand a bit? Also for sophisticated

Re: [GENERAL] DB and Unicode problem (was: user and DB confusion)

2008-10-13 Thread Tino Wildenhain
arnuld uttre wrote: ... and I phpBB can connect to the DB now but with a new problem from phoBB3:The database you have selected was not created in UNICODE or UTF8 encoding. Try installing with a database in UNICODE or UTF8 encoding. what to do about it ? Well exactly that. What

Re: [GENERAL] access public relation from a private database

2008-09-29 Thread Tino Wildenhain
Joey K. wrote: Hello, I've created a table in public schema, CREATE TABLE public.foo (fooid SERIAL); When I try to create a table in database nowhere that references public.foo table, CREATE DATABASE nowhere; \c nowhere; CREATE TABLE bar (bar integer REFERENCES public.foo(fooid)); I get,

Re: [GENERAL] how can I find out the numeric directory name of each database in PostgreSQL 8.3

2008-09-25 Thread Tino Wildenhain
Hi, Justin Yao wrote: Hi, In PostgreSQL 7.x, I can use SQL: select datname, oid from pg_database to find out the numeric directory name under $PGDATA/base for each database. But it doesn't work for PostgreSQL 8.3. Is there any way I can do it for 8.3? What would you do with that name once

Re: [GENERAL] match an IP address

2008-09-23 Thread Tino Wildenhain
Phoenix Kiula wrote: My post at the bottom. ... No. You have no idea what the design is for. Not forum crap. What happens when you need to store in a table the activity log? ACTIVITY_ID USER_STAMP (currently user_id or ip for registered and unregistered resp.) And here it gets

Re: [GENERAL] match an IP address

2008-09-23 Thread Tino Wildenhain
Hi, Phoenix Kiula wrote: Please forgive my attempt to help you based on a woefully insufficient description of your problem and situation. I will not make any attempt to do so again. To others: thanks for your suggestions, but this issue is not one of session IDs, nor is it solved by storing

Re: [GENERAL] match an IP address

2008-09-23 Thread Tino Wildenhain
Craig Ringer wrote: Phoenix Kiula wrote: 1. What extra tax will this constraint levy on an INSERT or UPDATE on this table? There are about 100,000 inserts a day, and over three times as many UPDATES. The concurrency is pretty high -- I mean sometimes 1,000 users at the same time but no more

Re: [GENERAL] PL/Python - Execute return results

2008-09-22 Thread Tino Wildenhain
Hi, Dean Grubb wrote: Hi, plan = plpy.prepare(SELECT last_name FROM my_users WHERE first_name = $1, [ text ]) rv = plpy.execute(plan, [ name ], 5) return rv[last_name] If the SELECT command does not return any results, how do I catch/check for this? I'm surprised to find you directly

Re: [GENERAL] match an IP address

2008-09-22 Thread Tino Wildenhain
Hi, Joao Ferreira gmail wrote: well... my IP addresses are stored in a TEXT type field. that field can actually contain usernames like 'joao' or 'scott' and it can contain IP addresses Any reason not to change this in the first place? For a quick fix you could use regex to find the

Re: [GENERAL] match an IP address

2008-09-22 Thread Tino Wildenhain
Phoenix Kiula wrote: my IP addresses are stored in a TEXT type field. that field can actually contain usernames like 'joao' or 'scott' and it can contain IP addresses I think this is common DB design on many websites that have registered user IDs. Is it? Name one! Sounds like crappy

Re: [GENERAL] [OT] CSS Mailinglist?

2008-09-21 Thread Tino Wildenhain
Hi Michelle, Michelle Konzack wrote: Hello, I am changeing my website from crappy HTML Tables to CSS :-D and need some help but failed to find mailinglists for it. Does someone from you know one? I have yet to see a competent mailinglist on HTML/CSS but if websites are ok, I'd recomment

Re: [GENERAL] [pgadmin-support] PostgreSQL

2008-09-11 Thread Tino Wildenhain
, plenty. Please check the webpage of postgresql.org Cheers Tino Wildenhain smime.p7s Description: S/MIME Cryptographic Signature

Re: [GENERAL] Oracle and Postgresql

2008-09-01 Thread Tino Wildenhain
Henry wrote: On Sun, August 31, 2008 10:44 pm, Scott Marlowe wrote: The other thing that holds back PostgreSQL right now is a lack of experienced pgsql DBAs and application developers. That will change over time. And built-in, simple to use, reliable, flexible and fast replication. Many a

Re: [GENERAL] SQL optimization - WHERE SomeField STARTING WITH ...

2008-08-28 Thread Tino Wildenhain
Hi Bill, Bill wrote: The SQL database servers I have worked with cannot use and index for a SELECT of the form SELECT * FROM ATABLE WHERE AFIELD LIKE ? because there is no way to know the location of the wild card until the parameter value is known. InterBase and Firebird allow SELECT *

Re: [GENERAL] SQL optimization - WHERE SomeField STARTING WITH ...

2008-08-28 Thread Tino Wildenhain
Bill wrote: Tino Wildenhain wrote: Hi Bill, Bill wrote: The SQL database servers I have worked with cannot use and index for a SELECT of the form SELECT * FROM ATABLE WHERE AFIELD LIKE ? because there is no way to know the location of the wild card until the parameter value is known

Re: [GENERAL] Postgre connect on Postgre

2008-08-27 Thread Tino Wildenhain
Hi, Anderson dos Santos Donda wrote: Thanks man!! I'll study this module!! You should also be aware that sometimes instead of connecting two separate databases via dblink or similar, two schemas in one database can be used instead. It really depends on what you are really doing if there are

Re: [GENERAL] Dumping/Restoring with constraints?

2008-08-27 Thread Tino Wildenhain
Hi, Phoenix Kiula wrote: Hello. I have a database dump. With data and schema, which includes all the constraints and rules. But it seems the pg_dumpall command does not copy data in such a way that foreign keys are satisfied upon restoring. Because tables are inter-related, importing them keep

Re: [GENERAL] Easy upgrade on Cpanel *without* downtime

2008-08-25 Thread Tino Wildenhain
Hi, Phoenix Kiula wrote: Hi. I have googled and googled for good, simple instructions to upgrade from 8.2.3 to 8.3.3 (latest stable at this time?) I am on a Cpanel interface. Use Apache and PHP for most of my websites. This seems to be the most often quoted resource on forums etc:

Re: [GENERAL] Easy upgrade on Cpanel *without* downtime

2008-08-25 Thread Tino Wildenhain
Andrew Sullivan wrote: On Mon, Aug 25, 2008 at 11:34:00AM +0200, Tino Wildenhain wrote: (e.g. pg_dump | pg_restore to avoid wasting space 2 times) then run slony to permanently update the last bits If you're going to run slony, then the pg_dump|pg_restore step is completely wasted. Slony

Re: [GENERAL] just work installation configuration

2008-08-25 Thread Tino Wildenhain
as well as postgresql.conf and pg_hba.conf in the datadir. Usually packages should come with a README or something telling you about specific setup if you need to do anything special. Regards Tino Wildenhain smime.p7s Description: S/MIME Cryptographic Signature

Re: [GENERAL] LIKE and SIMILAR TO

2008-08-22 Thread Tino Wildenhain
Hi, c k wrote: Hello all, As we are migrating our ERP application from MySQL to PostgreSQL we have some difficulties. One of them is use of Like and Similar to operators. We often use LIKE to search a string from front-end without case sensetivity. As postgreSQL's LIKE is case sensitive, we

Re: [GENERAL] SELECT query experts, anyone?

2008-08-20 Thread Tino Wildenhain
Teemu Juntunen wrote: Hi Experts, is threre any way to SELECT values in columns instead of rows? For example select products and their manufacters in the followin way: product1; manufacturer1; manufacturer2;,,, manufacturerN product2; manufacturer3; product3; manufacturer1;..

Re: [GENERAL] CASE

2008-08-19 Thread Tino Wildenhain
c k wrote: Hi, I want to create a function as follows: case variable=value1 SQL statements case variable=value2 SQL statements case else end of case Looks like you want to use pl/pgsl and IF ... THEN ... ELSE instead? Cheers Tino smime.p7s Description: S/MIME Cryptographic Signature

Re: [GENERAL] [Q] DNS(bind) ER model

2008-08-15 Thread Tino Wildenhain
Roderick A. Anderson wrote: Anyone aware of an ER model for holding name server records? Working on the zone file data and I am getting close but keep running into the differences between MX records (with a priority) and the others that can hold either a domain/sub-domain/host name or an IP

Re: [GENERAL] size of a table on postgresql

2008-08-13 Thread Tino Wildenhain
aravind chandu wrote: Hello, The following is the procedure to calculate the disk space occupied by postgresql from a flat file. In this I didn't understood some terms 24 bytes: each row header (approximate) 24 bytes: one int field and one text field + 4 bytes:

Re: [GENERAL] automatic REINDEX-ing

2008-08-13 Thread Tino Wildenhain
Martijn van Oosterhout wrote: ... AIUI, people know VACUUM FULL sucks and that in the cases where it really helps CLUSTER is faster anyway and doesn't have the index problems. The TODO list reference several discussions on the topic. Or, failing that, what's the reason to not issue a REINDEX

Re: [GENERAL] Fwd: setting datestyle

2008-08-11 Thread Tino Wildenhain
C K wrote: Dear Friends, I have tried to set datestyle to 'DMY'. As per manual and many other posts related to this point, I have set datestyle to 'DMY' at database. but still it is needed to execute each time *set datestyle to 'DMY' *before starting any new connection. Once this is set,

Re: [GENERAL] php + postgresql

2008-07-26 Thread Tino Wildenhain
Hi, Aarni Ruuhimäki wrote: On Friday 25 July 2008 15:33, you wrote: I would avoid that in favour of using $HOME/.pgpass http://www.postgresql.org/docs/8.1/interactive/libpq-pgpass.html HTH Tino Hi, Quite right you are. Or something like this?

Re: [GENERAL] php + postgresql

2008-07-26 Thread Tino Wildenhain
Joshua D. Drake wrote: On Sat, 2008-07-26 at 11:13 +0930, admin wrote: Anyway, while I'm quite happy to continue banging out things that just work in PHP for the time being, you suggest (in a subsequent post) that there is one scripting language in particular that you'd use ... might I

Re: [GENERAL] php + postgresql

2008-07-26 Thread Tino Wildenhain
Leif B. Kristensen wrote: On Friday 25. July 2008, Christophe wrote: ... My 2 cents: The prime reason for the popularity of PHP is probably the very gentle learning curve. You can start with a static HTML page, and introduce a few PHP snippets to show dynamic content. For us self-taught

Re: [GENERAL] php + postgresql

2008-07-26 Thread Tino Wildenhain
Bill Wordsworth wrote: ... PHP is faster than Python, has a smaller memory foot-print than Python, has better SOAP features than Python, and is better suited for the web than Python. Python is better suited for the cli/mac/desktop/phone. Do you have proof for that? Or is this similar to MySQL

Re: [GENERAL] php + postgresql

2008-07-25 Thread Tino Wildenhain
Hi, admin wrote: Thanks again for replies. I know those questions were pretty vague. I need to set up some methodical test scripts that replicate my problems, so that it is clear what is going on. There does seem to be some evidence of problems historically with PHP and persistent

Re: [GENERAL] php + postgresql

2008-07-25 Thread Tino Wildenhain
Aarni Ruuhimäki wrote: ... Not sure what causes this with your server but I always use something like this, ie first connect then do your stuff and then close the connection: require(dbconnect.inc); // holds the $conn which is pg_connect(with passes) I would avoid that in favour of using

Re: [GENERAL] php + postgresql

2008-07-25 Thread Tino Wildenhain
Hi, admin wrote: Is there any special reason to use PHP? There are a couple other scripting languages useable for the web which do all have better abstration available. (afaic even PHP does have some more abstration to just using pg* functions) Well, yes, there are alternatives of course and

Re: [GENERAL] php + postgresql

2008-07-25 Thread Tino Wildenhain
Andrew Sullivan wrote: On Fri, Jul 25, 2008 at 01:41:50PM -0400, Jonathan Bond-Caron wrote: Uhm, let's not start a PHP debate. Well it was just a innocent question since the original poster did not seem to know the language of choice good enough to solve this rather basic problem. (Note,

Re: [GENERAL] A couple of newbie questions ...

2008-07-23 Thread Tino Wildenhain
Shane Ambler wrote: Raymond O'Donnell wrote: ... INSERT INTO table (fld_y, fld_z) VALUES ('y', 'z'); Another way is INSERT INTO table VALUES (NULL,'y','z') of course you meant: INSERT INTO table VALUES (DEFAULT,'y','z') since Null would be wrongly insert NULL value instead of using the

Re: [GENERAL] Getting source code for database objects

2008-07-09 Thread Tino Wildenhain
Richard Huxton wrote: Artacus wrote: Easier would be just uing pg_dump -s schema.sql to get all schema objects so you could check them into subversion. If you want only specific objects, pg_dump -l listofobjects, then edit this list as you like and use pg_dump -L listofobjects

Re: [GENERAL] Getting source code for database objects

2008-07-08 Thread Tino Wildenhain
Artacus wrote: On pgadmin, when you click on a table or function, you get the source code (DDL) to create that table or function. I want to take that and check it into subversion so I have one file for each table, function, view, etc. My question is, how do you get that source code? I've

Re: [GENERAL] To store and retrive image data in postgresql

2008-07-07 Thread Tino Wildenhain
Hi, Craig Ringer wrote: Brent Wood wrote: ... I need to store an image in postgresql database and after that i need to retrive the image back.Can you please help me how to do this? ... - Storing image data in the DB is probably much less efficient in storage space and for

Re: [GENERAL] limits?

2008-06-23 Thread Tino Wildenhain
Thomas Kellerer wrote: Steve Atkins wrote on 23.06.2008 20:21: In real use you're unlikely to hit any limits, theoretical or practical, I imagine that the 1GB column-value limit is something that could be reached though. Especially for BLOB (aka bytea) or CLOB (aka text) columns. No, since

Re: [GENERAL] Method to detect certain characters in column?

2008-06-23 Thread Tino Wildenhain
Hi Ian, Ian Meyer wrote: Ah, so I forgot to mention the one caveat to this (sorry!) was there was a ton of punctuation/spaces and other ilk.. so this is what I came up with: bco=# select name from member where not (name ~ '^[A-Za-z0-9[:punct:] ]*$'); name --

Re: [GENERAL] Losing data

2008-06-19 Thread Tino Wildenhain
Hi, Garry Saddington wrote: On Thursday 19 June 2008 16:55, Joshua D. Drake wrote: On Thu, 2008-06-19 at 16:55 +0100, Garry Saddington wrote: ... Yes I thought of this but once the report is sent to the DB a separate query is run to get all of that teacher's reports and these are then

Re: [GENERAL] How to INSERT empty line into SEQUENTIAL table from PHP

2008-06-16 Thread Tino Wildenhain
A. Kretschmer wrote: insert into table_xx (id, field2, ...) values (NULL, ...) I'd say it should be DEFAULT instead of NULL :-) T. smime.p7s Description: S/MIME Cryptographic Signature

Re: [GENERAL] fitler database list

2008-06-09 Thread Tino Wildenhain
Christophe Simonis wrote: Is it a way to filter the database list on the tables containt in the database ? Yes it is. Cheers Tino :-) smime.p7s Description: S/MIME Cryptographic Signature

Re: [GENERAL] PL/pgSQL graph enumeration function hangs

2008-06-08 Thread Tino Wildenhain
Charles F. Munat wrote: Thanks, but the join clause is there, it's just buried in the subqueries. If there is a problem, it is probably that the loop never ends. Or it could be that the answer is exponential, and I just have too many rows in the source table and too deep a graph. I figured

Re: [GENERAL] Extracting data from deprecated MONEY fields

2008-06-07 Thread Tino Wildenhain
Hi, Shane Ambler wrote: ... I think the steps Joshua is referring to are - 1. pg_dump -t mytable_with_money mydb mytable_backup.sql 2. edit table definition in backup file to use numeric 3. remove $ and , from money column data 4. DROP TABLE mytable_with_money 5. psql mytable_backup.sql

Re: [GENERAL] Extracting data from deprecated MONEY fields

2008-06-07 Thread Tino Wildenhain
Hi, Tino Wildenhain wrote: Hi, Shane Ambler wrote: ... I think the steps Joshua is referring to are - 1. pg_dump -t mytable_with_money mydb mytable_backup.sql 2. edit table definition in backup file to use numeric 3. remove $ and , from money column data 4. DROP TABLE mytable_with_money 5

Re: [GENERAL] How can I compare sql create script with running database?

2008-06-05 Thread Tino Wildenhain
Hi, Bjørn T Johansen wrote: On Thu, 05 Jun 2008 11:06:36 +0100 Raymond O'Donnell [EMAIL PROTECTED] wrote: On 05/06/2008 10:52, Bjørn T Johansen wrote: If I already have a running database, how can I compare the tables in the database with the sql script to discover the differences? You can

Re: [GENERAL] Temporary Tables and Web Application

2008-06-05 Thread Tino Wildenhain
Hi, Tim Tassonis wrote: Hi all I assume this is not an uncommon problem, but so far, I haven't been able to find a good answer to it. I've got a table that holds log entries and fills up very fast during the day, it gets approx. 25 million rows per day. I'm now building a web application

Re: [GENERAL] Defining character sets for indicidual fields

2008-06-01 Thread Tino Wildenhain
Hi, Steve Atkins wrote: On May 31, 2008, at 6:22 PM, Ram Ravichandran wrote: Hi, By default, my postgresql server is set to use UTF8 character set. I was wondering if there is any way to make sure that certain fields like url etc. only makes use of ascii. My main aim is to save space by

Re: [GENERAL] cannot use result of (insert .. returning)

2008-05-31 Thread Tino Wildenhain
dvs wrote: Hello, I need to use query like: ,c from anytable where condition but it say ERROR: syntax error at or near into did you try with: select (insert into test (a) values (x) returning b) query_a JOIN c ON ... ? Tino. smime.p7s Description: S/MIME Cryptographic Signature

Re: [GENERAL] Extracting \ Generate DDL for existing object permissions

2008-05-22 Thread Tino Wildenhain
Raymond O'Donnell wrote: On 22/05/2008 22:33, smiley2211 wrote: 1) dump database A - 2) Extract permissions from database B - (HOW) How about dumping B using the plain-text format, then running the output through grep, looking for lines starting with GRANT...? Hint: sometimes easier

Re: [GENERAL] Substring Problem

2008-05-13 Thread Tino Wildenhain
[EMAIL PROTECTED] wrote: Type casting is required since 8.3, try SELECT substring(date :: varchar from 1 for 7) AS stryearmonth, ^^ sorry but this hurts and should not recommended. I think depesz approach with to_string() and the correct format string is the better

Re: [GENERAL] PHP Warning: pg_connect(): Unable to connect to PostgreSQL server: could not connect to server:

2008-05-12 Thread Tino Wildenhain
Hi, Abdus Samad Ansari wrote: PHP Warning: pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: I have setup PHP/Postgres and is running fine upto document root i.e. /var/www/html, but when i am calling it through a cgi-bin php file it is giving log error as :

Re: [GENERAL] Import German Decimal Numbers

2008-05-07 Thread Tino Wildenhain
Jan Christian Dittmer wrote: Thank you very much! You have remind me that the our server runs under Linux and not under Windows as our clients :-) So indeed I can use a sed-pipe construct to switch '.' and ','. But wait, there is just another problem then. Our date format is also german :-(

Re: [GENERAL] Import German Decimal Numbers

2008-05-07 Thread Tino Wildenhain
Thomas Pundt wrote: On Mittwoch, 7. Mai 2008, Jan Christian Dittmer wrote: | The (current) file is 1.4 GB so it will take ages to let awk chew on it | I guess. If you think awk is a bottleneck, I'd recommend using perl instead. It's waaay faster and should process your file within minutes if

Re: [GENERAL] Import German Decimal Numbers

2008-05-07 Thread Tino Wildenhain
William Temperley wrote: ... Bit of a tangent, but Is there any possibility of SQL injection via data provided to copy? depends on how you call COPY, but usually not :-) Cheers Tino smime.p7s Description: S/MIME Cryptographic Signature

Re: [GENERAL] Request for Materialized Views

2008-05-05 Thread Tino Wildenhain
Hi, [EMAIL PROTECTED] wrote: Hi, I am not sure about the right place to post this question so I'm trying here first: We are using Postgres in our company successfully since 2001 but now we arrived at the conclusion that we really need Materialized Views for our further business. Also we

Re: [GENERAL] operator varchar = integer

2008-05-05 Thread Tino Wildenhain
Hi, Daniel Schuchardt wrote: David Fetter schrieb: That technical debt is a risk to your whole project, and you need to dedicate resources to paying it down. http://en.wikipedia.org/wiki/Technical_debt There are ways to get those automated casts, but they will only make your situation worse

Re: [GENERAL] operator varchar = integer

2008-05-05 Thread Tino Wildenhain
Hi, Daniel Schuchardt wrote: Tino Wildenhain schrieb: Hi, ... Comparing int with text in general does not sound like a very good idea to me. It should be quite easy to write a script to identify such places so you can either change the datatypes (preferred) or add the cast. Then rerun your

Re: [GENERAL] operator is not unique: integer || integer

2008-05-05 Thread Tino Wildenhain
Hi, Daniel Schuchardt wrote: ... in 81: postgres=# SELECT 1::INTEGER||1::INTEGER; ?column? -- 11 (1 row) *shudder* is this actually a port of an application originally targeted at M*Sql? ;) Are you using those columns somewhere with their real type - as integer? I mean if you use

Re: [GENERAL] operator is not unique: integer || integer

2008-05-05 Thread Tino Wildenhain
Daniel Schuchardt wrote: Tino Wildenhain schrieb: Hi, Daniel Schuchardt wrote: ... in 81: postgres=# SELECT 1::INTEGER||1::INTEGER; ?column? -- 11 (1 row) *shudder* is this actually a port of an application originally targeted at M*Sql? ;) Are you using those columns somewhere

Re: [GENERAL] How to modify ENUM datatypes?

2008-05-02 Thread Tino Wildenhain
Andrew Sullivan wrote: On Fri, May 02, 2008 at 09:18:39AM -0700, Rob Wultsch wrote: Not really Postgres's problem, but for whatever its worth if I do the following on Debian stable: $apt-get install postgresql I get 7.4 . When I install Debian I generally expect the software to be supported

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-28 Thread Tino Wildenhain
Hi, Merlin Moncure wrote: On Thu, Apr 24, 2008 at 3:01 PM, Tino Wildenhain [EMAIL PROTECTED] wrote: Merlin Moncure wrote: I think you're being a little too hard on enums here. I was actually in the anti-enum camp until it was demonstrated to me (and in my own testing) that using enum

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-25 Thread Tino Wildenhain
D. Dante Lorenso wrote: Alvaro Herrera wrote: D. Dante Lorenso wrote: Or, here's another way to look at it ... make it easier to modify ENUM datatypes because we all know that you will eventually need that feature whether you males, females, and unknowns think so or not. Agreed. Let's

Re: [GENERAL] How to modify ENUM datatypes?

2008-04-24 Thread Tino Wildenhain
Merlin Moncure wrote: On Thu, Apr 24, 2008 at 12:22 PM, Andrew Sullivan [EMAIL PROTECTED] wrote: The first time I encountered them, I thought enums were a filthy, ill-conceived answer to a problem that didn't exist, implemented by people who didn't understand relational databases. With

Re: [GENERAL] Secure where in(a,b,c) clause.

2008-04-04 Thread Tino Wildenhain
Steve Atkins wrote: ... I count the number of values that I want to put in the IN () clause, then create a query string with the right number of bind variables in the in clause, then bind the values. So for {1, 3, 5} I'd use select * from foo where bar in (?, ?, ?) and for {1,5,7,9,11} I'd use

Re: [GENERAL] Survey: renaming/removing script binaries (createdb, createuser...)

2008-03-30 Thread Tino Wildenhain
Chris Browne wrote: ... pg_ctl is really more like the scripts in /etc/init.d; whatever it ought to be called instead, I don't think safe_postgresqld is it... eek. where is that save_ something coming from? Apache uses apachectl which seems pretty forward - pg_ctl seems to be in the same

Re: [GENERAL] Unicode comment on Postgres vs Sql Server

2008-03-02 Thread Tino Wildenhain
spec. You could work around that with a functional index. Regards Tino Wildenhain ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings

Re: [GENERAL] Unicode comment on Postgres vs Sql Server

2008-03-02 Thread Tino Wildenhain
Swaminathan Saikumar wrote: I am familiar with MS Sql Server just started using Postgres. For storing Unicode, Sql Server uses nvarchar/char for unicode, and uses char/varchar for ASCII. Postgres has this encoding setting at the database level. I am using UTF8 Unicode for most of my data,

Re: [GENERAL] Querying the schema for column widths - what syntax do I use?

2008-02-22 Thread Tino Wildenhain
Hi Howard, Howard Wilkinson wrote: I am working on some upgrades to the MyDNS open source product. I have some expertise in MySQL but am not overly familiar with PostgreSQL and need some guidance on how to query the schema for the maximum size of data a column can hold. In MySQL I can do

Re: [GENERAL] selective backup and restore

2008-02-22 Thread Tino Wildenhain
Hi, [EMAIL PROTECTED] wrote: Hi All. Is it possible in postgreSQL 8.2.4, using pg_dump.exe, make a backup/restore conditioned to the key of some tables (respecting existing constraints)? You can either use the -t option or with a full backup in custom format you can pick a few objects

Re: [GENERAL] Regex query not using index

2008-02-20 Thread Tino Wildenhain
Postgres User wrote: im trying to allow the client to pass a varchar param into my function, and want to avoid any parsing of the parameter inside the function, or code to build a sql string. if the function can use this code, it will be compiled and optimized (unlike a dynamic sql stirng)

Re: [GENERAL] Perceived weaknesses of postgres

2008-02-13 Thread Tino Wildenhain
Csaba Nagy wrote: http://www.theserverside.com/news/thread.tss?thread_id=48339 The interesting part is where somebody asks why NOT use postgres, and it's answers could give some additional hints to those interested on what people find missing from postgres to adopt it. Just to summarize some

Re: [GENERAL] dynamic crosstab

2008-02-13 Thread Tino Wildenhain
Hi, SunWuKung wrote: Hi, I found this to create dynamic crosstabs (where the resulting columns ... This could work although for hundreds of columns it looks a bit scary for me. Well I'd say hundreds of columns are always scary, no matter how you do it :-) ... I know that most db people

Re: [GENERAL] A select DISTINCT query?

2008-01-27 Thread Tino Wildenhain
Phil Rhoades wrote: People, I want to select from a table ONLY unique records ie if a column has values: 1 2 3 3 4 5 I want ONLY these records returned: 1 2 4 5 SELECT count(*) as cnt,a,b,c FORM yourtable GROUP BY a,b,c HAVING cnt=1 should do. Regards Tino

Re: [GENERAL] Query to get column-names in table via PG tables?

2008-01-15 Thread Tino Wildenhain
Ken Johanson wrote: I am looking for expertise on how to program the equivalent to this query, but using the pg_catalog tables, which I understand have fewer security restrictions than information_schema in some cases: SELECT column_name FROM information_schema.columns WHERE table_catalog=? AND

Re: [GENERAL] insert into ... select ... and column order

2008-01-15 Thread Tino Wildenhain
Tore Halset wrote: Hello. One of our users tried a insert into ... select ... that gave a strange error message. After digging into the issue, the problem seem to be that the order of the columns in the select statement must match the table definition. Here is a way to reproduce this case.

Re: [GENERAL] Simpler dump?

2007-12-10 Thread Tino Wildenhain
Hi Ted, Ted Byers wrote: Thanks Uwe This is a great start. It reduces the dump from 2 MB down to 167K, but out of 6833 lines of SQL, 5744 relate to the public schema in the DB, and I didn't touch that. It has over a dozen types, 419 functions, c., that were put there by postgresql the moment

Re: [GENERAL] Simpler dump?

2007-12-10 Thread Tino Wildenhain
Hi Ted, Ted Byers wrote: --- Tom Lane [EMAIL PROTECTED] wrote: ... it's not pg_dump's fault --- you need to clean out template1. Thanks Tom, Where will I find template1? When I look at the databases on the server, the only template I see is called template_postgis. Most of the extra

Re: [GENERAL] Simpler dump?

2007-12-10 Thread Tino Wildenhain
Douglas McNaught wrote: On 12/10/07, Ted Byers [EMAIL PROTECTED] wrote: Where will I find template1? When I look at the databases on the server, the only template I see is called template_postgis. Most of the extra stuff I see in all my databases relates to geometry that I find in this

Re: [GENERAL] subversion support?

2007-10-26 Thread Tino Wildenhain
Hi Dave, Dave Page schrieb: --- Original Message --- From: Roberts, Jon [EMAIL PROTECTED] To: pgsql-general@postgresql.org Sent: 25/10/07, 17:35:32 Subject: Re: [GENERAL] subversion support? Complaint? Who is complaining? I am simply asking if this feature that is rather common

Re: [GENERAL] subversion support?

2007-10-25 Thread Tino Wildenhain
Hi, Roberts, Jon schrieb: I could use psql instead of pgAdmin then which isn't what I want. Having used Quest software SQL Navigator since 97 for Oracle and then migrated to Toad for Oracle which both products have integration to source control, it is hard to revert back to a command line or

  1   2   3   4   >