Re: [GENERAL] SUBSTRING performance for large BYTEA

2007-08-18 Thread Karsten Hilbert
On Sat, Aug 18, 2007 at 12:20:42PM -0400, Tom Lane wrote: Vance Maverick [EMAIL PROTECTED] writes: My question is about performance in the postgres server. When I execute SELECT SUBSTRING (my_bytea FROM ? FOR ?) FROM my_table WHERE id =3D ?, does it fetch the whole BYTEA into memory? Or

Re: [GENERAL] SUBSTRING performance for large BYTEA

2007-08-18 Thread Karsten Hilbert
On Sat, Aug 18, 2007 at 12:49:09PM -0400, Tom Lane wrote: Joshua D. Drake [EMAIL PROTECTED] writes: Should we consider setting storage external by default for the type? No. That would be counterproductive for the more typical case of bytea values in the range of

Re: [GENERAL] SUBSTRING performance for large BYTEA

2007-08-18 Thread Karsten Hilbert
On Sat, Aug 18, 2007 at 10:23:42AM -0700, Joshua D. Drake wrote: SET STORAGE EXTERNAL (before storing anything in it...) See the ALTER TABLE reference page. Now, to convert an existing bytea column I would need to add a new bytea column with set storage external, move the data from

Re: [GENERAL] SUBSTRING performance for large BYTEA

2007-08-18 Thread Karsten Hilbert
On Sat, Aug 18, 2007 at 09:32:33PM +0100, Gregory Stark wrote: I do have to wonder how you're getting the data *in* though. If it's large enough to have to stream out like this then how do you initially load the data? Well, in my particular case it isn't so much that I *want* to access bytea

Re: [GENERAL] SUBSTRING performance for large BYTEA

2007-08-18 Thread Karsten Hilbert
On Sat, Aug 18, 2007 at 01:51:18PM -0400, Tom Lane wrote: Karsten Hilbert [EMAIL PROTECTED] writes: Would it be feasible to add an ALTER TABLE mode ... set storage externally-extended cutoff size ... where size is the user configurable size of the column data at which PostgreSQL

Re: [GENERAL] check if database is correctly created

2007-08-15 Thread Karsten Hilbert
On Wed, Aug 15, 2007 at 10:08:36AM +0200, Alain Roger wrote: i would like to check (via PHP or C#) if my database has been correctly created. for that i use the following SQL : select * from pg_tables where tablename = 'xxx' AND schemaname = 'yyy'; this i repeat till i check all tables.

Re: [GENERAL] Moving to postgresql and some ignorant questions

2007-08-14 Thread Karsten Hilbert
On Tue, Aug 14, 2007 at 11:09:36PM +0800, Phoenix Kiula wrote: If I am reading this right, does this mean it is probably better to leave fsync as fsync=off on production machines? No, you want fsync=on on any machine which holds data you care about. And you want hardware which doesn't lie to

Re: [GENERAL] timestamp skew during 7.4 - 8.2 upgrade

2007-08-10 Thread Karsten Hilbert
On Fri, Aug 10, 2007 at 10:11:29AM +0200, Louis-David Mitterrand wrote: So if I understand correctly, a timestamp_tz is ... ... stored as UTC in the backend ... sent to clients shifted by whatever timezone was requested by the client by one of several mechanisms: - set timezone to

Re: [GENERAL] russian case-insensitive regexp search not working

2007-07-10 Thread Karsten Hilbert
On Tue, Jul 10, 2007 at 08:40:24AM +0400, alexander lunyov wrote: Just to clarify: lower() on both sides of a comparison should still work as expected on multibyte encodings ? It's been suggested here before. lower() on both sides also does not working in my case, it still search for

Re: [GENERAL] russian case-insensitive regexp search not working

2007-07-09 Thread Karsten Hilbert
On Mon, Jul 09, 2007 at 04:00:01PM +0400, alexander lunyov wrote: I found this bug report: http://archives.postgresql.org/pgsql-bugs/2006-09/msg00065.php Is it about this issue? Yes. And will it be fixed someday? Likely. In the meantime lower() can come to the rescue. Karsten -- GPG key

Re: [GENERAL] russian case-insensitive regexp search not working

2007-07-09 Thread Karsten Hilbert
On Mon, Jul 09, 2007 at 09:50:42AM -0400, Tom Lane wrote: On Mon, Jul 09, 2007 at 04:00:01PM +0400, alexander lunyov wrote: I found this bug report: http://archives.postgresql.org/pgsql-bugs/2006-09/msg00065.php Is it about this issue? Yes. And will it be fixed someday? Likely.

Re: [GENERAL] multimaster

2007-06-05 Thread Karsten Hilbert
On Sun, Jun 03, 2007 at 07:47:04PM +0200, Alexander Staubo wrote: For example, part of the point of having validations declared on the model is so that you can raise user-friendly errors (and pipe them through gettext for localization) such as Your password must be at least 4 characters long

Re: [GENERAL] In theory question

2007-05-09 Thread Karsten Hilbert
On Wed, May 09, 2007 at 10:29:02AM -0700, Joshua D. Drake wrote: This is exactly what I was asking about. So my theoretical idea has already been implemented. Now if only *all* my ideas were done for me by the time I came up with them :) Then you wouldn't be able to eventually patent them

