Comments (8)
I was just trying to create a test table with a CITEXT column, but to my surprise, on Postgesql 15.1, I get an SQL error saying the type "CITEXT" does not exist:
CITEXT Documentation says it should work from PostgreSQL 12.0+ so it should work on my local server.
But the documentation also says something about a module installation, and I did not install any module. I have no clue what that means. Can you shed some light on that?
from heidisql.
Yes, citext is included with the default distribution but it isn't enabled by default - you have to do something like:
CREATE EXTENSION citext;
to enable it for each database you want to use it in.
from heidisql.
Thanks for the tip. That did it.
CITEXT
is now supported in the next builds, and categorized as text type, so it shows up in the foreign value pulldown you mentioned.
Note the value in IS.columns.data_type
is "USER-DEFINED" for such extension based types. I worked around that by using the value in udt_name
, which was the correct "citext" in my test case.
I'm crossing fingers the hardcoded oid 24651
is unique everywhere, and not only on my local server:
HeidiSQL/source/dbstructures.postgresql.pas
Line 239 in 4ac4152
from heidisql.
Yes - unfortunately - I think the oid changes from server to server/database to database. I was recently doing some similar work and noticed on my machine that citext was 2606673 but on the production server it was 59586 - i think the built in types are always the same, but ones from extensions like citext will vary. Hopefully that won't throw a wrench in things - if you want, i can download tomorrows build and verify for sure that it doesn't work, but I'm reasonably confident it won't if it is counting on 24651 being associated with citext.
from heidisql.
Yes, that would be helpful if you give it a test and give some feedback. The new build should be available in roughly half an hour.
from heidisql.
Similar issue in a different project: launchbadge/sqlx#295
from heidisql.
Yep - not sure if it helps, but the SQL to get it seems to be:
SELECT 'citext'::regtype::oid;
and I did confirm it is different on every server I tried. Also, this article discusses getting it via the C api:
https://stackoverflow.com/questions/45887484/get-user-defined-type-oid-in-postgresql-extension-c
from heidisql.
I decided for the xyz::regtype::oid
query you mentioned, which is now fired along with the very first query on the connection. This should work on all servers, even if the query fails for some reason - a potential crash is suppressed.
Minor drawback is that this query is fired once on each session, anyway if there is a citext type or not. This is due to a still hardcoded list of data types in HeidiSQL, with citext being one of them. Only dynamic thing is the oid of citext now.
Looking at the pg_type
table, I just realized how many data types PosgreSQL has (~300 + ~300 array types), and how few of these are supported in HeidiSQL (~40). So an idea for the future would be to replace the hardcoded data types with a dynamically built list. I only suspect this won't be doable with MySQL and the other protocols.
from heidisql.
Related Issues (20)
- AbstractError when closing text editor HOT 5
- Warn to overwrite file on Export grid rows HOT 3
- PostgresSQL 15.4: Export database as SQL does not export database structure HOT 1
- No Passphrase Popup, when using ssh tunnel. HOT 8
- Sorting of JSON keys HOT 2
- NULL in clipboard
- Space between "tree view" items are smaller than usual HOT 1
- Allow open multiple table (MariaDB) HOT 1
- Experiencing display issues after executing SQL scripts HOT 2
- update libmariadb.dll and plugin libraries to latest version HOT 4
- Don't change column header case in Detect CSV layout window
- Sequal integration does not work HOT 2
- Redis support
- CURRENT_TIMESTAMP not available for selection as default on DATETIME HOT 4
- Allow editing values of SELECT query Result HOT 7
- Un/comment action, when no text is selected, is inconsistent when undoing/redoing
- Import/Export Tables/Databases in .gz format
- small display error in query panel HOT 1
- PostgreSQL creating multiple reference foriegn key to each schema is incorrect HOT 2
- Separate checkboxes for drop/create tables, procedures etc. in SQL export HOT 4
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 heidisql.