How does one convert an octet string (e.g. something like a varlena
structure) to a Datum? I want to create datums for use w/
heap_form_tuple in a function returning a tuple containing bytea
representations of very large integers.
TIA
--
Ron Peterson
https://www.yellowbank.com
2007-10-12_22:22:32-0400 Ron Peterson <[EMAIL PROTECTED]>:
> How does one convert an octet string (e.g. something like a varlena
> structure) to a Datum? I want to create datums for use w/
> heap_form_tuple in a function returning a tuple containing bytea
> representations of v
2007-10-13_01:22:06-0400 Gregory Stark <[EMAIL PROTECTED]>:
> "Ron Peterson" <[EMAIL PROTECTED]> writes:
>
> > Is this a legitimate/blessed way to go about it?
> >
> > aval = (bytea *)palloc( len + VARHDRSZ );
> > VARATT_SIZEP(aval) = len +
2007-10-13_08:50:56-0400 Ron Peterson <[EMAIL PROTECTED]>:
> 2007-10-13_01:22:06-0400 Gregory Stark <[EMAIL PROTECTED]>:
> > And normally you would define your own datatype and not use bytea.
>
> Actually, I already have my data in a structure much like varlena.
Pgh
2007-10-13_11:12:05-0400 Gregory Stark <[EMAIL PROTECTED]>:
> "Ron Peterson" <[EMAIL PROTECTED]> writes:
>
> > 2007-10-13_08:50:56-0400 Ron Peterson <[EMAIL PROTECTED]>:
> >> 2007-10-13_01:22:06-0400 Gregory Stark <[EMAIL PROTECTED]>:
> &g
2007-10-13_13:44:33-0400 Gregory Stark <[EMAIL PROTECTED]>:
> "Ron Peterson" <[EMAIL PROTECTED]> writes:
>
> > I think I can get where I want to go without completely figuring that out
> > right now though...
>
> What are you trying to do?
I&
2007-10-13_14:15:06-0400 yrp001:
> select * from generate_rsa_key();
Am I making this way too complicated? Do I only have to return a C
string representation of three bytea values as a tuple?
(I still think a bona-fide user-defined type in C is probably better.)
--
Ron Peterson
ht
2007-10-13_15:22:34-0400 Gregory Stark <[EMAIL PROTECTED]>:
> "Ron Peterson" <[EMAIL PROTECTED]> writes:
>
> > My first thought was to just do something like:
> >
> > CREATE TYPE __full_key AS ( n bytea, e bytea, d bytea );
> >
> > CREATE
like to make
it available.
--
Ron Peterson
https://www.yellowbank.com/
---(end of broadcast)---
TIP 4: Have you searched our list archives?
http://archives.postgresql.org/
racter varying(24)
I'm using PostgreSQL 9.0.4
I tried to replicate this with a new database and a simple table, but
could not.
I had to drop (and then recreate) three rules and a view on this table
before altering the column.
This is a production database, so I need to treat it gently.
--
2011-09-05_15:03:00-0400 Tom Lane :
> Ron Peterson writes:
> > I just updated a table to have a larger column size as follows.
>
> > alter table attributes_log alter column attribute_name type varchar(48);
>
> How come this refers to "attributes_log" while y
2011-09-05_16:14:00-0400 Tom Lane :
> Ron Peterson writes:
> > I just dropped my logging rules, stopped the database and restarted it,
> > put my rules back in place, and now it works. Not sure why. Cached
> > query plan?
>
> Maybe. We'd need a reproducible tes
Phghght. Sorry, no, that didn't do it, I was typing too fast and
skipped updating the attributes table. That was definitely not the case
w/ my original database. Wasn't working. The table definition reported
the update I made. Insert did not work. Dropping rules, restarting
database, and recr
ready been done many times over. I'd rather re-use something existing
that re-invent the wheel. Dr. Google hasn't been as helpful as I'd like
so far.
--
Ron Peterson
Network & Systems Manager
Mount Holyoke College
http://www.mtholyoke.edu/~rpeterso
-
I wish my computer would do
pam available, you could do pam authentication, and
configure pam_ldap to enforce group membership.
--
Ron Peterson
Network & Systems Manager
Mount Holyoke College
http://www.mtholyoke.edu/~rpeterso
-
I wish my computer would do what I want it to do - not what I tell it to do.
--
Sent via pgsql-
Creator:
http://creator.zoho.com/
I'm not finding any similar good F/OSS tool in the same space.
--
Ron Peterson
Network & Systems Manager
Mount Holyoke College
http://www.mtholyoke.edu/~rpeterso
-
I wish my computer would do what I want it to do - not what I tell it to do.
--
2008-07-03_21:17:50-0400 Ron Peterson <[EMAIL PROTECTED]>:
> 2008-06-29_09:44:01-0400 Taha Ozket <[EMAIL PROTECTED]>:
>
> > I have a ldap group, "pgsql-developers". I have an user (user1) member
> > of this group;
> > ...
> > How can I cha
et the error:
CREATE DATABASE
:v_dbname
WITH OWNER
:v_dbadmin
ENCODING
:v_encoding;
ERROR: syntax error at or near "SQL_ASCII" at character 59
LINE 6: SQL_ASCII;
So it seems like the single quotes are causing :v_encoding to be read as
a string literal for ENCODING, but they don&
On Sat, Feb 19, 2005 at 05:30:25PM -0500, Ron Peterson wrote:
> Hi,
>
> I'm trying to use PostgreSQL's internal variables to simplify some shell
> scripting database setup stuff. Single quotes appear to behave
> differently in diffent contexts.
I decided to just do
I've been staring at my array bounds so hard it's giving me headache.
If anyone can identify what might be wrong, I'd greatly appreciate it.
Best.
--
Ron Peterson
https://www.yellowbank.com/
---(end of broadcast)---
TIP
On Tue, Oct 17, 2006 at 03:25:05PM -0400, Ron Peterson wrote:
> I've written some PostgreSQL C functions which expose the functionality
> of Theodore Ts'o's UUID library. I need to add a few sanity clauses
> here and there, but working (mostly) code can
On Tue, Oct 17, 2006 at 09:07:08PM -0400, Ron Peterson wrote:
> On Tue, Oct 17, 2006 at 03:25:05PM -0400, Ron Peterson wrote:
>
> > I've written some PostgreSQL C functions which expose the functionality
> > of Theodore Ts'o's UUID library.
% select
On Wed, Oct 18, 2006 at 04:31:57PM -0400, Ron Peterson wrote:
> I'm having a hard time finding any examples of functions returning
> timestamps I can study to see how they are handled internally. I'm sure
> it's only a line or two of code.
...I just found date.c
On Wed, Oct 18, 2006 at 04:43:40PM -0400, Ron Peterson wrote:
> On Wed, Oct 18, 2006 at 04:31:57PM -0400, Ron Peterson wrote:
>
> > I'm having a hard time finding any examples of functions returning
> > timestamps I can study to see how they are handled internally. I'
On Fri, Oct 20, 2006 at 03:32:05PM +0200, Andreas Seltenreich wrote:
> Ron Peterson writes:
>
> > On Wed, Oct 18, 2006 at 04:43:40PM -0400, Ron Peterson wrote:
> > I'm pretty close, but I'm still not understanding something about
> > PostgreSQL's inte
I created a set of PostgreSQL functions which implement the extended set
of digest/hashing functions provided by the Mhash library
(http://mhash.sourceforge.net/).
For anyone interested, the code is available here:
http://www.yellowbank.com/code/PostgreSQL/y_mhash/
Best.
--
Ron Peterson
https
leFromCStrings( aim, vals);
/* make the tuple into a datum */
result = HeapTupleGetDatum( ht );
...
// pfree( rd );
// pfree( vals[0] );
// pfree( vals[1] );
// pfree( vals[2] );
// pfree( vals );
PG_RETURN_DATUM( result );
TIA
--
Ron Peterson
https://www.yellowbank.com/
-
On Tue, Nov 07, 2006 at 08:36:45AM -0500, Ron Peterson wrote:
> I just encountered a problem with a C function I've been working on
> where it broke with the error:
>
> could not find block containing chunk ...
>
> I tracked the problem down to my use of pfree.
I narr
);
executor.h has:
/*
* prototypes from functions in execQual.c
*/
extern Datum GetAttributeByNum(HeapTupleHeader tuple, AttrNumber attrno,
bool *isNull);
I'm just not seeing what's wrong here...
--
Ron Peterson
https://www.yellowbank.com/
---
On Tue, Nov 07, 2006 at 07:50:52PM -0500, Ron Peterson wrote:
> I have a couple of more PostgreSQL C questions, about the following two
> compiler warnings:
>
> warning: ISO C90 forbids mixed declarations and code
I'm thinking this is unavoidable, and unless my time machi
ble atable?
CREATE TYPE atype AS (
acol
TEXT,
bcol
TEXT
);
CREATE TABLE atable (
aval
atype
);
CREATE TEMP TABLE
tt
AS
SELECT 'aaa'::text AS a, 'bbb'::text AS b;
INSERT INTO
atable
SELECT
ROW(a, b)
FROM
tt;
Thanks as always.
--
Ron Peter
On Sun, Nov 19, 2006 at 02:09:11AM -0500, Tom Lane wrote:
> Ron Peterson <[EMAIL PROTECTED]> writes:
> > How should I create a composite type value out of columns a and b in
> > table tt that I can insert into table atable?
>
> Hm, it works for me with an expl
ger insert data.
The operation errors out with:
"invalid regular expression: invalid repetition count(s)"
I'd like the following domain statement to work. It used to work in
8.1.4, but not now. Can I do this in 8.2?
CREATE DOMAIN
__hex_string_8192
AS TEXT
CHECK ( VALUE ~ '^[
On Mon, Jan 01, 2007 at 11:30:00PM -0500, Tom Lane wrote:
> Ron Peterson <[EMAIL PROTECTED]> writes:
> > I believe there's been a change in PostgreSQL's regular expression
> > handling w/ 8.2.
>
> Compared to what? A repeat count of 256 has been an error at
which would be appropriate for storing MD5 hashes or UUID's (aka
GUID's), say. I plan to implement other common sizes.
http://www.yellowbank.com/code/PostgreSQL/y_octet_t/
Comments or suggestions for improvement are very welcome.
Best.
--
Ron Peterson
https://www
The following location contains PostgreSQL C functions for generating
lanmanager and ntlm password hashes. Feel free to use as you see fit.
http://www.yellowbank.com/code/PostgreSQL/y_ntlm/
Best.
--
Ron Peterson
https://www.yellowbank.com/
---(end of broadcast
6);
Datum
text_cast_to_y_octet_16(PG_FUNCTION_ARGS)
{
text *txtstr;
char *octstr;
if( PG_ARGISNULL(0) ) {
PG_RETURN_NULL();
}
txtstr = PG_GETARG_TEXT_P(0);
octstr = hex2bin_palloc( VARDATA(txtstr), 16 );
PG_RETURN_POINTER( octstr );
}
TIA
--
Ron Peterson
https://www.yellowbank.com/
---
On Mon, Jan 22, 2007 at 04:36:20PM +0100, Martijn van Oosterhout wrote:
> On Mon, Jan 22, 2007 at 09:44:52AM -0500, Ron Peterson wrote:
> > I've created my own type: y_octet_16. Now I'm trying to create a CAST
> > function for this type, but I'm not quite getting i
On Mon, Jan 22, 2007 at 11:40:08AM -0500, Tom Lane wrote:
> Ron Peterson <[EMAIL PROTECTED]> writes:
> > That cleared one hurdle, but I'm still not there yet.
>
> > % select 'fe43d07c0c624786bebfcb3357a2a13a':
er_update
AS ON UPDATE TO atable
WHERE
CURRENT_USER != 'mysuper'
AND
old.username != CURRENT_USER
DO INSTEAD nothing;
CREATE RULE atable__lock_user_delete
AS ON DELETE TO atable
WHERE
CURRENT_USER != 'mysuper'
AND
old.username != CURRENT_USER
DO INSTEAD n
Anyone have any tips for an earnest aspiring but somewhat befuddled
PostgreSQL acolyte as to what's required to program (in C) a 'like'
operator for a user defined type?
--
Ron Peterson
https://www.yellowbank.com/
---(end of broadcast)--
rnal, internal, internal),
STORAGE ltree_gist;
I'm running PostgreSQL 8.2.1.
I also gave the 'seg' contrib module a whirl, and it also errors out on
the CREATE OPERATOR CLASS statement.
--
Ron Peterson
https://www.yellowbank.com/
---(end of broa
On Tue, Feb 06, 2007 at 10:45:23AM -0500, Tom Lane wrote:
> Ron Peterson <[EMAIL PROTECTED]> writes:
> > I wanted to play with ltree, but I'm having trouble running ltree.sql.
> > Everything in ltree.sql seems to work, except for the CREATE OPERATOR
> > CLASS
A function to authenticate username/password pairs via PAM.
y_pam_auth( username text, password text ) returns bool
http://www.yellowbank.com/code/PostgreSQL/y_pam/
This obviously requires that you trust the server.
Best.
--
Ron Peterson
https://www.yellowbank.com
I was just reading the PostgreSQL documentation about Information
Schemas. Some of the tables have fields which are described as
"Applies to a feature not available in PostgreSQL"
What does that mean?
--
Ron Peterson
Network & Systems Manager
Mount Holyoke College
http://www
On Fri, Dec 10, 2004 at 11:26:09PM -0500, rpeterso wrote:
I should have mentioned...
PostgreSQL versions 8.0.0beta5 and 7.4.6
libpq-perl 2.0.2
perl 5.8.4
--
Ron Peterson
Network & Systems Manager
Mount Holyoke College
http://www.mtholyoke.edu/~rpeterso
---(en
! ( $oid eq "" || $status eq PGRES_COMMAND_OK ) ) {
print STDERR sprintf( 'SQL exec failed: %s',
$CONN->errorMessage ), "\n";
}
}
--
Ron Peterson
Network & Systems Manager
Mount Holyoke College
http://www.mtholyoke.ed
On Sat, Dec 11, 2004 at 11:58:31AM +0900, Michael Glaesemann wrote:
> On Dec 9, 2004, at 12:46 PM, Ron Peterson wrote:
>
> >I was just reading the PostgreSQL documentation about Information
> >Schemas. Some of the tables have fields which are described as
> >
>
On Fri, Dec 10, 2004 at 11:26:09PM -0500, Ron Peterson wrote:
> I have a simple table, a view, and an on insert rule. These work fine,
> ordinarily. But when I attempt to to insert a value into thesis_ps_v
> via libpq_sql, nothing happens.
Fixed. I didn't set the schema search
How are bytea values encoded internally?
Or maybe a better question would be what is the proper way to access
bytea data from within a C function? Are there utility functions for
reading the bytea data as a stream of scalar values, for example?
--
Ron Peterson
Network & Systems Manager
M
On Wed, Dec 15, 2004 at 11:08:29PM -0500, Ron Peterson wrote:
> How are bytea values encoded internally?
>
> Or maybe a better question would be what is the proper way to access
> bytea data from within a C function? Are there utility functions for
> reading the bytea data as a s
On Wed, Dec 15, 2004 at 10:22:07PM -0700, Michael Fuhr wrote:
> On Wed, Dec 15, 2004 at 11:08:29PM -0500, Ron Peterson wrote:
>
> > How are bytea values encoded internally?
> >
> > Or maybe a better question would be what is the proper way to access
> > bytea data
that I can count on 'currval' returning the sequence
value returned by the previous action's 'nextval', so that I know I am
inserting the proper foreign key into a table after inserting a record
into the referenced table.)
--
Ron Peterson
Network & Systems Manager
Mount H
ce, but that applies to any system, not
just PostgreSQL.
--
Ron Peterson
Network & Systems Manager
Mount Holyoke College
http://www.mtholyoke.edu/~rpeterso
---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings
On Sat, Feb 05, 2005 at 11:00:28PM -0800, David Fetter wrote:
> On Sat, Feb 05, 2005 at 09:08:00PM -0500, Ron Peterson wrote:
> > I would like to be able to assert that the security of data stored
> > as a value in a PostgreSQL table can be as high as the security of
> > savi
What does 'STATEMENT' refer to in the following description for CREATE
TRIGGER?
CREATE TRIGGER name { BEFORE | AFTER } { event [OR ...] }
ON table FOR EACH { ROW | STATEMENT }
EXECUTE PROCEDURE func ( arguments )
________
Ron Peterson
[EMAIL PROTECTED]
mikeo wrote:
>
> just a curiosity question...is the pg_FieldType() function
> something you wrote yourself?
It's a PHP function.
-Ron-
on "Formatting Functions" in the distribution's included
html documentation for more details.
Ron Peterson
[EMAIL PROTECTED]
integer,
> ...etc...
> );
>
> create table editors(
> editorID integer,
> editorname text,
> ...etc...
> );
Ron Peterson
[EMAIL PROTECTED]
have three options, I think.
(1) Increase the data page size and recompile.
(2) Use the large object interface.
(3) Check out Jan Wieck's TOAST project
(http://www.postgresql.org/projects/devel-toast.html). It's still in
development, but maybe you can help.
Ron Peterson
[EMAIL PROTECTED]
f course. This is assuming
PostgreSQL has been installed in the usual location.
________
Ron Peterson
[EMAIL PROTECTED]
ation
about this in the PL/pgSQL portion of the user's guide. The function
also needs to return something. A return type of 'opaque' doesn't mean
the function returns nothing, it means the function doesn't return a
defined SQL datatype.
Ron Peterson
[EMAIL PROTECTED]
90);
INSERT INTO pie
VALUES ('blackbird', 45);
INSERT INTO pie
VALUES ('plum', 120);
SELECT filling, radians( slice ) AS size
FROM pie
WHERE radians( slice ) > 1;
Ron Peterson
[EMAIL PROTECTED]
fkey2 INTEGER REFERENCES ...,
id SERIAL PRIMARY KEY,
UNIQUE(fkey1,fkey2)
);
____
Ron Peterson
[EMAIL PROTECTED]
.
Sorry to be cynical, but as a consumer, I can't help seeing BSD licenses
as good old bait and switch. And this discussion doesn't reassure me
otherwise.
Sure, the code can fork. SunOS, AIX, HPUX are good examples. Examples
of the kind of code forking and corporatism I thought, I hoped, the
world was moving away from.
Ron Peterson
[EMAIL PROTECTED]
time in PostgreSQL unless those assurances are
backed by contractually binding verbage.
Ron Peterson
[EMAIL PROTECTED]
Philip Warner wrote:
>
> At 10:19 6/07/00 -0400, Ron Peterson wrote:
> >
> >This has happened in PostgreSQL's own history. How long did it take for
> >the project to get picked up again? How long did it take for the people
> >who picked it up to familiarize
vent))
trigger_tuple = CurrentTriggerData->tg_trigtuple;
else if (TRIGGER_FIRED_BY_UPDATE(CurrentTriggerData->tg_event))
/* trigger_tuple = CurrentTriggerData->tg_newtuple; */
elog(ERROR, "nodeinsert: must be fired on INSERT, not UPDATE");
else
elog(ERROR, "nodei
Gordan Bobic wrote:
>
> > Here's a crypted password: 00xNyXeahk4NU. I crypted it in perl as
> > crypt(, salt). So what is ?
> >
> > The point of a one way hash is that it's, well, one way. Pretty much
> > the only way you're going to figure out what password that encrypted
> > string correspon
Tom Lane wrote:
>
> Ron Peterson <[EMAIL PROTECTED]> writes:
> > I'm having a bit of authentication trouble. I'm trying to use 'crypt'
> > authentication. PostgreSQL 7.1beta5. My pg_hba.conf is as follows:
>
> IIRC, you can't use c
e, so when you use \i, the
SQL commands you are loading will be executed one at a time.
--
Ron Peterson
Network & Systems Manager
Mount Holyoke College
GPG and other info at http://www.mtholyoke.edu/~rpeterso
---(end of broadcast)---
TIP 6: H
om this host or hosts.
If you wanted to be really sure, you could do some packet sniffing...
--
Ron Peterson
Network & Systems Manager
Mount Holyoke College
GPG and other info at http://www.mtholyoke.edu/~rpeterso
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster
Is there any such thing as a standard schema for international
addresses? Maybe I'm grasping at straws, but one can always hope. I
can find information about individual countries easily enough. But how
about a general solution? Or is this just pie in the sky?
Ron Peterson
[EMAIL PROTECTED]
unicates
with that broker via an n-way blah blah blah. I can maintain literacy
in several tools at once, but not several dozen. Is my best bet simply
to accept SQL's limitations and program around them in C++ (or C, or
Python, or Perl, etc.)?
Ron Peterson
[EMAIL PROTECTED]
Joseph wrote:
You're also asking everyone who reads this newsgroup to send you a
reciept. Could you turn that auto-ask-for-a-reciept feature off,
please?
Ron Peterson
[EMAIL PROTECTED]
e
current product is more useful than feedback on past versions.
The features you mention are significant additions to PostgreSQL's
capabilities. I'm particularly grateful for the addition of referential
integrity constraints.
Ron Peterson
[EMAIL PROTECTED]
Does PostgreSQL have local user groups? I happen to live in Boston, so
of course anything around here would interest me most.
-Ron-
> On Tue, 16 May 2000, siva wrote:
> > and i also wants to know how to find and delete duplicate values from postgres
>database(primary key not defined). and i dont wants to go thru. any other books or
>reference . give me the correct syntax :
The correct syntax for writing a sentence is to c
> "Voitenko, Denis" wrote:
>
> So I am almost there, except my data is formated as follows:
>
> "chunk1","chunk2","chunk3"
>
> how would I tell COPY that my data is encapsulated in " and separated
> by , ? Furthermore, I did not find a manual on the COPY command.
> Anyone?
In /usr/local/pgsql/
Aha!
I have had this thing about trying to figure out how to program
trees/hierarchies/graphs in SQL for awhile now. Something I've
complained about in this list an others, including a Byte newsgroup.
Well whaddya know, but I read Jon Udell's Byte column today, and it
begins by quoting my compl
Joe Karthauser wrote:
>
> Hi there,
>
> I'm migrating from MySQL to PostgreSQL and I was wondering whether someone
> could help me match some datatypes.
I'm trying to learn PostgreSQL myself. They say there's no better way
to learn than to teach, so here goes...
> Firstly MySQL has a 'timesta
81 matches
Mail list logo