Re: [GENERAL] CREATE OPERATOR error

1999-11-16 Thread ^chewie

On Tue, 16 Nov 1999, Brandon Ibach wrote:

BI>Can anybody explain what might be happening here?
BI> 
BI> abc=> create operator =* ( leftarg = varchar, rightarg = varchar,
BI> abc->procedure = vciceq, commutator = =* );
BI> ERROR:  parser: parse error at or near "varchar"
BI> 
BI>The function "vciceq" already exists, and works.  I've tried a
BI> number of variations on the above with different spacing, with no
BI> success.  Is there some syntax peculiarity I'm missing?  This is
BI> on PostgreSQL 6.5.2 on a Linux x86 system (RedHat 5.1, kernel
BI> 2.0.34).

Isn't the operator '=*' a reserved operator for a right outer join?

Chad






Re: [GENERAL] postgres libpq library

1999-12-02 Thread ^chewie

On Thu, 2 Dec 1999, Peter Eisentraut wrote:

> > I guess that the postgres it-self is not designated as a multi-threaded
> > server. I was wondering if the library is instead thread safe (i.e.:
> > if it can be safely called from multi-threaded applications).
> 
> That's a definite no.
> 
> I'm not even sure if there is a chance of cleaning that up in finite
> time, after all many C libraries are not very thread-safe either.
> 
> Perhaps this CORBA stuff that has been thrown around lately can help
> there, but that's merely in the proposal stage right now.

You know.  I, for one, have a little bit of free time I could donate to
contributing to the Postgresql project.  I know C and would not mind
learning how to implement POSIX threading.  Like any project, it needs
to start somewhere with someone.  I suppose I should join the [HACKERS]
list, then, huh? ;-)

^chewie <[EMAIL PROTECTED]>






Re: [GENERAL] Can't I create indexes on BOOL columns?

1999-12-13 Thread ^chewie

On 13 Dec 1999, Manuel Lemos wrote:

> Hello,
> 
> I am using PostgreSQL 6.4.2.  and it seems I can't create indexes on
> BOOL columns.  I tried this:
> 
> ...snip...
>
> However, if I change the BOOL type to CHAR (1) it works.

I'm not a developer, so I don't know if it's a bug or a logic error
you're pointing out, or even if it's an error at all.  However, I could
rationalize that it is not an error on the premise that BOOLEAN
identifiers can only have two values: true or false.

Obviously, you cannot use a UNIQUE index on such an column.  A Clustered
index would not do much better, logically, since you're only splitting
up the data into two groups.  Therefore, what is the point of indexing
on boolean columns, really?  I suppose it would depend upon the data in
the table.  If you see one value predominantly over the other, splitting
out the smaller group via the index *may* help your search.  However, if
the values are fairly even in proportion, you won't gain much.

I'd say stick with your work-around, and post the question to the devel
team.


Chad Walstrom mailto:[EMAIL PROTECTED] 
a.k.a ^chewie, gunnarr   http://wookimus.net/~chewie

   Gnupg = B4AB D627 9CBD 687E 7A31  1950 0CC7 0B18 206C 5AFD







Re: [GENERAL] To BLOB Or Not To BLOB

2000-04-17 Thread chewie

How do I start this?  There are so many different ways to look at this
question.  Do I save files inside the database, or do I simply use the database
as a tool to query information about a given file, it's properties, etc.

Instead of making general statements, let me pick specific examples.  Let's say
we want to create an MP3 repository.  Our goals are to be able to query the
information saved in ID3 tags, to locate, organize, manipulate, or play the
MP3.  To narrow the scope of discussion, let's say I will be accessing these
files locally, on my filesystem or a NFS mounted directory.

What would be the most efficient way for us to query the information found in
the ID3 tags?  We could parse each file in a number of directories and their
subdirectories for the information we require each time we need it, or we could
parse it once and save the information in a database structured around ID3
information.  I would say the later is definitely more desireable and
acceptable.  Inside the database, the ID3 tags can be indexed and our searches
optimized by the information we're requesting.

But should we store the mp3's inside the database?  I say no.  A few
observations:

* Filesystems are generally better at allocating space for files than
databases are.  
* Storing files inside databases renders shell access or direct access to
files as impossible.  If the database goes South, so does access to the
files.

Now, our mp3 decoders are shell programs that read mp3 input by opening a file,
a URL connection, or reading it from standard input (that is if we have a good
mp3 player).  Yet, in order for these mp3 decoders to be able to play an mp3
found inside the database, we are forced to use a specialized database
interface.  It may return the mp3 file to the decoder via standard input,
or it may export the file to a temp directory and feed the mp3 player the
location of that temp file.

Yet, why should we go through all of this trouble?  And why should we tie the
operation of two clearly separate applications into such inflexible
relationships?  We add overhead to the database to output this file, and we add
another level of logic to get the file to the decoder.  A level of logic that
could prove the downfall of a would-be MP3 mobile disc jockey, who's worked so
hard to please the Wicked Witch of the Wedding.  He'd be forced to pull out the
CD's and tapes he so dreads -- if he remembered to bring them along. 

If we keep file access decoupled from gleaning catagorizable, quantifiable data
about/from the file, we allow two separate and efficient tools to do their jobs
independently.  If file access is your concern, then use a file system that
will give you the level of control you desire to develop your security
policies.  

If grabbing information from a data file is important, such as parsing text
files for content, then build indexes to the data inside the file and store
those indexes in the database.  Internet directories are excellent examples of
this!  We don't neuter local file access by the applications that need the data
files, and we still provide access to searchable information.

I would argue that access to a data file and querying sets of data files for
information are two separate layers of logic.  Logical layers are best served
when they are given tools to interact, but are not crippled by tight
integration.  Saving data files inside a database, IMHO, is an example of tight
integration, and something to be avoided if possible -- at least in this case.

-- 
  Chad "^chewie, gunnarr" Walstrom <[EMAIL PROTECTED]>
  http://wookimus.net/chewie