Re: [GENERAL] Any guide to indexes exists?

2007-05-07 Thread Karsten Hilbert
On Mon, May 07, 2007 at 10:47:24AM -0500, Jim Nasby wrote: GiST can also be useful if you have to query in multiple dimensions, which can occur outside the normal case of geometry. Best example I know of is a table containing duration information in the form of start_time and end_time.

Re: [GENERAL] An alternatives to rules and triggers

2007-05-05 Thread Karsten Hilbert
On Sat, May 05, 2007 at 03:01:36PM +1200, Glen Eustace wrote: Is there some way that one can determine whether a table has changed i.e. an insert, delete, update, without having to resort to setting a flag in another table using a triger or rule. You can NOTIFY a LISTENing client which does

Re: [GENERAL] dollar-quoting trouble

2007-04-23 Thread Karsten Hilbert
On Fri, Apr 20, 2007 at 06:08:36PM +0930, Shane Ambler wrote: If you do want 2 versions installed (both in different prefix dirs) at the same time then you probably want to make sure that your shell $PATH setting includes the path to the newer version of psql and then specify the full path

Re: [GENERAL] dollar-quoting trouble

2007-04-20 Thread Karsten Hilbert
On Fri, Apr 20, 2007 at 12:40:45PM +1000, Klint Gore wrote: I can't spot the trouble with this function definition: ... PostgreSQL 8.1.8 (Debian/Etch) is telling me: Actually, Lenny. psql:dem-identity.sql:43: ERROR: unterminated dollar-quoted string at or near $null_empty_title$ begin

[GENERAL] dollar-quoting trouble

2007-04-19 Thread Karsten Hilbert
Hi all, I can't spot the trouble with this function definition: create function dem.trf_null_empty_title() returns trigger language plpgsql as $null_empty_title$ begin if (NEW.title is null) then return NEW; end if; if

Re: [GENERAL] Creation of a read-only role.

2007-03-17 Thread Karsten Hilbert
On Sat, Mar 17, 2007 at 01:47:11AM +0300, Dmitry Koterov wrote: When we start using of any replication system (e.g. Slony) we need to create a read-only role for access the database. This role must be able to read anything, but should NOT be able to INSERT, UPDATE or DELETE for all database

Re: HIPPA (was Re: [GENERAL] Anyone know ...)

2007-03-09 Thread Karsten Hilbert
On Fri, Mar 09, 2007 at 08:08:11AM -0500, Kenneth Downs wrote: First, security is defined directly in terms of tables, it is not arbitrated by code. The public group has SELECT access to the articles table and the schedules tables, that's it. If a person figures out how our links work

Re: HIPPA (was Re: [GENERAL] Anyone know ...)

2007-03-09 Thread Karsten Hilbert
On Fri, Mar 09, 2007 at 11:02:45AM -0500, Kenneth Downs wrote: First, security is defined directly in terms of tables, it is not arbitrated by code. The public group has SELECT access to the articles table and the schedules tables, that's it. If a person figures out how our links work

Re: HIPPA (was Re: [GENERAL] Anyone know ...)

2007-03-09 Thread Karsten Hilbert
On Fri, Mar 09, 2007 at 12:22:19PM -0500, Kenneth Downs wrote: My interest was more towards the we get an email part. What level do you send that from ? A trigger ? The web framework does that. I see. IOW if a violation happens below the web layer the e-mail doesn't get send. I thought you

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-19 Thread Karsten Hilbert
On Mon, Feb 19, 2007 at 10:16:12AM +0100, Alban Hertroys wrote: What I'm trying to say is not that it _is_ immutable, but that it _behaves_ immutable (under said conditions). This could imply that if a certain condition is available in a query on which such a function operates, it would

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-19 Thread Karsten Hilbert
On Mon, Feb 19, 2007 at 10:58:50AM +0100, Martijn van Oosterhout wrote: I'll solve it with a date_trunc_utc() wrapper. It should be noted the date_truc(timestamptz) is not immutable, whereas date_trunc(timestamp) is. Thus you should be able to make an index on: date_trunc(

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-19 Thread Karsten Hilbert
On Mon, Feb 19, 2007 at 12:53:15PM +0100, Martijn van Oosterhout wrote: Well, your queries need to use the same form, ie: SELECT blah FROM foo WHERE date_trunc( 'entered_timestamp'::timestamptz AT TIME ZONE 'UTC', 'foo' ) Thought so. That seems a bit error prone though, so your idea of

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-19 Thread Karsten Hilbert
On Mon, Feb 19, 2007 at 12:41:11PM -0600, Bruno Wolff III wrote: Karsten Hilbert [EMAIL PROTECTED] wrote: The date-of-birth field in our table holding patients is of type timestamp with time zone. One of our patient search queries uses the date-of-birth field to find matches. Since

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-19 Thread Karsten Hilbert
On Mon, Feb 19, 2007 at 03:28:01PM -0600, Bruno Wolff III wrote: What is the technical reason that makes you wonder ? Because it would make doing the queries simpler. If you aren't collecting the data, it doesn't make sense to deal with the extra headaches involved with pretending you know

