exposing float8-as-value to PGXS/makefiles

Started by Alvaro Herreraover 14 years ago5 messages
#1Alvaro Herrera
alvherre@alvh.no-ip.org

Hi,

I was just messing around with a datatype that's based in int64
representation. Pretty much everything (seems to) work cleanly, but one
problem I have is that I cannot build the correct CREATE TYPE sentence
in the .sql.in file to actually install the type, because there's no
easy way to figure out whether float64 (and therefore int64) is passed
by value or not.

configure gets the value as a C define but that's a PITA to use. So
what I'm saying is that I'd like it to be exposed in Makefile.global or
something like that where pgxs-built things can use it to build their
SQL files.

I don't have a patch to show, but does the basic idea sound good?

--
Álvaro Herrera <alvherre@alvh.no-ip.org>

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#1)
Re: exposing float8-as-value to PGXS/makefiles

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:

I was just messing around with a datatype that's based in int64
representation. Pretty much everything (seems to) work cleanly, but one
problem I have is that I cannot build the correct CREATE TYPE sentence
in the .sql.in file to actually install the type, because there's no
easy way to figure out whether float64 (and therefore int64) is passed
by value or not.

We already solved that for contrib/isn --- use the LIKE clause in CREATE
TYPE.

regards, tom lane

#3Alvaro Herrera
alvherre@commandprompt.com
In reply to: Tom Lane (#2)
Re: exposing float8-as-value to PGXS/makefiles

Excerpts from Tom Lane's message of vie may 20 12:43:25 -0400 2011:

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:

I was just messing around with a datatype that's based in int64
representation. Pretty much everything (seems to) work cleanly, but one
problem I have is that I cannot build the correct CREATE TYPE sentence
in the .sql.in file to actually install the type, because there's no
easy way to figure out whether float64 (and therefore int64) is passed
by value or not.

We already solved that for contrib/isn --- use the LIKE clause in CREATE
TYPE.

Ooh, excellent, thanks.

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

#4Michael Glaesemann
grzm@seespotcode.net
In reply to: Alvaro Herrera (#3)
Re: exposing float8-as-value to PGXS/makefiles

On May 20, 2011, at 12:51, Alvaro Herrera wrote:

Excerpts from Tom Lane's message of vie may 20 12:43:25 -0400 2011:

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:

I was just messing around with a datatype that's based in int64
representation. Pretty much everything (seems to) work cleanly, but one
problem I have is that I cannot build the correct CREATE TYPE sentence
in the .sql.in file to actually install the type, because there's no
easy way to figure out whether float64 (and therefore int64) is passed
by value or not.

We already solved that for contrib/isn --- use the LIKE clause in CREATE
TYPE.

Ooh, excellent, thanks.

To confirm, this works for Postgres versions >= 8.4, correct?

Michael Glaesemann
grzm seespotcode net

#5Alvaro Herrera
alvherre@commandprompt.com
In reply to: Michael Glaesemann (#4)
Re: exposing float8-as-value to PGXS/makefiles

Excerpts from Michael Glaesemann's message of vie may 20 15:07:27 -0400 2011:

On May 20, 2011, at 12:51, Alvaro Herrera wrote:

Excerpts from Tom Lane's message of vie may 20 12:43:25 -0400 2011:

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:

I was just messing around with a datatype that's based in int64
representation. Pretty much everything (seems to) work cleanly, but one
problem I have is that I cannot build the correct CREATE TYPE sentence
in the .sql.in file to actually install the type, because there's no
easy way to figure out whether float64 (and therefore int64) is passed
by value or not.

We already solved that for contrib/isn --- use the LIKE clause in CREATE
TYPE.

Ooh, excellent, thanks.

To confirm, this works for Postgres versions >= 8.4, correct?

Yes, this is in 8.4 (but not in 8.3).

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support