Re: [SQL] Alternative to serial primary key

2006-07-07 Thread Achilleus Mantzios
O D'Arcy J.M. Cain έγραψε στις Jul 7, 2006 : > On Fri, 7 Jul 2006 19:37:15 +1200 > "David Clarke" <[EMAIL PROTECTED]> wrote: > > > And even given all of that, I would probably still use serial. > > Because? > > Simplicity. Cleanliness. > > > > Danger, Will Robinson. The phrase "regenerate my p

Re: RES: [SQL] Joins between int and int[]

2006-06-28 Thread Achilleus Mantzios
want. If your queries are ad-hoc then go the first approach. > Thanks in advance! > > > -Mensagem original- > De: Achilleus Mantzios [mailto:[EMAIL PROTECTED] > Enviada em: quarta-feira, 28 de junho de 2006 04:01 > Para: Rodrigo Sakai > Assunto: Re: [SQL] J

Re: [SQL] Efficient Searching of Large Text Fields

2006-06-14 Thread Achilleus Mantzios
O Oleg Bartunov έγραψε στις Jun 14, 2006 : > Don't invent a wheel and use contrib/tsearch2 for that. Hi Oleg, i just wanted to ask if anything close to exact phrase matching could be deployed/implemented with tsearch2. > > On Tue, 13 Jun 2006, Aaron Bono wrote: > > > In another post on a dif

Re: [SQL] Does PG have a database

2006-05-22 Thread Achilleus Mantzios
O Mark Fenbers έγραψε στις May 22, 2006 : > I have working PostgreSQL databases on 3 of my ~30 Linux boxes. I want > my software to be able to determine which of my 30 boxes have functional > databases on them. Since Pg is part of the baseline distro, merely > checking for the existence of an

Re: [SQL] usernames of a group from SQL

2006-05-19 Thread Achilleus Mantzios
O Kis Jαnos Tamαs έγραψε στις May 19, 2006 : > Hi, > > At the first time: I'm in newbie in SQL... I'm sorry! > > My question is: How can I get the usernames of a group (for example > 'osztatlan_users') from SQL? > > I try it: > > SELECT usename > FROM pg_user > WHERE usesysid IN (SELECT groli

Re: [SQL] Database OID

2006-05-17 Thread Achilleus Mantzios
O Kis Jαnos Tamαs έγραψε στις May 17, 2006 : > Hi, > > How can I find the database OID from simple SQL command? SELECT oid,* from pg_database ; > > Thanks, > kjt > > > McAfee SCM 4.1 αltal ellenυrizve! > > ---(end of broadcast)---TIP > 6: exp

Re: [SQL] Thoughts on a Isolation/Security problem.

2006-04-18 Thread Achilleus Mantzios
y , Organization, where you can > have company1, org1, org2 etc., this can also be applied in the same pattern > as stated above. Thanx for your thoughts, but this would require touching 173 tables + 2,594 SQL statements in a sum of 324 programs (which sum into 125,085 lines of code) >

Re: [SQL] [JDBC] Thoughts on a Isolation/Security problem.

2006-04-18 Thread Achilleus Mantzios
O Markus Schaber έγραψε στις Apr 18, 2006 : > Hi, Achilleus, > > Achilleus Mantzios wrote: > > > Now i am thinking of restructuring the whole architecture as: > > - Create one EAR app for every mgmt company > > - Create one DB USER for every mgmg company > &

[SQL] Thoughts on a Isolation/Security problem.

2006-04-18 Thread Achilleus Mantzios
Hi, i have run into the following problem. Let me describe the context first. When i joined the company(ies) i work for (a group of Shipping Mgmt/ Owenship/Agent companies), the only thing i was told when i started designing the DB/Apps was just one company. So i built everything into one single

Re: [SQL] Ugly group by problem

2006-03-30 Thread Achilleus Mantzios
O Markus Schaber έγραψε στις Mar 29, 2006 : > Hi, Achilleus, > > Achilleus Mantzios wrote: > > > foodb=# SELECT qoo.foo2,sum(qoo.foo3) from (SELECT mt.link_id as > > foo,_int_union(array(select mt2.feat_id from markustest mt2 where > > mt2.link_id=mt.link_id

Re: [SQL] Flight numbers data

2006-03-29 Thread Achilleus Mantzios
O Scott Marlowe έγραψε στις Mar 29, 2006 : > On Wed, 2006-03-29 at 02:17, Achilleus Mantzios wrote: > > Hi, i am in the process of writing an application about > > tickets, flights, etc, and i am thinking of getting the primitive > > data ready at the begining and doing it th

Re: [SQL] Ugly group by problem

2006-03-29 Thread Achilleus Mantzios
O Markus Schaber έγραψε στις Mar 29, 2006 : > Hello, > > I have a table filled from third party that basically has the following > structure: > > link_id | feat_id | other | columns... > +-+---+--- > 1 | 2 | ... > 2 | 5 | ... > 2 | 23

[SQL] Flight numbers data

2006-03-29 Thread Achilleus Mantzios
Hi, i am in the process of writing an application about tickets, flights, etc, and i am thinking of getting the primitive data ready at the begining and doing it the right way, (e.g. the user will just select a flight number and doesnt have to enter the airports, airport coordinates, countries, ai

[SQL] Proposed dbmirror change

2006-03-27 Thread Achilleus Mantzios
hi again i made one mod to dbmirror. 1) I implemented a mechanism to exclude attributes (columns) from dbmirror'ed tables. I added one table CREATE TABLE dbmirror_exclude_attributes ( tblname character varying(100) NOT NULL, attnames text[] NOT NULL ); ALTER TABLE ONLY dbmirror_exclu

Re: [SQL] COPY tablename FROM and null values

2006-03-22 Thread Achilleus Mantzios
O ivan marchesini έγραψε στις Mar 22, 2006 : > Dear users, > I'm working on a Postgres 7.4 server > > I have a .txt file, containing some tabular data, where data are > delimited by TABs. > there are 3 columns: > > column1 int4, column2 float8, column3 float8 > > the problem is that column3 con

Re: [SQL] Job queue, how would you implement this?

2006-03-21 Thread Achilleus Mantzios
O Alexis Paul Bertolini έγραψε στις Mar 21, 2006 : > Dear all, > > I have implemented a job queue table where various apps can add jobs to > the queue and other daemons then execute them. A basic producer-consumer > pattern. Each tuple in the queue has the basic info such as job to be > done,

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Achilleus Mantzios
O Eugene E. έγραψε στις Mar 20, 2006 : > Peter Eisentraut wrote: > > Eugene E. wrote: > > > >>the bytea does not output NULs at all. > >>don't mock me. > > > > > > peter=# create table test (a bytea); > > CREATE TABLE > > peter=# insert into test values ('a\\000b'); > > INSERT 0 1 > > peter=# s

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Achilleus Mantzios
O Alvaro Herrera έγραψε στις Mar 20, 2006 : > Achilleus Mantzios wrote: > > > dynacom=# SELECT '\000\150\145\154\154\157'::text; > > text > > -- > > > > (1 row) > > > > dynacom=# > > > > Oops! > > t

Re: [SQL] have you feel anything when you read this ?

2006-03-20 Thread Achilleus Mantzios
O Peter Eisentraut έγραψε στις Mar 20, 2006 : > Eugene E. wrote: > > the bytea does not output NULs at all. > > don't mock me. > > peter=# create table test (a bytea); > CREATE TABLE > peter=# insert into test values ('a\\000b'); > INSERT 0 1 > peter=# select * from test; >a > > a\0

Re: R: Re: R: R: Re: [SQL] schema inspection

2006-03-17 Thread Achilleus Mantzios
O [EMAIL PROTECTED] έγραψε στις Mar 17, 2006 : > > > >SELECT c1.relname,c2.relname from pg_constraint cons,pg_class c1, > pg_class > >c2 where cons.conrelid=c1.oid and cons.confrelid = c2.oid; > > > >for column(s) names you will have to do extra homework. > > Thanks! I have obtained my query!

Re: R: R: Re: [SQL] schema inspection

2006-03-17 Thread Achilleus Mantzios
O [EMAIL PROTECTED] έγραψε στις Mar 16, 2006 : > > pg_catalog.pg_constraint is your (only?) friend. > > I have already examintated this table without results. Seem not to be > a "human-readable" table :( Right you will have to join against pg_class, and make it readable. SELECT c1.reln

Re: [SQL] schema inspection

2006-03-16 Thread Achilleus Mantzios
O [EMAIL PROTECTED] έγραψε στις Mar 16, 2006 : > Hi, > > supposing to have a small DB: > > TABLE a ( > id SERIAL PRIMARY KEY > ); > > TABLE b ( > id SERIAL PRIMARY KEY, > idA INTEGER NOT NULL REFERENCES a(id) > ); > > How can I inspect pg_schema/information_schema to "detect" the > rela

Re: [SQL] connectby documentation

2006-03-14 Thread Achilleus Mantzios
O Jean-Paul Argudo έγραψε στις Mar 14, 2006 : > Daniel Caune a ιcrit : > > Wow, that was the quest for the Holy Grail! :-) > > Yes I understand. That kind of documentation for a > contrib-addon-whatever for PostgreSQL can be tricky sometimes to find.. > > > I just jump on that thread to place a

Re: [SQL] removing "not null" modifier

2006-03-13 Thread Achilleus Mantzios
O Robert Urban έγραψε στις Mar 13, 2006 : > Hello, > > let's say I have created a postgresql-7.2.2 db using the following cmds: > > CREATE TABLE status > ( > id SERIAL NOT NULL PRIMARY KEY, > name VARCHAR(32) > ); > > CREATE TABLE event >

Re: [SQL] After Trigger assignment to NEW

2006-02-24 Thread Achilleus Mantzios
O Owen Jacobson έγραψε στις Feb 24, 2006 : > Achilleus Mantzios wrote: > > > O Tom Lane έγραψε στις Feb 24, 2006 : > > > > > By definition, an AFTER trigger is too late to change what was > > > stored. Use a BEFORE trigger. > > > > Too late if

Re: [SQL] After Trigger assignment to NEW

2006-02-24 Thread Achilleus Mantzios
O Tom Lane έγραψε στις Feb 24, 2006 : > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > Tom Lane wrote: > >> Achilleus Mantzios <[EMAIL PROTECTED]> writes: > >>> Is there a reason that the NEW values should remain unchanged in AFTER > >>> ro

Re: [SQL] After Trigger assignment to NEW

2006-02-24 Thread Achilleus Mantzios
O Tom Lane έγραψε στις Feb 24, 2006 : > Achilleus Mantzios <[EMAIL PROTECTED]> writes: > > Is there a reason that the NEW values should remain unchanged in AFTER > > row triggers? > > By definition, an AFTER trigger is too late to change what was stored. > Use

[SQL] After Trigger assignment to NEW

2006-02-24 Thread Achilleus Mantzios
Hi, i am currently on 7.4.12, and i what i try to do is having an AFTER row trigger nullify one NEW column, so as to prevent a subsequent (AFTER row) trigger from using this column's data. Unfortunately this nullification (assignment) does not have any effect on the next AFTER trigger. The fi

Re: [SQL] Feature, my misconception or bug??

2006-02-22 Thread Achilleus Mantzios
O Markus Schaber έγραψε στις Feb 22, 2006 : > Achilleus Mantzios wrote: > > In PgSQL 7.4.12, > > > > foodb=# SELECT '255.255.255.255/24'::cidr; > > ERROR: invalid cidr value: "255.255.255.255/24" > > DETAIL: Value has bits set to right of m

Re: [SQL] Feature, my misconception or bug??

2006-02-22 Thread Achilleus Mantzios
O Peter Eisentraut έγραψε στις Feb 22, 2006 : > Am Mittwoch, 22. Februar 2006 13:04 schrieb Achilleus Mantzios: > > foodb=# SELECT '255.255.255.255/24'::cidr; > > ERROR: invalid cidr value: "255.255.255.255/24" > > DETAIL: Value has bits

[SQL] Feature, my misconception or bug??

2006-02-22 Thread Achilleus Mantzios
In PgSQL 7.4.12, foodb=# SELECT '255.255.255.255/24'::cidr; ERROR: invalid cidr value: "255.255.255.255/24" DETAIL: Value has bits set to right of mask. foodb=# SELECT '255.255.255.255/25'::cidr; cidr 255.255.255.255/25 (1 row) foodb=# in this case .1

Re: [SQL] Avoid querying a specific field - how?

2006-02-21 Thread Achilleus Mantzios
O Ibrahim Tekin έγραψε στις Feb 21, 2006 : > i may i misunderstood your question but it seems to me, partial indexes will > work for you. > check this example: > http://www.postgresql.org/docs/8.1/interactive/indexes-partial.html#INDEXES-PARTIAL-EX2 > > On 2/21/06, Stefan Schwarzer <[EMAIL PROTEC

Re: [SQL] passing array to database function

2006-02-07 Thread Achilleus Mantzios
O Richard Huxton έγραψε στις Feb 7, 2006 : > padmanabha konkodi wrote: > > Β hi everybody, > > > > i want to pass Integer array to database function from java > > precompiled statement. > > > > java gives java.sql.Array interface but i dont know which > > implementing class i have to use in post

Re: [SQL] Does PostgreSQL support job?

2006-02-02 Thread Achilleus Mantzios
O Markus Schaber έγραψε στις Feb 2, 2006 : > H, Achilleus, > > Achilleus Mantzios wrote: > > >>PLPGSQL is turing complete, plain SQL is not. > > H is SQL equally powerful as a pushdown automaton then??? > > SQL is _not_ a programming language, it is a que

Re: [SQL] Does PostgreSQL support job?

2006-02-02 Thread Achilleus Mantzios
O Markus Schaber έγραψε στις Feb 2, 2006 : > Hi, Daniel, > > Daniel Caune wrote: > > > I'm not sure to understand. Why calling a function from a script is > > different from executing a series of SQL commands? I mean, I can run a > > script defined as follows: > > > > SELECT myjob(); > > >

Re: [SQL] how is searchable email archive on

2006-01-31 Thread Achilleus Mantzios
O Alvaro Herrera έγραψε στις Jan 31, 2006 : > Jacob Costello wrote: > > > Has anyone tried using a postgres based solution for archiving email for > > regulatory purposes ? > > I don't know about regulatory purposes, but the Oryx software is > designed for that: http://www.oryx.com (or .net, don

[SQL] DBMirror.pl performance change

2006-01-23 Thread Achilleus Mantzios
Steven Hi, i hope you are ok. I discovered a problem in DBMirror.pl, performance wise. pending.c stores data in a way very similar to the PgSQL input "\" escaped format. When the field is of type bytea, and the source of data is binary, then this produces 2 additional backslashes for every unpr

Re: [SQL] Still struggling with history tables

2006-01-18 Thread Achilleus Mantzios
O Ken Winter έγραψε στις Jan 17, 2006 : > Friends ~ > > I'm still trying to implement a solution to the requirement to keep a > complete history of data changes to a "person" table. (See earlier > correspondence below.) I'm trying for a variant of the architecture > suggested by Richard Huxton

[SQL] Merry Xmas and a Happy New Year

2005-12-23 Thread Achilleus Mantzios
to All! -- -Achilleus ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq

Re: [SQL] How to Force Transactions to Process Serially on A Table

2005-12-19 Thread Achilleus Mantzios
next COMMIT. > Then transaction isolation SERIALIZABLE is not for this task. What you would do is use the SELECT ... FOR UPDATE construct. Normally you would not care about locking the whole table but only row of interest. > -Original Message- > From: Achilleus Mantzios [mailto:[EMAIL

Re: [SQL] How to Force Transactions to Process Serially on A Table

2005-12-19 Thread Achilleus Mantzios
O Lane Van Ingen έγραψε στις Dec 19, 2005 : > I am using PL/SQL functions on Windows 2003, version 8.0.1. > > I have not used explicit PostgreSQL LOCKing before, but I need some advice > on how properly to use some explicit locking. I think that duplicate key > violations I am now getting are the

Re: [SQL] exporting Excel tables into PostgreSQL database with Python

2005-12-13 Thread Achilleus Mantzios
O Christian Kratzer έγραψε στις Dec 13, 2005 : > Hi, > > On Tue, 13 Dec 2005, Jόrgen Kemeter wrote: > > Hi! > > > > Here is a hopefully convenient description of my situation: > > - I have a main folder, containing several subfolders. > > - Every (sub)folder contains one or more .xls - Workbooks.

Re: [SQL] Sybase Connection_Property('number') equivalent in PostGre

2005-12-02 Thread Achilleus Mantzios
O Emil Rachovsky έγραψε στις Dec 2, 2005 : > > I am trying to find out the PostGre equivalent to > the Sybase function Connection_Property (which returns > the connection id, given the parameter 'number') ,but > without success so far. Can anyone tell me how to > retrieve the connection id in P

Re: [SQL]

2005-11-24 Thread Achilleus Mantzios
O Oliver Elphick έγραψε στις Nov 24, 2005 : > On Wed, 2005-11-23 at 23:23 -0500, Ken Winter wrote: > > In PL/pgSQL, is there a way to put a *variable* column-name in a dot > > notation reference to a RECORD column? You can do it with a C function. (See dbmirror's pending.c for a reference) > -

Re: [SQL] Triggers

2005-11-22 Thread Achilleus Mantzios
O Neil Saunders έγραψε στις Nov 22, 2005 : > And change AFER INSERT to BEFORE INSERT 1) it doesnt make any difference since we are updating a different table than the trigger's one 2) Your email text comes really garbled > -- -Achilleus ---(end of broadcast)

Re: [SQL] Triggers

2005-11-22 Thread Achilleus Mantzios
O Leif B. Kristensen έγραψε στις Nov 22, 2005 : > On Tuesday 22 November 2005 17:25, Achilleus Mantzios wrote: > >O Leif B. Kristensen έγραψε στις Nov 22, 2005 : > >> I'm trying to understand triggers. I have read the documentation in > >> the manual as well as t

Re: [SQL] Foreign key to 2 tables problem

2005-11-22 Thread Achilleus Mantzios
O Joost Kraaijeveld έγραψε στις Nov 22, 2005 : > Hi, > > Is there a way to create a foreign key to 2 tables: e.g. a bankaccount > table that has a column "owner", that must point to a record in either > the customer or the supplier table? While there are techniques to accomplish this, i see a p

Re: [SQL] Triggers

2005-11-22 Thread Achilleus Mantzios
O Leif B. Kristensen έγραψε στις Nov 22, 2005 : > I'm trying to understand triggers. I have read the documentation in the > manual as well as the few pages in the Douglas book about the subject, > but I don't see how to implement a trigger that simply updates a > 'last_edit' date field in my 'p

Re: [SQL] idea for a geographically distributed database: how best

2005-11-17 Thread Achilleus Mantzios
O codeWarrior έγραψε στις Nov 17, 2005 : > Sounds like a mis-guided approach to me... > > You might want to consider using latitude and longitude or zip codes or > taking more of a traditional "GIS" approach rather than duplicating data > across redundant databases. > > Another issue is that y

Re: [SQL] Arrya variable as argument to IN expression

2005-11-17 Thread Achilleus Mantzios
O Emil Kaffeshop έγραψε στις Nov 17, 2005 : > Hello I am trying the following: > a INTEGER[] := ''{10,15,20}''; > b INTEGER := 15; > flag BOOLEAN := FALSE; > > SELECT b IN (a) INTO flag; !!! does not work contrib/intarray and SELECT intset(b) ~ a::int[] INTO flag; are your friends. > > Is it l

Re: [SQL] Migrating database from postgresql 7.4.6 to postgresql

2005-11-09 Thread Achilleus Mantzios
O A. Kretschmer έγραψε στις Nov 9, 2005 : > am 08.11.2005, um 23:18:35 -0800 mailte Louise Catherine folgendes: > > Hi, > > I would like to migrating my database from postgresql > > 7.4.6 to postgresql 8.0.3. > > Why not 8.1.0? > > > > Are there any problem during migrating database? a > > cas

Re: [SQL] Welcome to the pgsql-sql list!

2005-11-03 Thread Achilleus Mantzios
For some reason i got unsubscribed from sql for no apparent reason. (I cant recall anything close to that, and i never intented to unsubscribe from -sql list) The [EMAIL PROTECTED] person might be interested in investigating this. Thank you. -- -Achilleus ---(end of

Re: [SQL] postgres on the comman line

2005-09-22 Thread Achilleus Mantzios
O "Michael Hφller" έγραψε στις Sep 22, 2005 : > > > Hello, > > I like to automate a daily check and like to run select statement via > cron but this seems to be more tricky than I thought > > I tried the following: > su postgres -c "select count(*) from TABLE where xx;" Firstoff, 'sel

Re: [SQL] Inheritance (general hints wanted)

2005-09-20 Thread Achilleus Mantzios
Judging from the replies i got, it seems that inheritance is even less used than i initially thought. I think that the OO term is a little too much advertised in pgsql advocacy various acts, than actually engineered. However, OO in pgsql besides being a traditionally cool acronym, it also *could

Re: [SQL] Inheritance (general hints wanted)

2005-09-20 Thread Achilleus Mantzios
O Achilleus Mantzios έγραψε στις Sep 20, 2005 : > > Hi, > > I think i have reached a point in my PgSQL years > that i am seriously thinking of using inheritance. > > The situation is simple: An new entity (tanker vessels crew) > is about to be modeled, and i suspect

[SQL] Inheritance (general hints wanted)

2005-09-20 Thread Achilleus Mantzios
Hi, I think i have reached a point in my PgSQL years that i am seriously thinking of using inheritance. The situation is simple: An new entity (tanker vessels crew) is about to be modeled, and i suspect there will be a future need to include the rest of 'workers' besides 'sailors', IOW i suspect

Re: [SQL] not sure about constraints

2005-09-02 Thread Achilleus Mantzios
O Jerome Alet έγραψε στις Sep 2, 2005 : > Hello, > > I've got 4 tables : > > CREATE TABLE tableA (id SERIAL PRIMARY KEY NOT NULL, > blahA TEXT); > > CREATE TABLE tableB (id SERIAL PRIMARY KEY NOT NULL, > blahB TEXT); >

Re: [SQL] REINDEX DATABASE

2005-08-30 Thread Achilleus Mantzios
O Achilleus Mantzios έγραψε στις Jul 28, 2005 : > O Chris Browne έγραψε στις Jul 27, 2005 : > > > I'll try to postpone the next reindexdb at the end of august, > and get some numbers then. > However the big difference in performance as i told was near the 2GB > "

Re: [SQL] REINDEX DATABASE

2005-07-28 Thread Achilleus Mantzios
O Chris Browne έγραψε στις Jul 27, 2005 : > [EMAIL PROTECTED] (Achilleus Mantzios) writes: > > O Chris Browne έγραψε στις Jul 26, 2005 : > >> You can get a savings of about 4% of the space, but at the cost of > >> taking an appreciable outage during which the database

Re: [SQL] REINDEX DATABASE

2005-07-26 Thread Achilleus Mantzios
O Chris Browne έγραψε στις Jul 26, 2005 : > [EMAIL PROTECTED] (Achilleus Mantzios) writes: > > O Christopher Browne έγραψε στις Jul 26, 2005 : > > > >> > Hello > >> > > >> > Would you like to advice to use REINDEX DATABASE on regular bas

Re: [SQL] REINDEX DATABASE

2005-07-26 Thread Achilleus Mantzios
O Christopher Browne έγραψε στις Jul 26, 2005 : > > Hello > > > > Would you like to advice to use REINDEX DATABASE on regular basis ? > > > > if (yes) > > how it should be connected with VACUUM FULL ANALYZE which is run > > regularly ? (reindex before vacuum or vacuum before reindex?) > > > > els

Re: [SQL] Are long term never commited SELECT statements are a

2005-07-21 Thread Achilleus Mantzios
O Erik Wasser έγραψε στις Jul 21, 2005 : > Hello List, > > I've written an application in perl using DBI with MySQL (no transaction > support). Then we decide to migrate it to postgresql > (postgresql-8.0.1-r4). > > At first we were using 'AutoCommit => 1' with the application. That > means t

Re: [SQL] Alias to a type

2005-06-22 Thread Achilleus Mantzios
O Sean Davis έγραψε στις Jun 22, 2005 : > > On Jun 22, 2005, at 7:42 AM, Achilleus Mantzios wrote: > > > O Veikko MΞ΄kinen έγραψΡ στις Jun 22, 2005 : > > > >> Hey, > >> > >> Is it possible to create a new type as an alias to a pre-define

Re: [SQL] Alias to a type

2005-06-22 Thread Achilleus Mantzios
O Veikko Mδkinen έγραψε στις Jun 22, 2005 : > Hey, > > Is it possible to create a new type as an alias to a pre-defined type? I > use "USERID varchar(20)" in almost every table I have I'd like to make > an alias for that type eg. > > >create type myschema.useridtype as varchar(20); > >

Re: [SQL] to listadmin

2005-06-07 Thread Achilleus Mantzios
O Kenneth Gonsalves έγραψε στις Jun 7, 2005 : > On Tuesday 07 Jun 2005 1:35 pm, Richard Huxton wrote: > > I'm not sure it is from the list - it appears to be something setup > > by [EMAIL PROTECTED] > > apparently he is a member of the list - so mail from any 'untrusted' > guy like me gets this

Re: [SQL] What is faster?

2005-06-07 Thread Achilleus Mantzios
O ON.KG έγραψε στις Jun 7, 2005 : > RH> ON.KG wrote: > >> Hi All! > >> > What is faster - SLECTion data from one large table (200 000 - 300 000 > records), or SELECTion from a few small tables (example, 2 tables 150 > 000 records each)? > >> > >> For example i have two large tables >

Re: [SQL] 'true'::TEXT::BOOLEAN

2005-06-03 Thread Achilleus Mantzios
O Michael Glaesemann έγραψε στις Jun 3, 2005 : > > On Jun 3, 2005, at 9:23 PM, Markus Bertheau β?­ wrote: > > > This also bypasses the built in postgresql boolean literal parsing. > > > > I think casting from text to boolean should be possible, and use the > > same algorithm that's used when cas

Re: [SQL] 'true'::TEXT::BOOLEAN

2005-06-03 Thread Achilleus Mantzios
O Markus Bertheau β^Ψ­ έγραψε στις Jun 3, 2005 : > Π? Π?Ρ?Π½, 03/06/2005 Π² 14:20 +0300, Achilleus Mantzios ΠΏΠΈΡ?Π΅Ρ?: > > O Markus Bertheau Ξ²^Ψ­ Ξ­Ξ³Ο?Ξ±Ο?Ξ΅ Ο?Ο?ΞΉΟ? Jun 3, 2005 : > > > > > Hi, > > > > > > What's the type I need to convert t

Re: [SQL] 'true'::TEXT::BOOLEAN

2005-06-03 Thread Achilleus Mantzios
O Markus Bertheau β^Ψ­ έγραψε στις Jun 3, 2005 : > Hi, > > What's the type I need to convert text to before I can convert it to > boolean? just 't' will suffice. > > Markus > -- -Achilleus ---(end of broadcast)--- TIP 4: Don't 'kill -9' the

Re: [SQL] View unique rowid

2005-06-01 Thread Achilleus Mantzios
O David Klugmann έγραψε στις Jun 1, 2005 : > > Hi > Is it possible to refer to a unique row identifier on a view ? > > I have the following view but in a subsequent select I need to refer to > each row's unique identifier and I know oid's are not valid for a view. Provided your ids are 4 bytes

Re: [SQL] ARRAY() returning NULL instead of ARRAY[] resp. {}

2005-05-23 Thread Achilleus Mantzios
O Joe Conway έγραψε στις May 23, 2005 : > Markus Bertheau wrote: > > why does SELECT ARRAY(SELECT 1 WHERE FALSE) return NULL instead of > > ARRAY[] resp. '{}'? > > > > Why would you expect an empty array instead of a NULL? NULL is what > you'd get for other data types -- for example: One could

Re: [SQL] Need clarification

2005-05-23 Thread Achilleus Mantzios
O [EMAIL PROTECTED] έγραψε στις May 23, 2005 : > > > > > how can retrieve rows where the datedifference is more than 30... more than 30 in what units? years,days,milliseconds?? > assume there exists a field named 'datacreated' which is of type 'date'. I > need to compare it with the current

Re: [SQL] people who buy A, also buy C, D, E

2005-04-26 Thread Achilleus Mantzios
O Christoph Haller έγραψε στις Apr 26, 2005 : > Dan Langille wrote: > > > > The goal of my query is: given a book, what did other people who > > bought this book also buy? I plan the list the 5 most popular such > > books. In reality, this isn't about books, but that makes it easier > > to unde

Re: [SQL] How to add 1 hour in a date or time stamp?

2005-04-18 Thread Achilleus Mantzios
O Dinesh Pandey έγραψε στις Apr 18, 2005 : > > > How to add 1 hour in a date or time stamp? # SELECT now() + '1 hour'::interval; > > Regards > Dinesh Pandey > > > > -- > > > > > > -- -Achilleus ---

Re: [SQL] order by question

2005-03-09 Thread Achilleus Mantzios
O Gary Stainburn έγραψε στις Mar 9, 2005 : > Hi folks. > > I seem to remember somewhere being shown how to bump specific rows to > the top of a list; something along the lines of: > > select c_id as key, c_des as value from customers order by c_id = 7, > c_id = 160, value; use the case ... w

Re: [SQL] Timestamp with timezone question.

2005-02-21 Thread Achilleus Mantzios
O Bruno Wolff III έγραψε στις Feb 22, 2005 : > On Mon, Feb 21, 2005 at 16:16:04 +0200, > Achilleus Mantzios <[EMAIL PROTECTED]> wrote: > > > > Since pgsql always converts a timestamptz to UTC, we have lost > > the information of the Sender's local timezone. &

Re: [SQL] Timestamp with timezone question.

2005-02-21 Thread Achilleus Mantzios
O Andrew - Supernews έγραψε στις Feb 21, 2005 : > On 2005-02-21, Achilleus Mantzios <[EMAIL PROTECTED]> wrote: > > Consider a schema designed to store internet mail. > > > > Since pgsql always converts a timestamptz to UTC, we have lost > > the informati

[SQL] Timestamp with timezone question.

2005-02-21 Thread Achilleus Mantzios
AFAIK, the input for a timestamptz is converted and stored as UTC. And outputing a timezonetz value converts the internally stored UTC value to the current locale's timezone. So there is not a way to actually store the original TZ itself, whereas the timetz type clearly does that. Consider a sch

Re: [SQL] parsing a string with a hexadecimal notation

2005-02-09 Thread Achilleus Mantzios
O KΦPFERL Robert έγραψε στις Feb 9, 2005 : > I intend to retrieve an int value in an integer variable from a string with > a hexadecimal notation of a number. > Which function is appropriate to do > i int4 > i = ???('BEAF') You can do something like foodb=# SELECT int4(X'FF'::bit varying);

Re: [SQL] BLOBs vs BYTEA

2005-01-31 Thread Achilleus Mantzios
O Dennis Sacks έγραψε στις Jan 31, 2005 : > Sam Adams wrote: > > >Anyway, I was wondering which would be a better way to store a large > >amount of files each a few megabytes in size. There could be hundreds of > >thousands of files altogether. If stored as BYTEAs this would put them > >all in a

Re: [SQL] contrib/intarray doc/tutorial needed

2005-01-27 Thread Achilleus Mantzios
O Oleg Bartunov έγραψε στις Jan 26, 2005 : > Achilleus, > > I'm looking for better documentation for contrib/intarray. > As an experienced user of this module, could you prepare > tutorial on using the module in real life applications ? Oleg, i wrote to you, but i suspect my machine is spam list

Re: [SQL] datediff is there something like it?

2005-01-25 Thread Achilleus Mantzios
O Joel Fradkin έγραψε στις Jan 25, 2005 : > Hi all working my way through our views and all is going very well. > > We use datediff in MSSQL a bit and I read about the field1::date - > field2::date to return the days numerically. > > Is there any way to get months and years besides guessing days

Re: [SQL] pg_user relationship does not exist

2005-01-20 Thread Achilleus Mantzios
O Joel Fradkin έγραψε στις Jan 20, 2005 : > Not sure this is the correct place to ask, but when I log in with pgadminIII > I get that message. Maybe do extensive logging (show queries,etc..)(see in postgresql.conf), and then examine your log to see what pgadminIII is asking for. > > > > Any

Re: [SQL] mail + rfc822, rfc2822 + schema

2005-01-19 Thread Achilleus Mantzios
O Ron Peterson έγραψε στις Jan 18, 2005 : > On Tue, Jan 18, 2005 at 05:05:55PM +0200, Achilleus Mantzios wrote: > > > i am thinking of doing a remote MUA web-based system, based on > > postgresql. > > ... > > So, i'd like to know if any of you has designed a sc

[SQL] mail + rfc822, rfc2822 + schema

2005-01-18 Thread Achilleus Mantzios
Hi, i am thinking of doing a remote MUA web-based system, based on postgresql. The idea is to let uucp/sendmail do the job of transporting the smtp mail to the remote site, and then using an mbox parser at the site (i have already done that in java), to offload (remotely) the mail messages to t

Re: [SQL] Get current trasanction id

2004-12-27 Thread Achilleus Mantzios
O Marek Lewczuk έγραψε στις Dec 27, 2004 : > Hello, > is there any way to get current transaction id using plpgsql or sql ? Maybe write a C function which calls GetCurrentTransactionId(). > > Thanks in advance for any help. > > ML > > > > ---(end of broadcast)--

Re: [SQL] Date datatype

2004-12-21 Thread Achilleus Mantzios
O Pablo Digonzelli έγραψε στις Dec 20, 2004 : > hi all, > Ca anyone send me an example how to update a date datatype? > for example > update table set birthdate = "200-01-01" doesnt work. # update table set birthdate = '2000-01-01'; > > TIA > Pablo > > > ---(end of

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

2004-12-17 Thread Achilleus Mantzios
O Kenneth Gonsalves έγραψε στις Dec 17, 2004 : > On Friday 17 December 2004 05:54 pm, Andreas Kretschmer wrote: > > > Yes, simple: > > > > test=# select name, case > > test-# when fruit = 1 then 'good' > > test-# when fruit = 2 then 'bad' > > test-# when fruit = 3 then 'rotten' end as fruit from

Re: [SQL] Failed system call was shmget(key=1, size=1155072, 03600).

2004-12-03 Thread Achilleus Mantzios
O Andrew M έγραψε στις Dec 3, 2004 : > Hi, > when building postgreSQL 8 I get the following error message: > > DETAIL: Failed system call was shmget(key=1, size=1155072, 03600). > HINT: This error usually means that PostgreSQL's request for a shared > memory segment exceeded available memory o

Re: [SQL] get sequence value of insert command

2004-11-19 Thread Achilleus Mantzios
O Erik Thiele έγραψε στις Nov 19, 2004 : > hi > > create sequence mysequence; > > create table foo( > id integer default nextval('mysequence'), > bla text, > wombat integer, > foobar date, > primary key(id) > ); > > insert into foo (wombat) values (88); > > now how do i know the id o

Re: [SQL] session_id

2004-11-17 Thread Achilleus Mantzios
O Richard Huxton έγραψε στις Nov 17, 2004 : > Riccardo G. Facchini wrote: > > hi all, > > > > is there a way to determine the session id on a database session? > > > > I would need to have a unique number whenever a session is started, and > > have this available as a function or view result. W

Re: [SQL] tree structure photo gallery date quiery

2004-11-17 Thread Achilleus Mantzios
O Oleg Bartunov έγραψε στις Nov 17, 2004 : > Gary, > > if you need really fast solution for you task and dont't afraid > non-standard soltion, take a look on contrib/ltree module. > http://www.sai.msu.su/~megera/postgres/gist/ltree/ > > Oleg Oleg how would you compare an ltree solution a

Re: [SQL] Move table between schemas

2004-11-16 Thread Achilleus Mantzios
O Andrew Sullivan έγραψε στις Nov 16, 2004 : > On Tue, Nov 16, 2004 at 10:02:34AM +0100, Markus Schaber wrote: > > Hello, > > > > Is there an easy way to move a table to another schema in PostgreSQL 7.4? > > > > ALTER TABLE and ALTER SCHEMA don't have this options. > > CREATE TABLE newschema.ne

Re: [SQL] A transaction in transaction? Possible?

2004-11-10 Thread Achilleus Mantzios
O Peter Eisentraut έγραψε στις Nov 10, 2004 : > Achilleus Mantzios wrote: > > Wouldn't make more sense to allow nested begin/commit/rollback > > blocks? > > Possibly. But that consideration would have been more relevant about 6 > years ago when they wrote the

Re: [SQL] A transaction in transaction? Possible?

2004-11-10 Thread Achilleus Mantzios
O Michael Fuhr έγραψε στις Nov 10, 2004 : > On Wed, Nov 10, 2004 at 12:45:19AM -0800, Riccardo G. Facchini wrote: > > > Sorry, but I understand that your example is not really about nested > > transactions, but about sequential transactions. > > Here's a more elaborate example. If this doesn't

Re: [SQL] Drop all indexes of a table w/o knowing the index names

2004-11-09 Thread Achilleus Mantzios
O Giulio Orsero έγραψε στις Nov 9, 2004 : > 7.4.6 on Linux. > > I need a way to drop all indexes of a table without knowing the names of the > indexes. > > Say I have a table > > table1 > index1 > index2 > index3 > > I don't want to do > > drop index1; > drop index2; > drop

Re: [SQL] sql problem

2004-11-05 Thread Achilleus Mantzios
O Flavio Fonseca έγραψε στις Nov 5, 2004 : > Hi, > > I am having a problem with a system I developed using php with postgres. > > Take a look at this: > > Welcome to psql 7.3.2, the PostgreSQL interactive terminal. > NetAdmin=# delete from operador where oplogin = 'ff'; > ERROR: fk_historico

Re: [SQL] 'show databases' in psql way?

2004-11-02 Thread Achilleus Mantzios
O lorid έγραψε στις Nov 2, 2004 : > \z will list the tables in the dbase > \d tablename will list the columns in the table > or foodb=# SELECT oid,* from pg_database ; > - > Erik Wasser wrote: > > >Hi list, > > > >how can I list the databases in a postgresish way? I know

Re: [SQL] Offtopic: psql

2004-10-21 Thread Achilleus Mantzios
O sad έγραψε στις Oct 21, 2004 : > Hi > > Postgres has a perfect tool - psql > what libraries did you (developers) use to develop psql console and > particulary command-line editor. % ldd `which psql` maybe? > > thnx > > > ---(end of broadcast)---

Re: [SQL] help on a query

2004-10-08 Thread Achilleus Mantzios
O CHRIS HOOVER έγραψε στις Oct 8, 2004 : > Just curious, what is wrong with the first way of coding the solution? > --( Forwarded letter 1 follows )- > Date: Fri, 8 Oct 2004 08:44:23 +0400 > To: Thomas.F.O'[EMAIL PROTECTED], [EMAIL PROTECTED] > Cc: [EMAIL PROTEC

  1   2   3   >