Re: [GENERAL] [ANNOUNCE] Advisory on possibly insecure security definer functions

2007-02-18 Thread Karsten Hilbert
On Sat, Feb 17, 2007 at 11:31:19AM -0700, Michael Fuhr wrote: If you schema-qualify objects instead of setting search_path then don't forget about operators. I knew I had missed something. SELECT col FROM schemaname.tablename WHERE othercol operator(pg_catalog.=)

[GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-18 Thread Karsten Hilbert
Hi all, we (GNUmed) run a medical database on PostgreSQL. We are very pleased with it (PostgreSQL, that is ;-) in all aspects. The date-of-birth field in our table holding patients is of type timestamp with time zone. One of our patient search queries uses the date-of-birth field to find

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-18 Thread Karsten Hilbert
followup to self: On Sun, Feb 18, 2007 at 12:29:17PM +0100, Karsten Hilbert wrote: So I figured it would make sense to add a functional index on date_trunc('day', dob) to the patients table. Which worked (appeared to, at least) with PG 7.4. One of our users is on PG 8.2 PostgreSQL 8.1 I

Re: [GENERAL] Why *exactly* is date_trunc() not immutable ?

2007-02-18 Thread Karsten Hilbert
On Sun, Feb 18, 2007 at 09:19:43PM +0900, Michael Glaesemann wrote: What I don't understand, however, is exactly *why* date_trunc is not immutable ? I believe it's because the result of date_trunc depends on the time zone setting for the session. ... So, given the same arguments,

Re: [GENERAL] [ANNOUNCE] Advisory on possibly insecure security definer functions

2007-02-17 Thread Karsten Hilbert
On Sat, Feb 17, 2007 at 01:26:34PM +0900, Tatsuo Ishii wrote: But if we insert a set schema search_path command in an SQL function, the caller will be affected by it. Doing reset search_path before returning to caller might solve some of problems, but it will not recover caller's special

Re: [GENERAL] DBMS Engines and Performance

2007-01-31 Thread Karsten Hilbert
On Wed, Jan 31, 2007 at 09:57:21AM +0100, Mikael Carneholm wrote: I'm tired of teenage 1337 skill0rz PHP hackers who go whoaah, 0ms! after running select count(*) from forum_posts in a single thread (the developer himself testing his app), and then claim MySQL rocks! I tested the postgres 7.1

[GENERAL] self-referential UPDATE problem on 7.4

2007-01-04 Thread Karsten Hilbert
Hello ! I am trying to run this query in psql: update clin.episode set fk_patient = clin.health_issue.fk_patient from clin.health_issue where clin.episode.fk_patient is NULL and clin.episode.fk_health_issue = clin.health_issue.pk; It returns UPDATE 2 which is what I expect from

Re: [GENERAL] self-referential UPDATE problem on 7.4

2007-01-04 Thread Karsten Hilbert
On Thu, Jan 04, 2007 at 11:36:35AM -0500, Tom Lane wrote: update clin.episode set fk_patient = clin.health_issue.fk_patient from clin.health_issue where clin.episode.fk_patient is NULL and clin.episode.fk_health_issue = clin.health_issue.pk; It returns UPDATE 2 which is

Re: [GENERAL] self-referential UPDATE problem on 7.4

2007-01-04 Thread Karsten Hilbert
On Thu, Jan 04, 2007 at 06:37:23PM +0100, Karsten Hilbert wrote: It returns UPDATE 2 which is what I expect from the data. However, the rows in question are not actually updated. That seems very strange. Could you perhaps have a BEFORE UPDATE trigger that's changing the values back

Re: [GENERAL] Large IN query optimization

2006-12-13 Thread Karsten Hilbert
On Wed, Dec 13, 2006 at 02:08:44PM -0500, Tom Lane wrote: Are you on 8.2? 8.1 is pretty stupid about joins to inheritance trees. To put up a number for stupid: For GNUmed a particular query involving one-level inheritance went down from over ten minutes to under one second just by running

[GENERAL] inheritance and index use (similar to UNION ALL)

2006-12-11 Thread Karsten Hilbert
Hi, we have a parent table root_item with a few common fields (one is a text field) from which a whole bunch of child tables derives. We need to run queries against the text field across the whole bunch of child tables. What naturally comes to mind is to run the query against

Re: FW: [GENERAL] Male/female

2006-12-11 Thread Karsten Hilbert
On Fri, Dec 08, 2006 at 04:50:16PM +0100, Alban Hertroys wrote: Why not use unicode symbols 0x2640 and 0x2642? A clever idea, however, it does not cover transsexual, female phenotype transsexual, male phenotype hermaphrodite, intersexual phenotype which we (GNUmed, that is) need to support in

Re: FW: [GENERAL] Male/female

2006-12-11 Thread Karsten Hilbert
On Mon, Dec 11, 2006 at 01:34:17PM +0100, H.J. Sanders wrote: I would also suggest using a *coded* gender, not male, female strings which will make gender-based calculations a lot easier down the road. Which will also make it easier to have a multi-langual solution. Which, precisely, is

Re: [GENERAL] inheritance and index use (similar to UNION ALL)

2006-12-11 Thread Karsten Hilbert
at 09:43:35AM +0100, Karsten Hilbert wrote: Subject: [GENERAL] inheritance and index use (similar to UNION ALL) User-Agent: Mutt/1.5.13 (2006-08-11) Hi, we have a parent table root_item with a few common fields (one is a text field) from which a whole bunch of child tables derives. We

Re: [GENERAL] Restore database from files (not dump files)?

2006-12-06 Thread Karsten Hilbert
On Wed, Dec 06, 2006 at 12:16:35PM -0800, wheel wrote: re Bruce Momjian Wow, what an unfriendly dude! Well, he's one of the very guys who make all this (PostgreSQL, that is) happen for us. Karsten -- GPG key ID E4071346 @ wwwkeys.pgp.net E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

Re: [GENERAL] How to implement backup protocol

2006-11-28 Thread Karsten Hilbert
On Tue, Nov 28, 2006 at 06:01:43PM +0200, Andrus wrote: 5. Server has *only* 5432 port open. pg_read_file() can read only text files and is restricted only to superusers. How to add a function pg_read_backup() to Postgres which creates and returns backup file with download speed ? You

Re: [GENERAL] How to implement backup protocol

2006-11-28 Thread Karsten Hilbert
On Tue, Nov 28, 2006 at 07:23:44PM +0200, Andrus wrote: Pelase, can you recomment a solution which uses port 5432 owned by Postgres If you think you know your usage pattern: Have cron stop PostgreSQL at, say, 2am. Have cron start ssh on port 5432 at 2:05am if PG is down. Have cron shutdown

Re: [GENERAL] How to implement backup protocol

2006-11-28 Thread Karsten Hilbert
On Tue, Nov 28, 2006 at 07:34:56PM +0200, Andrus wrote: This id good idea but it forces to use Postgres protocol for downloading. Why, of course. This protocol has some timeouts which are too small for large file download. For sane values of large I doubt this is true. A field in PG can store

Re: [GENERAL] Data transfer between databases over the Internet

2006-11-22 Thread Karsten Hilbert
John McCawley wrote: I think I may not have described my problem clearly enough...I *already* have a server-side app written in PHP with a Postgres backend...This is the ultimate destination of the data. The problem is that I am being forced by my client to deploy a 3rd party app on all

Re: [GENERAL] Encoding, Unicode, locales, etc.

2006-11-01 Thread Karsten Hilbert
On Tue, Oct 31, 2006 at 11:47:56PM -0500, Tom Lane wrote: Because we depend on libc's locale support, which (on many platforms) isn't designed to switch between locales cheaply. The fact that we allow a per-database encoding spec at all was probably a bad idea in hindsight --- it's out front

Re: [GENERAL] Encoding, Unicode, locales, etc.

2006-11-01 Thread Karsten Hilbert
On Wed, Nov 01, 2006 at 08:50:30PM +0100, Martijn van Oosterhout wrote: Could this paragraph be put into the docs and/or the FAQ, please ? Along with the recommendation that if you require multiple encodings for your databases you better had your OS locale configured properly for UTF8 and

Re: [GENERAL] SQL injection in a ~ or LIKE statement

2006-10-25 Thread Karsten Hilbert
On Mon, Oct 23, 2006 at 07:58:30AM +0200, Harald Armin Massa wrote: adding: Judging from the mails of Frederico, developer of psycopg2, he was also in the early notify circle of the 8.13-8.14 escaping improvement. So, if done correctly the DB API way, all escaping with psycopg2 is fine. On

Re: [GENERAL] exploiting features of pg to obtain polymorphism

2006-10-17 Thread Karsten Hilbert
On Mon, Oct 16, 2006 at 11:41:25AM +0200, Ivan Sergio Borgonovo wrote: You can put a unique constraint and a serial default on the parent table (such as a primary key). Insertion on a child table will fail if the key in question already exists in the base table. It may have come from

Re: [GENERAL] exploiting features of pg to obtain polymorphism

2006-10-13 Thread Karsten Hilbert
On Thu, Oct 12, 2006 at 04:40:32PM +0200, Ivan Sergio Borgonovo wrote: Anyway it doesn't solve the problem of having lists that can contain different elements with same parent and maintain ref. integrity. Only to some degree. You can put a unique constraint and a serial default on the parent

Re: [GENERAL] Is it possible to return custom type as proper ROW?

2006-10-11 Thread Karsten Hilbert
On Wed, Oct 11, 2006 at 02:08:03PM -0700, Jeff Davis wrote: select q.*, bar from ( select a, b,c from foo ) q; What is bar? XMIN, for example Karsten -- GPG key ID E4071346 @ wwwkeys.pgp.net E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346 ---(end of

Re: [GENERAL] Storing images in PostgreSQL databases (again)

2006-10-08 Thread Karsten Hilbert
On Thu, Oct 05, 2006 at 05:08:27PM -0600, Leonel Nunez wrote: Subject: Re: [GENERAL] Storing images in PostgreSQL databases (again) User-Agent: SquirrelMail/1.4.8 Leonel Nunez wrote: I think the arguments for keeping stuff inside the database are (a) far easier to maintain transactional

Re: [GENERAL] exploiting features of pg to obtain polymorphism maintaining ref. integrity

2006-10-08 Thread Karsten Hilbert
On Fri, Oct 06, 2006 at 11:09:29PM +0200, Ivan Sergio Borgonovo wrote: Is there any good documentation, example, tutorial, pamphlet, discussion... to exploit pg features to obtain polymorphic behavior without renouncing to referential integrity? In GNUmed we use it to aggregate text fields

Re: [GENERAL] in failed sql transaction

2006-09-25 Thread Karsten Hilbert
On Mon, Sep 25, 2006 at 03:16:07PM +0530, Gurjeet Singh wrote: All other databases I used up to now just ignore the statement violating the constraint, but leave the transaction intact. Which databases behave that way? Does COMMIT succeed even if some statements failed? Oracle, for

Re: [GENERAL] in failed sql transaction

2006-09-25 Thread Karsten Hilbert
On Mon, Sep 25, 2006 at 05:40:56PM +0530, Gurjeet Singh wrote: In this case PostgreSQL does the right thing; something went wrong, queries after the error may very well depend on that data - you can't rely on the current state. And it's what the SQL specs say too, of course... In an

[GENERAL] execute/perform and FOUND

2006-09-21 Thread Karsten Hilbert
Hi, I am utterly confused now. Running the attached script on Debian: postgresql: Installiert:7.5.21 Mögliche Pakete:7.5.21 Versions-Tabelle: *** 7.5.21 0 990 ftp://ftp.gwdg.de testing/main Packages 100 /var/lib/dpkg/status 7.4.7-6sarge3 0 500

Re: [GENERAL] execute/perform and FOUND

2006-09-21 Thread Karsten Hilbert
On Thu, Sep 21, 2006 at 01:06:32PM +0200, Karsten Hilbert wrote: I am utterly confused now. Running the attached script on Debian: postgresql: Installiert:7.5.21 Mögliche Pakete:7.5.21 Versions-Tabelle: *** 7.5.21 0 990 ftp://ftp.gwdg.de testing/main Packages 100

Re: [GENERAL] execute/perform and FOUND

2006-09-21 Thread Karsten Hilbert
On Thu, Sep 21, 2006 at 01:06:32PM +0200, Karsten Hilbert wrote: gives the result below. It seems inconsistent to me with regard to the FOUND variable. I would expect FOUND to always be false regardless of whether I use EXECUTE or PERFORM. I certainly do not expect it to be true for the third

Re: [GENERAL] execute/perform and FOUND

2006-09-21 Thread Karsten Hilbert
On Thu, Sep 21, 2006 at 01:32:02PM +0200, Martijn van Oosterhout wrote: So, what about the PERFORM ? Why does it set FOUND to true? I beleive that since PERFORM doesn't return anything, it sets the FOUND variable to at least indicate whether it did something. The docs say that it sets

Re: [GENERAL] execute/perform and FOUND

2006-09-21 Thread Karsten Hilbert
On Thu, Sep 21, 2006 at 01:32:02PM +0200, Martijn van Oosterhout wrote: I beleive that since PERFORM doesn't return anything, it sets the FOUND variable to at least indicate whether it did something. The weird thing is that in the example it sets FOUND to true even if it did NOT do anything.

Re: [GENERAL] execute/perform and FOUND

2006-09-21 Thread Karsten Hilbert
On Thu, Sep 21, 2006 at 02:50:08PM +0200, Marcin Mank wrote: With: perform cmd; raise notice ''found (perform): %'', found; You effectively do: select 'select 1 from test where fk_item=1324314' ; Try: perform 1 from test where fk_item=1324314 Marcin, you saved my day. I knew I

Re: [GENERAL] IF EXISTS

2006-09-20 Thread Karsten Hilbert
On Wed, Sep 20, 2006 at 04:12:16PM -0700, Jeff Davis wrote: In 8.2, which is currently still in production, they have added the feature where you can do things like: DROP SEQUENCE IF EXISTS mysequence; CREATE SEQUENCE mysequence; Which makes writing SQL scripts much easier. They also

Re: [GENERAL] Create user or role from inside a function?

2006-09-01 Thread Karsten Hilbert
On Fri, Sep 01, 2006 at 08:13:14PM +1000, Dan wrote: I am running PostgreSQL 8.1.4 and I want to create a user from inside a function. Is this possible in 8.1? ... I have a function like this: ... Executing this function yields: # SELECT user_create('bob',1234,'bobspassword'); ERROR:

Re: [GENERAL] invalid byte sequence ?

2006-08-25 Thread Karsten Hilbert
On Fri, Aug 25, 2006 at 01:53:30PM +0200, Peter Eisentraut wrote: In that case I would suggest to also emit a suitable warning (with a postgresql.conf option to switch that off which defaults to ON). libpq can neither read postgresql.conf nor does it have the liberty to write messages

Re: [GENERAL] Saving a jpg into Postgresql table

2006-08-25 Thread Karsten Hilbert
On Fri, Aug 25, 2006 at 10:17:34AM -0700, Jeff Davis wrote: It takes aproximately 25-30% more disk space but is much easier for me to operate with it. When I read the object from the database I decode it and I have the file in the original format. Why not go a step further and do

Re: [GENERAL] invalid byte sequence ?

2006-08-24 Thread Karsten Hilbert
On Thu, Aug 24, 2006 at 01:17:49PM -0400, Tom Lane wrote: I guess the key point might be what do we do if the client locale is C? Perhaps if it's C, we continue to use the server encoding as we have in the past. This would be a reasonable fallback in other cases where we fail to deduce an

Re: [GENERAL] How do i store arbitrary questions and answers in SQL?

2006-08-23 Thread Karsten Hilbert
On Wed, Aug 23, 2006 at 04:13:24PM +0300, Enver ALTIN wrote: CREATE TABLE Answer(ID INT, questionID INT, answer_text VARCHAR(255), datatype INT) You can actually store answer_text as a BLOB in the database that is packed in any format your application can handle. You can serialize a

Re: [GENERAL] [8.1.4] Create index on timestamp fails

2006-08-23 Thread Karsten Hilbert
On Wed, Aug 23, 2006 at 09:07:35AM -0400, Alvaro Herrera wrote: Another idea would be to separate the date column (which would have the index) from the time column (which would have the timezone). The timezone is important -- if you have bloggers from all around the world you're gonna have

Re: [GENERAL] [8.1.4] Create index on timestamp fails

2006-08-23 Thread Karsten Hilbert
On Wed, Aug 23, 2006 at 09:42:00AM -0400, Tom Lane wrote: It sounds a bit bogus to me too. Another possibility is to keep the data storage as timestamptz (which is really the recommended type for any sort of real time values), and define the index on date_part('day', entry_time AT

[GENERAL] GNUmed release (uses PostgreSQL)

2006-08-22 Thread Karsten Hilbert
will be available in a few days time (in testing). Find more documentation here: http://wiki.gnumed.de Thanks for a dependable ORDBMS. Regards, Karsten Hilbert, MD GNUmed developer -- GPG key ID E4071346 @ wwwkeys.pgp.net E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

Re: [GENERAL] LISTEN considered dangerous

2006-08-01 Thread Karsten Hilbert
On Tue, Aug 01, 2006 at 07:16:39PM +0200, Flemming Frandsen wrote: This way we could even have wildcard listens, imagine doing a listen % and getting all the generated events:) That'd be awesome. Along with a data field in the listen structure, please :-) Karsten -- GPG key ID E4071346 @

Re: [GENERAL] Mapping/DB Migration tool

2006-07-27 Thread Karsten Hilbert
On Wed, Jul 26, 2006 at 08:48:14AM -0700, Reece Hart wrote: In case your interested in these pgtools views, I've uploaded them to http://harts.net/reece/pgtools/ . I am looking into it. Any chance you could do a text dump with --no-owner --no-acl ? Thanks, Karsten -- GPG key ID E4071346 @

timestamp with definable accuracy, was: Re: [GENERAL] empty text fields

2006-07-10 Thread Karsten Hilbert
On Thu, Jun 29, 2006 at 12:02:40PM +0200, Alban Hertroys wrote: This kind of reeks like a begin/end date and an accuracy quantifier, though that wouldn't account for option 6. Your cases 0 to 5 and 7 would be transformed into something like: ... Where I defined '5' as being accurate, and

Re: [GENERAL] Long term database archival

2006-07-08 Thread Karsten Hilbert
On Fri, Jul 07, 2006 at 09:09:22AM -0700, Richard Broersma Jr wrote: I think that in twenty years, I think most of us will be more worried about our retirement than the long terms data conserns of the companies we will no longer be working for. :-D You may want to take precautions now such

Re: [GENERAL] different sort order in windows and linux version

2006-07-02 Thread Karsten Hilbert
On Sun, Jul 02, 2006 at 12:13:02PM +0200, Martijn van Oosterhout wrote: However, the most important point is that people have said they'll take the speed hit if they could get consistant collation. I can second that. Karsten -- GPG key ID E4071346 @ wwwkeys.pgp.net E167 67FD A291 2BEA 73BD

Re: [GENERAL] Question concerning arrays

2006-06-28 Thread Karsten Hilbert
On Tue, Jun 27, 2006 at 01:43:21PM +0200, Christian Rengstl wrote: i am in the middle of breaking my head over designing a database and came to the following question/problem: i have persons whose values (integer) have to be entered in the db, but per person the amount of values ranges from

Re: [GENERAL] empty text fields

2006-06-28 Thread Karsten Hilbert
On Wed, Jun 28, 2006 at 06:25:22PM +0200, Leif B. Kristensen wrote: event_date CHAR(18) NOT NULL DEFAULT The event_date field is a fuzzy date construct. It will allow the storage of such dates as 1784, ca. 1810, May 1852, 1798 or 1799, between 1820 and 1830 and so on. It's

Re: [GENERAL] empty text fields

2006-06-28 Thread Karsten Hilbert
self-replying with additional information On Wed, Jun 28, 2006 at 09:33:18PM +0200, Karsten Hilbert wrote: A full-blown implementation of a fuzzy timestamp type which a) preserves the input/update timestamp which tagged_types is able to handle b) allows setting the accuracy of the value

