Comments (10)
If they have a consistent/fixed OID, then it shouldn't be a problem, I would expect. Without looking at it, I'm not sure that's definitively the case. (ISTR it has the type/oid mapping hard-coded in the module, but it's been a while since I've looked.)
from dbdpg.
If it's not fixed, is it reasonable to do catalog lookups based on EXTENSIONs found?
from dbdpg.
At what point? DBD::Pg connect? Cached per-handle? I would expect that this could fall apart unless you were caching/storing this info per DBH, as the same extension could have different OIDs depending on where you connected, so something simple like:
my $dbh1 = DBI->connect('dbi:Pg:dbname=database1', $user1, $pass1);
my $dbh2 = DBI->connect('dbi:Pg:dbname=database2', $user2, $pass2);
could introduce overhead both in connection time (if that's when we query/cache the data), or different/non-matching OIDs depending on the database/host queried (if we try to shared the data once per module initialization).
This is not to say that it'd be impossible, just there are real obstacles here.
from dbdpg.
Yeah, looking at the code, there's not really any way to do this dynamically; you could conceivably use pg_types
without connecting to the database, and it is indeed a static struct in types.c
.
from dbdpg.
pg_types_dynamic
with a warning about the overhead? Caching per DBH seems reasonable. With slightly more effort, probably as a separate feature, pg_types_dyname->{when}
could be specified.
from dbdpg.
What are you looking for specifically about that interface?
from dbdpg.
It would need to be created as a DBH-level method, not a global function.
from dbdpg.
Oh, good point.
from dbdpg.
Come to think of it, everything we've discussed here seems like a DBH-level matter. If people want common attributes for all DBH's in their space, they know how.
from dbdpg.
They are indeed free to query the system tables. :-) Some specific helper methods though might be nice, similar to ->table_info()
and the like.
from dbdpg.
Related Issues (20)
- Value trimmed upon insert HOT 4
- Tests fail if root's shell is not a Bourne shell HOT 6
- Statement handle DESTROY slurps pending async queries
- Tests fail to start new DB: pg_ctl: unrecognized operation mode HOT 4
- DBD::Pg 3.16.0 tests fail HOT 11
- Dying with non-ASCII utf8 DB message, with use warnings FATAL => 'all'; leads to "Wide character in subroutine entry" error message with DB-message omitted HOT 6
- Old postgresql client has trouble with new DBD::Pg versions due to bug in old postgresql client libraries HOT 3
- Error building DBD::Pg on macOS Monterey HOT 5
- META.yaml should be META.yml HOT 4
- DBD::Pg builds are failing to produce MYMETA.json files HOT 3
- Simple select of jsonb field returning empty result when field is NULL HOT 6
- Change in result type of EXTRACT() with Pg14 upwards not handled HOT 1
- MERGE INTO statement handles not returning total count of rows affected HOT 2
- Can't load Pg.so on Ubuntu 20.04 and Postgres 8.3.5 - tries to use lo_import_with_oid HOT 1
- $dbh->ping documentation possibly not clear HOT 4
- failed to build in openwrt HOT 3
- Cannot detect the default value for a `generated always as identity` column HOT 3
- v5.40's builtin false keyword cannot be passed in a bind parameter as the value of a boolean field HOT 9
- DESTROY failed: no connection
- t/03smethod.t fails with DBI v1.641 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dbdpg.