Re: [GENERAL] New DBs from existing schemas

2006-05-25 Thread Karsten Hilbert
On Wed, May 24, 2006 at 04:14:46PM -0700, Nishad Prakash wrote: I want to create a new database with the exact schema of an existing one, but a different name. After some reading, it seems pg_dump -s old_db old_schema createdb -t old_schema new_db Now new_db is a 1:1 copy of old_schema,

Re: [GENERAL] Feature-Request: Login-Procedure

2006-05-12 Thread Karsten Hilbert
On Thu, May 11, 2006 at 12:30:13PM +0200, Tino Wildenhain wrote: - create a greeting ;-) (who has birthday?, ...) I was not aware so many people working at the psql console regulary :-) Na klar ! :-) Karsten -- GPG key ID E4071346 @ wwwkeys.pgp.net E167 67FD A291 2BEA 73BD 4537 78B9

Re: [GENERAL] sudo-like behavior

2006-04-20 Thread Karsten Hilbert
On Thu, Apr 20, 2006 at 04:06:19PM -0400, A.M. wrote: The problem is that I wish to run arbitrary SQL as an unprivileged user Would wrapping the SQL in a stored procedure with security definer help any ? Karsten -- GPG key ID E4071346 @ wwwkeys.pgp.net E167 67FD A291 2BEA 73BD 4537 78B9 A9F9

Re: [GENERAL] questions?

2006-03-11 Thread Karsten Hilbert
On Fri, Mar 10, 2006 at 01:59:13PM +1100, Chris wrote: xia_pw wrote: Hi,I have read the source codes of pgsql these days,and I want to know which part of the source codes deal with the function of executing the sql(select,alter,and so on),and which function deal with the query

Re: [GENERAL] record OID to table

2006-03-04 Thread Karsten Hilbert
On Fri, Mar 03, 2006 at 09:01:53PM -0700, Michael Fuhr wrote: Could you explain what you're trying to do without reference to how you're trying to do it? It sounds like the goal is to take an arbitrary string and find out what rows in what tables contain that string. Is that right? If so

Re: [GENERAL] Wish: remove ancient constructs from Postgres

2006-02-27 Thread Karsten Hilbert
On Mon, Feb 27, 2006 at 12:25:57AM +0300, Nikolay Samokhvalov wrote: Please help. how? ... PostgreSQL has very-very good documentation, but it teaches to go Pg's way, which is not right in that sense, unfortunately... By supplying documentation patches, perhaps ? Karsten -- GPG key ID

Re: [GENERAL] Wish: remove ancient constructs from Postgres

2006-02-26 Thread Karsten Hilbert
On Sun, Feb 26, 2006 at 10:36:23AM +0200, Andrus Moor wrote: It is difficult to write standard-compliant code in Postgres. There are a lot of constructs which have SQL equivalents but are still used widely, even in samples in docs! For example, there are suggestions using ... Bruce seems

Re: [GENERAL] How to specify infinity for intervals ?

2006-02-25 Thread Karsten Hilbert
On Fri, Feb 24, 2006 at 10:09:25PM -0500, Bruce Momjian wrote: Karsten Hilbert wrote: I will also stay with the hope that one day before long we will have 'infinite'::interval. We have this TODO: o Allow infinite dates just like infinite timestamps Do we need to add

Re: [GENERAL] How to specify infinity for intervals ?

2006-02-23 Thread Karsten Hilbert
Thanks to all for the suggestions. For the time being I will stay with using NULL. I will also stay with the hope that one day before long we will have 'infinite'::interval. Karsten -- GPG key ID E4071346 @ wwwkeys.pgp.net E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

Re: [GENERAL] How to specify infinity for intervals ?

2006-02-21 Thread Karsten Hilbert
On Tue, Feb 21, 2006 at 12:24:09PM +0900, Michael Glaesemann wrote: I don't know the details of your database schema, If you want to you can look it up here: http://salaam.homeunix.com/twiki/bin/view/Gnumed/DatabaseSchema Feel free to comment ! but I think the relationally proper

[GENERAL] How to specify infinity for intervals ?

2006-02-20 Thread Karsten Hilbert
I am storing the maximum age a vaccination is due in a patient (eg. don't give this vaccination beyond the age of 10 years or some such). Some vaccinations are to be given regardless of age. Up to now I have used NULL to mean no maximum age. That doesn't really feel right and also complicates the

Re: [GENERAL] Last modification time

2006-02-11 Thread Karsten Hilbert
Use LISTEN/NOTIFY and a trigger. Karsten -- DSL-Aktion wegen großer Nachfrage bis 28.2.2006 verlängert: GMX DSL-Flatrate 1 Jahr kostenlos* http://www.gmx.net/de/go/dsl ---(end of broadcast)--- TIP 5: don't forget to increase your free space map

Re: [GENERAL] creating users per database

2006-01-29 Thread Karsten Hilbert
wasn't clear enough on that (for me): ... The value samegroup specifies that the requested user must a member of the group with the same name as the requested database. ... Might this be amended to say ... a member of the *database* group with ... ? Karsten Hilbert, MD, GNUmed developer -- GPG

Re: [GENERAL] creating users per database

2006-01-29 Thread Karsten Hilbert
On Sun, Jan 29, 2006 at 02:01:51PM -0500, Tom Lane wrote: The 8.1 documentation uses the term role, which seems unlikely to be confused with Unix groups: ... Good enough? Yes :-) Karsten -- GPG key ID E4071346 @ wwwkeys.pgp.net E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

[GENERAL] creating users per database

2006-01-28 Thread Karsten Hilbert
Hi all, I have a faint memory of it being possible to create users inside *one* given database by way of a particular create user syntax along the lines of: create user [EMAIL PROTECTED] ...; or similar. Was this ever possible in PostgreSQL or is my memory playing tricks on me ? I went back

Re: [GENERAL] creating users per database

2006-01-28 Thread Karsten Hilbert
On Sat, Jan 28, 2006 at 11:04:09AM -0500, Tom Lane wrote: I have a faint memory of it being possible to create users inside *one* given database by way of a particular create user syntax along the lines of: create user [EMAIL PROTECTED] ...; There is the db_user_namespace

Re: [GENERAL] Arrays

2006-01-26 Thread Karsten Hilbert
On Thu, Jan 26, 2006 at 10:15:22AM -0800, Bob Pawley wrote: I would like to make a table of 20 plus columns the majority of columns being arrays. The following test works. The array will hold up to five characteristics of each parameter including the unit of measurement used. Using

Re: [GENERAL] Plans for 8.2?

2006-01-13 Thread Karsten Hilbert
On Thu, Jan 12, 2006 at 07:46:18PM -0500, Tom Lane wrote: * Transaction was committed/aborted/crashed - we have to update pg_clog * if transaction is still marked as running. */ if (!TransactionIdDidCommit(xid) !TransactionIdDidAbort(xid)) TransactionIdAbort(xid); The

Re: [GENERAL] I want to know how to improve the security of postgresql

2005-12-31 Thread Karsten Hilbert
On Thu, Dec 29, 2005 at 09:22:09AM -0800, Marc Munro wrote: http://pgfoundry.org/projects/veil/ Marc, is there a higher level written summary available somewhere to be read to understand conceptually how you implemented row level security ? We will (in GNUmed) eventually have to implement row

[GENERAL] veil docs

2005-12-31 Thread Karsten Hilbert
Sorry, found them. They were the first hit on a Google search I fired off while writing the last post. Karsten -- GPG key ID E4071346 @ wwwkeys.pgp.net E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346 ---(end of broadcast)--- TIP 4: Have you

Re: [GENERAL] I want to know how to improve the security of postgresql

2005-12-31 Thread Karsten Hilbert
On Sat, Dec 31, 2005 at 05:18:19PM +0100, Karsten Hilbert wrote: We will (in GNUmed) eventually have to implement row level security. The current thinking is by restricting access to the tables and setting up views that always do ... where user=current_user to limit the viewable data set

<    1   2   3   4   5   6   7   >